-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunValidation.sh
executable file
·122 lines (100 loc) · 2.83 KB
/
runValidation.sh
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
#Get the command line arguments
while [[ $# -gt 1 ]]
do
key="$1"
case $key in
--xml)
XML="$2"
shift
;;
--stage)
STAGE="$2"
shift
;;
--project)
PROJECT="$2"
shift
;;
*)
;;
esac
shift
done
#xml and stage are required arguments so check they exist
if [ -z "$XML" ]
then
echo "No xml file specified. Specify one with --xml XMLFILE"
exit 1
fi
if [ -z "$STAGE" ]
then
echo "No stage specified. Specify one with --stage STAGENAME"
exit 1
fi
#Create the command to give to the parser
PARSERCMD="--xml $XML --stage $STAGE"
if [ -n "$PROJECT" ]
then
PARSERCMD="$PARSERCMD --project $PROJECT"
fi
#Now call the parser using the created command to get the output DIR
echo "Running project.py to get project directory"
#OUTPUTDIR="$(python getOutputDir.py $PARSERCMD)"
OUTPUTDIR=`project.py $PARSERCMD --outdir`
echo "---The project directory is $OUTPUTDIR"
#echo $OUTPUTDIR
#Check that the validation output directory is empty
VALOUTPUTDIR="$OUTPUTDIR/../validation/$STAGE"
echo "---The validation output directory is: $VALOUTPUTDIR"
mkdir -p $VALOUTPUTDIR
DIRCONTENT=`ls -A $VALOUTPUTDIR | wc -l`
if [ $DIRCONTENT -ne 0 ]
then
echo "Validation output directory is not empty. Exiting!!!!"
exit 1
fi
#Now reconstruct the list of job ids from the directory (also reconstructes directory structure)
echo "Running: getAllJobIDs.sh"
getAllJobIDs.sh $OUTPUTDIR
#Get info on the LAr jobs (currently LAr time and memory). Dumps info to a text file called lar_stats.txt
echo "Running: getLArStats.sh"
getLArStats.sh jobids.txt $OUTPUTDIR
#Now dump the job id and job time elapsed into the text file (called job_time_elapsed.txt)
echo "Running: getJobTimes.sh"
getJobTimes.sh jobids.txt
#Create the output tree which will hold the data
echo "Running: runCreateTree.C"
root -l -b -q runCreateTree.C
#Now create the plots
echo "Running: createPlots.C"
root -l -b -q projectpytree.root createPlots.C
#Now dump the plots to picture files
echo "Running: dumpPlots.C"
root -l -b -q "dumpPlots.C(\"projectpyplots.root\",\"${STAGE}_\")"
#Now copy the stuff to the project.py project directory
echo "Moving output to $VALOUTPUTDIR"
#ifdh cp -D projectpytree.root $VALOUTPUTDIR/.
#ifdh cp -D projectpyplots.root $VALOUTPUTDIR/.
#ifdh cp -D job_time_elapsed.txt $VALOUTPUTDIR/.
#ifdh cp -D jobids.txt $VALOUTPUTDIR/.
##ifdh cp -D jobfolders.txt $VALOUTPUTDIR/.
#ifdh cp -D lar_stats.txt $VALOUTPUTDIR/.
cp projectpytree.root $VALOUTPUTDIR/.
cp projectpyplots.root $VALOUTPUTDIR/.
cp job_time_elapsed.txt $VALOUTPUTDIR/.
cp jobids.txt $VALOUTPUTDIR/.
#ifdh cp -D jobfolders.txt $VALOUTPUTDIR/.
cp lar_stats.txt $VALOUTPUTDIR/.
cp *.pdf $VALOUTPUTDIR/.
cp *.png $VALOUTPUTDIR/.
#Tidy up the directory
rm createTree_C*
rm job_time_elapsed.txt
rm jobids.txt
#rm jobfolders.txt
rm lar_stats.txt
rm projectpytree.root
rm projectpyplots.root
rm *.pdf
rm *.png