Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
FWCore
Services
plugins
UnixSignalService.cc
Go to the documentation of this file.
1
/*----------------------------------------------------------------------
2
3
UnixSignalService: At present, this defines a SIGUSR2 handler and
4
sets the shutdown flag when that signal has been raised.
5
6
This service is instantiated at job startup.
7
8
----------------------------------------------------------------------*/
9
#include <iostream>
10
#include <cstdlib>
11
12
#include "
FWCore/ServiceRegistry/interface/ServiceMaker.h
"
13
14
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
15
16
#include "
FWCore/Utilities/interface/UnixSignalHandlers.h
"
17
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
18
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
19
20
namespace
edm
{
21
namespace
service
{
22
class
UnixSignalService
{
23
public
:
24
explicit
UnixSignalService
(
ParameterSet
const
& ps);
25
~UnixSignalService
();
26
27
static
void
fillDescriptions
(
ConfigurationDescriptions
& descriptions);
28
29
private
:
30
bool
enableSigInt_
;
31
};
// class UnixSignalService
32
}
// end of namespace service
33
}
// end of namespace edm
34
35
namespace
edm
{
36
37
namespace
service
{
38
39
UnixSignalService::UnixSignalService
(
ParameterSet
const
&
pset
)
40
: enableSigInt_(
pset
.getUntrackedParameter<
bool
>(
"EnableCtrlC"
)) {
41
installCustomHandler
(SIGUSR2,
ep_sigusr2
);
42
if
(
enableSigInt_
)
43
installCustomHandler
(SIGINT,
ep_sigusr2
);
44
}
45
46
UnixSignalService::~UnixSignalService
() {}
47
48
void
UnixSignalService::fillDescriptions
(
ConfigurationDescriptions
& descriptions) {
49
ParameterSetDescription
desc
;
50
desc
.addUntracked<
bool
>(
"EnableCtrlC"
,
true
)
51
->setComment(
52
"If 'true', you can stop a cmsRun job gracefully by sending it a '<control> c' keyboard interrupt (i.e. "
53
"SIGINT)."
);
54
descriptions.
add
(
"UnixSignalService"
,
desc
);
55
descriptions.
setComment
(
56
"This service sets up unix signal handlers for the unix signal SIGUSR2 and optionally SIGINT"
57
" so that when cmsRun is sent a signal the application will stop processing and shut down gracefully."
);
58
}
59
}
// end of namespace service
60
}
// end of namespace edm
61
62
using
edm::service::UnixSignalService
;
63
typedef
edm::serviceregistry::ParameterSetMaker<UnixSignalService>
UnixSignalMaker
;
64
DEFINE_FWK_SERVICE_MAKER
(
UnixSignalService
,
UnixSignalMaker
);
ConfigurationDescriptions.h
service
Definition:
service.py:1
edm::service::UnixSignalService::UnixSignalService
UnixSignalService(ParameterSet const &ps)
Definition:
UnixSignalService.cc:39
electrons_cff.bool
bool
Definition:
electrons_cff.py:366
edm::serviceregistry::ParameterSetMaker
Definition:
ServiceMaker.h:54
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
edm::service::UnixSignalService::~UnixSignalService
~UnixSignalService()
Definition:
UnixSignalService.cc:46
edm::service::UnixSignalService
Definition:
UnixSignalService.cc:22
UnixSignalService_cfi.UnixSignalService
UnixSignalService
Definition:
UnixSignalService_cfi.py:5
edm::service::UnixSignalService::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition:
UnixSignalService.cc:48
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
edm::ep_sigusr2
void ep_sigusr2(int, siginfo_t *, void *)
Definition:
UnixSignalHandlers.cc:25
DEFINE_FWK_SERVICE_MAKER
#define DEFINE_FWK_SERVICE_MAKER(concrete, maker)
Definition:
ServiceMaker.h:100
ParameterSetDescription.h
ServiceMaker.h
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
UnixSignalHandlers.h
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition:
ConfigurationDescriptions.cc:48
UnixSignalMaker
edm::serviceregistry::ParameterSetMaker< UnixSignalService > UnixSignalMaker
Definition:
UnixSignalService.cc:63
edm::service::UnixSignalService::enableSigInt_
bool enableSigInt_
Definition:
UnixSignalService.cc:30
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
edm::installCustomHandler
void installCustomHandler(int signum, CFUNC func)
Definition:
UnixSignalHandlers.cc:93
ParameterSet.h
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
Generated for CMSSW Reference Manual by
1.8.16