Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:30

0001 import FWCore.ParameterSet.Config as cms
0002 from FWCore.ParameterSet.VarParsing import VarParsing
0003 
0004 options = VarParsing()
0005 options.register("moduleType","", VarParsing.multiplicity.singleton, VarParsing.varType.string)
0006 options.parseArguments()
0007 
0008 _allowedModuleTypes = ["Producer","Filter"]
0009 if options.moduleType not in ["Producer","Filter"]:
0010     raise ValueError("Unknown module type: {} (allowed: {})".format(options.moduleType,_allowedModuleTypes))
0011 _moduleName = "SonicDummy"+options.moduleType
0012 _moduleClass = getattr(cms,"ED"+options.moduleType)
0013 
0014 process = cms.Process("Test")
0015 
0016 process.source = cms.Source("EmptySource")
0017 
0018 process.maxEvents.input = 1
0019 
0020 process.options.numberOfThreads = 2
0021 process.options.numberOfStreams = 0
0022 
0023 process.dummySync = _moduleClass(_moduleName,
0024     input = cms.int32(1),
0025     Client = cms.PSet(
0026         mode = cms.string("Sync"),
0027         factor = cms.int32(-1),
0028         wait = cms.int32(10),
0029         allowedTries = cms.untracked.uint32(0),
0030         fails = cms.uint32(0),
0031     ),
0032 )
0033 
0034 process.dummyPseudoAsync = _moduleClass(_moduleName,
0035     input = cms.int32(2),
0036     Client = cms.PSet(
0037         mode = cms.string("PseudoAsync"),
0038         factor = cms.int32(2),
0039         wait = cms.int32(10),
0040         allowedTries = cms.untracked.uint32(0),
0041         fails = cms.uint32(0),
0042     ),
0043 )
0044 
0045 process.dummyAsync = _moduleClass(_moduleName,
0046     input = cms.int32(3),
0047     Client = cms.PSet(
0048         mode = cms.string("Async"),
0049         factor = cms.int32(5),
0050         wait = cms.int32(10),
0051         allowedTries = cms.untracked.uint32(0),
0052         fails = cms.uint32(0),
0053     ),
0054 )
0055 
0056 process.dummySyncRetry = process.dummySync.clone(
0057     Client = dict(
0058         wait = 2,
0059         allowedTries = 2,
0060         fails = 1,
0061     )
0062 )
0063 
0064 process.dummyPseudoAsyncRetry = process.dummyPseudoAsync.clone(
0065     Client = dict(
0066         wait = 2,
0067         allowedTries = 2,
0068         fails = 1,
0069     )
0070 )
0071 
0072 process.dummyAsyncRetry = process.dummyAsync.clone(
0073     Client = dict(
0074         wait = 2,
0075         allowedTries = 2,
0076         fails = 1,
0077     )
0078 )
0079 
0080 process.task = cms.Task(
0081     process.dummySync,process.dummyPseudoAsync,process.dummyAsync,
0082     process.dummySyncRetry,process.dummyPseudoAsyncRetry,process.dummyAsyncRetry,
0083 )
0084 
0085 process.testerSync = cms.EDAnalyzer("IntTestAnalyzer",
0086     valueMustMatch = cms.untracked.int32(-1),
0087     moduleLabel = cms.untracked.InputTag("dummySync"),
0088 )
0089 
0090 process.testerPseudoAsync = cms.EDAnalyzer("IntTestAnalyzer",
0091     valueMustMatch = cms.untracked.int32(4),
0092     moduleLabel = cms.untracked.InputTag("dummyPseudoAsync"),
0093 )
0094 
0095 process.testerAsync = cms.EDAnalyzer("IntTestAnalyzer",
0096     valueMustMatch = cms.untracked.int32(15),
0097     moduleLabel = cms.untracked.InputTag("dummyAsync"),
0098 )
0099 
0100 process.testerSyncRetry = process.testerSync.clone(
0101     moduleLabel = "dummySyncRetry"
0102 )
0103 
0104 process.testerPseudoAsyncRetry = process.testerPseudoAsync.clone(
0105     moduleLabel = "dummyPseudoAsyncRetry"
0106 )
0107 
0108 process.testerAsyncRetry = process.testerAsync.clone(
0109     moduleLabel = "dummyAsyncRetry"
0110 )
0111 
0112 process.p1 = cms.Path(process.testerSync, process.task)
0113 process.p2 = cms.Path(process.testerPseudoAsync, process.task)
0114 process.p3 = cms.Path(process.testerAsync, process.task)
0115 process.p4 = cms.Path(process.testerSyncRetry, process.task)
0116 process.p5 = cms.Path(process.testerPseudoAsyncRetry, process.task)
0117 process.p6 = cms.Path(process.testerAsyncRetry, process.task)