3 echo
"%%%------------------------------%%%"
4 echo
"% Executing $(basename ${0}) script %"
5 echo
"%%%------------------------------%%%"
9 #########################################################################
10 ### Establish environment and read in the arguments from the cfg file ###
11 #########################################################################
15 WORKSPACE=${WORKSPACE:-$PWD}
16 ci_cur_exp_name=${ci_cur_exp_name:-${EXPERIMENT}}
19 LOCAL_REF_DIR=
"${WORK_DIR}/references"
21 echo -
e "\nWorking Directory: ${WORK_DIR}"
35 ######################################################
36 ### Create working and reference store directories ###
37 ######################################################
41 mkdir "${LOCAL_REF_DIR}"
45 ######################################
46 ### Loop over fcl files for checks ###
47 ######################################
49 ACCESS_REF_DIR=${REF_DIR
55 echo -
e "\nRemote Reference Directory: ${ACCESS_REF_DIR}"
58 echo -e
"\nUpdating ref files for fcl checks"
59 export datestamp=$(date +
"%Y%m%d%H%M")
62 if IFDH_DEBUG=0 ifdh ll ${ACCESS_REF_DIR}/${REF_FILE}
64 echo -e
"\nFound reference tar: ${ACCESS_REF_DIR}/${REF_FILE}"
65 echo
"ifdh cp ${ACCESS_REF_DIR}/${REF_FILE} ${LOCAL_REF_DIR}/${REF_FILE}"
66 ifdh cp ${ACCESS_REF_DIR}/${REF_FILE} ${LOCAL_REF_DIR}/${REF_FILE}
67 echo -e
"\nExtract tar to local references directory"
68 echo
"tar -xzvf references/${REF_FILE} -C ${LOCAL_REF_DIR}"
69 tar -xzvf references/${REF_FILE} -C ${LOCAL_REF_DIR}
72 echo -e
"\nCannot find reference tar: ${ACCESS_REF_DIR}/${REF_FILE}"
73 echo
"Exiting with exit code: ${exit_code}"
75 ERRORSTRING=
"Failure accessing reference tar file~Check the log"
76 echo
"`basename $CWD`~${exit_code}~${EXITSTATUS}~$ERRORSTRING" >> $WORKSPACE/data_production_stats${ci_cur_exp_name}.log
80 echo -e
"\nList of reference files in: ${LOCAL_REF_DIR}"
81 echo
"$(ls ${LOCAL_REF_DIR}/*)"
84 echo -e
"\nList of files from: ${SBNDCODE_DIR}/test/fcl_file_checks.list"
85 echo
"$(cat ${SBNDCODE_DIR}/test/fcl_file_checks.list)"
87 for fcl in `cat ${SBNDCODE_DIR}/
test/fcl_file_checks.list`
90 echo -e
"\nTesting fcl file ${fcl}"
93 #######################################
94 ### Perform debug check on fcl file ###
95 #######################################
98 larout=${
fcl%.fcl}_lar.out
99 larerr=${
fcl%.fcl}_lar.err
100 lar -c ${
fcl} --
debug-config $fclout > $larout 2> $larerr
103 ##############################################
104 ### Check fcl could be parsed successfully ###
105 ##############################################
109 if [[ $stat -ne 0 && $stat -ne 1 ]]; then
110 echo
"Error parsing ${fcl} --- Exited with status ${stat}"
111 echo
"==================================================================================================================================="
113 echo
"==================================================================================================================================="
114 let exit_code_parsing=201
117 echo
"Successful parsing of ${fcl} --- Exited with status ${stat}"
121 ###############################################################################
122 ### Check the diff between the fcl configs for the ref and current versions ###
123 ###############################################################################
129 if [[ ! -f ${LOCAL_REF_DIR}/${
fcl%.fcl}_fhicl_dump.out ]]
131 echo
"Cannot open reference file: ${LOCAL_REF_DIR}/${fcl%.fcl}_fhicl_dump.out it does not exist"
132 let exit_code_dump=201
136 fcl_diff=$(diff ${LOCAL_REF_DIR}/${
fcl%.fcl}_fhicl_dump.out ${fclout})
138 if [[ -
n $fcl_diff ]]; then
139 echo
"Non-zero diff from file: ${fcl}"
140 echo
"==================================================================================================================================="
142 echo
"==================================================================================================================================="
143 let exit_code_dump=201
145 echo
"Zero diff from file: ${fcl}"
151 ############################################
152 ### Update reference file (if requested) ###
153 ############################################
158 echo -e
"\nMaking tar of new output files"
159 echo
"tar -czvf ${CWD}/${CUROUTPUT} *_fhicl_dump.out"
164 ##################################
165 ### Prepare exit code and exit ###
166 ##################################
170 if [[ $exit_code_parsing -ne 0 && $exit_code_dump -ne 0 ]]; then
171 ERRORSTRING=
"Error parsing fcl file and differences in fhicl dump outputs~Check error in log"
173 elif [[ $exit_code_parsing -ne 0 ]]; then
174 ERRORSTRING=
"Error parsing fcl file~Check error in log"
176 elif [[ $exit_code_dump -ne 0 ]]; then
177 ERRORSTRING=
"Differences in fhicl dump outputs~Update reference files"
180 ERRORSTRING=
"All checks successful"
183 echo -e
"\nExiting with exit code: $exit_code"
184 echo $ERRORSTRING | cut -d~ -f 1
187 if [[ $exit_code -ne 0 ]]; then
189 echo
"`basename $CWD`~${exit_code}~${EXITSTATUS}~$ERRORSTRING" >> $WORKSPACE/data_production_stats${ci_cur_exp_name}.log
process_name standard_reco_uboone fcl
process_name opflash particleana ie x
then source cvmfs dune opensciencegrid org products dune setup_dune sh exit elif[-f/grid/fermiapp/products/dune/setup_dune_fermiapp.sh]
find $MRB_BUILDDIR larpandora job name *fcl print while read fcl do echo Testing fcl file $fcl fclout
x update ref files UPDATE_REF_FILE_ON
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
BEGIN_PROLOG hitmakerfive clustermakerfour pfparticlemakerthree showermakertwo END_PROLOG hitmakerfive clustermakerfour pfparticlemakerthree sequence::inline_paths sequence::inline_paths sequence::inline_paths showermakers test