DAMASK_EICMD/installation/mods_MarcMentat/2010.2/Marc_tools/run_marc.org

97 KiB
Raw Blame History

#!/bin/ksh ##############################################################################

##############################################################################

REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" DIR=`dirname $REALCOM`

case $DIR in \/*) ;; *) DIR=`pwd`/$DIR ;; esac DIRSCRIPT=$DIR AWK=awk ARCH=`uname -a | cut -f 1 -d " "`

if test $ARCH = "SunOS" then AWK=nawk fi BASENAME=basename

if test $ARCH = "SunOS" then if test -x /usr/ucb/basename then BASENAME=/usr/ucb/basename fi fi

if test "$ECHO_COMMAND" = true ; then echo command "$0" "$@" fi

#

mode= if test -f $DIRSCRIPT/run_marc_defaults; then line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` line=`echo $line | $AWK '{print $NF}'` if test "$line" = "i4"; then mode=i4 fi if test "$line" = "i8"; then mode=i8 fi fi if test -f $HOME/run_marc_defaults; then line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` line=`echo $line | $AWK '{print $NF}'` if test "$line" = "i4"; then mode=i4 fi if test "$line" = "i8"; then mode=i8 fi fi if test -n "$MARC_INTEGER_SIZE" ; then mode=$MARC_INTEGER_SIZE fi if test -z "$mode" ; then mode=i4 fi case $mode in i4) MARC_INTEGER_SIZE=i4 export MARC_INTEGER_SIZE ;; i8) MARC_INTEGER_SIZE=i8 export MARC_INTEGER_SIZE ;; *) echo "error, version mode must be i4 or i8" exit ;; esac

setmode=false for arg in $* ; do if $setmode ; then mode=$arg case $mode in i4) MARC_INTEGER_SIZE=i4 export MARC_INTEGER_SIZE ;; i8) MARC_INTEGER_SIZE=i8 export MARC_INTEGER_SIZE ;; *) echo " " echo "error, version mode must be i4 or i8" echo " " echo " use -mo i4 or -mo i8 " echo " " exit ;; esac setmode=false fi if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then setmode=true fi if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then MARC_INTEGER_SIZE=i8 export MARC_INTEGER_SIZE fi if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then MARC_INTEGER_SIZE=i4 export MARC_INTEGER_SIZE fi done

if test "`uname -s`" = "Linux"; then if test "`uname -m`" = "i686"; then mode=i4 MARC_INTEGER_SIZE=i4 export MARC_INTEGER_SIZE fi fi

. "$DIR/getarch"

. $MARC_INCLUDE #

#

#

case "`echo '\c'`" in '\c') ECHO='echo -n' ECHOTXT=' ' ;; *) ECHO='echo' ECHOTXT=' \c' ;; esac

#

PRODUCT="Marc" EXITMSG=$MARC_TOOLS/MESSAGES export EXITMSG FLEXDIR=$DIR/../flexlm/licenses export FLEXDIR TIMCHK=3600 export TIMCHK BINDIR=$MARC_BIN export BINDIR AFMATDAT=$MARC_RUNTIME/AF_flowmat/ export AFMATDAT #

# MATFILE= export MATFILE

#

memlimit=$MEMLIMIT #

# if test $MACHINENAME = "HP" then SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH export SHLIB_PATH fi

LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH export LD_LIBRARY_PATH export LD_LIBRARY64_PATH export LD_LIBRARYN32_PATH

atexit() { kill -15 $$ # if test $MPITYPE = "myrinet" then if test -f "$host_filt" then /bin/rm $host_filt fi fi }

trap "atexit" 2

#

#

prog=marc exefile=marc jid= rid= pid= sid= did= vid= user= usersubname= objs= qid=background cpu= priority= att= trk= verify=yes prgsav=no rmdll=no cpdll=no progdll= pathdll= error= nprocd=0 nprocdddm=1 nprocdddmprint= icreated=0 nprocdarg= nsolver=0 nsolverarg=-nsolver if test $nprocds then if test $nprocds -gt 1 then nprocdddm=$nprocds nprocdddmprint=$nprocds icreated=1 nprocdarg=-nprocds fi fi nthread=-1 nauto=0 ndcoup=0 ndytran=0 noutcore=0 dllrun=0 mesh=0 nthreadprint=0 itree=0 iam= link= trkrun=0 DIRJOB=`pwd` DIRSCR=$DIRJOB DIRSCRSET= autoforge=0 dotdat=.dat dotdefhost=.defhost host= numhost= mfile= userhost= makebdf= cpinput=yes cpresults=yes marcdll=libmarc.$EXT_DLL

thishost=`hostname` thishost=${thishost%%.*} compatible=unknown numfield=1 justlist= feature= mpioption=false MDSRCLIB=$MARC_LIB/mdsrc.a #

value= file= if test -f $DIRSCRIPT/run_marc_defaults; then value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` value=`echo $value | $AWK '{print $NF}'` if test -n "$value"; then file=$DIRSCRIPT/run_marc_defaults fi fi if test -f $HOME/run_marc_defaults; then value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` value=`echo $value | $AWK '{print $NF}'` if test -n "$value"; then file=$HOME/run_marc_defaults fi fi if test -n "$value"; then MARC_MPITYPE=$value notok=true for i in "$MPI_OTHER"; do if test "$MARC_MPITYPE" = "$i"; then notok=false fi done if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then notok=false fi if $notok; then echo " " echo " error, incorrect option for MARC_MPI" echo " defined in $file: $MARC_MPITYPE" echo " valid options: $MPI_DEFAULT $MPI_OTHER" echo " " exit fi if test "$value" != "$MPI_DEFAULT"; then exefile=marc_$value . $MARC_INCLUDE MDSRCLIB=$MARC_LIB/mdsrc.a_$value if test "$MUMPSSOLVER" = MUMPS; then MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value $MARC_LIB/libpord.a" fi fi fi

#

if test $MARCSCRATCH then if test -d $MARCSCRATCH then DIRSCR=$MARCSCRATCH else echo "error, scratch directory '$MARCSCRATCH'" echo " specified via environmental variable MARCSCRATCH does not exist" exit fi fi # ##############################################################################

##############################################################################

arg=$1 if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then shift arg=$1 fi while [ -n "$arg" ] do shift value=$1 case $arg in -al* | -AL*) $MARC_BIN/marc -alloc 1 exit ;; -li* | -LI*) justlist=yes ;; -fe* | -FE*) feature=$value ;; -pr* | -PR*) if test `dirname $value` = '.' then prog=`$BASENAME $value .marc` progdll=`$BASENAME $value` else prog=`dirname $value`/`$BASENAME $value .marc` progdll=`dirname $value`/`$BASENAME $value` fi prdir=`dirname $value` case $prdir in \/*) ;; *) prog=`pwd`/$prdir/$prog ;; esac ;; -j* | -J*) jid=`$BASENAME $value $dotdat` DIRJID=`dirname $value` case $DIRJID in \/*) ;; *) DIRJID=`pwd`/$DIRJID ;; esac ;; -r* | -R*) rid=`$BASENAME $value .t08` DIRRID=`dirname $value` case $DIRRID in \/*) ;; *) DIRRID=`pwd`/$DIRRID ;; esac ;; -si* | -SI*) sid=$value DIRSID=`dirname $value` case $DIRSID in \/*) ;; *) DIRSID=`pwd`/$DIRSID ;; esac ;; -pi* | -PI*) if test -f $value.t19 then pid=`$BASENAME $value .t19` else pid=`$BASENAME $value .t16` fi DIRPID=`dirname $value` case $DIRPID in \/*) ;; *) DIRPID=`pwd`/$DIRPID ;; esac ;; -bdf | -BDF) makebdf=1 ;; -de* | -DE*) did=`$BASENAME $value $dotdat` DIRDID=`dirname $value` case $DIRDID in \/*) ;; *) DIRDID=`pwd`/$DIRDID ;; esac ;; -vf | -VF) vid=`$BASENAME $value .vfs` DIRVID=`dirname $value` case $DIRVID in \/*) ;; *) DIRVID=`pwd`/$DIRVID ;; esac ;; -u* | -U*) user=`dirname $value`/`$BASENAME $value .f` basefile=`$BASENAME $value` if test ${basefile##*.} = F then user=`dirname $value`/`$BASENAME $value .F` fi case $user in \/*) ;; *) user=`pwd`/$user ;; esac if test -f $user.f then usersubname=$user.f elif test -f $user.F then usersubname=$user.F else usersubname=$user fi ;; -obj | -OBJ) objs="$value" ;; -q* | -Q*) qid=$value ;; -b* | -B*) case $value in y* | Y*) qid=background ;; n* | N*) qid=foreground ;; *) ;; esac ;; -at | -AT) att=$value ;; -cpu* | -CPU*) cpu=$value ;; -pq | -PQ*) priority=$value ;; -v* | -V*) verify=$value ;; -sa* | -SA*) prgsav=$value ;; -np* | -NP*) nprocdddm=$value nprocdddmprint=$value case $arg in -nps* | -NPS* | -nprocds* | -NPROCDS*) icreated=1 nprocdarg=-nprocds ;; esac case $arg in -np | -NP | -nprocd | -NPROCD) icreated=0 nprocdarg=-nprocd ;; esac ;; -ns* | -NS*) nsolver=$value ;; -nt* | -NT*) nthread=$value ;; -it* | -IT*) itree=$value ;; -iam | -IAM) iam=$value ;; -au* | -AU*) nauto=$value ;; -dc* | -DC*) ndcoup=$value ;; -dy* | -DY*) ndytran=$value ;; -ou* | -OU*) noutcore=$value ;; -dll | -DLL) dllrun=$value ;; -trk | -TRK) trkrun=$value ;; -me | -ME ) mesh=$value ;; -ml | -ML ) memlimit=$value ;; -mo | -MO ) ;; -mpi | -MPI ) mpioption=true MARC_MPITYPE=$value if test "$value" != "$MPI_DEFAULT"; then exefile=marc_$value . $MARC_INCLUDE MDSRCLIB=$MARC_LIB/mdsrc.a_$value if test "$MUMPSSOLVER" = MUMPS; then MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value $MARC_LIB/libpord.a" fi else exefile=marc . $MARC_INCLUDE MDSRCLIB=$MARC_LIB/mdsrc.a if test "$MUMPSSOLVER" = MUMPS; then MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a $MARC_LIB/libpord.a" fi fi ;; -dir* | -DIR*) DIRJOB=$value case $DIRJOB in \/*) ;; *) DIRJOB=`pwd`/$DIRJOB ;; esac if test -z "$DIRSCRSET" then DIRSCR=$DIRJOB fi ;; -sd* | -SD*) DIRSCR=$value DIRSCRSET=yes case $DIRSCR in \/*) ;; *) DIRSCR=`pwd`/$DIRSCR ;; esac ;; -ho* | -HO*) host=$value ;; -co* | -CO*) compatible=$value ;; -ci* | -CI*) cpinput=$value ;; -cr* | -CR*) cpresults=$value ;; *) error="$error $arg: invalid option" break ;; esac case $value in -*) error="$error $arg: invalid name $value" break ;; esac shift arg=$1 if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then shift arg=$1 fi done argc=`expr $# % 2` if test $argc -eq 1 then #

# error="$error argument list incomplete" fi

if test $nprocdddm -gt 0 then nprocd=$nprocdddm fi

if test $nsolver -gt 0 then if test $nsolver -gt $nprocd then nprocd=$nsolver fi fi

if test $nthread -eq -1 then nthread=${MARC_NUMBER_OF_THREADS:-0} fi if test $nthread -lt 0 then nthread=0 fi

nthreadprint=$nthread if test $nthreadprint -eq 0 then nthreadprint=1 if test $nprocd -gt 1 then nthreadprint=$nprocd fi if test $nsolver -gt 1 then nthreadprint=$nsolver fi fi

nthread=$nthreadprint

if test $nprocd -gt 1; then if test -f $jid$dotdefhost; then if test "$host" = ""; then host=$jid$dotdefhost fi fi if test -f hostfile_qa_$nprocd; then if test "$host" = ""; then host=hostfile_qa_$nprocd fi fi fi

if test "$dllrun" -gt 0; then exefile=exe_marc prog=exe_marc program=$exefile bd=$MARC_BIN/ if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then dotdat=.inp fi

if test "$progdll"; then /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll rmdll=yes pathdll=yes progdll=${progdll}_$marcdll else progdll=$marcdll fi

if test "$user"; then . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user user= if test $prgsav = no; then rmdll=yes fi if test $prgsav = yes; then cpdll=yes rmdll=yes fi pathdll=yes fi fi

##############################################################################

##############################################################################

while test forever; do

#

# if test $nprocdddm -gt 1 -a $icreated -eq 0; then if test ! -f $DIRJID/1$jid$dotdat; then if test "$jid" != "" ; then error="$error input file $DIRJID/1$jid$dotdat not accessible" fi fi else if test ! -f $DIRJID/$jid$dotdat; then if test "$jid" != "" ; then error="$error input file $DIRJID/$jid$dotdat not accessible" fi fi fi if test $nprocd -gt 1; then if test "$host" ; then if test ! -f $host; then error="$error host name file $host not accessible" fi fi fi

#

# if test -f $DIRJOB/$jid.pid; then error="$error job is already running (the file $jid.pid exists)" fi

#

#

bd=$MARC_BIN/

case $prog in marc | MARC | $exefile) program=$exefile if test "$rid" then if test ! -f $DIRRID/$rid.t08 then error="$error restart file $DIRRID/$rid.t08 not accessible" fi fi if test "$pid" then if test ! -f $DIRPID/$pid.t16 then if test ! -f $DIRPID/$pid.t19 then error="$error post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" fi fi fi if test "$usersubname" then if test ! -f $usersubname then error="$error user subroutine file $usersubname not accessible" fi fi if test "$objs" then missingobjs= for o in $objs do if test ! -f "$o" then if test -z "$missingobjs" then missingobjs="$o" else missingobjs="$missingobjs $o" fi fi done if test -n "$missingobjs" then error="$error user object/library file(s) $missingobjs not accessible" fi fi if test "$did" then if test $nprocdddm -gt 1 -a $icreated -eq 0 then if test ! -f $DIRDID/1$did$dotdat then error="$error defaults file $DIRDID/1$did$dotdat not accessible" fi else if test ! -f $DIRDID/$did$dotdat then error="$error defaults file $DIRDID/$did$dotdat not accessible" fi fi fi if test "$vid" then if test $nprocdddm -gt 1 -a $icreated -eq 0 then if test ! -f $DIRVID/1$vid.vfs then error="$error view factor file $DIRVID/1$vid.vfs not accessible" fi else if test ! -f $DIRVID/$vid.vfs then error="$error view factor file $DIRVID/$vid.vfs not accessible" fi fi fi if $mpioption then notok=true for i in "$MPI_OTHER"; do if test "$MARC_MPITYPE" = "$i"; then notok=false fi done if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then notok=false fi if $notok; then error="$error incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" fi fi ;; *) program=$prog.marc case $prog in \/* | \.\/*) bd= ;; *) bd=`pwd`/ ;; esac if test "$rid" then if test ! -f $DIRRID/$rid.t08 then error="$error restart file $DIRRID/$rid.t08 not accessible" fi fi if test "$pid" then if test ! -f $DIRPID/$pid.t16 then if test ! -f $DIRPID/$pid.t19 then error="$error post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" fi fi fi if test "$user" then error="$error program option may not be used with user subroutine" fi if test "$objs" then error="$error program option may not be used with user objects or libraries" fi if test "$did" then if test $nprocdddm -gt 1 -a $icreated -eq 0 then if test ! -f $DIRDID/1$did$dotdat then error="$error defaults file $DIRDID/1$did$dotdat not accessible" fi else if test ! -f $DIRDID/$did$dotdat then error="$error defaults file $DIRDID/$did$dotdat not accessible" fi fi fi if test "$nauto" then if test $nauto -gt 2 then error="$error incorrect option for auto restart " fi fi if test "$ndcoup" then if test $ndcoup -gt 3 then error="$error incorrect option for contact decoupling " fi fi if test "$ndytran" then if test $ndytran -gt 1 then error="$error incorrect option for Marc-Dytran Switch " fi fi if $mpioption then if test ! -x $MARC_BIN/$exefile then error="$error incorrect option for -mpi option: $MARC_MPITYPE " fi fi ;; esac

##############################################################################

##############################################################################

if test "$jid" then


else error="$error job id required" fi

if test $nprocd -gt 1 then if test $nauto -gt 0 then error="$error cannot run DDM job with auto restart (-au) option " fi fi case $qid in S* | s*) qid=short ;; L* | l*) qid=long ;; V* | v*) qid=verylong ;; B* | b*) qid=background ;; F* | f*) qid=foreground ;; A* | a*) qid=at ;; *) error="$error bad value for queue_id option" ;; esac

case $prgsav in N* | n*) prgsav=no ;; Y* | y*) prgsav=yes ;; *) error="$error bad value for save option" ;; esac

case $verify in N* | n*) verify=no ;; Y* | y*) verify=yes ;; *) error="$error bad value for verify option" ;; esac

case $nprocdddm in -* ) error="$error bad value for nprocd option" ;; esac

case $nthread in -* ) error="$error bad value for nthread option" ;; esac

case $itree in -* ) error="$error bad value for itree option" ;; esac case $iam in -* ) error="$error bad value for iam option" ;; esac case $compatible in N* | n*) compatible=no ;; Y* | y*) compatible=yes ;; unknown) ;; *) error="$error bad value for comp option" ;; esac case $cpinput in N* | n*) cpinput=no ;; Y* | y*) cpinput=yes ;; *) error="$error bad value for copy input option" ;; esac case $cpresults in N* | n*) cpresults=no ;; Y* | y*) cpresults=yes ;; *) error="$error bad value for copy results option" ;; esac

#

# if test -f $MARC_TOOLS/run_marc_check then . $MARC_TOOLS/run_marc_check fi

#

# if test -f $MARC_BIN/VERSION; then ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` if test -n "$ppp" ;then PRODUCT=$ppp fi ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` if test -n "$ppp" ;then REVISION=", Build $ppp" fi fi ##############################################################################

##############################################################################

deletelog=yes if test $qid = background -a $verify = no then echo \ " $PRODUCT $REVISION $MACHINE version


Program name : $prog Marc shared lib : $progdll Version type : $mode Job ID : $DIRJID/$jid User subroutine name : $usersubname User objects/libs : $objs Restart file job ID : $rid Substructure file ID : $sid Post file job ID : $pid Defaults file ID : $did View Factor file ID : $vid Save generated module: $prgsav MPI library : $MPITYPE DDM processes : $nprocdddmprint Solver processes : $nthreadprint Host file name : $host Message passing type : $itree Run job in queue : $qid Run directory : $DIRJOB Scratch directory : $DIRSCR Memory limit in Mbyte: $memlimit Auto Restart : $nauto " > $jid.log deletelog=no fi echo \ " $PRODUCT $REVISION $MACHINE version


Program name : $prog Marc shared lib : $progdll Version type : $mode Job ID : $DIRJID/$jid User subroutine name : $usersubname User objects/libs : $objs Restart file job ID : $rid Substructure file ID : $sid Post file job ID : $pid Defaults file ID : $did View Factor file ID : $vid Save generated module: $prgsav MPI library : $MPITYPE DDM processes : $nprocdddmprint Solver processes : $nthreadprint Host file name : $host Message passing type : $itree Run job in queue : $qid Run directory : $DIRJOB Scratch directory : $DIRSCR Memory limit in Mbyte: $memlimit Auto Restart : $nauto"

case $qid in s* | S* | l* | L* | v* | V* ) echo \ "Queue priority : $priority Queue CPU limit : $cpu Queue start time : $att" ;;

#" "

esac

if test "$error" then if test $verify = yes then $ECHO "$error

Please correct or quit(correct,quit,<correct>): $ECHOTXT" error= read answer case $answer in q* | Q*) answer=quit ;; *) answer=correct ;; esac else $ECHO "$error $ECHOTXT" echo " " if test "$deletelog" = no then $ECHO "$error $ECHOTXT" >> $jid.log echo " " >> $jid.log fi answer=quit fi else if test $verify = yes then $ECHO " Are these parameters correct (yes,no,quit,<no>)? $ECHOTXT" read answer case $answer in q* | Q*) answer=quit ;; y* | Y*) answer=yes ;; *) answer=no ;; esac else answer=yes fi fi

case $answer in no | correct)

##############################################################################

##############################################################################

$ECHO " Program name ($prog)? $ECHOTXT" read value if test "$value" then prog=$value fi $ECHO "Job ID ($jid)? $ECHOTXT" read value if test "$value" then jid=`$BASENAME $value $dotdat` DIRJID=`dirname $value` case $DIRJID in \/*) ;; *) DIRJID=`pwd`/$DIRJID ;; esac fi $ECHO "User subroutine name ($user)? $ECHOTXT" read value if test "$value" then case $value in -*) user= ;; *) user=`dirname $value`/`$BASENAME $value .f` basefile=`$BASENAME $value` if test ${basefile##*.} = F then user=`dirname $value`/`$BASENAME $value .F` fi case $user in \/*) ;; *) user=`pwd`/$user ;; esac if test -f $user.f then usersubname=$user.f elif test -f $user.F then usersubname=$user.F else usersubname=$user fi ;; esac fi $ECHO "User objects or libraries ($objs)? $ECHOTXT" read value if test "$value" then case $value in -*) objs= ;; *) objs="$value" ;; esac fi $ECHO "Restart File Job ID ($rid)? $ECHOTXT" read value if test "$value" then case $value in -*) rid= ;; *) rid=`$BASENAME $value .t08` DIRRID=`dirname $value` case $DIRRID in \/*) ;; *) DIRRID=`pwd`/$DIRRID ;; esac ;; esac fi $ECHO "Substructure File ID ($sid)? $ECHOTXT" read value if test "$value" then case $value in -*) sid= ;; *) sid=$value DIRSID=`dirname $value` case $DIRSID in \/*) ;; *) DIRSID=`pwd`/$DIRSID ;; esac ;; esac fi $ECHO "Post File Job ID ($pid)? $ECHOTXT" read value if test "$value" then case $value in -*) pid= ;; *) pid=$value DIRPID=`dirname $value` case $DIRPID in \/*) ;; *) DIRPID=`pwd`/$DIRPID ;; esac ;; esac fi $ECHO "Defaults File ID ($did)? $ECHOTXT" read value if test "$value" then case $value in -*) did= ;; *) did=`$BASENAME $value $dotdat` DIRDID=`dirname $value` case $DIRDID in \/*) ;; *) DIRDID=`pwd`/$DIRDID ;; esac ;; esac fi $ECHO "View Factor File ID ($vid)? $ECHOTXT" read value if test "$value" then case $value in -*) vid= ;; *) vid=`$BASENAME $value .vfs` DIRVID=`dirname $value` case $DIRVID in \/*) ;; *) DIRVID=`pwd`/$DIRVID ;; esac ;; esac fi $ECHO "Save generated module ($prgsav)? $ECHOTXT" read value if test "$value" then prgsav=$value fi $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" read value if test "$value" then nprocdddm=$value nprocdddmprint=$value fi $ECHO "Run on ($nthread) threads ? $ECHOTXT" read value if test "$value" then nthread=$value fi $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" read value if test "$value" then nsolver=$value fi # if test $nprocdddm -gt 0 then nprocd=$nprocdddm fi if test $nsolver -gt 0 then if test $nsolver -gt $nprocd then nprocd=$nsolver fi fi if test $nthread -eq -1 then nthread=${MARC_NUMBER_OF_THREADS:-0} fi if test $nthread -lt 0 then nthread=0 fi nthreadprint=$nthread if test $nthreadprint -eq 0 then nthreadprint=1 if test $nprocd -gt 1 then nthreadprint=$nprocd fi if test $nsolver -gt 1 then nthreadprint=$nsolver fi fi # if test $nprocd -gt 1 then $ECHO "Message passing type ($itree)? $ECHOTXT" read value if test "$value" then itree=$value fi $ECHO "Host file name ($host)? $ECHOTXT" read value if test "$value" then host=$value fi if test $nprocdddm -gt 1 then $ECHO "Single input file? $ECHOTXT" read value case $value in y* | Y*) icreated=1 nprocdarg=-nprocds ;; esac $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" read value if test "$value" then compatible=$value fi $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" read value if test "$value" then cpinput=$value fi $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" read value if test "$value" then cpresults=$value fi fi fi $ECHO "Run the job in the queue ($qid)? $ECHOTXT" read value if test "$value" then qid=$value fi case $qid in s* | S* | l* | L* | v* | V* ) $ECHO "Queue priority ($priority)? $ECHOTXT" read value if test "$value" then priority=$value fi $ECHO "Job starts at ($att)? $ECHOTXT" read value if test "$value" then att=$value fi $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" read value if test "$value" then cpu=$value fi ;;

  • )

;; esac $ECHO "Auto Restart option ($nauto)? $ECHOTXT" read value if test "$value" then nauto=$value fi $ECHO "Run directory ($DIRJOB)? $ECHOTXT" read value if test "$value" then DIRJOB=$value DIRSCR=$DIRJOB fi $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" read value if test "$value" then DIRSCR=$value fi ;; quit) exit 1 ;; *) break ;;

esac

if test $nthread -eq -1 then nthread=${MARC_NUMBER_OF_THREADS:-0} fi if test $nthread -lt 0 then nthread=0 fi

done

if test "$dllrun" -gt 0; then exefile=exe_marc prog=exe_marc program=$exefile bd=$MARC_BIN/ if test "$user"; then . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user user= pathdll=yes if test $prgsav = no; then rmdll=yes fi if test $prgsav = yes; then cpdll=yes rmdll=yes fi fi

if test "$pathdll"; then #

# if test $MACHINENAME = "HP" then SHLIB_PATH=$DIRJOB:$SHLIB_PATH export SHLIB_PATH fi if test $MACHINENAME = "IBM" then LIBPATH=$DIRJOB:$LIBPATH export LIBPATH fi # LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH export LD_LIBRARY_PATH export LD_LIBRARY64_PATH export LD_LIBRARYN32_PATH fi fi

if test $program = $exefile -o $program = $prog.marc then

if test "$deletelog" = yes then /bin/rm $jid.log 2>/dev/null else echo echo running the job in the background, see $jid.log echo fi

#

# if test $nprocd -eq 1 then line=`$AWK '^[eE][nN][dD] {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` if test "$line" then autoforge=1 fi line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` if test "$line" then autoforge=1 fi line=`$AWK '^[eE][nN][dD] {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` if test "$line" then autoforge=1 fi fi #

# if test "$rid" then if test "$jid" = "$rid" then echo " " echo "ERROR: job name of current run is the same as job name" echo " of the restarted job" echo " " if test "$deletelog" = no then echo " " >> $jid.log echo "ERROR: job name of current run is the same as job name" >> $jid.log echo " of the restarted job" >> $jid.log echo " " >> $jid.log fi exit 1 fi fi

#

#

if test "$objs" then program="$DIRJOB/$jid.marc" case $program in \/* | \.\/*) bd= ;; *) bd=`pwd`/ ;; esac link=yes fi

#

#

if test "$user" then

program=$DIRJOB/`$BASENAME $user .f`.marc case $program in \/* | \.\/*) bd= ;; *) bd=`pwd`/ ;; esac link=yes fi

#

# if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP then MP_HOSTFILE=${jid}.host if test -f $jid.host then /bin/rm $jid.host 2> /dev/null fi if test $nprocd -gt 1 then numdom=$nprocd while test $numdom -gt 0 do hostname -s >> $MP_HOSTFILE numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` done else hostname -s > $MP_HOSTFILE fi fi #

# if test $nprocd -gt 1 then

execpath=$MARC_BIN/$exefile usersub=0 if test $program = $prog.marc then execpath=$prog.marc usersub=1 fi if test "$objs" then execpath="$DIRJOB/$jid.marc" usersub=1 fi if test "$user" then execpath=$DIRJOB/`$BASENAME $user .f`.marc usersub=1 fi export execpath execname=`$BASENAME $execpath`

if test "$host" then userhost=$host case $userhost in \/* | \.\/*) ;; *) userhost=`pwd`/$userhost ;; esac

numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` if test $nprocd -ne $numproc then echo " " echo "error, the number of processes specified in the host file" echo "must be equal to the number of processes given by -nprocd/-nsolver" echo " " if test "$deletelog" = no then echo " " >> $jid.log echo "error, the number of processes specified in the host file" >> $jid.log echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log echo " " >> $jid.log fi exit 1 fi

if test $MPITYPE = "myrinet" then numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` if test $numproc -gt 5 then echo " " echo "error, for Myrinet the number of processes specified " echo "in the hostfile must not exceed 5 for a hostname" echo " " if test "$deletelog" = no then echo " " >> $jid.log echo "error, for Myrinet the number of processes specified " >> $jid.log echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log echo " " >> $jid.log fi exit 1 fi if test $MPIVERSION = "MPICH-GM1.2.1..7" then if test ! -d ~/.gmpi then echo " " echo "error, for Myrinet a .gmpi directory must exist " echo "under the user's home directory" echo " " if test "$deletelog" = no then echo " " >> $jid.log echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log echo "under the user's home directory" >> $jid.log echo " " >> $jid.log fi exit 1 fi fi if test $MPIVERSION = "MPICH-GM1.2.1..7" then homedir=`echo ~` for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` do ibase=${i%%.*} if test $ibase != $thishost then $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ if test -s tmp.$$ then echo " " echo "error, for Myrinet a shared .gmpi directory must exist " echo "under the user's home directory " echo "with remote write permission" echo " " if test "$deletelog" = no then echo " " >> $jid.log echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log echo "under the user's home directory " >> $jid.log echo "with remote write permission" >> $jid.log echo " " >> $jid.log fi exit 1 else /bin/rm tmp.$$ if test -f $jid.$$ then /bin/rm $jid.$$ fi fi fi done fi fi

if test -f $jid.host then /bin/rm $jid.host 2> /dev/null fi if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware then

grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -v mpihpspecial="$MPIHPSPECIAL" \ '{if ( NF > 0) {\ fnr++ ; \ printf("-h %s -np %s",$1,$2); \ printf(" %s",mpihpspecial); \ if ( NF = 2 ) printf(" %s\n",path);\ if ( NF > 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ }\ }' > $jid.host

elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP then

MP_HOSTFILE=$jid.host grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host

elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" then

if test -f $jid.mfile then /bin/rm $jid.mfile 2> /dev/null fi /bin/cp $host $jid.host grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile

elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" then

if test -f $jid.mfile then /bin/rm $jid.mfile 2> /dev/null fi grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile

elif test $MPITYPE = "myrinet" then if test $MPIVERSION = "MPICH-GM1.2.1..7" then echo $nprocd > ~/.gmpi/$jid.host grep -v '^#' $host | $AWK \ 'BEGIN {iport[0] = 2; \ iport[1] = 4; \ iport[2] = 5; \ iport[3] = 6; \ iport[4] = 7 \ } \ {if ( NF > 0 ) \ for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ }' >> ~/.gmpi/$jid.host else

grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ '{if ( NF > 0) {\ fnr++ ; \ if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ else printf("%s %s",$1,$2); \ if ( NF == 2 ) printf(" %s %s\n",path,user);\ if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ }\ }' > $jid.host fi

elif test $MACHINENAME = DEC -a $MPITYPE = hardware then

grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host

else

grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ '{if ( NF > 0) {\ fnr++ ; \ if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ else printf("%s %s",$1,$2); \ if ( NF == 2 ) printf(" %s\n",path);\ if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ }\ }' > $jid.host fi

if test $MPITYPE = "myrinet" then if test $MPIVERSION = "MPICH-GM1.2.1..7" then host=~/.gmpi/$jid.host host_filt=$jid.host_tMp grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt else host=$jid.host host_filt=$host fi else host=$jid.host host_filt=$host if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" then host_filt=$jid.mfile fi fi

numfield=1 if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware then numfield=2 fi DIR1=$DIRJOB if test $program = $prog.marc -o -n "$user" -o -n "$objs" then counter=0 echo " " echo "checking if local or shared directories for host" if test "$deletelog" = no then echo "checking if local or shared directories for host" >> $jid.log fi for i in `$AWK -v n=$numfield '{print $n}' $host_filt` do ibase=${i%%.*} if test $ibase != $thishost then counter=$((counter+1)) dirstatus[$counter]="shared" $ECHO " $i $ECHOTXT" if test "$deletelog" = no then $ECHO " $i $ECHOTXT" >> $jid.log fi DIR1=$DIRJOB line=`grep -v '^#' $userhost | grep "^$ibase "` workdir=`echo $line | $AWK '{print $3}'` if test -n "$workdir" then DIR1=$workdir fi if test -f $jid.$$ then /bin/rm $jid.$$ fi $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ if test -s tmp.$$ then dirstatus[$counter]="local" /bin/rm tmp.$$ else if test ! -f $jid.$$ then dirstatus[$counter]="local" $RSH $i /bin/rm $DIR1/$jid.$$ else /bin/rm $jid.$$ fi fi if test -f tmp.$$ then /bin/rm tmp.$$ fi if test -f $jid.$$ then /bin/rm $jid.$$ fi echo " ${dirstatus[$counter]}" if test "$deletelog" = no then echo " ${dirstatus[$counter]}" >> $jid.log fi fi done echo " " if test "$deletelog" = no then echo " " >> $jid.log fi fi

if test $program = $prog.marc -o -n "$user" -o -n "$objs" then if test $compatible = "unknown" then thisname=$ARCH compatible=yes counter=0 echo "checking if machines are compatible for host" if test "$deletelog" = no then echo "checking if machines are compatible for host" >> $jid.log fi for i in `$AWK -v n=$numfield '{print $n}' $host_filt` do ibase=${i%%.*} if test $ibase != $thishost then counter=$((counter+1)) compstatus[$counter]="yes" $ECHO " $i $ECHOTXT" if test "$deletelog" = no then $ECHO " $i $ECHOTXT" >> $jid.log fi othername=`$RSH $i uname -a | cut -f 1 -d " "` if test $thisname != $othername then compatible=no compstatus[$counter]="no" fi fi echo " ${compstatus[$counter]}" if test "$deletelog" = no then echo " ${compstatus[$counter]}" >> $jid.log fi done echo " " if test "$deletelog" = no then echo " " >> $jid.log fi else counter=0 for i in `$AWK -v n=$numfield '{print $n}' $host_filt` do ibase=${i%%.*} if test $ibase != $thishost then counter=$((counter+1)) compstatus[$counter]=$compatible fi done if test $compatible = "no" then echo "all machines assumed incompatible" if test "$deletelog" = no then echo "all machines assumed incompatible" >> $jid.log fi else echo "all machines compatible" if test "$deletelog" = no then echo "all machines compatible" >> $jid.log fi fi fi

if test "$compatible" = "no" -a -n "$objs" then echo "User object/libraries cannot be used in a parallel job on incompatible machines" if test "$deletelog" = no then echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log fi exit 1 fi

doit= if test $program = $prog.marc then doit=yes fi if test "$user" then doit=yes fi if test "$doit" then counter=0 for i in `$AWK -v n=$numfield '{print $n}' $host_filt` do ibase=${i%%.*} if test $ibase != $thishost then counter=$((counter+1)) if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" then $AWK -v hst=$i '{fnr++ ; \ if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} /bin/mv $jid.host{$$} $jid.host host=$jid.host fi fi done fi fi # if test $program = $prog.marc -o $user -o $obj

else # if test $host

if test $MPITYPE = "mpich" -o $MPITYPE = "scali" then numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` echo `hostname` $numproc $execpath > $jid.host host=$jid.host elif test $MPITYPE = "myrinet" then if test $nprocd -gt 5 then echo " " echo "error, for Myrinet the number of processes " echo "must not exceed 5 for a hostname" echo " " if test "$deletelog" = no then echo " " >> $jid.log echo "error, for Myrinet the number of processes " >> $jid.log echo "must not exceed 5 for a hostname" >> $jid.log echo " " >> $jid.log fi exit 1 fi if test $MPIVERSION = "MPICH-GM1.2.1..7" then echo $nprocd > ~/.gmpi/$jid.host echo `hostname` $nprocd | $AWK \ 'BEGIN {iport[0] = 2; \ iport[1] = 4; \ iport[2] = 5; \ iport[3] = 6; \ iport[4] = 7 \ } \ {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ ' >> ~/.gmpi/$jid.host host=~/.gmpi/$jid.host else numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` echo `hostname` $numproc $execpath > $jid.host

fi fi # if test myrinet

fi # if test $host

fi # if test $nprocd -gt 1

fi # if test $program = $exefile -o $program = $prog.marc

##############################################################################

##############################################################################

if test $itree -eq 0 -a $MPITYPE = hardware then itree=100000000 if test $MACHINENAME = SGI then itree=100000001 fi fi if test $itree -eq 0 -a $MPITYPE = hpmpi then itree=100000000 fi if test $itree -eq 0 -a $MPITYPE = myrinet then itree=100000000 fi if test $itree -eq 0 -a $MPITYPE = nec then itree=100000000 fi if test $itree -eq 0 -a $MPITYPE = scali then itree=100000000 fi if test $itree -eq 0 -a $MPITYPE = intelmpi then itree=100000000 fi if test $nprocdddm -lt 2 then nprocdarg= else nprocdarg="$nprocdarg $nprocdddm" fi if test $nsolver -eq 0 then nsolverarg= else nsolverarg="$nsolverarg $nsolver" fi if test $nprocdddm -lt 2 -a $nsolver -eq 0 then nprocd=0 fi if test $nprocd -gt 0 then if test "$host" then if test -z "$RUN_JOB2" then echo " " echo "error: parallel job attempted on non-parallel version," echo " or, if parallel version is installed, the include " echo " file is probably corrupted" echo " " if test "$deletelog" = no then echo " " >> $jid.log echo "error: parallel job attempted on non-parallel version," >> $jid.log echo " or, if parallel version is installed, the include " >> $jid.log echo " file is probably corrupted" >> $jid.log echo " " >> $jid.log fi exit fi if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware then RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB " elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP then RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB " elif test $MPITYPE = "myrinet" then if test $MPIVERSION = "MPICH-GM1.2.1..7" then RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB " else RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" RUN_JOB=" -jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB " fi elif test $MACHINENAME = DEC -a $MPITYPE = hardware then RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB " elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" then numhost=`uniq $jid.mfile | wc -l` if test "$INTELMPI_VERSION" = "HYDRA" then RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" else export I_MPI_JOB_CONTEXT=$$ mpdboot -n $numhost -r $RSH -f $jid.mfile RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" fi

RUN_JOB="-jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB "

elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" then RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB " else RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB " fi if test "$userhost" then RUN_JOB="$RUN_JOB -mhost $userhost" fi if test $MPITYPE = "scali" then

SCAMPI_WORKING_DIRECTORY=/tmp export SCAMPI_WORKING_DIRECTORY fi else if test -z "$RUN_JOB1" then echo " " echo "error: parallel job attempted on non-parallel version," echo " or, if parallel version is installed, the include " echo " file is probably corrupted" echo " " if test "$deletelog" = no then echo " " >> $jid.log echo "error: parallel job attempted on non-parallel version," >> $jid.log echo " or, if parallel version is installed, the include " >> $jid.log echo " file is probably corrupted" >> $jid.log echo " " >> $jid.log fi exit fi RUNNPROCD=$nprocd if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" then RUNNPROCD= MP_PROCS=$nprocd export MP_PROCS fi if test $MPITYPE = "myrinet" then RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB " else RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB " fi if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" then touch $jid.hosts if test "$INTELMPI_VERSION" = "HYDRA" then echo " " > /dev/null else export I_MPI_JOB_CONTEXT=$$ mpdboot -n 1 -f $jid.hosts fi

RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ $nprocdarg \ $nsolverarg \ -maxnum $MAXNUM -itree $itree \ -nthread $nthread -dirjob $DIRJOB " fi fi else if test $nauto -gt 0 -o $ndcoup -gt 0 then RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ -maxnum $MAXNUM \ -nthread $nthread -dirjob $DIRJOB " else

RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ -maxnum $MAXNUM \ -nthread $nthread -dirjob $DIRJOB " fi fi if test "$rid" then RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" fi if test "$pid" then RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" fi if test "$sid" then RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" fi if test "$did" then RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" fi if test "$vid" then RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" fi if test $nauto -gt 0 then RUN_JOB="$RUN_JOB -autorst $nauto " fi if test $ndcoup -gt 0 then RUN_JOB="$RUN_JOB -dcoup $ndcoup " fi if test $ndytran -gt 0 then RUN_JOB="$RUN_JOB -dytran $ndytran " fi if test $mesh -gt 0 then RUN_JOB="$RUN_JOB -me $mesh " fi if test $noutcore -gt 0 then RUN_JOB="$RUN_JOB -outcore $noutcore " fi if test "$dllrun" -gt 0 then RUN_JOB="$RUN_JOB -dll $dllrun " fi if test "$trkrun" -gt 0 then RUN_JOB="$RUN_JOB -trk $trkrun " fi if test "$iam" then RUN_JOB="$RUN_JOB -iam $iam " fi if test "$justlist" then RUN_JOB="$RUN_JOB -list 1 " fi if test "$feature" then RUN_JOB="$RUN_JOB -feature $feature " fi if test "$memlimit" -ne 0 then RUN_JOB="$RUN_JOB -ml $memlimit " fi if test "$cpinput" then RUN_JOB="$RUN_JOB -ci $cpinput " fi if test "$cpresults" then RUN_JOB="$RUN_JOB -cr $cpresults " fi if test "$DIRSCR" != "$DIRJOB" then RUN_JOB="$RUN_JOB -dirscr $DIRSCR" else DIRSCR=$DIRJOB fi if test "$makebdf" then RUN_JOB="$RUN_JOB -bdf $makebdf " fi if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" then

$AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ /bin/mv $host.$$ $host RUN_JOB=$RUN_JOB_TMP fi if test $MPITYPE = "intelmpi" -a "$host" then

if test "$INTELMPI_VERSION" = "HYDRA" then grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ '{if ( NF > 0) {\ printf("-n %s",$2); \ if ( NF = 2 ) printf(" %s",path);\ if ( NF > 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ printf(" %s\n",args); \ }\ }' > $jid.cfile else grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ '{if ( NF > 0) {\ printf("-host %s -n %s",$1,$2); \ if ( NF = 2 ) printf(" %s",path);\ if ( NF > 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ printf(" %s\n",args); \ }\ }' > $jid.cfile fi RUN_JOB=$RUN_JOB_TMP fi echo " " echo "Final run stream value" echo " RUNJOB="$RUN_JOB if test "$deletelog" = no then echo " " >> $jid.log echo "Final run stream value" >> $jid.log echo " RUNJOB="$RUN_JOB >> $jid.log fi

##############################################################################

############################################################################## #RUN_JOB="valgrind $RUN_JOB" #RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" #RUN_JOB="valgrind gen-suppressions=all -v $RUN_JOB" #RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" ##############################################################################

##############################################################################

##############################################################################

if test "$deletelog" = yes then echo date else echo >> $jid.log date >> $jid.log fi if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] then

/bin/rm -f $jid.runmarcscript

#

# if test "$link" then if test "$user" then userobj=$DIRJOB/`$BASENAME $user .f`.o basefile=`$BASENAME $usersubname` if test ${basefile##*.} = f then usersub=$DIRJOB/`$BASENAME $user .f`.F ln -sf "$user.f" "$usersub" else usersub=$usersubname fi

fi cat > $jid.runmarcscript << END4 if test "$user" then if test ${basefile##*.} = f then ln -sf "$user.f" "$usersub" fi if test $MACHINENAME = "CRAY" then $FORTRAN $usersub || \ { echo "$0: compile failed for $user.f" exit 1 } /bin/rm $program 2>/dev/null else $FORTRAN $usersub -o $userobj || \ { echo "$0: compile failed for $user.f" exit 1 } /bin/rm $program 2>/dev/null fi if test ${basefile##*.} = f then /bin/rm -f "$usersub" fi fi

$LOAD $bd${program} $MARC_LIB/main.o \ $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ ${userobj-} \ $objs \ $MARC_LIB/srclib.a \ $MNFLIBS \ $MDUSER \ ${MUMPSSOLVERLIBS} \ $MDSRCLIB \ $MARC_LIB/mcvfit.a \ $STUBS \ $SOLVERLIBS \ $TKLIBS \ $MRCLIBS \ $METISLIBS \ $SYSLIBS \ $SECLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" exit 1 } END4 else prgsav=yes fi /bin/rm $userobj 2>/dev/null

#

#

cat >> $jid.runmarcscript << END5

if test $MACHINENAME = "IBM" then LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH export LIBPATH fi

if test $nprocdddm -gt 1 then numdom=$nprocdddm while test \$numdom -gt 0 do /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` done else /bin/rm $DIRJOB/$jid.out 2>/dev/null /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null fi

if test $nprocdddm -gt 1 then $RUN_JOB 2>>$jid.log else $RUN_JOB 2>>$jid.log fi

if test $dllrun -eq 0; then if test $prgsav = no then /bin/rm -f $bd$program 2>/dev/null fi else if test $cpdll = yes; then filename=`basename $usersubname .f` /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null fi if test $rmdll = yes then /bin/rm -f $DIRJOB/$marcdll 2>/dev/null fi fi

if test $nprocdddm -gt 1 then numdom=$nprocdddm while test \$numdom -gt 0 do /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` done /bin/rm $DIRJOB/$jid.pid 2>/dev/null else /bin/rm $DIRSCR/$jid.t02 2>/dev/null /bin/rm $DIRSCR/$jid.t03 2>/dev/null /bin/rm $DIRSCR/$jid.t11 2>/dev/null /bin/rm $DIRSCR/$jid.t12 2>/dev/null /bin/rm $DIRSCR/$jid.t13 2>/dev/null /bin/rm $DIRSCR/$jid.t14 2>/dev/null /bin/rm $DIRSCR/$jid.t15 2>/dev/null /bin/rm $DIRSCR/$jid.t22 2>/dev/null /bin/rm $DIRSCR/$jid.t23 2>/dev/null /bin/rm $DIRSCR/$jid.t32 2>/dev/null /bin/rm $DIRSCR/$jid.t33 2>/dev/null /bin/rm $DIRSCR/$jid.t81 2>/dev/null /bin/rm $DIRSCR/$jid.t82 2>/dev/null /bin/rm $DIRSCR/$jid.t83 2>/dev/null /bin/rm $DIRSCR/$jid.t84 2>/dev/null /bin/rm $DIRJOB/$jid.pid 2>/dev/null fi END5

# if [ $qid = at ] then QUENAME=at SUBMCMD= else #

# QUENAME=qsub SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" if test "$priority" then SUBMCMD=$SUBMCMD" -p $priority" fi if test "$att" then SUBMCMD=$SUBMCMD" -a $att" fi if test "$cpu" then SUBMCMD=$SUBMCMD" -lt $cpu" fi

fi echo $QUENAME $SUBMCMD #cat $jid.runmarcscript $QUENAME $SUBMCMD < $jid.runmarcscript

/bin/rm -f $jid.runmarcscript

##############################################################################

##############################################################################

else if test $qid = background then

#

if test $nprocdddm -gt 1 then numdom=$nprocdddm while test $numdom -gt 0 do /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` done else /bin/rm $DIRJOB/$jid.out 2>/dev/null fi #

# ( if test "$link" then if test "$user" then

if test $nprocd -gt 1 then if test "$userhost" then counter=0 for i in `$AWK -v n=$numfield '{print $n}' $host_filt` do ibase=${i%%.*} if test $ibase != $thishost then counter=$((counter+1)) if test ${compstatus[$counter]} = "no" then DIR1=$DIRJOB DIR2=$DIR line=`grep -v '^#' $userhost | grep "^$ibase "` workdir=`echo $line | $AWK '{print $3}'` marcdir=`echo $line | $AWK '{print $4}'` if test -n "$workdir" then DIR1=$workdir fi if test -n "$marcdir" then DIR2=$marcdir fi

if test ${dirstatus[$counter]} = "local" then $RCP $user.f $i:$DIR1/ fi

if test ${dirstatus[$counter]} = "shared" then hname=_$ibase else hname= fi remoteprog=$DIR1/${execname}$hname remoteuser=$DIR1/`$BASENAME $user` $RSH $i /bin/rm $remoteprog 2> /dev/null echo $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog

line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` if test "$line" then echo compilation and linking successful on host $i else echo "$0: compile failed for $user.f on host $i" echo " $PRODUCT Exit number 3" exit 1 fi

if test ${dirstatus[$counter]} = "local" then $RSH $i /bin/rm $remoteuser.f 2> /dev/null fi fi fi done fi fi if test "$userhost" then echo echo "Compiling and linking user subroutine $user.f on host `hostname`" fi userobj=$DIRJOB/`$BASENAME $user .f`.o basefile=`$BASENAME $usersubname` if test ${basefile##*.} = f then usersub=$DIRJOB/`$BASENAME $user .f`.F ln -sf "$user.f" "$usersub" else usersub=$usersubname fi if test $MACHINENAME = "CRAY" then $FORTRAN $usersub || \ { echo "$0: compile failed for $user.f" echo " $PRODUCT Exit number 3" exit 1 } /bin/rm $program 2>/dev/null else $FORTRAN $usersub -o $userobj || \ { echo "$0: compile failed for $user.f" echo " $PRODUCT Exit number 3" exit 1 } /bin/rm $program 2>/dev/null fi if test ${basefile##*.} = f then /bin/rm -f "$usersub" fi fi # if test $user

$LOAD $bd${program} $MARC_LIB/main.o \ $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ ${userobj-} \ $objs \ $MARC_LIB/srclib.a \ $MNFLIBS \ $MDUSER \ ${MUMPSSOLVERLIBS} \ $MDSRCLIB \ $MARC_LIB/mcvfit.a \ $STUBS \ ${SOLVERLIBS} \ $TKLIBS \ $MRCLIBS \ $METISLIBS \ $SYSLIBS \ $SECLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" echo " $PRODUCT Exit number 3" exit 1 }

if test $nprocd -gt 1 then if test "$userhost" then counter=0 for i in `$AWK -v n=$numfield '{print $n}' $host_filt` do ibase=${i%%.*} if test $ibase != $thishost then counter=$((counter+1)) if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" then DIR1=$DIRJOB line=`grep -v '^#' $userhost | grep "^$ibase "` workdir=`echo $line | $AWK '{print $3}'` if test -n "$workdir" then DIR1=$workdir fi echo "Copying executable to host ${i}" $RCP $program ${i}:${DIR1}/ fi fi done fi fi else # if test $link prgsav=yes fi # if test $link /bin/rm $userobj 2>/dev/null

#

#

if test $MACHINENAME = "IBM" then LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH export LIBPATH fi

$RUN_JOB &

marcpid=$! echo $marcpid > $DIRJOB/$jid.pid wait $marcpid

if test $dllrun -eq 0; then if test $prgsav = no then /bin/rm -f $bd$program 2>/dev/null

if test $nprocd -gt 1 then if test "$userhost" then counter=0 for i in `$AWK -v n=$numfield '{print $n}' $host_filt` do ibase=${i%%.*} if test $ibase != $thishost then counter=$((counter+1)) DIR1=$DIRJOB line=`grep -v '^#' $userhost | grep "^$ibase "` workdir=`echo $line | $AWK '{print $3}'` if test -n "$workdir" then DIR1=$workdir fi

if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" then hname=_$ibase /bin/rm ${execname}$hname fi

if test ${dirstatus[$counter]} = "local" then $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null fi fi done fi fi fi else #dllrun >0 if test $cpdll = yes; then filename=`basename $usersubname .f` /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null fi if test $rmdll = yes;then /bin/rm -f $DIRJOB/$marcdll 2>/dev/null fi fi if test $nprocdddm -gt 1 then numdom=$nprocdddm while test $numdom -gt 0 do /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` done /bin/rm $DIRJOB/$jid.pid 2>/dev/null if test $MPITYPE = "myrinet" then if test -f "$host_filt" then /bin/rm $host_filt fi fi else /bin/rm $DIRSCR/$jid.t02 2>/dev/null /bin/rm $DIRSCR/$jid.t03 2>/dev/null /bin/rm $DIRSCR/$jid.t11 2>/dev/null /bin/rm $DIRSCR/$jid.t12 2>/dev/null /bin/rm $DIRSCR/$jid.t13 2>/dev/null /bin/rm $DIRSCR/$jid.t14 2>/dev/null /bin/rm $DIRSCR/$jid.t15 2>/dev/null /bin/rm $DIRSCR/$jid.t22 2>/dev/null /bin/rm $DIRSCR/$jid.t23 2>/dev/null /bin/rm $DIRSCR/$jid.t32 2>/dev/null /bin/rm $DIRSCR/$jid.t33 2>/dev/null /bin/rm $DIRSCR/$jid.t81 2>/dev/null /bin/rm $DIRSCR/$jid.t82 2>/dev/null /bin/rm $DIRSCR/$jid.t83 2>/dev/null /bin/rm $DIRSCR/$jid.t84 2>/dev/null /bin/rm $DIRJOB/$jid.pid 2>/dev/null fi ) 1>>$jid.log 2>&1 &

##############################################################################

##############################################################################

else

#

# if test "$link" then if test "$user" then

if test $nprocd -gt 1 then if test "$userhost" then counter=0 for i in `$AWK -v n=$numfield '{print $n}' $host_filt` do ibase=${i%%.*} if test $ibase != $thishost then counter=$((counter+1)) if test ${compstatus[$counter]} = "no" then DIR1=$DIRJOB DIR2=$DIR line=`grep -v '^#' $userhost | grep "^$ibase "` workdir=`echo $line | $AWK '{print $3}'` marcdir=`echo $line | $AWK '{print $4}'` if test -n "$workdir" then DIR1=$workdir fi if test -n "$marcdir" then DIR2=$marcdir fi

if test ${dirstatus[$counter]} = "local" then $RCP $user.f $i:$DIR1/ fi

if test ${dirstatus[$counter]} = "shared" then hname=_$ibase else hname= fi remoteprog=$DIR1/${execname}$hname remoteuser=$DIR1/`$BASENAME $user` $RSH $i /bin/rm $remoteprog 2> /dev/null echo $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog

line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` if test "$line" then echo compilation and linking successful on host $i else echo "$0: compile failed for $user.f on host $i" exit 1 fi

if test ${dirstatus[$counter]} = "local" then $RSH $i /bin/rm $remoteuser.f 2> /dev/null fi fi fi done fi fi if test "$userhost" then echo echo "Compiling and linking user subroutine $user.f on host `hostname`" fi userobj=$DIRJOB/`$BASENAME $user .f`.o basefile=`$BASENAME $usersubname` if test ${basefile##*.} = f then usersub=$DIRJOB/`$BASENAME $user .f`.F ln -sf "$user.f" "$usersub" else usersub=$usersubname fi if test $MACHINENAME = "CRAY" then $FORTRAN $usersub || \ { echo "$0: compile failed for $user.f" exit 1 } /bin/rm $program 2>/dev/null else $FORTRAN $usersub -o $userobj || \ { echo "$0: compile failed for $user.f" exit 1 } /bin/rm $program 2>/dev/null fi if test ${basefile##*.} = f then /bin/rm -f "$usersub" fi fi # if test $user

$LOAD $bd${program} $MARC_LIB/main.o \ $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ ${userobj-} \ $objs \ $MARC_LIB/srclib.a \ $MNFLIBS \ $MDUSER \ ${MUMPSSOLVERLIBS} \ $MDSRCLIB \ $MARC_LIB/mcvfit.a \ $STUBS \ ${SOLVERLIBS} \ $TKLIBS \ $MRCLIBS \ $METISLIBS \ $SYSLIBS \ $SECLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" exit 1 }

if test $nprocd -gt 1 then if test "$userhost" then counter=0 for i in `$AWK -v n=$numfield '{print $n}' $host_filt` do ibase=${i%%.*} if test $ibase != $thishost then counter=$((counter+1)) if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" then DIR1=$DIRJOB line=`grep -v '^#' $userhost | grep "^$ibase "` workdir=`echo $line | $AWK '{print $3}'` if test -n "$workdir" then DIR1=$workdir fi echo "Copying executable to host ${i}" $RCP $program ${i}:${DIR1}/ fi fi done fi fi else # if test $link prgsav=yes fi # if test $link /bin/rm $userobj 2>/dev/null

#

#

if test $MACHINENAME = "IBM" then LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH export LIBPATH fi

if test $nprocdddm -gt 1 then numdom=$nprocdddm while test $numdom -gt 0 do /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` done else /bin/rm $DIRJOB/$jid.out 2>/dev/null fi

$RUN_JOB

if test $nprocd -gt 1 then if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" then if test "$INTELMPI_VERSION" = "HYDRA" then echo " " > /dev/null else if test "$host" then mpdcleanup -a -f $jid.mfile /bin/rm $jid.host 2> /dev/null /bin/rm $jid.mfile 2> /dev/null else mpdcleanup -a -f $jid.hosts /bin/rm $jid.hosts 2> /dev/null fi fi fi fi

if test $dllrun -eq 0; then if test $prgsav = no then /bin/rm -f $bd$program 2>/dev/null

if test $nprocd -gt 1 then if test "$userhost" then counter=0 for i in `$AWK -v n=$numfield '{print $n}' $host_filt` do ibase=${i%%.*} if test $ibase != $thishost then counter=$((counter+1)) DIR1=$DIRJOB line=`grep -v '^#' $userhost | grep "^$ibase "` workdir=`echo $line | $AWK '{print $3}'` if test -n "$workdir" then DIR1=$workdir fi

if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" then hname=_$ibase /bin/rm ${execname}$hname fi

if test ${dirstatus[$counter]} = "local" then $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null fi fi done fi fi fi else #dllrun >0 if test $cpdll = yes; then filename=`basename $usersubname .f` /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null fi if test $rmdll = yes;then /bin/rm -f $DIRJOB/$marcdll 2>/dev/null fi fi

if test $nprocdddm -gt 1 then numdom=$nprocdddm while test $numdom -gt 0 do /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` done /bin/rm $DIRJOB/$jid.pid 2>/dev/null if test $MPITYPE = "myrinet" then if test -f "$host_filt" then /bin/rm $host_filt fi fi else /bin/rm $DIRSCR/$jid.t02 2>/dev/null /bin/rm $DIRSCR/$jid.t03 2>/dev/null /bin/rm $DIRSCR/$jid.t11 2>/dev/null /bin/rm $DIRSCR/$jid.t12 2>/dev/null /bin/rm $DIRSCR/$jid.t13 2>/dev/null /bin/rm $DIRSCR/$jid.t14 2>/dev/null /bin/rm $DIRSCR/$jid.t15 2>/dev/null /bin/rm $DIRSCR/$jid.t22 2>/dev/null /bin/rm $DIRSCR/$jid.t23 2>/dev/null /bin/rm $DIRSCR/$jid.t32 2>/dev/null /bin/rm $DIRSCR/$jid.t33 2>/dev/null /bin/rm $DIRSCR/$jid.t81 2>/dev/null /bin/rm $DIRSCR/$jid.t82 2>/dev/null /bin/rm $DIRSCR/$jid.t83 2>/dev/null /bin/rm $DIRSCR/$jid.t84 2>/dev/null /bin/rm $DIRJOB/$jid.pid 2>/dev/null fi

fi fi