forked from desihub/desiconda
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcosmodesiconda.gen
91 lines (77 loc) · 2.5 KB
/
cosmodesiconda.gen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#%Module###<-magic cookie ####################################################
##
## Software dependencies for the DESI cosmological pipeline.
##
##
# variables for Tcl script use only
set version _DCONDAVERSION_
module-whatis "Loads software dependencies for DESI cosmological pipeline."
proc ModulesHelp { } {
global version
puts stderr "\t\t DESI software dependencies - Version $version\n"
puts stderr "\t This loads a conda environment and other compiled"
puts stderr "\t software needed by the cosmological pipeline."
puts stderr ""
}
conflict cosmodesiconda
# in case _CONDAPRGENV_ is not loaded, swap it in
setenv CRAYPE_LINK_TYPE dynamic
if [ module-info mode load ] {
if [ is-loaded _CONDAPRGENV_ ] {
} else {
foreach prgenv [list _PRGENVS_] {
if { [string trim $prgenv] != "" && [is-loaded $prgenv] } {
module swap $prgenv _CONDAPRGENV_
}
}
}
foreach mod [list _UNLOADMODULES_] {
if { [string trim $mod] != "" } {
module unload $mod
}
}
foreach mod [list _LOADMODULES_] {
if { [string trim $mod] != "" } {
module load $mod
}
}
}
# This is set by OS python and gives us problems.
unsetenv PYTHONSTARTUP
# This is the conda environment location
prepend-path PATH _CONDADIR_/bin
prepend-path PATH _AUXDIR_/bin
prepend-path PYTHONPATH _CONDADIR_/lib/python_PYVERSION_/site-packages
setenv COSMODESIROOT _ROOTDIR_
setenv COSMODESICONDA _CONDADIR_
setenv COSMODESICONDA_VERSION _DCONDAVERSION_
# Add location of conda environment shared objects to search path
prepend-path LD_LIBRARY_PATH _AUXDIR_/lib
# for basemap; see https://github.com/matplotlib/basemap/issues/419
setenv PROJ_LIB _CONDADIR_/share/proj
# for performance on KNL; see https://github.com/desihub/desiutil/issues/180
# but don't set automatically; leave it for srun --cpu-bind=cores opt-in
# setenv SLURM_CPU_BIND cores
foreach {envname envvalue} [list _ENVVARIABLES_] {
setenv $envname $envvalue
}
set hostname [exec hostname]
if { [string match "nid*" $hostname] } {
foreach {envname envvalue} [list _ENVVARIABLES_NODES_] {
setenv $envname $envvalue
}
} else {
foreach {envname envvalue} [list _ENVVARIABLES_LOGIN_] {
setenv $envname $envvalue
}
}
# Set specific paths
foreach lib [list _PATH_] {
prepend-path PATH $lib
}
foreach lib [list _PYTHONPATH_] {
prepend-path PYTHONPATH $lib
}
foreach lib [list _LDLIBRARYPATH_] {
prepend-path LD_LIBRARY_PATH $lib
}