1 |
#! /bin/bash |
2 |
|
3 |
CAT="/bin/cat" |
4 |
SED="/bin/sed" |
5 |
RM="/bin/rm" |
6 |
QSUB="/sge-root/bin/lx24-x86/qsub" |
7 |
SEQ="/usr/bin/seq" |
8 |
|
9 |
PIN_DIR="${PWD}/pin" |
10 |
POUT_DIR="${PWD}/pout" |
11 |
PERR_DIR="${PWD}/perr" |
12 |
|
13 |
SETPAMENV="/opt/vmc.sh" |
14 |
WORKDIR="${PWD}" |
15 |
INPUT_KINEMATICS="/home/nikonov/HE_SIM/points_logbins40/*" |
16 |
RUN_G4_SIM="${PWD}/run_sim_g4.C" |
17 |
|
18 |
script="${PWD}/run_single_job.sh" |
19 |
|
20 |
configmacro="g4Config.C" |
21 |
|
22 |
for i in ${INPUT_KINEMATICS} |
23 |
do |
24 |
prefix1="${i##/*/}" |
25 |
prefix="${prefix1%.*}" |
26 |
echo $prefix |
27 |
echo $i |
28 |
pin="${prefix}.in.txt" |
29 |
pin="${PIN_DIR}/${pin}" |
30 |
if [ -e $pin ]; then |
31 |
$RM -f $pin |
32 |
fi |
33 |
pout="${prefix}.out.txt" |
34 |
pout="${POUT_DIR}/${pout}" |
35 |
if [ -e $pout ]; then |
36 |
$RM -f $pout |
37 |
fi |
38 |
perr="${prefix}.err.txt" |
39 |
perr="${PERR_DIR}/${perr}" |
40 |
if [ -e $perr ]; then |
41 |
$RM -f $perr |
42 |
fi |
43 |
|
44 |
echo $SETPAMENV >> $pin |
45 |
echo $RUN_G4_SIM >> $pin |
46 |
echo $configmacro >> $pin |
47 |
echo $i >> $pin |
48 |
|
49 |
$QSUB -wd $WORKDIR -e $perr -i $pin -o $pout $script |
50 |
done |
51 |
exit 0 |