From a74acd7be35c08ce9468eab3085741e6ea79f609 Mon Sep 17 00:00:00 2001 From: amassiro Date: Tue, 30 Jun 2020 15:47:04 +0200 Subject: [PATCH 1/2] i/o test for scan --- scan | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scan b/scan index 4775b6d..5440663 100755 --- a/scan +++ b/scan @@ -2,6 +2,7 @@ import sys import os +import copy from multirun import * @@ -34,9 +35,11 @@ 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 @@ -47,6 +50,16 @@ if __name__ == "__main__": # print a system overview info() + if run_io_benchmark : + print 'Benchmarking only I/O' + print ' NB: your config file will not be run, just I/O test will be' + 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 + # save scan results to 'scan.csv' options['data'] = open('scan.csv', 'w', 1) options['header'] = True @@ -75,7 +88,10 @@ if __name__ == "__main__": step_opt['jobs'] = options['jobs'] if options['jobs'] is not None else (count + step - 1) // step # run - multiCmsRun(process, **step_opt) + if run_io_benchmark : + multiCmsRun(io, **step_opt) + else : + multiCmsRun(process, **step_opt) # warm up only once step_opt['warmup'] = False From b972a304844d455a2d5352fbf83eb4b77ba69b2e Mon Sep 17 00:00:00 2001 From: amassiro Date: Tue, 14 Jul 2020 10:29:10 +0200 Subject: [PATCH 2/2] add i/o in parallel: default false --- scan | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/scan b/scan index 5440663..bbbb76d 100755 --- a/scan +++ b/scan @@ -25,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 @@ -42,7 +42,7 @@ if __name__ == "__main__": # 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 ############################################################################## @@ -52,7 +52,6 @@ if __name__ == "__main__": if run_io_benchmark : print 'Benchmarking only I/O' - print ' NB: your config file will not be run, just I/O test will be' io = copy.deepcopy(process) io.hltGetRaw = cms.EDAnalyzer("HLTGetRaw", RawDataCollection = cms.InputTag("rawDataCollector")) io.path = cms.Path(io.hltGetRaw) @@ -81,6 +80,10 @@ 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 @@ -89,9 +92,16 @@ if __name__ == "__main__": # run if run_io_benchmark : - multiCmsRun(io, **step_opt) - else : - multiCmsRun(process, **step_opt) + 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 step_opt['warmup'] = False