-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrun
executable file
·78 lines (67 loc) · 1.8 KB
/
run
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
#!/bin/bash
#---------------------------------------------------------------------------------------------------
#
# Script to debug functionality of the workernode.
#
#---------------------------------------------------------------------------------------------------
# show the executing script
echo ""; echo " ## Executing"
echo $0
#echo Directory: `dirname $0`
#cd `dirname $0`
# show the arguments
echo ""; echo " ## Arguments"
echo $@
jobid=$1
# show the directory
echo ""; echo " ## Directory"
pwd
echo ""
ls -lhrt
# show the directory
echo ""; echo " ## Me?"
id
echo ""
# show cvmfs
echo ""; echo " ## List root (/)"
ls -l /
echo ""; echo " ## Load CMS default setup"
ls -lhrt /cvmfs/cms.cern.ch/cmsset_default.sh
source /cvmfs/cms.cern.ch/cmsset_default.sh
# show singularity
echo ""; echo " ## Singularity"
which singularity
if [ ".$?" == ".0" ]
then
singularity --version
else
echo " ERROR - singularity not found"
fi
# now let's do what we came for
echo ""; echo " ## Flags: cat /proc/cpuinfo | grep flags | sort -u"
flags=`cat /proc/cpuinfo | grep flags | sort -u`
host=`hostname`
echo " $host: $flags"
# show my running environment
echo ""; echo " ## Environment"
env | sort -u
## now sleep to make those queue busy
#echo ""; echo " ## Sleep 20"
#sleep 20
# check whether conditions are met to create the output file
if [ -e "Public.tgz" ]
then
tar fzx Public.tgz
ls -lhrt
echo "All looks good!" > debug_${jobid}.result
echo "All looks good!"
ls -lhrt
input_file=`cat input_file.list | sed -n "${jobid}p"`
export X509_USER_PROXY=`echo ./x509up_*`
echo xrdcp root://t3serv017.mit.edu/$input_file /tmp/`basename $input_file`
xrdcp root://t3serv017.mit.edu/$input_file /tmp/`basename $input_file`
echo " RC: $?"
rm -f /tmp/`basename $input_file`
else
echo " ERROR -- this job failed"
fi