Jpp
18.0.0-rc.2
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
scripts
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
}
JCOMPAREHISTOGRAMS::read
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
Definition:
JTestSummary.hh:222
file
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
Definition:
JDataQuality.sh:19
queue
then echo Submitting reweighting and histogram comparison jobs to nikhef stbc batch queue
Definition:
JEvtReweightMupageParameterScan.sh:108
f
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
Definition:
JDataQuality.sh:76
puts_queue
function puts_queue()
Definition:
qlib.sh:34
echo
then echo
Definition:
JDOMDAQDriver.sh:56
JTOOLS::n
const int n
Definition:
JPolint.hh:697
a
then JCalibrateToT a
Definition:
JTuneHV.sh:116
rm
then rm
Definition:
JEvtReweightMupageParameterScan.sh:95
then
then
Definition:
acoustics-fit-toolkit.sh:215
FIFO
Q FIFO
Definition:
JDataQuality.sh:61
put_queue
function put_queue()
Definition:
qlib.sh:19
done
esac done
Definition:
JAddHDE.sh:21
Generated by
1.8.5