14 |
echo " -skd LIST_EXP : skip experiments in LIST_EXP" |
echo " -skd LIST_EXP : skip experiments in LIST_EXP" |
15 |
echo " -exe COMMAND : use COMMAND to run the tests" |
echo " -exe COMMAND : use COMMAND to run the tests" |
16 |
echo " -mpi : run the tests using MPI" |
echo " -mpi : run the tests using MPI" |
17 |
|
echo " -mf STRING :(MPI) file with list of possible machines to run on" |
18 |
echo " -o STRING : used to build output directory name" |
echo " -o STRING : used to build output directory name" |
19 |
echo " (DEF=\"hostname\")" |
echo " (DEF=\"hostname\")" |
20 |
echo " -a,-A STRING : email address to send output to" |
echo " -a,-A STRING : email address to send output to" |
31 |
scrArg='All' |
scrArg='All' |
32 |
COMMAND= |
COMMAND= |
33 |
mpi=0 |
mpi=0 |
34 |
|
MPI_MFILE= |
35 |
OUTDIR=`hostname | sed 's/\..*$//'` |
OUTDIR=`hostname | sed 's/\..*$//'` |
36 |
SAVELOG=0 |
SAVELOG=0 |
37 |
ADDRESS= |
ADDRESS= |
51 |
-skd ) yy=SKIPDIRS ;; |
-skd ) yy=SKIPDIRS ;; |
52 |
-exe ) yy=COMMAND ;; |
-exe ) yy=COMMAND ;; |
53 |
-mpi ) mpi=1 ;; |
-mpi ) mpi=1 ;; |
54 |
|
-mf ) yy=MPI_MFILE ;; |
55 |
-a ) yy=ADDRESS ;; |
-a ) yy=ADDRESS ;; |
56 |
-A ) yy=ADDRESS ; SAVELOG=1 ;; |
-A ) yy=ADDRESS ; SAVELOG=1 ;; |
57 |
-o ) yy=OUTDIR ;; |
-o ) yy=OUTDIR ;; |
109 |
fi |
fi |
110 |
#------------------------ |
#------------------------ |
111 |
# Create a uniquely named directory to store results |
# Create a uniquely named directory to store results |
112 |
|
CMDLINE=$0 |
113 |
|
for xx in "$@" ; do nw=`echo $xx | wc -w` |
114 |
|
if test $nw = '1' ; then CMDLINE="$CMDLINE $xx" |
115 |
|
else CMDLINE="$CMDLINE '$xx'" ; fi |
116 |
|
done |
117 |
|
#for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done |
118 |
DATE=`date +%Y%m%d` |
DATE=`date +%Y%m%d` |
119 |
BASE="rs_"$OUTDIR"_"$DATE"_" |
BASE="rs_"$OUTDIR"_"$DATE"_" |
120 |
xx=0 |
xx=0 |
134 |
|
|
135 |
printf "Start time: " > $SUMMARY |
printf "Start time: " > $SUMMARY |
136 |
date >> $SUMMARY |
date >> $SUMMARY |
137 |
|
echo 'run:' $CMDLINE >> $SUMMARY |
138 |
if test -f tr_out.txt ; then |
if test -f tr_out.txt ; then |
139 |
echo ' using output from:' >> $SUMMARY |
echo ' using output from:' >> $SUMMARY |
140 |
sed -n '2,/OPTFILE/ p' tr_out.txt >> $SUMMARY |
sed -n '2,/OPTFILE/ p' tr_out.txt >> $SUMMARY |
146 |
echo ' 1 2 3' >> $SUMMARY |
echo ' 1 2 3' >> $SUMMARY |
147 |
|
|
148 |
#-- For MPI test: |
#-- For MPI test: |
149 |
|
LOC_MFILE='tr_mpi_mfile' |
150 |
RUNOUTP="output.txt" |
RUNOUTP="output.txt" |
151 |
if [ $mpi -ge 1 ] ; then |
if [ $mpi -ge 1 ] ; then |
152 |
SCRIPT="$SCRIPT -mpi" |
SCRIPT="$SCRIPT -mpi" |
156 |
for xx in $LIST |
for xx in $LIST |
157 |
do |
do |
158 |
echo ============================================================================== |
echo ============================================================================== |
159 |
if [ $mpi -ge 1 ] ; then |
if [ $mpi -le 0 ] ; then |
160 |
NP_MPI=2 |
rCommand=$COMMAND |
161 |
|
else |
162 |
|
LOC_NPROC=2 |
163 |
mpi_size=$xx/build/SIZE.h.mpi |
mpi_size=$xx/build/SIZE.h.mpi |
164 |
if test -f $mpi_size ; then |
if test -f $mpi_size ; then |
165 |
px=`grep '^ & *nPx *=' $mpi_size | sed 's/^ & *nPx *= *//' | sed 's/, *$//'` |
px=`grep '^ & *nPx *=' $mpi_size | sed 's/^ & *nPx *= *//' | sed 's/, *$//'` |
166 |
py=`grep '^ & *nPy *=' $mpi_size | sed 's/^ & *nPy *= *//' | sed 's/, *$//'` |
py=`grep '^ & *nPy *=' $mpi_size | sed 's/^ & *nPy *= *//' | sed 's/, *$//'` |
167 |
pp=`expr $px \* $py` > /dev/null 2>&1 ; out=$? |
pp=`expr $px \* $py` > /dev/null 2>&1 ; out=$? |
168 |
if test "x$out" = x0 ; then NP_MPI=$pp ; fi |
if test "x$out" = x0 ; then LOC_NPROC=$pp ; fi |
169 |
|
fi |
170 |
|
rCommand=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"` |
171 |
|
if test "x$MPI_MFILE" != x ; then |
172 |
|
#- create new MPI machine-file with the right number of Procs |
173 |
|
rm -f $LOC_MFILE |
174 |
|
cat $MPI_MFILE | sort | uniq | head -$LOC_NPROC > $LOC_MFILE |
175 |
|
nl=`wc -l $LOC_MFILE | awk '{print $1}'` |
176 |
|
if [ $nl -lt $LOC_NPROC ] ; then |
177 |
|
rm -f $LOC_MFILE |
178 |
|
cat $MPI_MFILE | head -$LOC_NPROC > $LOC_MFILE |
179 |
|
fi |
180 |
|
rCommand=`echo $rCommand | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"` |
181 |
fi |
fi |
|
rCommand=`echo $COMMAND | sed "s/ TR_NPROC / $NP_MPI /"` |
|
|
else |
|
|
rCommand=$COMMAND |
|
182 |
fi |
fi |
183 |
|
|
184 |
listD='run '`(cd $xx/results ; ls output.*.txt 2> /dev/null | sed 's/^output\./tr_run./g' | sed 's/\.txt$//g' )` |
listD='run '`(cd $xx/results ; ls output.*.txt 2> /dev/null | sed 's/^output\./tr_run./g' | sed 's/\.txt$//g' )` |
185 |
for yy in $listD |
for yy in $listD |
186 |
do |
do |
239 |
cd $here |
cd $here |
240 |
fi |
fi |
241 |
done |
done |
242 |
|
if test "x$mpi" != x0 -a "x$MPI_MFILE" != x ; then rm -f $LOC_MFILE ; fi |
243 |
done |
done |
244 |
printf "End time: " >> $SUMMARY |
printf "End time: " >> $SUMMARY |
245 |
date >> $SUMMARY |
date >> $SUMMARY |