Skip to content

Commit 7fb3150

Browse files
authored
Merge pull request #8 from sbamin/scratch
Scratch
2 parents ebf2205 + 4de0952 commit 7fb3150

File tree

15 files changed

+637
-22
lines changed

15 files changed

+637
-22
lines changed

confs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
## Configuration files
22

3-
Configuration files used during setup. Read inline comments in respective configuration files for further details.
3+
Configuration files used during setup. These files are hard-coded with paths specific to my user env. Please edit those before applying to your user env. Also, read inline comments in respective configuration files for further details.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
# warn while activating Winter (GPU) env on Sumner (CPU) HPC.
4+
# load at the very beginning of activate.d/ scripts, e.g.,
5+
# a01_warn_nongpu.sh
6+
7+
if [[ "$(hostname)" != *"winter"* ]]; then
8+
echo -e "\n############### WARN: INVALID HPC ################
9+
\nhostname string, $(hostname) does not match winter.\nconda env, ${CONDA_DEFAULT_ENV} works only on the Winter GPU HPC." >& 2
10+
fi
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
# name this script such that it loads after
4+
# conda activates cuda related configs, e.g.,
5+
# cupy_activate.sh
6+
7+
## switch gpu env to meet conda specific env needs
8+
## only on Winter GPU HPC
9+
10+
if [[ "$(hostname)" == *"winter"* ]]; then
11+
# avoid exiting with non-zero exit status
12+
# during bash startup but manually
13+
# fix any errors, if any loading/unloading
14+
# these modules
15+
16+
## deactivate default gpu env
17+
module unload gpu/11.1.1 || true
18+
19+
## activate non-default gpu env for conda ben env
20+
module load gpu/11.1.1_ben || true
21+
fi
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
## switch gpu env to meet conda specific env needs
4+
## load at the last in deactivate directory
5+
6+
if [[ "$(hostname)" == *"winter"* ]]; then
7+
module unload gpu/11.1.1_ben || true
8+
fi
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
# warn while activating Winter (GPU) env on Sumner (CPU) HPC.
4+
# load at the very beginning of activate.d/ scripts, e.g.,
5+
# a01_warn_nongpu.sh
6+
7+
if [[ "$(hostname)" != *"winter"* ]]; then
8+
echo -e "\n############### WARN: INVALID HPC ################
9+
\nhostname string, $(hostname) does not match winter.\nconda env, ${CONDA_DEFAULT_ENV} works only on the Winter GPU HPC." >& 2
10+
fi
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env sh
2+
3+
# name this script such that it loads after
4+
# conda activates r-base using activate-r-base.sh
5+
6+
## override ~/.Renviron which point to R from yoda env
7+
R_HOME="$CONDA_PREFIX/lib/R"
8+
R_ENVIRON_USER="/projects/verhaak-lab/amins/hpcenv/opt/R/confs/rey/Renviron"
9+
10+
export R_HOME R_ENVIRON_USER
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
# name this script such that it loads after
4+
# conda activates cuda related configs, e.g.,
5+
# cupy_activate.sh
6+
7+
## switch gpu env to meet conda specific env needs
8+
## only on Winter GPU HPC
9+
10+
if [[ "$(hostname)" == *"winter"* ]]; then
11+
# avoid exiting with non-zero exit status
12+
# during bash startup but manually
13+
# fix any errors, if any loading/unloading
14+
# these modules
15+
16+
## deactivate non-default gpu env, if any.
17+
module unload gpu/11.1.1_ben || true
18+
19+
## activate default gpu env
20+
module load gpu/11.1.1 || true
21+
fi
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
3+
## fall back to pre-existing R env
4+
unset R_HOME R_ENVIRON_USER
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
## switch gpu env to meet conda specific env needs
4+
## load at the last in deactivate directory
5+
6+
if [[ "$(hostname)" == *"winter"* ]]; then
7+
module unload gpu/11.1.1 || true
8+
fi
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
# warn while activating Sumner (CPU) env on Winter (GPU) HPC.
4+
# load at the very beginning of activate.d/ scripts, e.g.,
5+
# a01_warn_noncpu.sh
6+
7+
## PS: It's ok to use CPU env on GPU HPC as long as both HPCs
8+
## share identical base OS (CentOS7 in our case) and shared
9+
## system paths, e.g., /etc/, /usr/, /opt/, etc.
10+
11+
if [[ "$(hostname)" != *"sumner"* ]]; then
12+
echo -e "\n######### WARN: CAREFUL MANAGING CPU ENV #########
13+
\nhostname string, $(hostname) does not match sumner.\nconda env, ${CONDA_DEFAULT_ENV} should be managed using Sumner CPU HPC.\nAvoid installing or updating packages outside Sumner HPC env." >& 2
14+
fi

0 commit comments

Comments
 (0)