Skip to content

Commit 5122101

Browse files
hyeoksu-leeHyeoksu LeeHyeoksu Lee
authored
Support for DoD Carpenter (#475)
Co-authored-by: Hyeoksu Lee <hyeoksu@carpenter04.hsn.ex4000.erdc.hpc.mil> Co-authored-by: Hyeoksu Lee <hyeoksu@carpenter03.hsn.ex4000.erdc.hpc.mil>
1 parent 2a2d3d1 commit 5122101

File tree

5 files changed

+65
-11
lines changed

5 files changed

+65
-11
lines changed

mfc.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ if [ -d "$(pwd)/bootstrap" ] || [ -d "$(pwd)/dependencies" ] || [ -f "$(pwd)/bui
2222
fi
2323

2424
# If the user wishes to run the "load" script
25-
if [ "$1" == 'load' ]; then
25+
if [ "$1" '==' 'load' ]; then
2626
shift; . "$(pwd)/toolchain/bootstrap/modules.sh" $@; return
27-
elif [ "$1" == "lint" ]; then
27+
elif [ "$1" '==' "lint" ]; then
2828
. "$(pwd)/toolchain/bootstrap/python.sh"
2929

3030
shift; . "$(pwd)/toolchain/bootstrap/lint.sh" $@; exit 0
31-
elif [ "$1" == "format" ]; then
31+
elif [ "$1" '==' "format" ]; then
3232
. "$(pwd)/toolchain/bootstrap/python.sh"
3333

3434
shift; . "$(pwd)/toolchain/bootstrap/format.sh" $@; exit 0
35-
elif [ "$1" == "docker" ]; then
35+
elif [ "$1" '==' "docker" ]; then
3636
shift; . "$(pwd)/toolchain/bootstrap/docker.sh" $@; exit 0
37-
elif [ "$1" == "venv" ]; then
37+
elif [ "$1" '==' "venv" ]; then
3838
shift; . "$(pwd)/toolchain/bootstrap/python.sh" $@; return
3939
fi
4040

toolchain/bootstrap/modules.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ if [ -v $u_c ]; then
2323
log "$C""ACCESS$W: Bridges2 (b) | Expanse (e) | Delta (d)"
2424
log "$Y""Gatech$W: Phoenix (p)"
2525
log "$R""Caltech$W: Richardson (r)"
26-
log_n "($G""a$W/$G""f$W/$G""s$W/$G""w$W/$C""b$W/$C""e$CR/$C""d$CR/$Y""p$CR/$R""r$CR): "
26+
log "$B""DoD$W: Carpenter (c)"
27+
log_n "($G""a$W/$G""f$W/$G""s$W/$G""w$W/$C""b$W/$C""e$CR/$C""d$CR/$Y""p$CR/$R""r$CR/$B""c$CR): "
2728
read u_c
2829
log
2930
fi
@@ -42,9 +43,9 @@ fi
4243
u_c=$(echo "$u_c" | tr '[:upper:]' '[:lower:]')
4344
u_cg=$(echo "$u_cg" | tr '[:upper:]' '[:lower:]')
4445

45-
if [ "$u_cg" == 'c' ] || [ "$u_cg" == 'cpu' ]; then
46+
if [ "$u_cg" '==' 'c' ] || [ "$u_cg" '==' 'cpu' ]; then
4647
CG='CPU'; cg='cpu'
47-
elif [ "$u_cg" == "g" ] || [ "$u_cg" == 'gpu' ]; then
48+
elif [ "$u_cg" '==' "g" ] || [ "$u_cg" '==' 'gpu' ]; then
4849
CG='GPU'; cg='gpu'
4950
fi
5051

toolchain/modules

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@ f-all cray-fftw cray-hdf5 cray-mpich/8.1.26 cce/16.0.1
5454
f-all rocm/5.5.1 cray-python omniperf
5555
f-cpu
5656

57-
5857
d NCSA Delta
5958
d-all python/3.11.6
6059
d-cpu gcc/11.4.0 openmpi
6160
d-gpu nvhpc/22.11 openmpi+cuda/4.1.5+cuda cmake
6261
d-gpu CC=nvc CXX=nvc++ FC=nvfortran
62+
63+
c DoD Carpenter
64+
c-all python
65+
c-cpu gcc/12.2.0 cmake/3.28.1-gcc-12.2.0 openmpi/4.1.6
66+
c-gpu nvhpc/23.7 cuda/12.2

toolchain/templates/carpenter.mako

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
3+
<%namespace name="helpers" file="helpers.mako"/>
4+
5+
% if engine == 'batch':
6+
#PBS -l select=${nodes}:ncpus=192:mpiprocs=${tasks_per_node}
7+
#PBS -N "${name}"
8+
#PBS -l walltime=${walltime}
9+
% if partition:
10+
#PBS -q ${partition}
11+
% endif
12+
% if account:
13+
#PBS -A ${account}
14+
% endif
15+
% if email:
16+
#PBS -M ${email}
17+
#PBS -m abe
18+
% endif
19+
#PBS -o "${name}.out"
20+
#PBS -e "${name}.err"
21+
#PBS -V
22+
% endif
23+
24+
${helpers.template_prologue()}
25+
26+
ok ":) Loading modules:\n"
27+
cd "${MFC_ROOTDIR}"
28+
. ./mfc.sh load -c c -m ${'g' if gpu else 'c'}
29+
cd - > /dev/null
30+
echo
31+
32+
33+
% for target in targets:
34+
${helpers.run_prologue(target)}
35+
36+
% if not mpi:
37+
(set -x; ${profiler} "${target.get_install_binpath(case)}")
38+
% else:
39+
(set -x; ${profiler} \
40+
mpirun -np ${nodes*tasks_per_node} \
41+
"${target.get_install_binpath(case)}")
42+
% endif
43+
44+
${helpers.run_epilogue(target)}
45+
46+
echo
47+
% endfor
48+
49+
${helpers.template_epilogue()}

toolchain/util.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
if [ -t 1 ]; then
44
RED="\x1B[31m"; CYAN="\x1B[36m"; GREEN="\x1B[32m"
5-
YELLOW="\x1B[33m"; MAGENTA="\x1B[35m"; COLOR_RESET="\033[m"
5+
YELLOW="\x1B[33m"; MAGENTA="\x1B[35m"; BLUE="\x1B[34m"; COLOR_RESET="\033[m"
66

77
R=$RED; C=$CYAN; G=$GREEN
8-
Y=$YELLOW; M=$MAGENTA; CR=$COLOR_RESET; W=$CR
8+
Y=$YELLOW; M=$MAGENTA; B=$BLUE; CR=$COLOR_RESET; W=$CR
99
fi
1010

1111
log() { echo -e "$CYAN"mfc"$COLOR_RESET: $1$COLOR_RESET"; }

0 commit comments

Comments
 (0)