FWCore
ParameterSet
src
ThreadsInfo.cc
Go to the documentation of this file.
1
//
2
// ThreadsInfo.cc
3
// CMSSW
4
//
5
// Created by Chris Jones on 7/24/20.
6
//
7
#include "
FWCore/ParameterSet/interface/ThreadsInfo.h
"
8
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
9
10
namespace
edm
{
11
ThreadsInfo
threadOptions
(
edm::ParameterSet
const
&
pset
) {
12
// default values
13
ThreadsInfo
threadsInfo;
14
15
if
(
pset
.existsAs<
edm::ParameterSet
>(
"options"
,
false
)) {
16
auto
const
& ops =
pset
.getUntrackedParameterSet(
"options"
);
17
if
(ops.existsAs<
unsigned
int
>(
"numberOfThreads"
,
false
)) {
18
threadsInfo.
nThreads_
= ops.getUntrackedParameter<
unsigned
int
>(
"numberOfThreads"
);
19
}
20
if
(ops.existsAs<
unsigned
int
>(
"sizeOfStackForThreadsInKB"
,
false
)) {
21
threadsInfo.
stackSize_
= ops.getUntrackedParameter<
unsigned
int
>(
"sizeOfStackForThreadsInKB"
);
22
}
23
}
24
return
threadsInfo;
25
}
26
27
void
setThreadOptions
(
ThreadsInfo
const
& threadsInfo,
edm::ParameterSet
&
pset
) {
28
edm::ParameterSet
newOp;
29
if
(
pset
.existsAs<
edm::ParameterSet
>(
"options"
,
false
)) {
30
newOp =
pset
.getUntrackedParameterSet(
"options"
);
31
}
32
newOp.
addUntrackedParameter
<
unsigned
int
>(
"numberOfThreads"
, threadsInfo.
nThreads_
);
33
newOp.
addUntrackedParameter
<
unsigned
int
>(
"sizeOfStackForThreadsInKB"
, threadsInfo.
stackSize_
);
34
pset
.insertParameterSet(
true
,
"options"
,
edm::ParameterSetEntry
(newOp,
false
));
35
}
36
}
// namespace edm
edm::ThreadsInfo::stackSize_
unsigned int stackSize_
Definition:
ThreadsInfo.h:14
edm::setThreadOptions
void setThreadOptions(ThreadsInfo const &threadsInfo, edm::ParameterSet &pset)
Definition:
ThreadsInfo.cc:27
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ParameterSet::addUntrackedParameter
void addUntrackedParameter(std::string const &name, T const &value)
Definition:
ParameterSet.h:192
edm::threadOptions
ThreadsInfo threadOptions(edm::ParameterSet const &pset)
Definition:
ThreadsInfo.cc:11
edm::ThreadsInfo::nThreads_
unsigned int nThreads_
Definition:
ThreadsInfo.h:13
edm::ThreadsInfo
Definition:
ThreadsInfo.h:12
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::ParameterSetEntry
Definition:
ParameterSetEntry.h:23
ParameterSet.h
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
ThreadsInfo.h
Generated for CMSSW Reference Manual by
1.8.16