#! /bin/bash -l #------------------------------------------------------------------------------ #BSUB -q __batchqueue__ #BSUB -J __jobname__ #BSUB -o __resultsdir__/__jobname__.o%J #BSUB -e __resultsdir__/__jobname__.e%J #BSUB -n __nodes__ #BSUB -W __walltime__ #BSUB -b __starttime__ #----------------------------------------------------- # Set up the environment for use of the harness. #----------------------------------------------------- source __rgtenvironmentalfile__ module load __requiredmodules__ module list #----------------------------------------------------- # Define some variables. #----------------------------------------------------- EXECUTABLE="__pathtoexecutable__" STARTINGDIRECTORY="__startingdirectory__" WORKDIR="__workdir__" RESULTSDIR="__resultsdir__" TEST_ID="__test_id__" #----------------------------------------------------- # Ensure that we are in the correct starting # directory. #----------------------------------------------------- cd $STARTINGDIRECTORY echo "Starting directory is $(pwd)" #----------------------------------------------------- # Make the working scratch space directory. #----------------------------------------------------- mkdir -p $WORKDIR #----------------------------------------------------- # Make the results directory if not already there. #----------------------------------------------------- #mkdir -p $RESULTSDIR #----------------------------------------------------- # Copy needed files to work dir. #----------------------------------------------------- #EXECUTABLE_DIR=$(dirname $EXECUTABLE) #for FILE in $EXECUTABLE $EXECUTABLE_DIR"/"*.dat ; do # cp $FILE $WORKDIR #done cp ../Inputs/__inputfile__ $WORKDIR/sizes.txt #----------------------------------------------------- # Change directory to the working directory. #----------------------------------------------------- cd $WORKDIR #----------------------------------------------------- # Run the executable. #----------------------------------------------------- log_binary_execution_time.py --scriptsdir $STARTINGDIRECTORY \ --uniqueid $TEST_ID --mode start __joblaunchcommand__ log_binary_execution_time.py --scriptsdir $STARTINGDIRECTORY \ --uniqueid $TEST_ID --mode final sleep 30 #----------------------------------------------------- # Ensure that we return to the starting directory. #----------------------------------------------------- cd $STARTINGDIRECTORY #----------------------------------------------------- # Copy the results back to the $RESULTSDIR. #----------------------------------------------------- cp -rf $WORKDIR"/"* $RESULTSDIR ### && rm -rf $WORKDIR #----------------------------------------------------- # Move the batch file to $RESULTSDIR. #----------------------------------------------------- if [ -e __batchfilename__ ] ; then mv __batchfilename__ $RESULTSDIR fi #----------------------------------------------------- # Check the final results. #----------------------------------------------------- check_executable_driver.py -p $RESULTSDIR -i $TEST_ID #----------------------------------------------------- # The script now determines if we are to resubmit # itself. #----------------------------------------------------- case __resubmitme__ in 0) test_harness_driver.py -r;; 1) echo "No resubmit";; esac #------------------------------------------------------------------------------