-
Notifications
You must be signed in to change notification settings - Fork 2
/
abe.sh
66 lines (55 loc) · 1.66 KB
/
abe.sh
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
#!/bin/bash
MPI=mpirun
No_Pro=$(awk -F "=" '/no_of_cores/ {print $2}' abe.ini )
OUTPUT="RunStatus"
if [ -d "$OUTPUT" ]; then
rm -r "$OUTPUT"
fi
mkdir -p "$OUTPUT"
START=$(date +%s)
echo "Running initial settings"
python initial.py &>> "$OUTPUT/initial.txt"
if [ $? != 0 ]; then
echo " Error while running initial.py; check Runstatus"
exit 1
fi
echo "Running CatalogMaker"
No_Pro_cm=$(awk -F "=" '/pro_cm/ {print $2}' abe.ini)
$MPI -n $No_Pro_cm python CatalogMaker_MPI.py &>> "$OUTPUT/CatalogMaker.txt"
if [ $? != 0 ]; then
echo " Error while running CatalogMaker_MPI.py; check Runstatus"
exit 1
fi
echo "Running Data Combainer"
python Combiner.py &>> "$OUTPUT/Combainer.txt"
if [ $? != 0 ]; then
echo " Error while running Combiner.py; check Runstatus"
exit 1
fi
echo "Running CatalogAnalyser"
$MPI -n $No_Pro python CatalogAnalyser_MPI.py &>> "$OUTPUT/CatalogAnalyser.txt"
if [ $? != 0 ]; then
echo " Error while running CatalogAnalyser_MPI.py; check Runstatus"
exit 1
fi
echo "Running Data Editor"
python DataEditor.py &>> "$OUTPUT/DataEditor.txt"
if [ $? != 0 ]; then
echo " Error while running DataEditor.py; check Runstatus"
exit 1
fi
echo "Running Data Analyser"
$MPI -n $No_Pro python DataAnalysis_MPI.py &>> "$OUTPUT/DataAnalyser.txt"
if [ $? != 0 ]; then
echo " Error while running DataAnalysis_MPI.py; check Runstatus"
exit 1
fi
echo "Running Luminosity dump combainer"
python Combiner.py lum &>> "$OUTPUT/luminosity.txt"
if [ $? != 0 ]; then
echo " Error while running Combiner.py(luminosity); check Runstatus"
exit 1
fi
END=$(date +%s)
DIFF=$(( $END - $START ))
printf 'ABE tooks %dh:%dm:%ds to complete the analysis\n' $(($DIFF/3600)) $(($DIFF%3600/60)) $(($DIFF%60))