From 4faca62679ef0850794934b31a091c1f079aca0c Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 31 Dec 2018 05:04:30 -0800 Subject: Eliminated the need for a separate script variable. --- configure.ac | 7 +------ testpar/testpflush.sh.in | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 89adcae..9b890fd 100644 --- a/configure.ac +++ b/configure.ac @@ -841,13 +841,9 @@ fi ## command). The value of this variable is ## substituted in *.in files. ## -## RUNPARALLELSCRIPT -- Identical to RUNPARALLEL but without -## the special makefile protection for environment -## variables. AC_SUBST([PARALLEL]) AC_SUBST([RUNSERIAL]) AC_SUBST([RUNPARALLEL]) -AC_SUBST([RUNPARALLELSCRIPT]) AC_SUBST([TESTPARALLEL]) ## ---------------------------------------------------------------------- @@ -2481,10 +2477,9 @@ case "X-$enable_parallel" in PAC_PROG_FC_MPI_CHECK fi - ## Set RUNPARALLEL and RUNPARALLELSCRIPT to mpiexec if not set yet. + ## Set RUNPARALLEL to mpiexec if not set yet. if test "X$PARALLEL" = "Xyes" -a -z "$RUNPARALLEL"; then RUNPARALLEL="mpiexec -n \$\${NPROCS:=6}" - RUNPARALLELSCRIPT="mpiexec -n ${NPROCS:=6}" fi ;; diff --git a/testpar/testpflush.sh.in b/testpar/testpflush.sh.in index f2ce029..02f0e26 100644 --- a/testpar/testpflush.sh.in +++ b/testpar/testpflush.sh.in @@ -32,6 +32,17 @@ if test -z "$srcdir"; then srcdir=. fi +# Turn the $$ we use to avoid Autotools munging into $ +# +# Allowing $$ to substitute in both the RUNPARALLEL string and the +# regexp is intentional. There doesn't seem to be a way around +# this using quote shenanigans. The downside is that there is a remote +# chance that the shell's pid will match a number in the RUNPARALLEL +# variable, but that seems less likely to cause problems than expecting +# library builders to specify two almost identical versions of the +# RUNPARALLEL command, one for use in scripts and one via Makefiles. +RUNPARALLELSCRIPT=`echo "@RUNPARALLEL@" | sed "s/$$/\$/g"` + # ========================================== # Run the first parallel flush test program # (note that we ignore any errors here) @@ -41,7 +52,7 @@ echo "You may see complaints from mpiexec et al. that not all processes" echo "called MPI_Finalize(). This is an intended characteristic of the" echo "test and should not be considered an error." echo "********************************************************************" -@RUNPARALLELSCRIPT@ ./t_pflush1 +eval ${RUNPARALLELSCRIPT} ./t_pflush1 # =========================================== @@ -49,5 +60,5 @@ echo "********************************************************************" # The return code of this call is the return # code of the script. # =========================================== -@RUNPARALLELSCRIPT@ ./t_pflush2 +eval ${RUNPARALLELSCRIPT} ./t_pflush2 -- cgit v0.12