-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathparallel_run.sh
executable file
·46 lines (40 loc) · 1 KB
/
parallel_run.sh
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
#!/bin/bash
#
# Copyright (C) 2024, Northwestern University and Argonne National Laboratory
# See COPYRIGHT notice in top-level directory.
#
# Exit immediately if a command exits with a non-zero status.
set -e
# Get the directory containing this script
if test "x$NPROC" = x ; then
NPROC=4
fi
# get output folder from command line
if test "$#" -gt 0 ; then
args=("$@")
OUT_DIR="${args[0]}"
# check if output folder exists
if ! test -d $OUT_DIR ; then
echo "Error: output folder \"$OUT_DIR\" does not exist."
exit 1
fi
else
# output folder is not set at command line, use current folder
OUT_DIR="."
fi
# echo "OUT_DIR=$OUT_DIR"
for prog in ${check_PROGRAMS} ; do
printf '%-60s' "Testing $prog "
if test $prog = "tst_libver.py" ; then
CMD="${TESTMPIRUN} -n $NPROC python $prog -q"
else
CMD="${TESTMPIRUN} -n $NPROC python $prog $OUT_DIR"
fi
$CMD
status=$?
if [ $status -ne 0 ]; then
echo " ---- FAIL"
else
echo " ---- PASS"
fi
done