-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Remove use of deprecated tbb::task_scheduler_init from FWCore #31313
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e9c55be
Switch to using tbb::global_control
Dr15Jones 5c29b9c
Use edm::ThreadsController to constrain threads
Dr15Jones 654bd25
Use tbb::global_control to determine if using only 1 thread
Dr15Jones e29b797
Use explicit tbb::task_arena to control number of threads
Dr15Jones b540c6b
Removed unused EventProcessor calls
Dr15Jones 64122db
Removed unused file testDTUnpackingModule.cc
Dr15Jones 8ee085c
Use cmsRun directly for test
Dr15Jones ab1c866
Fix crash in TestProcessor when exception occurred
Dr15Jones cb40a2f
properly set number of threads for PythonEventProcessor
Dr15Jones c645fae
Added comment about ThreadsController lifetime requirements
Dr15Jones File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
process = cms.Process('analyzer') | ||
process.load('EventFilter.CSCTFRawToDigi.csctfunpacker_cfi') | ||
process.load('EventFilter.CSCTFRawToDigi.csctfpacker_cfi') | ||
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(128) ) | ||
process.load('FWCore.MessageLogger.MessageLogger_cfi') | ||
process.MessageLogger.cout.placeholder = cms.untracked.bool(False) | ||
process.MessageLogger.cout.threshold = cms.untracked.string('INFO') | ||
process.MessageLogger.debugModules = cms.untracked.vstring('*') | ||
process.source = cms.Source('EmptySource') | ||
process.csctfsinglegen = cms.EDProducer('CSCTFSingleGen') | ||
process.csctfpacker.lctProducer = cms.InputTag('csctfsinglegen:') | ||
process.csctfpacker.mbProducer = cms.InputTag('null:') | ||
process.csctfpacker.trackProducer = cms.InputTag('null:') | ||
process.csctfunpacker.producer = cms.InputTag('csctfpacker','CSCTFRawData') | ||
process.csctfanalyzer = cms.EDAnalyzer('CSCTFAnalyzer', | ||
mbProducer = cms.untracked.InputTag('csctfunpacker:DT'), | ||
lctProducer = cms.untracked.InputTag('csctfunpacker:'), | ||
trackProducer = cms.untracked.InputTag('csctfunpacker:'), | ||
statusProducer = cms.untracked.InputTag('csctfunpacker:') | ||
) | ||
process.p = cms.Path(process.csctfsinglegen*process.csctfpacker*process.csctfunpacker*process.csctfanalyzer) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef FWCore_Concurrency_ThreadsController_h | ||
#define FWCore_Concurrency_ThreadsController_h | ||
// -*- C++ -*- | ||
// | ||
// Package: FWCore/Concurrency | ||
// Class : ThreadsController | ||
// | ||
/**\class ThreadsController ThreadsController.h "ThreadsController.h" | ||
|
||
Description: Controls how many threads and how much stack memory per thread | ||
|
||
Usage: | ||
The lifetime of the ThreadsController sets how long the options are in use. | ||
|
||
*/ | ||
// | ||
// Original Author: FWCore | ||
// Created: Fri, 18 Nov 2016 20:30:42 GMT | ||
// | ||
|
||
// system include files | ||
#include "tbb/global_control.h" | ||
#include "tbb/task_arena.h" | ||
#include <memory> | ||
|
||
// user include files | ||
|
||
// forward declarations | ||
|
||
namespace edm { | ||
class ThreadsController { | ||
public: | ||
ThreadsController() = delete; | ||
explicit ThreadsController(unsigned int iNThreads) | ||
: m_nThreads{tbb::global_control::max_allowed_parallelism, iNThreads}, m_stackSize{} {} | ||
ThreadsController(unsigned int iNThreads, size_t iStackSize) | ||
: m_nThreads{tbb::global_control::max_allowed_parallelism, iNThreads}, m_stackSize{makeStackSize(iStackSize)} {} | ||
|
||
// ---------- member functions --------------------------- | ||
void setStackSize(size_t iStackSize) { m_stackSize = makeStackSize(iStackSize); } | ||
|
||
private: | ||
static std::unique_ptr<tbb::global_control> makeStackSize(size_t iStackSize); | ||
|
||
// ---------- member data -------------------------------- | ||
tbb::global_control m_nThreads; | ||
std::unique_ptr<tbb::global_control> m_stackSize; | ||
}; | ||
} // namespace edm | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beyond this PR, but what would you think about
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, given how it is called in
cmsRun.cpp
the two interfaces don't really make much difference.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be safe, I have to be sure the old
ThreadsController
is deleted before the new one is constructed. Previously when usingtbb::task_scheduler_init
if you didn't get rid of the old one before making a new one, the job would crash. I'm not sure iftbb::global_control
has the same conditions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would that subtlety be worth a comment in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment to the function declaration.