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
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# --------------------------------------------- EcnaSystemScriptSubmit --------------------------------
#
# Script for ECNA job submission with:
# CMSSW version, subsystem, .py file name and queue as arguments
#
# Syntax of call: csh EcnaSystemScriptSubmit CMSSW_BASE SUB_SYSTEM PYTHON_FILE QUEUE
#
# Example of call: csh EcnaSystemScriptSubmit CMSSW_1_8_0 CalibCalorimetry ECNA_MWGR_80896.py 1nh
#
# Update: 03/03/11
#
#------------------------------------------------------------------------------------------------------
echo "*EcnaSystemScriptSubmit> Script for ECNA job submission started."
pwd
set localdir = $PWD
set userdir = $HOME
#------------------------- Build each line of the script in tempo files
cd ${localdir}
if( -f cna_one_line_tempo_1 ) then
\rm cna_one_line_tempo_1
endif
# echo "cd ${userdir}/cmssw/${1}" > cna_one_line_tempo_1
echo "cd ${1}" > cna_one_line_tempo_1
if( -f cna_one_line_tempo_2 ) then
\rm cna_one_line_tempo_2
endif
echo eval \`scramv1 runtime -sh\` > cna_one_line_tempo_2
if( -f cna_one_line_tempo_3 ) then
\rm cna_one_line_tempo_3
endif
#echo "cd ${userdir}/scratch0/ecna/results_root" > cna_one_line_tempo_3
if( -f cna_one_line_tempo_3b ) then
\rm cna_one_line_tempo_3b
endif
echo "cd \" > cna_one_line_tempo_3b
cat cna_one_line_tempo_3b ${userdir}/ECNA/path_results_root > cna_one_line_tempo_3
if( -f cna_one_line_tempo_4 ) then
\rm cna_one_line_tempo_4
endif
#------------> add extension .py to ${3} to have complete python file name in the script
# echo "cmsRun ${userdir}/cmssw/${1}/src/${2}/EcalCorrelatedNoiseAnalysisModules/data/${3}.py" > cna_one_line_tempo_4
echo "cmsRun ${1}/src/${2}/EcalCorrelatedNoiseAnalysisModules/data/${3}.py" > cna_one_line_tempo_4
#------------------------- Remove old script (named SubmissionScriptFromPythonFile_${3})
# if it exists and build the new script with cat command
if ( -f SubmissionScriptFromPythonFile_${3} ) then
\rm SubmissionScriptFromPythonFile_${3}
endif
cat cna_one_line_tempo_1 cna_one_line_tempo_2 cna_one_line_tempo_3 cna_one_line_tempo_4 > SubmissionScriptFromPythonFile_${3}
#------------------------- Right for execution
chmod u+x SubmissionScriptFromPythonFile_${3}
#.......... Submit the job with script SubmissionScriptFromPythonFile_${3}
echo "*EcnaSystemScriptSubmit> Submitting the job on queue ${4} with script SubmissionScriptFromPythonFile_${3}"
echo " "
bsub -q ${4} SubmissionScriptFromPythonFile_${3}
echo " "
#------------------------- Flag files: EcnaSubmissionFlagFile and EcnaLSFJobReportFlagFile
#.......... remove the flag file EcnaSubmissionFlagFile if it exists and build a new flag file
if( -f EcnaSubmissionFlagFile ) then
\rm EcnaSubmissionFlagFile
endif
echo "Flag file for ECNA submission script management. Used by TCnaGui. Can be removed by user (with option Clean in TCnaGui or directly) ONLY AFTER all submitted jobs have been finished." > EcnaSubmissionFlagFile
#.......... remove the flag file EcnaLSFJobReportFlagFile if it exists and build a new flag file
if( -f EcnaLSFJobReportFlagFile ) then
\rm EcnaLSFJobReportFlagFile
endif
echo "Flag file for ECNA LSFJOB report management. Used by TCnaGui. Can be removed by user (with option Clean in TCnaGui or directly) ONLY AFTER all submitted jobs have been finished." > EcnaLSFJobReportFlagFile
#------------------------- Remove the tempo files
\rm cna_one_line_tempo_1
\rm cna_one_line_tempo_2
\rm cna_one_line_tempo_3
\rm cna_one_line_tempo_3b
\rm cna_one_line_tempo_4
#..........the submission script must not be removed here but AFTER the job execution
# (directly or with option Clean in TCnaGui)
# NOT TO BE DONE HERE: \rm SubmissionScriptFromPythonFile_${3}
echo "*EcnaSystemScriptSubmit> End of execution."
|