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