Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cmsDriver option --maxmem_profile to prefix LD_PRELOAD="libPerfToolsAllocMonitorPreload.so libPerfToolsMaxMemoryPreload.so" to cmsRun #44001

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Configuration/Applications/python/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,12 @@
type=str,
dest="heap_profile")

expertSettings.add_argument("--maxmem_profile",
help="add the PerfTools/MaxMemoryPreload Service",
gartung marked this conversation as resolved.
Show resolved Hide resolved
default=None,
type=str,
gartung marked this conversation as resolved.
Show resolved Hide resolved
dest="maxmem_profile")

expertSettings.add_argument("--io",
help="Create a json file with io informations",
default=None,
Expand Down
26 changes: 16 additions & 10 deletions Configuration/Applications/python/cmsDriverOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def checkModifier(era):

def checkOptions():
return

def adaptOptions():
return

Expand All @@ -34,7 +34,7 @@ def OptionsFromCommand(command):
def OptionsFromCommandLine():
import sys
options=OptionsFromItems(sys.argv[1:])
# memorize the command line arguments
# memorize the command line arguments
options.arguments = reduce(lambda x, y: x+' '+y, sys.argv[1:])
return options

Expand All @@ -60,8 +60,8 @@ def OptionsFromItems(items):
if options.triggerResultsProcess == None and "ALCAOUTPUT" in options.step:
print("ERROR: If ALCA splitting is requested, the name of the process in which the alca producers ran needs to be specified. E.g. via --triggerResultsProcess RECO")
sys.exit(1)
if not options.evt_type:

if not options.evt_type:
options.evt_type=sys.argv[1]

#now adjust the given parameters before passing it to the ConfigBuilder
Expand Down Expand Up @@ -123,15 +123,15 @@ def OptionsFromItems(items):

# add on the end of job sequence...
addEndJob = True
if ("FASTSIM" in options.step and not "VALIDATION" in options.step) or "HARVESTING" in options.step or "ALCAHARVEST" in options.step or "ALCAOUTPUT" in options.step or options.step == "":
if ("FASTSIM" in options.step and not "VALIDATION" in options.step) or "HARVESTING" in options.step or "ALCAHARVEST" in options.step or "ALCAOUTPUT" in options.step or options.step == "":
addEndJob = False
if ("SKIM" in options.step and not "RECO" in options.step):
addEndJob = False
if ("ENDJOB" in options.step):
addEndJob = False
if ('DQMIO' in options.datatier):
addEndJob = False
if addEndJob:
if addEndJob:
options.step=options.step+',ENDJOB'


Expand Down Expand Up @@ -180,7 +180,7 @@ def OptionsFromItems(items):
options.name = 'RESIM'
elif 'reDIGI' in options.trimmedStep:
options.name = 'REDIGI'
elif 'HLT' in options.trimmedStep:
elif 'HLT' in options.trimmedStep:
options.name = 'HLT'
elif 'RECO' in options.trimmedStep:
options.name = 'RECO'
Expand Down Expand Up @@ -244,13 +244,19 @@ def OptionsFromItems(items):
raise Exception("Not a valid profiler type %s. Alternatives are pp, mp, fp=<function>."%(profilerType))

options.prefix = "igprof -t cmsRun -%s" % profilerType

if options.heap_profile:
if options.profile and options.prefix:
if options.heap_profile and options.prefix:
gartung marked this conversation as resolved.
Show resolved Hide resolved
raise Exception("--heap_profile and --prefix are incompatible")
profilerType = 'pp'
options.prefix = "MALLOC_CONF=prof:true,prof_accum:true,prof_prefix:jeprof.out cmsRunJE "

if options.maxmem_profile:
if options.maxmem_profile and and options.prefix:
gartung marked this conversation as resolved.
Show resolved Hide resolved
raise Exception("--maxmem_profile and --prefix are incompatible")
options.prefix = 'LD_PRELOAD="libPerfToolsAllocMonitorPreload.so libPerfToolsMaxMemoryPreload.so" cmsRun '


# If an "era" argument was supplied make sure it is one of the valid possibilities
if options.era :
from Configuration.StandardSequences.Eras import eras
Expand All @@ -262,7 +268,7 @@ def OptionsFromItems(items):
validOptions="" # Create a stringified list of valid options to print to the user
for key in eras.__dict__ :
if checkModifier(eras.__dict__[key]):
if validOptions!="" : validOptions+=", "
if validOptions!="" : validOptions+=", "
validOptions+="'"+key+"'"
raise Exception( "'%s' is not a valid option for '--era'. Valid options are %s." % (eraName, validOptions) )
# If the "--fast" option was supplied automatically enable the fastSim era
Expand Down