diff --git a/crab/utils/submit_mem.py b/crab/utils/submit_mem_desy.py similarity index 92% rename from crab/utils/submit_mem.py rename to crab/utils/submit_mem_desy.py index 027880a649deb06afc9cae884de7c38c324c0c61..865527195e41e759e2823edc3cadd84b941bb456 100755 --- a/crab/utils/submit_mem.py +++ b/crab/utils/submit_mem_desy.py @@ -76,6 +76,9 @@ if __name__ == '__main__': parser.add_argument('-e', '--era', dest='era', choices=['2016', '2017', '2018'], required=True, action='store', default=None, help='name of Run-2 era') + parser.add_argument('--T2-prefix', dest='tier2_prefix', required=False, action='store', default='/pnfs/desy.de/cms/tier2', + help='path on target Tier-2 preceding store/ directory') + parser.add_argument('--no-submit', dest='no_submit', action='store_true', default=False, help='do not submit crab3 tasks') @@ -90,6 +93,9 @@ if __name__ == '__main__': log_prx = os.path.basename(__file__)+' -- ' + if len(opts_unknown) > 0: + KILL(log_prx+'unknown command-line arguments: '+str(opts_unknown)) + if not os.path.isdir(opts.input): KILL(log_prx+'invalid path to input directory [-i]: '+opts.input) @@ -98,18 +104,15 @@ if __name__ == '__main__': if os.path.exists(opts.storage): KILL(log_prx+'target path to Tier-2 storage directory for crab3 tasks already exists [-s]: '+opts.storage) - if not opts.storage.startswith('/pnfs/desy.de/cms/tier2/store/'): - KILL(log_prx+'invalid path to dCache directory on DESY Tier-2, does not start with \"/pnfs/desy.de/cms/tier2/store/\": '+opts.storage) + if not opts.storage.startswith(opts.tier2_prefix+'/store/'): + KILL(log_prx+'invalid path to Tier-2 storage area, does not start with \"'+opts.tier2_prefix+'/store/\": '+opts.storage) - STORE_DIR = os.path.abspath(os.path.realpath(opts.storage[len('/pnfs/desy.de/cms/tier2'):])) + STORE_DIR = os.path.abspath(os.path.realpath(opts.storage[len(opts.tier2_prefix):])) if 'CMSSW_BASE' not in os.environ: KILL(log_prx+'enviroment variable CMSSW_BASE is not defined, first set up a CMSSW area') which('crab') - - if len(opts_unknown) > 0: - KILL(log_prx+'unknown command-line arguments: '+str(opts_unknown)) ### ---- # configuration file @@ -163,7 +166,7 @@ if __name__ == '__main__': # crab task submission cmd_multicrab = 'python -B multicrab.py' cmd_multicrab += ' --out T2_DE_DESY' - cmd_multicrab += ' --samples samples_desy_'+opts.tag+'/*.txt.*' + cmd_multicrab += ' --samples '+cfg_file_name_woExt+'/*.txt.*' cmd_multicrab += ' --store '+STORE_DIR+'/outputs/' cmd_multicrab += ' --tag '+opts.tag cmd_multicrab += ' --no-submit'*opts.no_submit diff --git a/crab/utils/submit_mem_desy_driver.sh b/crab/utils/submit_mem_desy_driver.sh new file mode 100644 index 0000000000000000000000000000000000000000..7a0b732962d5a62bf205f72b7dec67687049ea65 --- /dev/null +++ b/crab/utils/submit_mem_desy_driver.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +voms-proxy-init --voms cms + +source /cvmfs/cms.cern.ch/crab3/crab.sh + +MEM_INPUTS= +TIER2_DIR= +PROD_TAG= + +for year in 2016 2017 2018; do + + ./utils/submit_mem_desy.py -i ${MEM_INPUTS}/${year} -s ${TIER2_DIR}/${PROD_TAG}_${year} -t ${PROD_TAG}_${year} -e ${year} # --no-submit + +done +unset -v year + +unset -v MEM_INPUTS TIER2_DIR PROD_TAG diff --git a/crab/utils/submit_mem_driver.sh b/crab/utils/submit_mem_driver.sh deleted file mode 100755 index 6a271d00175d902c01996c26b0f24f51bb98aba6..0000000000000000000000000000000000000000 --- a/crab/utils/submit_mem_driver.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -voms-proxy-init --voms cms - -source /cvmfs/cms.cern.ch/crab3/crab.sh - -MEM_INPUTS= -PNFS_DIR= -PROD_TAG= - -for year in 2016 2017 2018; do - - ./utils/submit_mem.py -i ${MEM_INPUTS}/${year} -s ${PNFS_DIR}/${PROD_TAG}_${year} -t ${PROD_TAG}_${year} -e ${year} # --no-submit - -done -unset -v year - -unset -v MEM_INPUTS PNFS_DIR PROD_TAG