Skip to content

Commit

Permalink
Merge pull request #45 from LSSTDESC/issue/43/pymultinest
Browse files Browse the repository at this point in the history
add sitecustomize.py to avoid MPI on login nodes
  • Loading branch information
heather999 authored Apr 9, 2022
2 parents b277a39 + 30779e8 commit 3f5aacc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
10 changes: 1 addition & 9 deletions conda/build-nersc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ scratchBuildDir=/global/cscratch1/sd/heatherk/td_env-devbuilds
commonDevBuildDir=/global/common/software/lsst/cori-haswell-gcc/stack/td_env-dev
commonProdBuildDir=/global/common/software/lsst/cori-haswell-gcc/stack/td_env-prod

#echo "REF_NAME " $CI_COMMIT_REF_NAME
#echo "COMMIT_BRANCH " $CI_COMMIT_BRANCH
#echo "SLUG " $CI_COMMIT_REF_SLUG

#if [ "$CI_COMMIT_REF_NAME" = "dev" ];
#then
# echo "Found DEV"!
#fi

if [ "$installFlag" ] && [ "$CI_COMMIT_REF_NAME" = "dev" ]; # Install dev
then
curBuildDir=$commonDevBuildDir/$CI_PIPELINE_ID
Expand All @@ -50,6 +41,7 @@ mkdir -p $curBuildDir
cp conda/packlist.txt $curBuildDir
cp conda/piplist.txt $curBuildDir
cp nersc/setup_td_env.sh $curBuildDir
cp nersc/sitecustomize.py $curBuildDir
sed -i 's|$1|'$curBuildDir'|g' $curBuildDir/setup_td_env.sh
cd $curBuildDir

Expand Down
9 changes: 9 additions & 0 deletions nersc/setup_td_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ then
#export GSL_DIR=$CONDA_PREFIX
#export CFITSIO_DIR=$CONDA_PREFIX

export PYTHONPATH=$PYTHONPATH:$DESC_TD_INSTALL

# SLURM_JOB_ID is set only on compute nodes
# DESC_TD_KEEP_MPI will be user-controlled way to keep MPI set up
#if [[ -z "$DESC_TD_KEEP_MPI" && -z "$SLURM_JOB_ID" ]];
#then
# export PYTHONSTARTUP=$DESC_TD_INSTALL/nompi4py.py
#fi

fi

# DIA Environment Variables
Expand Down
Empty file modified nersc/setup_td_env.sh
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions nersc/sitecustomize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import os
if "DESC_TD_KEEP_MPI" not in os.environ:
if "SLURM_JOB_ID" not in os.environ:
import sys
sys.modules["mpi4py"] = None

0 comments on commit 3f5aacc

Please sign in to comment.