File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,13 @@ remove_fail_test() {
25
25
rm -f " ${PATHRT} /fail_test_${TEST_ID} "
26
26
}
27
27
28
+ redirect_out_err () {
29
+ ( " $@ " 2>&1 1>&3 3>& - | tee err ) 3>&1 1>&2 | tee out
30
+ # The above shell redirection copies stdout to "out" and stderr to "err"
31
+ # while still sending them to stdout and stderr. It does this without
32
+ # relying on bash-specific extensions or non-standard OS features.
33
+ }
34
+
28
35
if [[ $# != 5 ]]; then
29
36
echo " Usage: $0 PATHRT RUNDIR_ROOT TEST_NAME TEST_ID COMPILE_ID"
30
37
exit 1
@@ -380,9 +387,9 @@ if [[ ${SCHEDULER} = 'none' ]]; then
380
387
381
388
ulimit -s unlimited
382
389
if [[ ${CI_TEST} = ' true' ]]; then
383
- eval " ${OMP_ENV} " mpiexec -n " ${TASKS} " ./fv3.exe > out 2> >( tee err >&3 )
390
+ redirect_out_err $( eval " ${OMP_ENV} " mpiexec -n " ${TASKS} " ./fv3.exe )
384
391
else
385
- mpiexec -n " ${TASKS} " ./fv3.exe > out 2> >( tee err >&3 )
392
+ redirect_out_err mpiexec -n " ${TASKS} " ./fv3.exe
386
393
fi
387
394
388
395
else
@@ -399,10 +406,7 @@ else
399
406
fi
400
407
401
408
chmod u+x job_card
402
- ( ./job_card 2>&1 1>&3 3>& - | tee err ) 3>&1 1>&2 | tee out
403
- # The above shell redirection copies stdout to "out" and stderr to "err"
404
- # while still sending them to stdout and stderr. It does this without
405
- # relying on bash-specific extensions or non-standard OS features.
409
+ redirect_out_err ./job_card
406
410
fi
407
411
408
412
fi
You can’t perform that action at this time.
0 commit comments