Jpp  test_elongated_shower_pde
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
qlib.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 #
4 # \author mdejong
5 #
6 #--------------------------------------------------------------------------------------
7 #
8 # Utility script for batch queue functions.
9 #
10 #--------------------------------------------------------------------------------------
11 
12 
13 #
14 # Put command(s) in given queue; do not submit job.
15 #
16 # \param 1 queue name
17 # \param 2-N command(s)
18 #
19 function put_queue()
20 {
21  queue_name=$1
22  shift
23 
24  echo -n "$*;" >> $queue_name
25 }
26 
27 
28 #
29 # Put command(s) in given queue and submit job.
30 #
31 # \param 1 queue name
32 # \param 2-N command(s)
33 #
34 function puts_queue()
35 {
36  queue_name=$1
37  shift
38 
39  echo "$*" >> $queue_name
40 }
41 
42 
43 #
44 # Run queue.
45 #
46 # \param 1 queue name
47 # \param 2 queue size
48 # \param 3 sleep time [s]
49 #
50 function queue()
51 {
52  queue_name=$1
53  queue_size=$2
54  sleep_time=$3
55 
56  if [[ -e $queue_name ]]; then
57 
58  if [[ -p $queue_name ]]; then
59  fatal "Queue $queue_name in use."
60  fi
61  else
62 
63  mkfifo $queue_name # create a new FIFO
64  fi
65 
66  fd=7 # file descriptor
67 
68  eval "exec $fd<>$queue_name" # attach file descriptor to FIFO
69 
70  while read job <& $fd; do # read job from file descriptor
71 
72  if [[ -n $job ]]; then
73 
74  if [[ $job = "exit" ]]; then
75  break
76  fi
77 
78  notice "submit $job"
79  eval exec $job & # submit job
80 
81  # wait for free slot
82 
83  while (( ${#jobstates} >= $queue_size )); do
84  sleep $sleep_time
85  done
86  fi
87  done
88 
89  rm -f $queue_name # remove FIFO
90 }
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
then set_variable PMT_FILE set_variable DAQ_FILE set_variable OUTPUT_FILE set_variable DETECTOR else fatal Wrong number of arguments fi set_variable RUNBYRUN file
then echo Submitting reweighting and histogram comparison jobs to nikhef stbc batch queue
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
function puts_queue()
Definition: qlib.sh:34
then echo
const int n
Definition: JPolint.hh:676
set_variable NUMBER_OF_ITERATIONS set_variable EPSILON cat acoustics_fit_parameters txt<< EOF $CONFIGURATION[*]Nmin=3;sigma_s=100.0e-6;stdev=10.0;mestimator=0;fixStrings=0;EOF for STRING in $STRINGS[*];do#fit stretching and(z) position of given string set_variable DETECTOR_TMP ${TMPDIR:-/tmp}/detector_A.datx JEditDetector-a $DETECTOR-o $DETECTOR_TMP-r $STRING JEditDetector-a $DETECTOR-o $DETECTOR-k $STRING for MUL in 0.005 0.001;do DX_M=0.2 for((N=0;$N< $NUMBER_OF_ITERATIONS;++N));do CHI2[3]=$CHI2[1] fitPositionOfString $STRING Z $DX_M fitStretchingOfString $STRING $MUL if(($CHI2[3]-$CHI2[1]< $EPSILON));then break fi done if(($N >=$NUMBER_OF_ITERATIONS));then printf"warning: reached maximum number of iterations %d - converenge %7.3f\n"$N $(($CHI2[3]-$CHI2[1])) fi done JMergeDetector-a $DETECTOR-a $DETECTOR_TMP-o $DETECTOR rm-f $DETECTOR_TMP JConvertDetectorFormat-a $DETECTOR-o $DETECTOR-r-d 0 > &dev null done
Q FIFO
Definition: JDataQuality.sh:55
then JCalibrateToT a
Definition: JTuneHV.sh:116
function put_queue()
Definition: qlib.sh:19