#!/bin/sh
# @ job_type = bluegene
# @ class = @@{PARTITION}
#
# Specify partition using the following statement. This statement is the only way a partition should ever be
# specified in a LoadLeveler job control file.
# The partition you designate here indicates the number of nodes, so note that we do not specify a
# desired number of nodes anywhere in the job control file.
# @ bg_size = @@{PARTITIONSIZE}
#
# @ input = @@{STDIN}
# @ output = ll_@@{RUNNAME}_@@{INSTANCEID}.stdout
# @ error = ll_@@{RUNNAME}_@@{INSTANCEID}.stderr
#
# Maximum wall clock time for job will be in minutes.
# @ wall_clock_limit = @@{WALLTIME}
#
# @ notification = never
# @ queue

# RemoteBatchLL:makeMPINoForkTemplate
# SubmissionScripts/Distributor/Batch/LL/mpinofork

cd ${LOADL_STEP_INITDIR}

@@{QUOTA}

date +"%s" > @@{TS_START}

@@{PREMANAGERCOMMANDS}
@@{MANAGERCOMMAND} -cwd ${LOADL_STEP_INITDIR} @@{ENVIRONMENT} -exe @@{EXECUTABLE} @@{ARGUMENTS} > @@{RUNNAME}_@@{INSTANCEID}.stdout 2> @@{RUNNAME}_@@{INSTANCEID}.stderr
@@{POSTMANAGERCOMMANDS}

date +"%s" > @@{TS_FINISH}

startTime=`cat @@{TS_START}`
finishTime=`cat @@{TS_FINISH}`
let wallTime=finishTime-startTime
cnt=0
while [ "${cnt}" != "@@{NPROCESSORS}" ] ; do
   cat >> @@{TIME_RESULTS} <<EOF
real ${wallTime}.00
user ${wallTime}.00
sys 0.00
EOF
   cnt=`expr ${cnt} + 1`
done
