Skip to content

Commit

Permalink
Merge pull request #52 from desihub/multiple-env-var
Browse files Browse the repository at this point in the history
Remove multiply-defined environment variables
  • Loading branch information
sbailey authored Jul 18, 2024
2 parents d9b6250 + 9ee3869 commit e58ff93
Showing 1 changed file with 55 additions and 18 deletions.
73 changes: 55 additions & 18 deletions main
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ proc ModulesHelp { } {
set product desimodules
set version main
conflict $product
set desiconda_version 20211217-2.0.0
if {[info exists env(NERSC_HOST)]} {

# NOTE: As of 2024-07-19, KPNO sets $DESI_PRODUCT_ROOT and
# "module load desiconda" before loading desimodules,
# in which case this desiconda_version isn't used at all.
# The current structure is a leftover from supporting
# cori+perlmutter, and it might be useful again in the future,
# even if the if blocks are overkill right now.
set desiconda_version 20240425-2.2.0
if { [info exists env(NERSC_HOST)] } {
if { $env(NERSC_HOST) == "perlmutter" } {
set desiconda_version 20240425-2.2.0
# https://docs.nersc.gov/current/#ongoing-issues
setenv MPI4PY_RC_RECV_MPROBE "False"
# https://docs.nersc.gov/development/languages/python/using-python-perlmutter/#mpi-issues
setenv CXI_FORK_SAFE 1
setenv CXI_FORK_SAFE_HP 1
module unload cudatoolkit
}
}
#
Expand Down Expand Up @@ -70,10 +71,6 @@ if { [info exists env(NERSC_HOST)] } {
module use $desiconda_modules_root
module load desiconda/$desiconda_version
prereq desiconda
setenv DESI_ROOT_READONLY /dvs_ro/cfs/cdirs/desi

# Use NERSC provided cudatoolkit
module load cudatoolkit/12.2
}
#
# DESI-specific modules
Expand Down Expand Up @@ -101,21 +98,61 @@ module load redrock-templates/main
module load prospect/main
module load desimeter/main
module load simqso/main
module load dust/v0_1
# module load dust/v0_1
module load speclite/main
module load QuasarNP/0.2.0
module load specprod-db/main

#
# Environment variables that point to checkouts of software products, or
# similar calibration products.
#
if { [info exists env(NERSC_HOST) ] } {
setenv DESI_ROOT_READONLY /dvs_ro/cfs/cdirs/desi
}
setenv DESI_SPECTRO_CALIB $env(DESI_ROOT)/spectro/desi_spectro_calib/trunk
setenv DESI_SPECTRO_DARK $env(DESI_ROOT)/spectro/desi_spectro_dark/latest
setenv DESI_SURVEYOPS $env(DESI_ROOT)/survey/ops/surveyops/trunk

# may solve some OpenMP instabilities at NERSC
setenv FIBER_ASSIGN_DIR $env(DESI_ROOT)/target/fiberassign/tiles/trunk
setenv QN_MODEL_FILE $env(DESI_ROOT)/target/catalogs/lya/qn_models/qn_train_coadd_indtrain_0_0_boss10.h5
setenv SQ_MODEL_FILE $env(DESI_ROOT)/target/catalogs/lya/sq_models/BOSS_train_64plates_model.json
set dust_version v0_1
setenv DUST_DIR $env(DESI_ROOT)/external/dust/$dust_version
setenv DUST_VERSION $dust_version
#
# NERSC performance settings.
# See e.g., https://docs.nersc.gov/development/languages/python/using-python-perlmutter/#mpi-issues
#
# Although these environment variables are somewhat NERSC-specific, they should
# be harmless if set elsewhere.
#
# May solve some OpenMP instabilities at NERSC, however it is no longer known what those actual instabilities were.
# See discussion in https://github.com/desihub/desimodules/pull/52.
setenv KMP_INIT_AT_FORK FALSE

# work around
# https://docs.nersc.gov/development/languages/python/using-python-perlmutter/#mpi-issues
# As of 2024, this is no longer listed as an ongoing issue in https://docs.nersc.gov/current/#ongoing-issues.
# See discussion in https://github.com/desihub/desimodules/pull/52.
setenv MPI4PY_RC_RECV_MPROBE "False"
# https://docs.nersc.gov/development/languages/python/using-python-perlmutter/#issues-with-fork-in-mpi-processes
setenv CXI_FORK_SAFE 1
setenv CXI_FORK_SAFE_HP 1
# Consolidated from desispec, redrock & fastspecfit module files.
setenv KMP_AFFINITY disabled
# Consolidated from desispec, redrock & fastspecfit module files.
setenv MPICH_GNI_FORK_MODE FULLCOPY
# Consolidated from redrock & fastspecfit module files.
setenv OMP_NUM_THREADS 1
# Moved from redrock module file.
setenv HDF5_USE_FILE_LOCKING FALSE
# Moved from fastspecfit module file.
setenv MKL_NUM_THREADS 1
#
# Settings that can *only* be set at NERSC.
#
if { [info exists env(NERSC_HOST)] } {
if { $env(NERSC_HOST) == "perlmutter" } {
# Use a specific version of cudatoolkit.
module swap cudatoolkit/12.2
# https://docs.nersc.gov/development/languages/python/using-python-perlmutter/#conda-cray-mpich-libfabric-dependencies-missing-evp-symbols
module load evp-patch
}
}
Expand Down

0 comments on commit e58ff93

Please sign in to comment.