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

Enable concurrent lumis and IOVs by default when number of streams is at least 2 #34231

Merged
merged 7 commits into from
Jul 3, 2021
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
47 changes: 26 additions & 21 deletions FWCore/Framework/src/EventProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,14 @@ namespace edm {

std::shared_ptr<EDLooperBase> fillLooper(eventsetup::EventSetupsController& esController,
eventsetup::EventSetupProvider& cp,
ParameterSet& params) {
ParameterSet& params,
std::vector<std::string> const& loopers) {
std::shared_ptr<EDLooperBase> vLooper;

std::vector<std::string> loopers = params.getParameter<std::vector<std::string>>("@all_loopers");

if (loopers.empty()) {
return vLooper;
}

assert(1 == loopers.size());

for (std::vector<std::string>::iterator itName = loopers.begin(), itNameEnd = loopers.end(); itName != itNameEnd;
++itName) {
ParameterSet* providerPSet = params.getPSetForUpdate(*itName);
for (auto const& looperName : loopers) {
ParameterSet* providerPSet = params.getPSetForUpdate(looperName);
validateLooper(*providerPSet);
providerPSet->registerIt();
vLooper = eventsetup::LooperFactory::get()->addTo(esController, cp, *providerPSet);
Expand Down Expand Up @@ -386,9 +380,6 @@ namespace edm {
if (nStreams == 0) {
nStreams = nThreads;
}
if (nThreads > 1 or nStreams > 1) {
edm::LogInfo("ThreadStreamSetup") << "setting # threads " << nThreads << "\nsetting # streams " << nStreams;
}
unsigned int nConcurrentRuns = optionsPset.getUntrackedParameter<unsigned int>("numberOfConcurrentRuns");
if (nConcurrentRuns != 1) {
throw Exception(errors::Configuration, "Illegal value nConcurrentRuns : ")
Expand All @@ -397,7 +388,24 @@ namespace edm {
unsigned int nConcurrentLumis =
optionsPset.getUntrackedParameter<unsigned int>("numberOfConcurrentLuminosityBlocks");
if (nConcurrentLumis == 0) {
nConcurrentLumis = nConcurrentRuns;
nConcurrentLumis = 2;
}
if (nConcurrentLumis > nStreams) {
nConcurrentLumis = nStreams;
}
std::vector<std::string> loopers = parameterSet->getParameter<std::vector<std::string>>("@all_loopers");
if (!loopers.empty()) {
//For now loopers make us run only 1 transition at a time
nStreams = 1;
nConcurrentLumis = 1;
nConcurrentRuns = 1;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably add a LogWarning if this changes the settings. I know we didn't have that before, but that was probably bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I added the LogWarning. Thanks.

if (nThreads > 1 or nStreams > 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we move this to be within an else block from if(dumpOptions)? That way we would only print the info once.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. This seems better. We don't need the LogInfo stuff in the unit test output.

I viewed the dumpOptions as something for Framework unit tests. I am wondering if it could get used for other purposes... I tried to leave the other output unmodified, just in case there is something that uses it and depends on it being in the log file.

(I'll push all the commits with changes when I get them all done.)

edm::LogInfo("ThreadStreamSetup") << "setting # threads " << nThreads << "\nsetting # streams " << nStreams;
}
bool dumpOptions = optionsPset.getUntrackedParameter<bool>("dumpOptions");
if (dumpOptions) {
dumpOptionsToLogFile(nThreads, nStreams, nConcurrentLumis, nConcurrentRuns);
}

//Check that relationships between threading parameters makes sense
Expand Down Expand Up @@ -439,18 +447,15 @@ namespace edm {

// intialize the event setup provider
ParameterSet const& eventSetupPset(optionsPset.getUntrackedParameterSet("eventSetup"));
esp_ = espController_->makeProvider(*parameterSet, items.actReg_.get(), &eventSetupPset);
esp_ = espController_->makeProvider(
*parameterSet, items.actReg_.get(), &eventSetupPset, nConcurrentLumis, dumpOptions);

// initialize the looper, if any
looper_ = fillLooper(*espController_, *esp_, *parameterSet);
if (looper_) {
if (!loopers.empty()) {
looper_ = fillLooper(*espController_, *esp_, *parameterSet, loopers);
looper_->setActionTable(items.act_table_.get());
looper_->attachTo(*items.actReg_);

//For now loopers make us run only 1 transition at a time
nStreams = 1;
nConcurrentLumis = 1;
nConcurrentRuns = 1;
// in presence of looper do not delete modules
deleteNonConsumedUnscheduledModules_ = false;
}
Expand Down
6 changes: 4 additions & 2 deletions FWCore/Framework/src/EventSetupsController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ namespace edm {

std::shared_ptr<EventSetupProvider> EventSetupsController::makeProvider(ParameterSet& iPSet,
ActivityRegistry* activityRegistry,
ParameterSet const* eventSetupPset) {
ParameterSet const* eventSetupPset,
unsigned int nConcurrentLumis,
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we change this to maxConcurrency instead? That better explains what is happening without forcing in the code at this point the policy that maxConcurrency == nConcurrentLumis.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made some improvements here. The behavior is exactly the same, but hopefully it is more readable and understandable. Below are the changes in EventProcessor.cc with appropriate changes also in the lower level code (I'll push all these commits as soon as I finish all of them). I noticed we no longer need the separate function setMaxConcurrentIOVs since I moved the code that resets things if there is a looper.

+++ b/FWCore/Framework/src/EventProcessor.cc
@@ -414,6 +414,9 @@ namespace edm {
         edm::LogInfo("ThreadStreamSetup") << "setting # threads " << nThreads << "\nsetting # streams " << nStreams;
       }
     }
+    // The number of concurrent IOVs is configured individually for each record in
+    // the class NumberOfConcurrentIOVs to values less than or equal to this.
+    unsigned int maxConcurrentIOVs = nConcurrentLumis;
 
     //Check that relationships between threading parameters makes sense
     /*
@@ -455,7 +458,7 @@ namespace edm {
     // intialize the event setup provider
     ParameterSet const& eventSetupPset(optionsPset.getUntrackedParameterSet("eventSetup"));
     esp_ = espController_->makeProvider(
-        *parameterSet, items.actReg_.get(), &eventSetupPset, nConcurrentLumis, dumpOptions);
+        *parameterSet, items.actReg_.get(), &eventSetupPset, maxConcurrentIOVs, dumpOptions);
 
     // initialize the looper, if any
     if (!loopers.empty()) {
@@ -466,7 +469,6 @@ namespace edm {
       // in presence of looper do not delete modules
       deleteNonConsumedUnscheduledModules_ = false;
     }
-    espController_->setMaxConcurrentIOVs(nStreams, nConcurrentLumis);

bool dumpOptions) {
// Makes an EventSetupProvider
// Also parses the prefer information from ParameterSets and puts
// it in a map that is stored in the EventSetupProvider
Expand All @@ -53,7 +55,7 @@ namespace edm {
// EventSetupsController and in the EventSetupProvider
fillEventSetupProvider(*this, *returnValue, iPSet);

numberOfConcurrentIOVs_.readConfigurationParameters(eventSetupPset);
numberOfConcurrentIOVs_.readConfigurationParameters(eventSetupPset, nConcurrentLumis, dumpOptions);

providers_.push_back(returnValue);
return returnValue;
Expand Down
4 changes: 3 additions & 1 deletion FWCore/Framework/src/EventSetupsController.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ namespace edm {

std::shared_ptr<EventSetupProvider> makeProvider(ParameterSet&,
ActivityRegistry*,
ParameterSet const* eventSetupPset = nullptr);
ParameterSet const* eventSetupPset = nullptr,
unsigned int nConcurrentLumis = 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

maxConcurrency here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See comment above

bool dumpOptions = false);

void setMaxConcurrentIOVs(unsigned int nStreams, unsigned int nConcurrentLumis);

Expand Down
11 changes: 8 additions & 3 deletions FWCore/Framework/src/NumberOfConcurrentIOVs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ namespace edm {

NumberOfConcurrentIOVs::NumberOfConcurrentIOVs() : numberConcurrentIOVs_(1) {}

void NumberOfConcurrentIOVs::readConfigurationParameters(ParameterSet const* eventSetupPset) {
void NumberOfConcurrentIOVs::readConfigurationParameters(ParameterSet const* eventSetupPset,
unsigned int nConcurrentLumis,
Copy link
Contributor

Choose a reason for hiding this comment

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

maxConcurrency here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See comment above

bool dumpOptions) {
if (eventSetupPset) { // this condition is false for SubProcesses
numberConcurrentIOVs_ = eventSetupPset->getUntrackedParameter<unsigned int>("numberOfConcurrentIOVs");
if (numberConcurrentIOVs_ == 0) {
numberConcurrentIOVs_ = 1;
if (numberConcurrentIOVs_ == 0 || numberConcurrentIOVs_ > nConcurrentLumis) {
numberConcurrentIOVs_ = nConcurrentLumis;
}
if (dumpOptions) {
LogAbsolute("Options") << "Number of Concurrent IOVs = " << numberConcurrentIOVs_;
}

ParameterSet const& pset(eventSetupPset->getUntrackedParameterSet("forceNumberOfConcurrentIOVs"));
Expand Down
4 changes: 3 additions & 1 deletion FWCore/Framework/src/NumberOfConcurrentIOVs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ namespace edm {
public:
NumberOfConcurrentIOVs();

void readConfigurationParameters(ParameterSet const* eventSetupPset);
void readConfigurationParameters(ParameterSet const* eventSetupPset,
unsigned int nConcurrentLumis,
Copy link
Contributor

Choose a reason for hiding this comment

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

here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See comment above

bool dumpOptions);

// Can't have more concurrent IOVs than streams or concurrent lumis
void setMaxConcurrentIOVs(unsigned int nStreams, unsigned int nConcurrentLumis);
Expand Down
5 changes: 5 additions & 0 deletions FWCore/Framework/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
<use name="FWCore/Utilities"/>
</bin>

<bin name="TestFWCoreFrameworkOptions" file="TestDriver.cpp">
Copy link
Contributor

Choose a reason for hiding this comment

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

There is scram support now for specifying running a .sh script as part of a test without doing the TestDriver.cpp approach. I suggest switching to that since it reduces the number of executables we need.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smuzaffar I am not familiar with this (I've never seen it or forgot...). Is there is an example or documentation somewhere? Does it work the same way and set the same environmental variables as the old way? Here is the script I want to run:

#!/bin/bash

 function die { echo Failure $1: status $2 ; exit $2 ; }

 pushd ${LOCAL_TMP_DIR}

 echo testOptions1_cfg.py
 cmsRun -p ${LOCAL_TEST_DIR}/testOptions1_cfg.py >& testOptions1.log || die "cmsRun testOptions1_cfg.py" $?
 grep "Number of Streams = 1" testOptions1.log || die "Failed number of streams test" $?
 grep "Number of Concurrent Lumis = 1" testOptions1.log || die "Failed number of concurrent lumis test" $?
 grep "Number of Concurrent IOVs = 1" testOptions1.log || die "Failed number of concurrent IOVs test" $?

 echo testOptions2_cfg.py
 cmsRun -p ${LOCAL_TEST_DIR}/testOptions2_cfg.py >& testOptions2.log || die "cmsRun testOptions2_cfg.py" $?
 grep "Number of Streams = 5" testOptions2.log || die "Failed number of streams test" $?
 grep "Number of Concurrent Lumis = 4" testOptions2.log || die "Failed number of concurrent lumis test" $?
 grep "Number of Concurrent IOVs = 3" testOptions2.log || die "Failed number of concurrent IOVs test" $?

 echo testOptions3_cfg.py
 cmsRun -p ${LOCAL_TEST_DIR}/testOptions3_cfg.py >& testOptions3.log || die "cmsRun testOptions3_cfg.py" $?
 grep "Number of Streams = 6" testOptions3.log || die "Failed number of streams test" $?
 grep "Number of Concurrent Lumis = 2" testOptions3.log || die "Failed number of concurrent lumis test" $?
 grep "Number of Concurrent IOVs = 2" testOptions3.log || die "Failed number of concurrent IOVs test" $?

 echo testOptions4_cfg.py
 cmsRun -p ${LOCAL_TEST_DIR}/testOptions4_cfg.py >& testOptions4.log || die "cmsRun testOptions4_cfg.py" $?
 grep "Number of Streams = 6" testOptions4.log || die "Failed number of streams test" $?
 grep "Number of Concurrent Lumis = 6" testOptions4.log || die "Failed number of concurrent lumis test" $?
 grep "Number of Concurrent IOVs = 6" testOptions4.log || die "Failed number of concurrent IOVs test" $?

 echo testOptions5_cfg.py
 cmsRun -p ${LOCAL_TEST_DIR}/testOptions5_cfg.py >& testOptions5.log || die "cmsRun testOptions5_cfg.py" $?
 grep "Number of Streams = 1" testOptions5.log || die "Failed number of streams test" $?
 grep "Number of Concurrent Lumis = 1" testOptions5.log || die "Failed number of concurrent lumis test" $?
 grep "Number of Concurrent IOVs = 1" testOptions5.log || die "Failed number of concurrent IOVs test" $?

 echo testOptions6_cfg.py
 cmsRun -p ${LOCAL_TEST_DIR}/testOptions6_cfg.py >& testOptions6.log || die "cmsRun testOptions6_cfg.py" $?
 # Cannot run the grep tests because by default the options are not dumped.
 # You can however run this manually with a debugger and check (which was done)
 # And also just run it and see it doesn't crash...

 rm testOptions1.log
 rm testOptions2.log
 rm testOptions3.log
 rm testOptions4.log
 rm testOptions5.log
 rm testOptions6.log

 popd

 exit 0

Copy link
Contributor

Choose a reason for hiding this comment

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

Here

<test name="testFWCoreSharedMemoryMonitorThreadSignals" command="test_monitor_thread_signals.sh">
<flags PRE_TEST="testFWCoreSharedMemoryMonitorThread"/>
</test>

<test name="testFWCoreFrameworkNonEventOrdering" command="test_non_event_ordering.sh"/>
<test name="testFWCoreFramework1ThreadESPrefetch" command="run_test_1_thread_es_prefetching.sh"/>
<test name="testFWCoreFrameworkModuleDeletion" command="run_module_delete_tests.sh"/>

<test name="TestFWCoreIntegrationInterProcess" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/test_TestInterProcessProd_cfg.py"/>
<test name="TestFWCoreIntegrationPutOrMerge" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/putOrMergeTest_cfg.py"/>
<test name="TestFWCoreIntegrationInputSourceAlias" command="cmsRun ${LOCALTOP}//src/FWCore/Integration/test/inputSource_alias_Test_cfg.py"/>

Copy link
Contributor

@smuzaffar smuzaffar Jun 29, 2021

Choose a reason for hiding this comment

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

@wddgit , it works nearly the same way ( see examples of it https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/PythonAnalysis/test/BuildFile.xml ) but it does not set the env variables set here https://github.com/cms-sw/cmssw/blob/master/FWCore/Utilities/src/TestHelper.cc#L149-L164 . But most of these you can calculate within the script itself. So basically you just need to use

<test name="TestFWCoreFrameworkOptions" command="your-script-in-test.sh args"/>

Copy link
Contributor

Choose a reason for hiding this comment

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

@wddgit , if the tests in your script do not depend on each other then better to have a small script e.g.

  • runtest.sh
 echo $1
 cmsRun -p ${CMSSW_BASE}/src/FWCore/Framework/test/$1 >& ${1}.log || die "cmsRun$1" $?
 grep "Number of Streams = $2" ${1}.log || die "Failed number of streams test" $?
 grep "Number of Concurrent Lumis = $3" ${1}.log || die "Failed number of concurrent lumis test" $?
 grep "Number of Concurrent IOVs = $4" ${1}.log || die "Failed number of concurrent IOVs test" $?

and then add multiple tests e.g.

<test name="TestFWCoreFrameworkOptions1" command="runtest.sh testOptions1_cfg.py 1 1 1"/>
<test name="TestFWCoreFrameworkOptions2" command="runtest.sh testOptions2_cfg.py 5 4 3"/>
...

this way scram can run these in parallel. Only thing you need to make sure that these tests do not write in to same output file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mostly did what was suggested here. The main difference is instead of putting so much in the BuildFile I passed only a single index to identify the test and put the config file names and expected results in arrays in the bash script. It seemed to be too much to put expected results in a BuildFile.

Overall, this seems much better. Thanks.

<flags TEST_RUNNER_ARGS=" /bin/bash FWCore/Framework/test run_testOptions.sh"/>
<use name="FWCore/Utilities"/>
</bin>

<library file="stubs/TestTriggerNames.cc" name="TestTriggerNames">
<flags EDM_PLUGIN="1"/>
<use name="DataFormats/Common"/>
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Framework/test/run_concurrent_lumis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ touch empty_file

(cmsRun ${LOCAL_TEST_DIR}/test_2_concurrent_lumis_cfg.py 2>&1) | tail -n 1 | grep -v ' 0 ' | grep -v 'e-' | diff - empty_file && die "Failure using test_2_concurrent_lumis_cfg.py" $?

exit 0
exit 0
52 changes: 52 additions & 0 deletions FWCore/Framework/test/run_testOptions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

function die { echo Failure $1: status $2 ; exit $2 ; }

pushd ${LOCAL_TMP_DIR}

echo testOptions1_cfg.py
cmsRun -p ${LOCAL_TEST_DIR}/testOptions1_cfg.py >& testOptions1.log || die "cmsRun testOptions1_cfg.py" $?
grep "Number of Streams = 1" testOptions1.log || die "Failed number of streams test" $?
grep "Number of Concurrent Lumis = 1" testOptions1.log || die "Failed number of concurrent lumis test" $?
grep "Number of Concurrent IOVs = 1" testOptions1.log || die "Failed number of concurrent IOVs test" $?

echo testOptions2_cfg.py
cmsRun -p ${LOCAL_TEST_DIR}/testOptions2_cfg.py >& testOptions2.log || die "cmsRun testOptions2_cfg.py" $?
grep "Number of Streams = 5" testOptions2.log || die "Failed number of streams test" $?
grep "Number of Concurrent Lumis = 4" testOptions2.log || die "Failed number of concurrent lumis test" $?
grep "Number of Concurrent IOVs = 3" testOptions2.log || die "Failed number of concurrent IOVs test" $?

echo testOptions3_cfg.py
cmsRun -p ${LOCAL_TEST_DIR}/testOptions3_cfg.py >& testOptions3.log || die "cmsRun testOptions3_cfg.py" $?
grep "Number of Streams = 6" testOptions3.log || die "Failed number of streams test" $?
grep "Number of Concurrent Lumis = 2" testOptions3.log || die "Failed number of concurrent lumis test" $?
grep "Number of Concurrent IOVs = 2" testOptions3.log || die "Failed number of concurrent IOVs test" $?

echo testOptions4_cfg.py
cmsRun -p ${LOCAL_TEST_DIR}/testOptions4_cfg.py >& testOptions4.log || die "cmsRun testOptions4_cfg.py" $?
grep "Number of Streams = 6" testOptions4.log || die "Failed number of streams test" $?
grep "Number of Concurrent Lumis = 6" testOptions4.log || die "Failed number of concurrent lumis test" $?
grep "Number of Concurrent IOVs = 6" testOptions4.log || die "Failed number of concurrent IOVs test" $?

echo testOptions5_cfg.py
cmsRun -p ${LOCAL_TEST_DIR}/testOptions5_cfg.py >& testOptions5.log || die "cmsRun testOptions5_cfg.py" $?
grep "Number of Streams = 1" testOptions5.log || die "Failed number of streams test" $?
grep "Number of Concurrent Lumis = 1" testOptions5.log || die "Failed number of concurrent lumis test" $?
grep "Number of Concurrent IOVs = 1" testOptions5.log || die "Failed number of concurrent IOVs test" $?

echo testOptions6_cfg.py
cmsRun -p ${LOCAL_TEST_DIR}/testOptions6_cfg.py >& testOptions6.log || die "cmsRun testOptions6_cfg.py" $?
# Cannot run the grep tests because by default the options are not dumped.
# You can however run this manually with a debugger and check (which was done)
# And also just run it and see it doesn't crash...

rm testOptions1.log
rm testOptions2.log
rm testOptions3.log
rm testOptions4.log
rm testOptions5.log
rm testOptions6.log

popd

exit 0
10 changes: 10 additions & 0 deletions FWCore/Framework/test/testOptions1_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Test of options when all parameters taken from Config.py
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)
process.options = dict (
dumpOptions = True
)
Copy link
Contributor

Choose a reason for hiding this comment

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

You should be able to do process.options.dumpOptions = True

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. It works. It is a little more concise. Thanks.

17 changes: 17 additions & 0 deletions FWCore/Framework/test/testOptions2_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Test of options when all parameters explicitly set
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.options = dict(
dumpOptions = True,
numberOfThreads = 6,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably keep the # threads to 4 or less as many IB VMs are only 4 threaded machines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I reduced the number of threads to 4 when it was greater than 4 in this file and the other configurations as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just wondering. For each individual test I limited this to 4 concurrent threads. But does this resolve all the problems if scram is running multiple tests concurrently? I was wondering how that works. Does each test run on a different VM?

numberOfStreams = 5,
numberOfConcurrentLuminosityBlocks = 4,
eventSetup = dict(
numberOfConcurrentIOVs = 3
)
)
17 changes: 17 additions & 0 deletions FWCore/Framework/test/testOptions3_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Test of options when parameters are zero
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.options = dict(
dumpOptions = True,
numberOfThreads = 6,
numberOfStreams = 0,
numberOfConcurrentLuminosityBlocks = 0,
eventSetup = dict(
numberOfConcurrentIOVs = 0
)
)
17 changes: 17 additions & 0 deletions FWCore/Framework/test/testOptions4_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Test of options when concurrentIOVs and concurrentLumis are too big
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.options = dict(
dumpOptions = True,
numberOfThreads = 6,
numberOfStreams = 6,
numberOfConcurrentLuminosityBlocks = 7,
eventSetup = dict(
numberOfConcurrentIOVs = 7
)
)
21 changes: 21 additions & 0 deletions FWCore/Framework/test/testOptions5_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Test of options when a looper is in the job
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.options = dict(
dumpOptions = True,
numberOfThreads = 6,
numberOfStreams = 6,
numberOfConcurrentLuminosityBlocks = 7,
eventSetup = dict(
numberOfConcurrentIOVs = 7
)
)

process.looper = cms.Looper("DummyLooper",
value = cms.untracked.int32(4)
)
7 changes: 7 additions & 0 deletions FWCore/Framework/test/testOptions6_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Test of options when parameter defaults coming from descriptions
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)
3 changes: 2 additions & 1 deletion FWCore/Framework/test/test_global_modules_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

process.options = cms.untracked.PSet(
numberOfStreams = cms.untracked.uint32(nStreams),
numberOfThreads = cms.untracked.uint32(nStreams)
numberOfThreads = cms.untracked.uint32(nStreams),
numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(1)
)

process.maxEvents = cms.untracked.PSet(
Expand Down
3 changes: 2 additions & 1 deletion FWCore/Framework/test/test_limited_modules_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

process.options = cms.untracked.PSet(
numberOfStreams = cms.untracked.uint32(nStreams),
numberOfThreads = cms.untracked.uint32(nStreams)
numberOfThreads = cms.untracked.uint32(nStreams),
numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(1)
)


Expand Down
3 changes: 2 additions & 1 deletion FWCore/Framework/test/test_stream_modules_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import FWCore.Framework.test.cmsExceptionsFatalOption_cff
process.options = cms.untracked.PSet(
numberOfStreams = cms.untracked.uint32(nStreams),
numberOfThreads = cms.untracked.uint32(nStreams)
numberOfThreads = cms.untracked.uint32(nStreams),
numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(1)
)


Expand Down
4 changes: 4 additions & 0 deletions FWCore/ParameterSet/interface/validateTopLevelParameterSets.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ namespace edm {
void fillMaxEventsDescription(ParameterSetDescription& description);
void fillMaxLuminosityBlocksDescription(ParameterSetDescription& description);
void fillMaxSecondsUntilRampdownDescription(ParameterSetDescription& description);
void dumpOptionsToLogFile(unsigned int nThreads,
unsigned int nStreams,
unsigned int nConcurrentLumis,
unsigned int nConcurrentRuns);
} // namespace edm
#endif
10 changes: 6 additions & 4 deletions FWCore/ParameterSet/python/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ def defaultOptions_():
return untracked.PSet(numberOfThreads = untracked.uint32(1),
numberOfStreams = untracked.uint32(0),
numberOfConcurrentRuns = untracked.uint32(1),
numberOfConcurrentLuminosityBlocks = untracked.uint32(1),
numberOfConcurrentLuminosityBlocks = untracked.uint32(0),
eventSetup = untracked.PSet(
numberOfConcurrentIOVs = untracked.uint32(1),
numberOfConcurrentIOVs = untracked.uint32(0),
forceNumberOfConcurrentIOVs = untracked.PSet(
allowAnyLabel_ = required.untracked.uint32
)
Expand All @@ -234,6 +234,7 @@ def defaultOptions_():
FailPath = untracked.vstring(),
IgnoreCompletely = untracked.vstring(),
canDeleteEarly = untracked.vstring(),
dumpOptions = untracked.bool(False),
allowUnscheduled = obsolete.untracked.bool,
emptyRunLumiMode = obsolete.untracked.string,
makeTriggerResults = obsolete.untracked.bool
Expand Down Expand Up @@ -2015,17 +2016,18 @@ def testProcessDumpPython(self):
allowUnscheduled = cms.obsolete.untracked.bool,
canDeleteEarly = cms.untracked.vstring(),
deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
dumpOptions = cms.untracked.bool(False),
emptyRunLumiMode = cms.obsolete.untracked.string,
eventSetup = cms.untracked.PSet(
forceNumberOfConcurrentIOVs = cms.untracked.PSet(
allowAnyLabel_=cms.required.untracked.uint32
),
numberOfConcurrentIOVs = cms.untracked.uint32(1)
numberOfConcurrentIOVs = cms.untracked.uint32(0)
),
fileMode = cms.untracked.string('FULLMERGE'),
forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
makeTriggerResults = cms.obsolete.untracked.bool,
numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(1),
numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
numberOfConcurrentRuns = cms.untracked.uint32(1),
numberOfStreams = cms.untracked.uint32(0),
numberOfThreads = cms.untracked.uint32(1),
Expand Down
Loading