lsf.template.x 3.37 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#! /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 

#------------------------------------------------------------------------------