3
# This runs a quick survey over all of the processes to determine
4
# which channels in each process are important. This must be run
5
# before you call integrate since it sets up important information
6
# about each process. Must be run from main directory or bin directory
8
# Usage: survey compression parallel [name]
10
# parallel is 0 for serial, 1 for PBS, 2 for multicore
11
# name is queue name for PBS or number of cores for multicore
13
# First we need to get into the main directory
15
if [[ ! -d ./bin ]]; then
17
if [[ ! -d ./bin ]]; then
18
echo "Error: survey must be executed from the main, or bin directory"
23
# Now let shell know where to find important executables
27
# Begin Local versions
28
# set dirbin = /home/tstelzer/bin/MG_ME
32
if [[ "$1" == "" ]]; then
33
echo 'Enter 2 for multi-core, 1 for parallel, 0 for serial run'
38
if [[ $mode -gt 0 ]]; then
39
if [[ "$2" == "" ]]; then
40
if [[ $mode -eq 1 ]]; then
41
echo 'Enter name for jobs on pbs queue'
42
elif [[ $mode -eq 2 ]]; then
43
echo 'Enter number of cores'
51
# check makefile version
52
c=`awk '/^[^#].*=.*pdlabel/{print $1}' Cards/run_card.dat`
53
if [[ $c == "'lhapdf'" ]]; then
54
echo Using LHAPDF interface!
55
if [[ -e $main/Source/makefile_default ]]; then
58
cp $main/Source/makefile $main/Source/makefile_default
59
cp $main/Source/PDF/makefile $main/Source/PDF/makefile_default
60
cp $main/Source/DHELAS/Makefile $main/Source/DHELAS/Makefile_default
61
cp $main/Source/MODEL/makefile $main/Source/MODEL/makefile_default
62
cp $main/Source/CERNLIB/makefile $main/Source/CERNLIB/makefile_default
63
cp $main/SubProcesses/makefile $main/SubProcesses/makefile_default
64
cp $main/SubProcesses/makefile_mo $main/SubProcesses/makefile_mo_default
65
cp $main/Source/makefile_lhapdf $main/Source/makefile
66
cp $main/Source/PDF/makefile_lhapdf $main/Source/PDF/makefile
67
cp $main/SubProcesses/makefile_lhapdf $main/SubProcesses/makefile
68
cp $main/SubProcesses/makefile_mo_lhapdf $main/SubProcesses/makefile_mo
69
sed -i.bak "s|f77|gfortran|g" $main/Source/DHELAS/Makefile
70
sed -i.bak "s|f77|gfortran|g" $main/Source/MODEL/makefile
71
sed -i.bak "s|f77|gfortran|g" $main/Source/CERNLIB/makefile
72
# cp $lhadir/lib/libLHAPDF.a $main/lib/.
75
if [[ -e $main/Source/makefile_default ]]; then
76
mv Source/makefile_default Source/makefile
77
mv Source/PDF/makefile_default Source/PDF/makefile
78
mv Source/DHELAS/Makefile_default Source/DHELAS/Makefile
79
mv Source/MODEL/makefile_default Source/MODEL/makefile
80
mv Source/CERNLIB/makefile_default Source/CERNLIB/makefile
81
mv SubProcesses/makefile_default SubProcesses/makefile
85
echo "Compiling libraries"
86
if [[ -d Source ]]; then
87
echo "Compiling Libraries" >& status
89
make ../bin/sum_html >/dev/null
93
echo 'Error Source directory not found'
96
if [[ -d SubProcesses ]]; then
97
if [[ $mode -gt 0 ]]; then
98
echo "Creating Jobs" >& status
104
if [[ -e randinit ]]; then
107
for i in `cat subproc.mg` ; do
110
# echo "Using random number seed offset = " $r
111
echo "r=$r" >& randinit
112
echo "Working on subprocess:"
113
for i in `cat subproc.mg` ; do
116
rm -f ajob* >& /dev/null
117
rm -f wait.ajob* >& /dev/null
118
rm -f run.ajob* >& /dev/null
119
rm -f done.ajob* >& /dev/null
120
make gensym > /dev/null
121
./gensym >& gensym.log
123
make madevent > /dev/null
124
for job in ajob* ; do
126
if [[ $mode == 1 ]]; then
127
$qsub -N $n $job >> ../../running_jobs
128
elif [[ $mode == 2 ]]; then
129
../../bin/multicore $n $job
132
time nice ./$job >/dev/null
133
../../bin/sum_html >/dev/null
137
if [[ $mode == 0 ]]; then
141
if [[ $mode -ge 1 ]]; then
147
echo "Error could not find SubProcesses"
150
$dirbin/gen_crossxhtml-pl $3