-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript_psc.sh
More file actions
executable file
·81 lines (64 loc) · 2.44 KB
/
script_psc.sh
File metadata and controls
executable file
·81 lines (64 loc) · 2.44 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
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
#
# This should be placed in the "launch" directory in the PSC
# work directory used for the job. e.g.
#
# /home/davidl/work/2019.07.25.swif2_test
#
# This script will wake up in the singularity container in the
# job directory created by swif2. GlueX software is available via CVMFS.
#
# Arguments:
#
# arg 1: JANA config file
# arg 2: sim-recon version
# arg 3: run <--+ run and file number used to name job_info
# arg 4: file <--+ directory only.
JANA_CONFIG=$1
HALLD_RECON_VERSION=$2
RUN=$3
FILE=$4
ulimit -c unlimited
# Setup environment for the specified sim-recon version
setenv_file=/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/${HALLD_RECON_VERSION}/Linux_CentOS7-x86_64-gcc4.8.5-cntr/setenv.sh
source $setenv_file
# Use CCDB and RCDB from CVMFS. Make a temporary local
# copy so that we don't interfere with other jobs locking
# the same file
cp /group/halld/www/halldweb/html/dist/ccdb.sqlite .
cp /group/halld/www/halldweb/html/dist/rcdb.sqlite .
export JANA_CALIB_URL=sqlite:///${PWD}/ccdb.sqlite
export CCDB_CONNECTION=$JANA_CALIB_URL
export RCDB_CONNECTION=sqlite:///${PWD}/rcdb.sqlite
# Use JANA_RESOURCE_DIR from CVMFS
export JANA_RESOURCE_DIR=/group/halld/www/halldweb/html/resources
# Record some info about the node and environment
rm -f top.out
top -b -n 1 > top.out
rm -f cpuinfo.out
cat /proc/cpuinfo > cpuinfo.out
rm -f env.out
env > env.out
rm -f hostname.out
hostname > hostname.out
# Run script in background that will send abort signal after 8.5 hours
#/launch/assassin.sh &> assassin.out &
# Run hd_root
hd_root --config=${JANA_CONFIG} hd_rawdata_??????_???.evio 2> std.err 1> std.out
# Move small files into a directory and make a tarball
JOB_INFO=$(printf "job_info_%06d_%03d" $RUN $FILE)
mkdir $JOB_INFO
mv top.out cpuinfo.out env.out hostname.out std.err std.out $JOB_INFO
tar czf ${JOB_INFO}.tgz $JOB_INFO
rm -rf $JOB_INFO
# The converted_random.hddm file may or may not exist, depending on
# whether the file had random trigger events in it. In order for
# swif2 to copy it if it does, but ignore it if not, we have to use
# the "match:" feature. This requires the destination be a directory.
# Thus, we need to rename the file here to it's final name since swif2
# won't rename it while copying it.
if [ -f converted_random.hddm ]; then
mv converted_random.hddm $(printf "converted_random_%06d_%03d.hddm" $RUN $FILE)
fi
# Remove ccdb.sqlite and rcdb.sqlite files
rm -f ccdb.sqlite rcdb.sqlite