1 | #!/bin/bash |
---|
2 | |
---|
3 | cp ../context_grid_dynamico.xml ./ |
---|
4 | cp ../dynamico_grid.nc ./ |
---|
5 | cp ../config.py sub_config.py |
---|
6 | cp ../check.py sub_check.py |
---|
7 | cp ../default_param.py default_param.py |
---|
8 | |
---|
9 | |
---|
10 | # Black 0;30 Dark Gray 1;30 |
---|
11 | # Red 0;31 Light Red 1;31 |
---|
12 | # Green 0;32 Light Green 1;32 |
---|
13 | # Brown/Orange 0;33 Yellow 1;33 |
---|
14 | # Blue 0;34 Light Blue 1;34 |
---|
15 | # Purple 0;35 Light Purple 1;35 |
---|
16 | # Cyan 0;36 Light Cyan 1;36 |
---|
17 | # Light Gray 0;37 White 1;37 |
---|
18 | |
---|
19 | |
---|
20 | { nb_proc=$(python sub_config.py 2>&1 1>&3-) ;} 3>&1 |
---|
21 | # nb_proc=$(python sub_config.py 2>&1) |
---|
22 | |
---|
23 | # echo $nb_proc |
---|
24 | if [[ ($machine_name == irene) ]] |
---|
25 | then |
---|
26 | echo "Testing on Irene" |
---|
27 | echo "build_dir="$build_dir |
---|
28 | ccc_mprun -n $nb_proc $xios_dir/$build_dir/bin/generic_testcase.exe |
---|
29 | elif [[($machine_name == ada)]] |
---|
30 | then |
---|
31 | echo "Testing on ADA" |
---|
32 | mpirun -np $nb_proc $xios_dir/$build_dir/bin/generic_testcase.exe |
---|
33 | elif [[($machine_name == jeanzay)]] |
---|
34 | then |
---|
35 | echo "Testing on Jean-Zay" |
---|
36 | echo "build_dir="$build_dir |
---|
37 | srun -n $nb_proc --mpi=pmi2 $xios_dir/$build_dir/bin/generic_testcase.exe |
---|
38 | if [ $? -ne 0 ] |
---|
39 | then |
---|
40 | echo "execution failed" |
---|
41 | rm -f iodef.xml |
---|
42 | rm -f user_param.py |
---|
43 | rm -f default_param.py |
---|
44 | rm -f sub_config.py |
---|
45 | rm -f sub_check.py |
---|
46 | exit 1234 |
---|
47 | fi |
---|
48 | else |
---|
49 | echo "other machine" |
---|
50 | exit 1234 |
---|
51 | fi |
---|
52 | |
---|
53 | |
---|
54 | { check_stderr=$(python sub_check.py 2>&1 1>&3-) ;} 3>&1 #captures stderr, letting stdout through |
---|
55 | # check_stderr=$(python sub_check.py 2>&1 >/dev/null) |
---|
56 | |
---|
57 | if [[ "$check_stderr" -ne 0 ]] |
---|
58 | then |
---|
59 | echo "check.py failed" |
---|
60 | rm -f iodef.xml |
---|
61 | rm -f user_param.py |
---|
62 | rm -f default_param.py |
---|
63 | rm -f sub_config.py |
---|
64 | rm -f sub_check.py |
---|
65 | exit 1234 |
---|
66 | # else |
---|
67 | # echo "check.py OK" |
---|
68 | fi |
---|
69 | |
---|
70 | |
---|
71 | rm -f iodef.xml |
---|
72 | rm -f user_param.py |
---|
73 | rm -f default_param.py |
---|
74 | rm -f sub_config.py |
---|
75 | rm -f sub_check.py |
---|