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

i/o test for scan #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
32 changes: 29 additions & 3 deletions scan
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import sys
import os
import copy

from multirun import *

Expand All @@ -24,7 +25,7 @@ if __name__ == "__main__":
'verbose' : False,
'plumbing' : False,
'warmup' : True,
'events' : 4200,
'events' : 4100,
'repeats' : 4,
'jobs' : 1, # if None, set the number of jobs to fill all available CPUs
'threads' : None, # if None, overridden by the scan
Expand All @@ -34,19 +35,30 @@ if __name__ == "__main__":
'set_cpu_affinity' : True,
'set_gpu_affinity' : True,
'logdir' : None, # relative or absolute path, or None to disable storing the logs
'keep' : [] # list of files produced by the jobs to be kept (requires logdir)
'keep' : [], # list of files produced by the jobs to be kept (requires logdir)
}

run_io_benchmark = False # run i/o benchmark

# options specific to scan
steps = None # list, or None to make a linear scan from min_step to max_step
min_step = 4 # minimum is 1
min_step = 6 # minimum is 1
max_step = 12 # None to guess based on the number of available cores (or threads) and concurrent jobs

##############################################################################

# print a system overview
info()

if run_io_benchmark :
print 'Benchmarking only I/O'
io = copy.deepcopy(process)
io.hltGetRaw = cms.EDAnalyzer("HLTGetRaw", RawDataCollection = cms.InputTag("rawDataCollector"))
io.path = cms.Path(io.hltGetRaw)
io.schedule = cms.Schedule(io.path)
if 'PrescaleService' in io.__dict__:
del io.PrescaleService

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you move this further down (after the options are defined) ?

# save scan results to 'scan.csv'
options['data'] = open('scan.csv', 'w', 1)
options['header'] = True
Expand All @@ -68,13 +80,27 @@ if __name__ == "__main__":
# make a copy of the options to be updated during the scan
step_opt = dict(options)

options['data'] = open('scan_io.csv', 'w', 1)
step_opt_io = dict(options)


for step in steps:
# update the options for each step
step_opt['threads'] = options['threads'] if options['threads'] is not None else step
step_opt['streams'] = options['streams'] if options['streams'] is not None else step
step_opt['jobs'] = options['jobs'] if options['jobs'] is not None else (count + step - 1) // step

# run
if run_io_benchmark :
print ">>> running I/O <<<"
# update the options for each step
step_opt_io['threads'] = options['threads'] if options['threads'] is not None else step
step_opt_io['streams'] = options['streams'] if options['streams'] is not None else step
step_opt_io['jobs'] = options['jobs'] if options['jobs'] is not None else (count + step - 1) // step
# run
multiCmsRun(io, **step_opt_io)
print ">>> running config <<<"

multiCmsRun(process, **step_opt)

# warm up only once
Expand Down