Skip to content

Commit d66e442

Browse files
committed
Merge remote-tracking branch 'origin/release-v4.6.1'
2 parents 0a11865 + c21d571 commit d66e442

File tree

103 files changed

+4044
-2523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4044
-2523
lines changed

.ci/env/derecho.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
3+
echo "Setting up derecho environment"
4+
workingDirectory=$PWD
5+
. /etc/profile.d/z00_modules.sh
6+
echo "Loading modules : $*"
7+
cmd="module purge"
8+
echo $cmd && eval "${cmd}"
9+
10+
# We should be handed in the modules to load
11+
while [ $# -gt 0 ]; do
12+
cmd="module load $1"
13+
echo $cmd && eval "${cmd}"
14+
shift
15+
done
16+
17+
# Go back to working directory if for unknown reason HPC config changing your directory on you
18+
if [ "$workingDirectory" != "$PWD" ]; then
19+
echo "derecho module loading changed working directory"
20+
echo " Moving back to $workingDirectory"
21+
cd $workingDirectory
22+
fi

.ci/env/helpers.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/sh
2+
3+
# Useful string manipulation functions, leaving in for posterity
4+
# https://stackoverflow.com/a/8811800
5+
# contains(string, substring)
6+
#
7+
# Returns 0 if the specified string contains the specified substring,
8+
# otherwise returns 1.
9+
contains()
10+
{
11+
string="$1"
12+
substring="$2"
13+
14+
if [ "${string#*"$substring"}" != "$string" ]; then
15+
echo 0 # $substring is in $string
16+
else
17+
echo 1 # $substring is not in $string
18+
fi
19+
}
20+
21+
setenvStr()
22+
{
23+
# Changing IFS produces the most consistent results
24+
tmpIFS=$IFS
25+
IFS=","
26+
string="$1"
27+
for s in $string; do
28+
if [ ! -z $s ]; then
29+
eval "echo export \"$s\""
30+
eval "export \"$s\""
31+
fi
32+
done
33+
IFS=$tmpIFS
34+
}
35+
36+
banner()
37+
{
38+
lengthBanner=$1
39+
shift
40+
# https://www.shellscript.sh/examples/banner/
41+
printf "#%${lengthBanner}s#\n" | tr " " "="
42+
printf "# %-$(( ${lengthBanner} - 2 ))s #\n" "`date`"
43+
printf "# %-$(( ${lengthBanner} - 2 ))s #\n" " "
44+
printf "# %-$(( ${lengthBanner} - 2 ))s #\n" "$*"
45+
printf "#%${lengthBanner}s#\n" | tr " " "="
46+
}

.ci/env/hostenv.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
# Allow selection of hostname, and if none is provided use the current machine
4+
# While this may seem unintuitive at first, it provides the flexibility of using
5+
# "named" configurations without being explicitly tied to fqdn
6+
hostname=$AS_HOST
7+
if [ -z "$hostname" ]; then
8+
hostname=$( python3 -c "import socket; print( socket.getfqdn() )" )
9+
fi
10+
11+
if [ $( contains ${hostname} hsn.de.hpc ) -eq 0 ]; then
12+
# Derecho HPC SuSE PBS
13+
. .ci/env/derecho.sh
14+
else
15+
echo "No known environment for '${hostname}', using current"
16+
fi

.ci/hpc-workflows

Submodule hpc-workflows added at dfc8e6d

.ci/tests/build.sh

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#!/bin/sh
2+
help()
3+
{
4+
echo "./build.sh as_host workingdir [options] [-- <hostenv.sh options>]"
5+
echo " as_host First argument must be the host configuration to use for environment loading"
6+
echo " workingdir First argument must be the working dir to immediate cd to"
7+
echo " -c Configuration build type, piped directly into configure"
8+
echo " -n Configuration nesting type, piped directly into configure"
9+
echo " -o Configuration optstring passed into configure"
10+
echo " -b Build command passed into compile"
11+
echo " -e environment variables in comma-delimited list, e.g. var=1,foo,bar=0"
12+
echo " -- <hostenv.sh options> Directly pass options to hostenv.sh, equivalent to hostenv.sh <options>"
13+
echo " -h Print this message"
14+
echo ""
15+
echo "If you wish to use an env var in your arg such as '-c \$SERIAL -e SERIAL=32', you must"
16+
echo "you will need to do '-c \\\$SERIAL -e SERIAL=32' to delay shell expansion"
17+
}
18+
19+
echo "Input arguments:"
20+
echo "$*"
21+
22+
AS_HOST=$1
23+
shift
24+
if [ $AS_HOST = "-h" ]; then
25+
help
26+
exit 0
27+
fi
28+
29+
workingDirectory=$1
30+
shift
31+
32+
cd $workingDirectory
33+
34+
# Get some helper functions
35+
. .ci/env/helpers.sh
36+
37+
while getopts c:n:o:b:e:h opt; do
38+
case $opt in
39+
c)
40+
configuration="$OPTARG"
41+
;;
42+
n)
43+
nesting="$OPTARG"
44+
;;
45+
o)
46+
configOpt="$OPTARG"
47+
;;
48+
b)
49+
buildCommand="$OPTARG"
50+
;;
51+
e)
52+
envVars="$envVars,$OPTARG"
53+
;;
54+
h) help; exit 0 ;;
55+
*) help; exit 1 ;;
56+
:) help; exit 1 ;;
57+
\?) help; exit 1 ;;
58+
esac
59+
done
60+
61+
shift "$((OPTIND - 1))"
62+
63+
# Everything else goes to our env setup
64+
. .ci/env/hostenv.sh $*
65+
66+
# Now evaluate env vars in case it pulls from hostenv.sh
67+
if [ ! -z "$envVars" ]; then
68+
setenvStr "$envVars"
69+
fi
70+
71+
# Re-evaluate input values for delayed expansion
72+
eval "configuration=\"$configuration\""
73+
eval "nesting=\"$nesting\""
74+
eval "configOpt=\"$configOpt\""
75+
eval "buildCommand=\"$buildCommand\""
76+
77+
./clean -a
78+
79+
echo "Compiling with option $configuration nesting=$nesting and additional flags '$configOpt'"
80+
./configure $configOpt << EOF
81+
$configuration
82+
$nesting
83+
EOF
84+
85+
if [ ! -f configure.wrf ]; then
86+
echo "Failed to configure"
87+
exit 1
88+
fi
89+
90+
echo "./compile $buildCommand"
91+
./compile $buildCommand
92+
93+
result=$?
94+
95+
if [ $result -ne 0 ]; then
96+
echo "Failed to compile"
97+
exit 1
98+
fi
99+
100+
# And a *very* special check because WRF compiles the WRF way and force-ignores all make errors
101+
# putting the onus on US to check for things
102+
if [ ! -x ./main/wrf.exe ]; then # There's a bunch of other execs but this is the most important and
103+
# doing more checks to accomodate just reinforces this bad design
104+
echo "Failed to compile"
105+
exit 1
106+
fi
107+
108+
echo "TEST $(basename $0) PASS"

.ci/wrf_compilation_tests-make.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"submit_options" :
3+
{
4+
"timelimit" : "00:20:00",
5+
"working_directory" : "..",
6+
"arguments" :
7+
{
8+
"base_env_numprocs" : [ "-e", "NUM_PROCS=4" ],
9+
10+
".*make.*::args_nesting" : [ "-n", "1" ],
11+
".*make.*::args_configopt" : [ "-o", "-d" ],
12+
".*make.*::args_build_tgt" : [ "-b", "em_real -j $NUM_PROCS" ]
13+
},
14+
"hsn.de.hpc" :
15+
{
16+
"submission" : "PBS",
17+
"queue" : "main",
18+
"hpc_arguments" :
19+
{
20+
"node_select" : { "-l " : { "select" : 1, "ncpus" : 8 } },
21+
"priority" : { "-l " : { "job_priority" : "economy" } }
22+
},
23+
"arguments" :
24+
{
25+
"base_env_numprocs" : [ "-e", "NUM_PROCS=8" ],
26+
"very_last_modules" : [ "netcdf" ],
27+
".*gnu.*::test_modules" : [ "gcc" ],
28+
".*intel-classic.*::test_modules" : [ "intel-classic" ],
29+
".*intel-llvm.*::test_modules" : [ "intel-oneapi" ],
30+
".*pgi.*::test_modules" : [ "nvhpc" ],
31+
".*dm.*::test_mpi_module" : [ "cray-mpich" ]
32+
}
33+
}
34+
},
35+
36+
"make-gnu-serial" : { "steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "32" ] } } },
37+
"make-gnu-sm" : { "steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "33" ] } } },
38+
"make-gnu-dm" : { "steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "34" ] } } },
39+
"make-gnu-dm+sm" : { "steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "35" ] } } },
40+
41+
"make-intel-classic-serial" : {
42+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
43+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "13" ] } }
44+
},
45+
"make-intel-classic-sm" : {
46+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
47+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "14" ] } }
48+
},
49+
"make-intel-classic-dm" : {
50+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
51+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "15" ] } }
52+
},
53+
"make-intel-classic-dm+sm" : {
54+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
55+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "16" ] } }
56+
},
57+
58+
"make-intel-llvm-serial" : {
59+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
60+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "76" ] } }
61+
},
62+
"make-intel-llvm-sm" : {
63+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
64+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "77" ] } }
65+
},
66+
"make-intel-llvm-dm" : {
67+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
68+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "78" ] } }
69+
},
70+
"make-intel-llvm-dm+sm" : {
71+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
72+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "79" ] } }
73+
},
74+
75+
"make-pgi-serial" : {
76+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
77+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "1" ] } }
78+
},
79+
"make-pgi-sm" : {
80+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
81+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "2" ] } }
82+
},
83+
"make-pgi-dm" : {
84+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
85+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "3" ] } }
86+
},
87+
"make-pgi-dm+sm" : {
88+
"submit_options" : { "hsn.de.hpc" : { "timelimit" : "00:30:00" } },
89+
"steps" : { "build" : { "command" : ".ci/tests/build.sh", "arguments" : [ "-c", "4" ] } }
90+
}
91+
}

0 commit comments

Comments
 (0)