forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparallelMergeTest.sh
More file actions
executable file
·67 lines (55 loc) · 1.13 KB
/
parallelMergeTest.sh
File metadata and controls
executable file
·67 lines (55 loc) · 1.13 KB
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
#!/bin/bash
nprocess=$1
nhist=$2
ndims=$3
nbins=$4
usage() {
echo "parallelMergeTest.sh nprocess nhist [ndims] [nbins]"
}
if [ "x$nprocess" == "x" ] ; then
echo "Must specify the number of client process."
usage
exit 1;
fi
if [ "x$nhist" == "x" ] ; then
echo "Must specify the number of histograms."
usage
exit 1;
fi
if [ "x$ndims" == "x" ] ; then
ndims=1
fi
if [ "x$nbins" == "x" ] ; then
nbins=100
fi
# make sure the script is compiled
echo '.L parallelMergeTest.C+' | root.exe -b -l
res=$?
if [ $res -ne 0 ] ; then
exit $res;
fi
echo '.L parallelMergeServer.C+' | root.exe -b -l
res=$?
if [ $res -ne 0 ] ; then
exit $res;
fi
root.exe -b -l -q $ROOTSYS/tutorials/net/parallelMergeServer.C+ &
res=$?
if [ $res -ne 0 ] ; then
exit $res;
fi
# give sometimes to start
sleep 2
if type seq > /dev/null 2>&1 ; then
sequence=`seq ${nprocess}`
elif type jot > /dev/null 2>&1 ; then
sequence=`jot ${nprocess} 1`
else
echo "Neither seq nor jot is available, we can't count"
exit 1
fi
for index in ${sequence}
do
root.exe -b -l -q "parallelMergeTest.C+($nhist,$ndims,$nbins)" & # > output.$index &
done
wait