4 # \author mdejong, bjjung
6 #--------------------------------------------------------------------------------------
8 # Utility script for batch queue functions.
10 #--------------------------------------------------------------------------------------
14 # Put command(s) in given queue; do not submit job.
17 # \param 2-N command(s)
24 echo -
n "$*;" >> $queue_name
29 # Put command(s) in given queue and submit job.
32 # \param 2-N command(s)
39 echo "$*" >> $queue_name
48 # \param 3 sleep time [s]
56 if [[ -e $queue_name ]];
then
58 if [[ -p $queue_name ]];
then
59 fatal
"Queue $queue_name in use."
63 mkfifo $queue_name # create
a new FIFO
66 fd=7 #
file descriptor
68 eval
"exec $fd<>$queue_name" # attach
file descriptor to
FIFO
70 while read job <& $fd;
do #
read job from
file descriptor
72 if [[ -
n $job ]];
then
74 if [[ $job =
"exit" ]];
then
79 eval exec $job & # submit job
83 while (( ${#jobstates} >= $queue_size ));
do
93 # Function to configure jobs.\n
94 # Sets the environment variable EXEC_FILE, LOG_FILE as well as START_JOB and SUBMIT_JOB\n
95 # depending upon whether a new job should be set up or submitted.
97 # \param groupsize task group size
98 # \param exec_filename execution file name
103 2) local groupsize=$2;
104 local exec_filename=$1;;
105 *) fatal
"configure_job(): Invalid number of arguments."
108 if [[ ! ${exec_filename} =~
'%' ]];
then
109 fatal
"configure_job(): Missing wildcard character in ${exec_filename}."
112 if [[ -z $TASKID ]];
then # Initialize task
ID
116 if [[ -z $GROUPID ]];
then # Initialize task group
ID
120 local integer SUBTASKID=$(( TASKID % groupsize ))
122 if (( SUBTASKID == 1 || groupsize == 1 ));
then #
configure job start
124 export EXEC_FILE=${exec_filename/\%/${GROUPID}}
125 export LOG_FILE=${EXEC_FILE:
r}.log
146 # Function to reset job configuration variables.
157 # Function to submit a job.
159 # \param exec_file job script
160 # \param queue_name batch queue name
161 # \param scratchdir scratch directory
162 # \param dependencies dependency PIDs
166 local scratchdir=${
TMPDIR:-/tmp}
169 4) local dependencies=($4);&
171 2) local queue_name=$2;&
172 1) local exec_file=$1;;
173 *) local exec_file=${argv[1]}
174 local queue_name=${argv[2]}
175 scratchdir=${argv[3]}
176 local dependencies=(${argv[4,-2]})
179 chmod +
x ${exec_file}
181 if (( ${+queue_name} ));
then
183 if ( is_CCNikhef );
then
185 local depstr=
"depend=afterok$(printf ':%s' ${dependencies[@]})"
190 -
N ${exec_file:t:
r}.${
USER} \
191 ${dependencies:+-W ${depstr}} \
199 if (( ${+dependencies} ));
then
203 for dep
in ${dependencies[@]};
do
205 cat > ${scratchdir}/await_${dep}.sh <<EOF
208 while [[ -e /proc/${dep} ]];
do
214 put_queue ${queue_name} ${scratchdir}/await_${dep}.sh
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
then usage $script[< detector identifier >< run range >]< QA/QCfile > nExample script to produce data quality plots nWhen a detector identifier and run range are data are downloaded from the database nand subsequently stored in the given QA QC file
then JLigier sh continue fi cat
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
usr share Modules init zsh export TMPDIR
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
skip elif((BINFRAC< 1.0))
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
then echo Submitting reweighting and histogram comparison jobs to nikhef stbc batch queue
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in