dmwm / CRAB2

CRAB2
2 stars 11 forks source link

Weird interaction with CRAB2 and CMSSW's option parsing #926

Closed ericvaandering closed 10 years ago

ericvaandering commented 10 years ago

Original Savannah ticket 102552 reported by belforte on Tue Sep 10 15:30:41 2013.

see https://hypernews.cern.ch/HyperNews/CMS/get/crabDevelopment/1683.html

A few times, I've noticed that the option parsing with CRAB2 clashes with CMSSW's option parsing, which leads to a pset blowing up with a really obscure error message (it just throws invalid option and no traceback, which is unhelpful)

Basically, CRAB does a sys.argv.split(' ') and then passes that into the pset. Unfortunately, when that happens, if there are two spaces in the pycfg_params, it will end up passing '' as one of the arguments and CMSSW chokes on it.

I'd recommend changing that one line in cms_cmssw.py to:

sys.argv.extend( [ x for x in pycfg_params.split(' ') if x ] )

Which will only pass non-null, non-empty strings down to CMSSW. This is closer to the behavior from the command line

Cheers, Andrew

ericvaandering commented 10 years ago

Comment by belforte on Wed Sep 11 08:00:12 2013

OK, it appears harmless, so I have done the change: /local/reps/CMSSW/COMP/CRAB/python/cms_cmssw.py,v <-- cms_cmssw.py new revision: 1.400; previous revision: 1.399

by the way the crab help for this http://cmsdoc.cern.ch/cms/ccs/wm/www/Crab/Docs/crab-online-manual.html#pycfg_params__ points to a twiki page https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideAboutPythonConfigFile#Passing_Command_Line_Arguments_T which was moved to CMSPublic.

fixed: /local/reps/CMSSW/COMP/CRAB/python/crab_help.py,v <-- crab_help.py new revision: 1.182; previous revision: 1.181

belforte commented 10 years ago

released in CRAB_2_9_1