Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sitecustomize.py to avoid MPI on login nodes #45

Merged
merged 1 commit into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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