forked from lcorcodilos/BstarToTW_CMSDAS2020
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import subprocess | ||
from optparse import OptionParser | ||
import time | ||
|
||
|
||
parser = OptionParser() | ||
|
||
parser.add_option('-r', '--runscript', metavar='FILE', type='string', action='store', | ||
default = '', | ||
dest = 'runscript', | ||
help = 'Run template to use') | ||
parser.add_option('-i', '--inputs', metavar='FILE', type='string', action='store', | ||
default = '', | ||
dest = 'inputs', | ||
help = 'Inputs to send along') | ||
parser.add_option('-a', '--args', metavar='FILE', type='string', action='store', | ||
default = '', | ||
dest = 'args', | ||
help = 'Text file with python arguments') | ||
|
||
|
||
(options, args) = parser.parse_args() | ||
|
||
commands = [] | ||
|
||
print(options.args) | ||
|
||
# Tar stuff | ||
if options.inputs != '': | ||
commands.append("tar czvf tarball.tgz "+options.inputs) | ||
|
||
# Make JDL from template | ||
timestr = time.strftime("%Y%m%d-%H%M%S") | ||
out_jdl = 'temp_'+timestr+'_jdl' | ||
commands.append("sed 's$TEMPSCRIPT$"+options.runscript+"$g' $CMSSW_BASE/src/BstarToTW_CMSDAS2020/condor/templates/jdl_template > "+out_jdl) | ||
commands.append("sed -i 's$TEMPARGS$"+options.args+"$g' "+out_jdl) | ||
commands.append("condor_submit "+out_jdl+" -debugfile condor_submit_debug.log") | ||
commands.append("mv "+out_jdl+" condor/logs/") | ||
|
||
for s in commands: | ||
print(s) | ||
subprocess.call([s],shell=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
### Setup CMSSW environment: | ||
``` | ||
ssh -XY [email protected] | ||
cexport $SCRAM_ARCH=slc7_amd64_gcc820 | ||
export $SCRAM_ARCH=slc7_amd64_gcc820 | ||
cd nobackup/ | ||
mkdir b2g_exercise/ | ||
cd b2g_exercise/ | ||
|
@@ -52,3 +52,15 @@ cd ../BstarToTW_CMSDAS2020 | |
git fetch --all | ||
git pull origin master | ||
``` | ||
|
||
## Submitting jobs | ||
|
||
Testing one | ||
``` | ||
python CondorHelper.py -r condor/run_bstar.sh -a test_args.txt -i "bs_select.py bstar.cc bstar_config.json helpers.py" | ||
``` | ||
|
||
For 2016: | ||
``` | ||
python CondorHelper.py -r condor/run_bstar.sh -a all_args.txt -i "bs_select.py bstar.cc bstar_config.json helpers.py" | ||
``` |