Skip to content

Commit 480429b

Browse files
committed
Minor updates & mfc.sh load refactor
1 parent 8b5e276 commit 480429b

File tree

4 files changed

+100
-118
lines changed

4 files changed

+100
-118
lines changed

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
106106
add_compile_options($<$<COMPILE_LANGUAGE:Fortran>:-free>)
107107

108108
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
109-
add_compile_options(-g -O0 -traceback -debug)
109+
add_compile_options(-g -Og -traceback -debug)
110110
endif()
111111
elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI"))
112112
add_compile_options(
@@ -122,7 +122,7 @@ elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_
122122
endif()
123123

124124
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
125-
add_compile_options(-C -g -O0 -traceback -Mchkptr -Mchkstk -Minform=inform -Mbounds)
125+
add_compile_options(-C -g -Og -traceback -Mchkptr -Mchkstk -Minform=inform -Mbounds)
126126
endif()
127127
endif()
128128

@@ -396,15 +396,17 @@ if (MFC_DOCUMENTATION)
396396
ExternalProject_Add(doxygen-awesome-css
397397
PREFIX doxygen-awesome-css
398398
GIT_REPOSITORY "https://github.com/jothepro/doxygen-awesome-css"
399-
GIT_TAG "8a34f701d3435309a21080f44fbd4a466979aa19"
399+
GIT_TAG "df83fbf22cfff76b875c13d324baf584c74e96d0"
400400
CONFIGURE_COMMAND ""
401401
BUILD_COMMAND ""
402402
INSTALL_COMMAND ""
403403
)
404404

405-
set(theme_dirpath "${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css/src/doxygen-awesome-css/")
405+
set(theme_dirpath "${CMAKE_CURRENT_BINARY_DIR}/doxygen-awesome-css/src/doxygen-awesome-css")
406406

407-
set(DOXYGEN_HTML_EXTRA_STYLESHEET "\"${theme_dirpath}/doxygen-awesome.css\"")
407+
set(DOXYGEN_HTML_EXTRA_STYLESHEET
408+
"\"${theme_dirpath}/doxygen-awesome.css\"\
409+
\"${theme_dirpath}/doxygen-awesome-sidebar-only.css\"")
408410

409411
# === === Generate Documentation
410412
GEN_DOCS(pre_process "MFC: Pre-Process")

docs/Doxyfile.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# TAG += value [value, ...]
1414
# Values that contain spaces should be placed between quotes (\" \").
1515

16+
FULL_SIDEBAR = NO
17+
HTML_COLORSTYLE = LIGHT
18+
1619
#---------------------------------------------------------------------------
1720
# Project related configuration options
1821
#---------------------------------------------------------------------------

mfc.sh

Lines changed: 41 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
unset u_c
4+
unset u_cg
35

46
MFC_PYTHON_MIN_MAJOR=3
57
MFC_PYTHON_MIN_MINOR=6
@@ -22,7 +24,7 @@ if [ -d "$(pwd)/bootstrap" ] || [ -d "$(pwd)/dependencies" ] || [ -f "$(pwd)/bui
2224
fi
2325

2426
# If the user wishes to run the "load" script
25-
if [ "$1" == "load" ]; then
27+
if [ "$1" == 'load' ]; then
2628
shift;
2729

2830
# Reset u_computer & u_cg to known values since this script is run with "source"
@@ -32,143 +34,70 @@ if [ "$1" == "load" ]; then
3234
# If there are command-line arguments, parse them:
3335
while [[ $# -gt 0 ]]; do
3436
case $1 in
35-
-c|--computer) u_computer="$2"; shift; shift; ;;
36-
-m|--mode) u_cg="$2"; shift; shift; ;;
37+
-c|--computer) u_c="$2"; shift; shift; ;;
38+
-m|--mode) u_cg="$2"; shift; shift; ;;
3739
-*|--*) echo "Unknown option $1"; return; ;;
3840
esac
3941
done
4042

4143
# Get computer (if not supplied in command-line)
42-
if [ -v $u_computer ]; then
44+
if [ -v $u_c ]; then
4345
log "Select a system:"
44-
log "$G""ORNL$W: Ascent (a), Crusher (c), Summit (s), Wombat (w)"
45-
log "$C""ACCESS$W: Bridges2 (b), Expanse (e), Delta (d)"
46+
log "$G""ORNL$W: Ascent (a) | Crusher (c) | Summit (s) | Wombat (w)"
47+
log "$C""ACCESS$W: Bridges2 (b) | Expanse (e) | Delta (d)"
4648
log "$Y""GaTech$W: Phoenix (p)"
4749
log "$R""CALTECH$W: Richardson (r)"
4850
log_n "($G""a$W/$G""c$W/$G""s$W/$G""w$W/$C""b$W/$C""e$CR/$C""d$CR/$Y""p$CR/$R""r$CR): "
49-
read u_computer
51+
read u_c
5052
log
5153
fi
5254

5355
# Get CPU/GPU (if not supplied in command-line)
5456
if [ -v $u_cg ]; then
5557
log "Select configuration:"
56-
log " - CPU (c)"
57-
log " - GPU (g)"
58-
log_n "(c/g): "
58+
log " - CPU (c | cpu)"
59+
log " - GPU (g | gpu)"
60+
log_n "(c/cpu/g/gpu): "
5961
read u_cg
6062
log
6163
fi
6264

6365
# User input to lowercase
64-
u_computer=$(echo "$u_computer" | tr '[:upper:]' '[:lower:]')
66+
u_c=$(echo "$u_c" | tr '[:upper:]' '[:lower:]')
6567
u_cg=$(echo "$u_cg" | tr '[:upper:]' '[:lower:]')
6668

67-
COMPUTER=""; CG=""
68-
declare -a MODULES
69-
70-
if [ "$u_cg" == "c" ]; then # for CPU
71-
CG="CPU"
72-
elif [ "$u_cg" == "g" ]; then # For GPU
73-
CG="GPU"
69+
if [ "$u_cg" == 'c' ] || [ "$u_cg" == 'cpu' ]; then
70+
CG='CPU'; cg='cpu'
71+
elif [ "$u_cg" == "g" ] || [ "$u_cg" == 'gpu' ]; then
72+
CG='GPU'; cg='gpu'
7473
fi
7574

76-
if [ "$u_computer" == "s" ]; then # For Summit
77-
if [ "$u_cg" == "c" ]; then
78-
MODULES=("gcc/12.1.0")
79-
elif [ "$u_cg" == "g" ]; then
80-
MODULES=("nvhpc/22.11" "cuda/nvhpc")
81-
fi
82-
83-
MODULES=("${MODULES[@]}" "python/3.8.10" "darshan-runtime/3.3.1-lite"
84-
"hsi/5.0.2.p5" "xalt/1.2.1" "lsf-tools/2.0"
85-
"cmake/3.23.2" "ninja/1.10.2" "spectrum-mpi/10.4.0.3-20210112")
86-
elif [ "$u_computer" == "b" ]; then # Bridges2
87-
if [ "$u_cg" == "c" ]; then
88-
MODULES=("allocations/1.0" "gcc/10.2.0" "python/3.8.6"
89-
"openmpi/4.0.5-gcc10.2.0")
90-
elif [ "$u_cg" == "g" ]; then
91-
MODULES=("openmpi/4.0.5-nvhpc22.9" "nvhpc/22.9")
92-
fi
93-
94-
MODULES=("${MODULES[@]}" "python/3.8.6")
95-
elif [ "$u_computer" == "d" ]; then # Delta
96-
if [ "$u_cg" == "c" ]; then
97-
MODULES=()
98-
elif [ "$u_cg" == "g" ]; then
99-
MODULES=("nvhpc/22.5")
100-
fi
101-
102-
MODULES=("${MODULES[@]}" "cmake" "openmpi")
103-
elif [ "$u_computer" == "a" ]; then # For Ascent
104-
if [ "$u_cg" == "c" ]; then
105-
MODULES=("gcc/11.1.0" "spectrum-mpi" "cuda")
106-
elif [ "$u_cg" == "g" ]; then
107-
MODULES=("nvhpc/21.11" "spectrum-mpi" "cuda/nvhpc"
108-
"nsight-compute" "nsight-systems")
109-
fi
110-
111-
MODULES=("${MODULES[@]}" "python" "cmake/3.22.2")
112-
elif [ "$u_computer" == "r" ]; then # Richardson
113-
if [ "$u_cg" == "c" ]; then
114-
MODULES=("gcc/9.3.0" "openmpi-2.0/gcc-9.3.0")
115-
elif [ "$u_cg" == "g" ]; then
116-
error "GPU not supported on Richardson."
117-
118-
return
119-
fi
120-
121-
MODULES=("${MODULES[@]}" "python/3.7")
122-
elif [ "$u_computer" == "w" ]; then # For Wombat
123-
if [ "$u_cg" == "c" ]; then
124-
MODULES=("gcc/11.1.0" "openmpi/4.0.5_gcc")
125-
elif [ "$u_cg" == "g" ]; then
126-
MODULES=("nvhpc/22.11")
127-
fi
128-
129-
MODULES=("${MODULES[@]}" "cmake/3.25.1" "python/3.10.8")
130-
elif [ "$u_computer" == "e" ]; then # Expanse
131-
if [ "$u_cg" == "c" ]; then
132-
warn "Please set CC=icc, CXX=icx, and FC=ifort."
133-
log
134-
135-
MODULES=("cpu/0.15.4" "gcc/9.2.0" "openmpi/4.1.1" "cmake/3.18.2")
136-
elif [ "$u_cg" == "g" ]; then
137-
MODULES=("gpu/0.15.4" "cuda/11.0.2" "nvhpc/22.2" "openmpi/4.0.5" "cmake/3.19.8")
138-
fi
139-
140-
MODULES=("${MODULES[@]}" "python/3.8.5")
141-
elif [ "$u_computer" == "p" ]; then # Phoenix
142-
if [ "$u_cg" == "c" ]; then
143-
MODULES=("gcc/10.3.0-o57x6h" "openmpi/4.1.4")
144-
elif [ "$u_cg" == "g" ]; then
145-
MODULES=("cuda/11.7.0-7sdye3" "nvhpc/22.11")
146-
fi
147-
148-
MODULES=("${MODULES[@]}" "python/3.9.12-rkxvr6" "cmake/3.23.1-327dbl")
149-
elif [ "$u_computer" == "c" ]; then # Crusher
150-
if [ "$u_cg" == "c" ]; then
151-
MODULES=()
152-
elif [ "$u_cg" == "g" ]; then
153-
MODULES=("rocm/5.1.0" "craype-accel-amd-gfx90a")
154-
fi
75+
__combine() {
76+
echo -n $@ | sed 's/\[\n\r\s\]\+/\ /'
77+
}
15578

156-
MODULES=("${MODULES[@]}" "cce/15.0.1" "cmake/3.23.2" "cray-fftw/3.3.10.2" "hdf5/1.12.1" "cray-python/3.9.13.1" "ninja/1.10.2" "cray-mpich/8.1.23")
157-
else
158-
echo -e $RED"Error: Requested system $u_computer is not supported (yet!)"$COLOR_RESET
79+
__extract() {
80+
__combine "$(grep -E "^$1\s+" toolchain/modules | sed "s/^$1\s\+//")"
81+
}
15982

83+
COMPUTER="$(__extract "$u_c")"
84+
85+
if [[ -z "$COMPUTER" ]]; then
86+
error "Computer $M$u_cg$CR not recognized."
16087
return
16188
fi
162-
163-
log "Loading modules for $CG mode:"
89+
90+
MODULES=($(__extract "$u_c-$cg") $(__combine $(__extract "$u_c-all")))
91+
92+
log "Loading modules for $M$COMPUTER$CR on $M$CG$CR"'s:'
16493

16594
# Reset modules to default system configuration
166-
if [ "$u_computer" != "p" ]; then
95+
if [ "$u_c" != 'p' ]; then
16796
module reset > /dev/null 2>&1
16897
code="$?"
16998

17099
# Purge if reset is not available
171-
if [ "$code" -ne "0" ]; then
100+
if [ "$code" -ne '0' ]; then
172101
module purge > /dev/null 2>&1
173102
fi
174103
else
@@ -187,22 +116,21 @@ if [ "$1" == "load" ]; then
187116

188117
# Load modules ($MODULES)
189118
for module_name in ${MODULES[@]}; do
190-
log_n " - Load $CYAN$module_name$COLOR_RESET "
119+
log_n " - $CYAN$module_name$COLOR_RESET "
191120

192121
# Add padding spaces
193122
module_length="${#module_name}"
194-
delta="$((max_module_length-module_length-2))"
195-
if [ "$delta" -ne "-2" ]; then
196-
printf "%0.s-" $(seq 0 $delta)
197-
echo -n " "
123+
delta="$((max_module_length-module_length-1))"
124+
if [ "$delta" -ge "0" ]; then
125+
printf "%0.s " $(seq 0 $delta)
198126
fi
199-
127+
200128
# Load the module
201129
module load "$module_name" > /dev/null 2>&1
202130

203131
# Handle Success / Failure
204132
code=$?
205-
if [ "$code" == "0" ]; then
133+
if [ "$code" == '0' ]; then
206134
echo -e "[$G""SUCCESS$W]"
207135
else
208136
echo -e "[$R""FAILURE$W]"
@@ -214,7 +142,7 @@ if [ "$1" == "load" ]; then
214142
fi
215143
done
216144

217-
ok "All modules have been loaded."
145+
ok "All modules have been loaded for $M$COMPUTER$CR on $M$CG$CR"'s.'
218146

219147
return
220148
elif [ "$1" == "format" ]; then
@@ -228,7 +156,7 @@ elif [ "$1" == "format" ]; then
228156
--case 1 1 1 1 --strict-indent
229157
ret="$?"
230158

231-
if [ "$ret" != "0" ]; then
159+
if [ "$ret" != '0' ]; then
232160
error "failed to execute fprettify."
233161
error "MFC has not been fprettify'ied."
234162

toolchain/modules

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# List of modules used by . ./mfc.sh load to load modules known to be compatible
2+
# with MFC on different clusters.
3+
#
4+
# [slug] [system name]
5+
# [slug]-all [common modules] (any number of lines)
6+
# [slug]-cpu [cpu-only modules] (any number of lines)
7+
# [slug]-gpu [gpu-only modules] (any number of lines)
8+
9+
s OLCF Summit
10+
s-all python/3.8.10 darshan-runtime/3.3.1-lite hsi/5.0.2.p5 xalt/1.2.1
11+
s-cpu lsf-tools/2.0 cmake/3.23.2 ninja/1.10.2 spectrum-mpi/10.4.0.3-20210112
12+
s-cpu gcc/12.1.0
13+
s-gpu nvhpc/22.11 cuda/nvhpc
14+
15+
b PSC Bridges2
16+
b-all python/3.8.6
17+
b-cpu allocations/1.0 gcc/10.2.0 openmpi/4.0.5-gcc10.2.0
18+
b-gpu openmpi/4.0.5-nvhpc22.9 nvhpc/22.9
19+
20+
a OLCF Ascent
21+
a-all python cmake/3.22.2
22+
a-cpu gcc/11.1.0 spectrum-mpi cuda
23+
a-gpu nvhpc/21.11 spectrum-mpi cuda/nvhpc nsight-compute nsight-systems
24+
25+
r Richardson
26+
r-all python/3.7
27+
r-cpu gcc/9.3.0 openmpi-2.0/gcc-9.3.0
28+
29+
w OLCF Wombat
30+
w-all cmake/3.25.1 python/3.10.8
31+
w-cpu gcc/11.1.0 openmpi/4.0.5_gcc
32+
w-gpu nvhpc/22.11
33+
34+
e SDSC Expanse
35+
e-all python/3.8.5
36+
e-cpu cpu/0.15.4 gcc/9.2.0 openmpi/4.1.1 cmake/3.18.2
37+
e-gpu gpu/0.15.4 cuda/11.0.2 nvhpc/22.2 openmpi/4.0.5 cmake/3.19.8
38+
39+
p GT Phoenix
40+
p-all python/3.9.12-rkxvr6 cmake/3.23.1-327dbl
41+
p-cpu gcc/10.3.0-o57x6h openmpi/4.1.4
42+
p-gpu cuda/11.7.0-7sdye3 nvhpc/22.11
43+
44+
c OLCF Crusher
45+
c-all cmake/3.23.2 cray-fftw/3.3.10.2 hdf5/1.12.1 cray-python/3.9.13.1
46+
c-all ninja/1.10.2 cray-mpich/8.1.23
47+
c-cpu
48+
c-gpu rocm/5.1.0 craype-accel-amd-gfx90a
49+

0 commit comments

Comments
 (0)