Back to home page

Project CMSSW displayed by LXR

 
 

    


Warning, /CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/data/EcnaSystemScriptSubmit is written in an unsupported language. File is not indexed.

0001 # --------------------------------------------- EcnaSystemScriptSubmit --------------------------------
0002 #
0003 #    Script for ECNA job submission with:
0004 #     CMSSW version, subsystem, .py file name and queue as arguments
0005 #
0006 #    Syntax of call:   csh EcnaSystemScriptSubmit CMSSW_BASE SUB_SYSTEM PYTHON_FILE QUEUE
0007 #
0008 #    Example of call:  csh EcnaSystemScriptSubmit CMSSW_1_8_0 CalibCalorimetry ECNA_MWGR_80896.py 1nh
0009 #
0010 #    Update: 03/03/11
0011 #    
0012 #------------------------------------------------------------------------------------------------------
0013 
0014 echo "*EcnaSystemScriptSubmit> Script for ECNA job submission started."
0015 
0016 pwd
0017 set localdir = $PWD
0018 set userdir  = $HOME
0019 
0020 #------------------------- Build each line of the script in tempo files
0021  cd ${localdir}
0022 
0023  if( -f cna_one_line_tempo_1 ) then
0024   \rm cna_one_line_tempo_1
0025  endif
0026 # echo "cd ${userdir}/cmssw/${1}" > cna_one_line_tempo_1
0027  echo "cd ${1}" > cna_one_line_tempo_1
0028 
0029  if( -f cna_one_line_tempo_2 ) then
0030   \rm cna_one_line_tempo_2
0031  endif
0032  echo eval \`scramv1 runtime -sh\` > cna_one_line_tempo_2
0033 
0034  if( -f cna_one_line_tempo_3 ) then
0035   \rm cna_one_line_tempo_3
0036  endif
0037  #echo "cd ${userdir}/scratch0/ecna/results_root" > cna_one_line_tempo_3
0038  if( -f cna_one_line_tempo_3b ) then
0039   \rm cna_one_line_tempo_3b
0040  endif
0041  echo "cd \" > cna_one_line_tempo_3b
0042  cat cna_one_line_tempo_3b ${userdir}/ECNA/path_results_root > cna_one_line_tempo_3
0043  
0044  if( -f cna_one_line_tempo_4 ) then
0045   \rm cna_one_line_tempo_4
0046  endif
0047 #------------> add extension .py to ${3} to have complete python file name in the script
0048 # echo "cmsRun ${userdir}/cmssw/${1}/src/${2}/EcalCorrelatedNoiseAnalysisModules/data/${3}.py" > cna_one_line_tempo_4
0049  echo "cmsRun ${1}/src/${2}/EcalCorrelatedNoiseAnalysisModules/data/${3}.py" > cna_one_line_tempo_4
0050 
0051 #------------------------- Remove old script (named SubmissionScriptFromPythonFile_${3})
0052 #                          if it exists and build the new script with cat command
0053  if ( -f SubmissionScriptFromPythonFile_${3} ) then
0054   \rm SubmissionScriptFromPythonFile_${3}
0055  endif
0056 
0057  cat cna_one_line_tempo_1 cna_one_line_tempo_2 cna_one_line_tempo_3 cna_one_line_tempo_4 > SubmissionScriptFromPythonFile_${3}
0058 
0059 #------------------------- Right for execution
0060  chmod u+x SubmissionScriptFromPythonFile_${3}
0061 
0062 #.......... Submit the job with script SubmissionScriptFromPythonFile_${3}
0063  echo "*EcnaSystemScriptSubmit> Submitting the job on queue ${4} with script SubmissionScriptFromPythonFile_${3}"
0064  echo " "
0065  bsub -q ${4} SubmissionScriptFromPythonFile_${3}
0066  echo " "
0067 
0068 #------------------------- Flag files: EcnaSubmissionFlagFile and EcnaLSFJobReportFlagFile
0069 #.......... remove the flag file EcnaSubmissionFlagFile if it exists and build a new flag file
0070  if( -f EcnaSubmissionFlagFile ) then
0071   \rm EcnaSubmissionFlagFile
0072  endif
0073  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
0074 
0075 #.......... remove the flag file EcnaLSFJobReportFlagFile if it exists and build a new flag file
0076  if( -f EcnaLSFJobReportFlagFile ) then
0077   \rm EcnaLSFJobReportFlagFile
0078  endif
0079  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
0080 
0081 #------------------------- Remove the tempo files
0082  \rm cna_one_line_tempo_1
0083  \rm cna_one_line_tempo_2
0084  \rm cna_one_line_tempo_3
0085  \rm cna_one_line_tempo_3b
0086  \rm cna_one_line_tempo_4
0087 
0088 #..........the submission script must not be removed here but AFTER the job execution
0089 #          (directly or with option Clean in TCnaGui)
0090 # NOT TO BE DONE HERE: \rm SubmissionScriptFromPythonFile_${3}
0091 
0092 echo "*EcnaSystemScriptSubmit> End of execution."