Skip to content

Commit 1456a8a

Browse files
authored
Update sniff_mpirun.sh to look for srun also (#315)
And propagate results throughout test suite.
1 parent 6ef1e91 commit 1456a8a

23 files changed

+117
-131
lines changed

test/averaging.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ setup() {
1313
SOLN_FILE=restart_output.sol.h5
1414
REF_FILE=ref_solns/cyl-2d.cpu.h5
1515
REF_FILE_REST=ref_solns/cyl-2d.meanRestart.cpu.h5
16+
MPIRUN=`./sniff_mpirun.sh`
1617
}
1718

1819
@test "[$TEST] caseA: run serial case" {
@@ -27,7 +28,7 @@ setup() {
2728

2829
@test "[$TEST] caseB: run parallel case" {
2930
test -s $RUNFILE_B
30-
mpirun -n 4 ../src/tps -run $RUNFILE_B
31+
$MPIRUN -n 4 ../src/tps -run $RUNFILE_B
3132
test -s $SOLN_FILE
3233
./soln_differ -a -r -d 2 $SOLN_FILE $REF_FILE
3334

@@ -36,7 +37,7 @@ setup() {
3637

3738
@test "[$TEST] caseC: restart from a serialized solution" {
3839
test -s $RUNFILE_C1
39-
mpirun -n 4 ../src/tps -run $RUNFILE_C1
40+
$MPIRUN -n 4 ../src/tps -run $RUNFILE_C1
4041
../src/tps -run $RUNFILE_C2
4142
test -s $SOLN_FILE
4243
./soln_differ -a -d 2 $SOLN_FILE $REF_FILE

test/coupled-3d.interface.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ RUNFILE="inputs/coupled-3d-boltzmann.ini"
77
setup() {
88
SOLN_FILE=restart_output-coupled-3d.sol.h5
99
REF_FILE=ref_solns/coupled-3d.sol.h5
10+
MPIRUN=`./sniff_mpirun.sh`
1011
}
1112

1213
@test "[$TEST] verify tps runs in cylce-avg-joule-coupling mode (3D) with TPS2Boltzmann" {
1314
test -s $RUNFILE
14-
mpirun -np 4 ./tps_splitcomm_test --runFile $RUNFILE
15+
$MPIRUN -n 4 ./tps_splitcomm_test --runFile $RUNFILE
1516

1617
test -s $SOLN_FILE
1718
test -s $REF_FILE
1819

1920
./soln_differ -r $SOLN_FILE $REF_FILE
20-
}
21+
}

test/coupled-3d.py-loop.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ EXE="../src/tps-time-loop.py"
88
setup() {
99
SOLN_FILE=restart_output-coupled-3d.sol.h5
1010
REF_FILE=ref_solns/coupled-3d.sol.h5
11+
MPIRUN=`./sniff_mpirun.sh`
1112
}
1213

1314
@test "[$TEST] verify tps runs in cylce-avg-joule-coupling mode (3D)" {
1415
test -s $RUNFILE
15-
mpirun -np 2 $EXE --runFile $RUNFILE
16+
$MPIRUN -n 2 $EXE --runFile $RUNFILE
1617

1718
test -s $SOLN_FILE
1819
test -s $REF_FILE

test/coupled-3d.splitcomm.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ RUNFILE="inputs/coupled-3d.ini"
77
setup() {
88
SOLN_FILE=restart_output-coupled-3d.sol.h5
99
REF_FILE=ref_solns/coupled-3d.sol.h5
10+
MPIRUN=`./sniff_mpirun.sh`
1011
}
1112

1213
@test "[$TEST] verify tps runs in cylce-avg-joule-coupling mode (3D) with split comm" {
1314
test -s $RUNFILE
14-
mpirun -np 4 ./tps_splitcomm_test --runFile $RUNFILE
15+
$MPIRUN -n 4 ./tps_splitcomm_test --runFile $RUNFILE
1516

1617
test -s $SOLN_FILE
1718
test -s $REF_FILE
1819

1920
./soln_differ -r $SOLN_FILE $REF_FILE
20-
}
21+
}

test/coupled-3d.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ RUNFILE="inputs/coupled-3d.ini"
77
setup() {
88
SOLN_FILE=restart_output-coupled-3d.sol.h5
99
REF_FILE=ref_solns/coupled-3d.sol.h5
10+
MPIRUN=`./sniff_mpirun.sh`
1011
}
1112

1213
@test "[$TEST] verify tps runs in cylce-avg-joule-coupling mode (3D)" {
1314
test -s $RUNFILE
14-
mpirun -np 2 ../src/tps --runFile $RUNFILE
15+
$MPIRUN -n 2 ../src/tps --runFile $RUNFILE
1516

1617
test -s $SOLN_FILE
1718
test -s $REF_FILE

test/cyl3d.dtconst.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ setup() {
99
SOLN_FILE=restart_output.sol.h5
1010
REF_FILE=ref_solns/cyl3d.dtconst.cpu.h5
1111
REF_FILE_HEAT=ref_solns/cyl3d.dtconst.heatSource.cpu.h5
12+
MPIRUN=`./sniff_mpirun.sh`
1213
}
1314

1415
@test "[$TEST] check for input file $RUNFILE" {
@@ -37,7 +38,7 @@ setup() {
3738
REF_FILE_0=ref_solns/cyl.r0.p2.iter4.h5
3839
REF_FILE_1=ref_solns/cyl.r1.p2.iter4.h5
3940

40-
mpirun -np 2 ../src/tps --runFile $RUNFILE
41+
$MPIRUN -n 2 ../src/tps --runFile $RUNFILE
4142

4243
test -s $SOLN_FILE_0
4344
test -s $REF_FILE_0

test/cyl3d.interp.test

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ setup() {
1919
RUNFILE_INTERP0="inputs/input.refine0.cyl.ini"
2020
# RUNFILE_INTERP1="inputs/input.refine1.cyl"
2121

22-
# defaut to mpirun if available
23-
MPIRUN=$(type -P mpirun) || found=0
24-
25-
# if not, try flux
26-
if [ $found -eq 0 ]; then
27-
type -P flux && MPIRUN="$(type -P flux) run" || found=0
28-
fi
22+
MPIRUN=`./sniff_mpirun.sh`
2923
}
3024

3125
@test "[$TEST] check for pfield_interpolate executable and input files" {

test/cyl3d.python.splitcomm.test

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ EXE="./test_tps_splitcomm.py"
99
setup() {
1010
SOLN_FILE=restart_output.sol.h5
1111
REF_FILE=ref_solns/cyl3d_coarse.4iters.h5
12+
MPIRUN=`./sniff_mpirun.sh`
1213
}
1314

1415
@test "[$TEST] check for input file $RUNFILE" {
@@ -19,7 +20,7 @@ setup() {
1920
rm -f $SOLN_FILE
2021
touch DIE
2122
ls
22-
mpirun -n 2 $EXE --runFile $RUNFILE
23+
$MPIRUN -n 2 $EXE --runFile $RUNFILE
2324

2425
test -s $SOLN_FILE
2526
test ! -e DIE
@@ -54,7 +55,7 @@ setup() {
5455
rm -f $SOLN_FILE
5556

5657
# following should exit with error
57-
run mpirun -n 2 $EXE --runFile $RUNFILE
58+
run $MPIRUN -n 2 $EXE --runFile $RUNFILE
5859
[[ "${status}" -eq 1 ]]
5960
[[ "${output}" =~ "Unable to access desired restart file" ]]
6061
}
@@ -64,14 +65,14 @@ setup() {
6465

6566
rm -f $SOLN_FILE
6667
test -s $RUNFILE
67-
mpirun -n 2 $EXE --runFile $RUNFILE
68+
$MPIRUN -n 2 $EXE --runFile $RUNFILE
6869
test -s $SOLN_FILE
6970

7071
run h5dump -a iteration restart_output.sol.h5
7172
[ "${lines[5]}" = " (0): 2" ]
7273

7374
RUNFILE=inputs/input.4iters.restart.cyl.ini
74-
mpirun -n 2 $EXE --runFile $RUNFILE
75+
$MPIRUN -n 2 $EXE --runFile $RUNFILE
7576
./soln_differ $SOLN_FILE $REF_FILE
7677
}
7778

@@ -80,7 +81,7 @@ setup() {
8081

8182
rm -f $SOLN_FILE
8283
test -s $RUNFILE
83-
mpirun -n 2 $EXE --runFile $RUNFILE
84+
$MPIRUN -n 2 $EXE --runFile $RUNFILE
8485
test -s $SOLN_FILE
8586

8687
run h5dump -a iteration restart_output.sol.h5
@@ -92,7 +93,7 @@ setup() {
9293
VARPLOG=varp.log
9394
rm -f $VARPLOG
9495
RUNFILE=inputs/input.8iters.restart.newp.cyl.ini
95-
mpirun -n 2 $EXE --runFile $RUNFILE >& $VARPLOG
96+
$MPIRUN -n 2 $EXE --runFile $RUNFILE >& $VARPLOG
9697

9798
#intErr=$(cat $VARPLOG | grep "interpolation error" | awk '{print $6}')
9899
# Line grabs the printed interpolation error norm, which I'd like
@@ -127,7 +128,7 @@ setup() {
127128
echo "restartMode = singleFileWrite" >> $RUNFILE_PART
128129

129130
# run 2 tasks
130-
mpirun -np 4 $EXE --runFile $RUNFILE_PART
131+
$MPIRUN -n 4 $EXE --runFile $RUNFILE_PART
131132
test -s $SOLN_FILE_SERIAL
132133

133134
./soln_differ $SOLN_FILE $REF_FILE
@@ -154,7 +155,7 @@ setup() {
154155
echo "restartMode = singleFileWrite" >> $RUNFILE_PART
155156

156157
# run 4 tasks
157-
mpirun -np 8 $EXE --runFile $RUNFILE_PART
158+
$MPIRUN -n 8 $EXE --runFile $RUNFILE_PART
158159
test -s $SOLN_FILE_SERIAL
159160

160161
./soln_differ $SOLN_FILE $REF_FILE
@@ -183,7 +184,7 @@ setup() {
183184
echo "[io]" >> $RUNFILE_MOD
184185
echo "restartMode = singleFileWrite" >> $RUNFILE_MOD
185186

186-
mpirun -np 4 $EXE --runFile $RUNFILE_MOD
187+
$MPIRUN -n 4 $EXE --runFile $RUNFILE_MOD
187188
test -s ${SOLFILE_BASE}.h5
188189
test -s partition.2p.h5
189190

@@ -197,7 +198,7 @@ setup() {
197198
echo "restartMode = singleFileRead" >> $RUNFILE_MOD
198199
echo "enableRestart = true" >> $RUNFILE_MOD
199200

200-
mpirun -np 8 $EXE --runFile $RUNFILE_MOD
201+
$MPIRUN -n 8 $EXE --runFile $RUNFILE_MOD
201202
test -s partition.4p.h5
202203

203204
mkdir $TMPDIR
@@ -211,7 +212,7 @@ setup() {
211212

212213
# finally, run a normal 4 proc case for 4 iterations and compare against above solution
213214
rm -f restart_output.sol*.h5
214-
mpirun -np 8 $EXE --runFile $RUNFILE
215+
$MPIRUN -n 8 $EXE --runFile $RUNFILE
215216

216217
for i in `seq 0 3`; do
217218
test -s ${SOLFILE_BASE}.$i.h5
@@ -236,7 +237,7 @@ setup() {
236237

237238
# run 2 iterations using 2 tasks and save partitioned restart files
238239
test -s $RUNFILE
239-
mpirun -np 4 $EXE --runFile $RUNFILE
240+
$MPIRUN -n 4 $EXE --runFile $RUNFILE
240241
test -s ${SOLFILE_BASE}.0.h5
241242
test -s ${SOLFILE_BASE}.1.h5
242243
test -s partition.2p.h5
@@ -259,7 +260,7 @@ setup() {
259260
echo "restartMode = singleFileWrite" >> $RUNFILE_MOD
260261
echo "enableRestart = true" >> $RUNFILE_MOD
261262

262-
mpirun -np 4 $EXE --runFile $RUNFILE_MOD
263+
$MPIRUN -n 4 $EXE --runFile $RUNFILE_MOD
263264
test -s partition.2p.h5
264265
test -s ${SOLFILE_BASE}.h5
265266
run h5dump -a iteration ${SOLFILE_BASE}.h5
@@ -284,7 +285,7 @@ setup() {
284285
sed 's/maxIters = 4/maxIters = 2/' $RUNFILE > $RUNFILE_MOD
285286

286287
test -s $RUNFILE
287-
mpirun -np 4 $EXE --runFile $RUNFILE_MOD
288+
$MPIRUN -n 4 $EXE --runFile $RUNFILE_MOD
288289
test -s ${SOLFILE_BASE}.0.h5
289290
test -s ${SOLFILE_BASE}.1.h5
290291
test -s partition.2p.h5
@@ -296,7 +297,7 @@ setup() {
296297

297298
# now, restart and run 1 additional iteration
298299
sed 's/maxIters = 4/maxIters = 3/' $RUNFILE > $RUNFILE_MOD
299-
run mpirun -np 4 $EXE --runFile $RUNFILE_MOD
300+
run $MPIRUN -n 4 $EXE --runFile $RUNFILE_MOD
300301

301302
run h5dump -a iteration ${SOLFILE_BASE}.0.h5
302303
[ "${lines[5]}" = " (0): 3" ]
@@ -305,7 +306,7 @@ setup() {
305306
[ "${lines[5]}" = " (0): 3" ]
306307

307308
# now, repeat and run 1 additional iteration
308-
run mpirun -np 4 $EXE --runFile $RUNFILE
309+
run $MPIRUN -n 4 $EXE --runFile $RUNFILE
309310

310311
mkdir $TMPDIR
311312

@@ -318,7 +319,7 @@ setup() {
318319

319320
# finally, run a normal 2 proc case for 4 iterations and compare against above solution
320321
rm -f restart_output.sol*.h5
321-
mpirun -np 4 $EXE --runFile $RUNFILE
322+
$MPIRUN -n 4 $EXE --runFile $RUNFILE
322323

323324
for i in `seq 0 1`; do
324325
test -s ${SOLFILE_BASE}.$i.h5

test/cyl3d.python.test

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ EXE="../src/tps.py"
99
setup() {
1010
SOLN_FILE=restart_output.sol.h5
1111
REF_FILE=ref_solns/cyl3d_coarse.4iters.h5
12+
MPIRUN=`./sniff_mpirun.sh`
1213
}
1314

1415
@test "[$TEST] check for input file $RUNFILE" {
@@ -126,7 +127,7 @@ setup() {
126127
echo "restartMode = singleFileWrite" >> $RUNFILE_PART
127128

128129
# run 2 tasks
129-
mpirun -np 2 $EXE --runFile $RUNFILE_PART
130+
$MPIRUN -n 2 $EXE --runFile $RUNFILE_PART
130131
test -s $SOLN_FILE_SERIAL
131132

132133
./soln_differ $SOLN_FILE $REF_FILE
@@ -153,7 +154,7 @@ setup() {
153154
echo "restartMode = singleFileWrite" >> $RUNFILE_PART
154155

155156
# run 4 tasks
156-
mpirun -np 4 $EXE --runFile $RUNFILE_PART
157+
$MPIRUN -n 4 $EXE --runFile $RUNFILE_PART
157158
test -s $SOLN_FILE_SERIAL
158159

159160
./soln_differ $SOLN_FILE $REF_FILE
@@ -182,7 +183,7 @@ setup() {
182183
echo "[io]" >> $RUNFILE_MOD
183184
echo "restartMode = singleFileWrite" >> $RUNFILE_MOD
184185

185-
mpirun -np 2 $EXE --runFile $RUNFILE_MOD
186+
$MPIRUN -n 2 $EXE --runFile $RUNFILE_MOD
186187
test -s ${SOLFILE_BASE}.h5
187188
test -s partition.2p.h5
188189

@@ -196,7 +197,7 @@ setup() {
196197
echo "restartMode = singleFileRead" >> $RUNFILE_MOD
197198
echo "enableRestart = true" >> $RUNFILE_MOD
198199

199-
mpirun -np 4 $EXE --runFile $RUNFILE_MOD
200+
$MPIRUN -n 4 $EXE --runFile $RUNFILE_MOD
200201
test -s partition.4p.h5
201202

202203
mkdir $TMPDIR
@@ -210,7 +211,7 @@ setup() {
210211

211212
# finally, run a normal 4 proc case for 4 iterations and compare against above solution
212213
rm -f restart_output.sol*.h5
213-
mpirun -np 4 $EXE --runFile $RUNFILE
214+
$MPIRUN -n 4 $EXE --runFile $RUNFILE
214215

215216
for i in `seq 0 3`; do
216217
test -s ${SOLFILE_BASE}.$i.h5
@@ -235,7 +236,7 @@ setup() {
235236

236237
# run 2 iterations using 2 tasks and save partitioned restart files
237238
test -s $RUNFILE
238-
mpirun -np 2 $EXE --runFile $RUNFILE
239+
$MPIRUN -n 2 $EXE --runFile $RUNFILE
239240
test -s ${SOLFILE_BASE}.0.h5
240241
test -s ${SOLFILE_BASE}.1.h5
241242
test -s partition.2p.h5
@@ -258,7 +259,7 @@ setup() {
258259
echo "restartMode = singleFileWrite" >> $RUNFILE_MOD
259260
echo "enableRestart = true" >> $RUNFILE_MOD
260261

261-
mpirun -np 2 $EXE --runFile $RUNFILE_MOD
262+
$MPIRUN -n 2 $EXE --runFile $RUNFILE_MOD
262263
test -s partition.2p.h5
263264
test -s ${SOLFILE_BASE}.h5
264265
run h5dump -a iteration ${SOLFILE_BASE}.h5
@@ -283,7 +284,7 @@ setup() {
283284
sed 's/maxIters = 4/maxIters = 2/' $RUNFILE > $RUNFILE_MOD
284285

285286
test -s $RUNFILE
286-
mpirun -np 2 $EXE --runFile $RUNFILE_MOD
287+
$MPIRUN -n 2 $EXE --runFile $RUNFILE_MOD
287288
test -s ${SOLFILE_BASE}.0.h5
288289
test -s ${SOLFILE_BASE}.1.h5
289290
test -s partition.2p.h5
@@ -295,7 +296,7 @@ setup() {
295296

296297
# now, restart and run 1 additional iteration
297298
sed 's/maxIters = 4/maxIters = 3/' $RUNFILE > $RUNFILE_MOD
298-
run mpirun -np 2 $EXE --runFile $RUNFILE_MOD
299+
run $MPIRUN -n 2 $EXE --runFile $RUNFILE_MOD
299300

300301
run h5dump -a iteration ${SOLFILE_BASE}.0.h5
301302
[ "${lines[5]}" = " (0): 3" ]
@@ -304,7 +305,7 @@ setup() {
304305
[ "${lines[5]}" = " (0): 3" ]
305306

306307
# now, repeat and run 1 additional iteration
307-
run mpirun -np 2 $EXE --runFile $RUNFILE
308+
run $MPIRUN -n 2 $EXE --runFile $RUNFILE
308309

309310
mkdir $TMPDIR
310311

@@ -317,7 +318,7 @@ setup() {
317318

318319
# finally, run a normal 2 proc case for 4 iterations and compare against above solution
319320
rm -f restart_output.sol*.h5
320-
mpirun -np 2 $EXE --runFile $RUNFILE
321+
$MPIRUN -n 2 $EXE --runFile $RUNFILE
321322

322323
for i in `seq 0 1`; do
323324
test -s ${SOLFILE_BASE}.$i.h5

0 commit comments

Comments
 (0)