-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset_default
More file actions
executable file
·105 lines (90 loc) · 2.13 KB
/
set_default
File metadata and controls
executable file
·105 lines (90 loc) · 2.13 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
# Set default version of compilers and toolchains
#
# Ruoshi Sun
# 2020-08-11
APPDIR="/sfs/applications"
SOFTWARE="software"
MODFILE="modulefiles"
PREFIX="standard"
# define default versions
GCC_VER=9.2.0
GCCC_VER=9.2.0 # GCC for CUDA
INTEL_VER=20.0
OPENMPI_VER=3.1.6
MVAPICH2_VER=2.3.3
INTELMPI_VER=20.0
CUDA_VER=11.0.228
# compilers default (do not edit)
COMPILERS=(gcc intel)
COMPILERS_VER=($GCC_VER $INTEL_VER)
# toolchain default (do not edit)
TOOLCHAINS=(gcccuda gmvapich2 gmvolf gompi gompic goolf goolfc iintelmpi imvapich2)
TOOLCHAINS_VER=( \
${GCCC_VER}_${CUDA_VER} \
${GCC_VER}_${MVAPICH2_VER} \
${GCC_VER}_${MVAPICH2_VER} \
${GCC_VER}_${OPENMPI_VER} \
${GCCC_VER}_${OPENMPI_VER} \
${GCC_VER}_${OPENMPI_VER} \
${GCCC_VER}_${OPENMPI_VER}_${CUDA_VER} \
${INTEL_VER}_${INTELMPI_VER} \
${INTEL_VER}_${MVAPICH2_VER} \
)
CATEGORY=("core" "toolchains")
CORE=("gcc" "intel")
function print_usage {
echo "Usage: `basename $0` \"YYYYMM_list\""
}
function print_error {
RED='\e[1;31m'
NC='\e[m'
echo -e "${RED}Error: $1${NC}"
echo
print_usage
exit 1
}
function print_default {
CAT=$1
shift
if [ "$CAT" = "core" ]; then
APP=("${COMPILERS[@]}")
APP_VER=("${COMPILERS_VER[@]}")
elif [ "$CAT" = "toolchains" ]; then
APP=("${TOOLCHAINS[@]}")
APP_VER=("${TOOLCHAINS_VER[@]}")
else
print_error "Category $CAT not found."
fi
for i in "${!APP[@]}"; do
printf "%-10s" ${APP[$i]}
MODFILE_PATH=$APPDIR/$YYYYMM/$MODFILE/$PREFIX/$CAT/${APP[$i]}
cd $MODFILE_PATH
if [ -e default ]; then
rm default
fi
LUA="${APP_VER[$i]}.lua"
if [ ! -e $LUA ]; then
print_error "Module file $LUA not found."
fi
ln -s $LUA default
basename `readlink -f default`
cd ..
done
}
if [ $# -ne 1 ]; then
print_usage
exit 1
fi
if [ ! -e $APPDIR ]; then
print_error "$APPDIR not found. Please update $0."
fi
# store list of YYYYMMs
YYYYMMs=$1
shift
for YYYYMM in $YYYYMMs; do
echo $YYYYMM
print_default core
print_default toolchains
echo
done