CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::service::EnableFloatingPointExceptions Class Reference

#include <EnableFloatingPointExceptions.h>

Public Types

typedef int fpu_flags_type
 

Public Member Functions

 EnableFloatingPointExceptions (ParameterSet const &pset, ActivityRegistry &registry)
 
void postEndJob ()
 
void postModule (ModuleDescription const &description)
 
void postModuleBeginJob (ModuleDescription const &description)
 
void postModuleBeginLumi (ModuleDescription const &description)
 
void postModuleBeginRun (ModuleDescription const &description)
 
void postModuleEndJob (ModuleDescription const &description)
 
void postModuleEndLumi (ModuleDescription const &description)
 
void postModuleEndRun (ModuleDescription const &description)
 
void preModule (ModuleDescription const &description)
 
void preModuleBeginJob (ModuleDescription const &description)
 
void preModuleBeginLumi (ModuleDescription const &description)
 
void preModuleBeginRun (ModuleDescription const &description)
 
void preModuleEndJob (ModuleDescription const &description)
 
void preModuleEndLumi (ModuleDescription const &description)
 
void preModuleEndRun (ModuleDescription const &description)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void echoState () const
 
void enableAndDisableExcept (fpu_flags_type target)
 
void establishModuleEnvironments (ParameterSet const &pset)
 
void postActions (ModuleDescription const &description, char const *debugInfo)
 
void preActions (ModuleDescription const &description, char const *debugInfo)
 
void setPrecision (bool precisionDouble)
 

Private Attributes

fpu_flags_type defaultState_
 
fpu_flags_type fpuState_
 
bool reportSettings_
 
std::map< std::string,
fpu_flags_type
stateMap_
 
std::stack< fpu_flags_typestateStack_
 

Detailed Description

Description: This service gives cmsRun users the ability to configure the behavior of the Floating Point (FP) environment. There are two separate aspects of the FP environment this service can control:

1. floating-point exceptions (on a module by module basis if desired)
2. precision control on x87 FP processors.

If you do not use the service at all, floating point exceptions will not be trapped anywhere (FP exceptions will not cause a crash). Add something like the following to the configuration file to enable to the exceptions:

process.EnableFloatingPointExceptions = cms.Service("EnableFloatingPointExceptions", moduleNames = cms.untracked.vstring( 'default', 'sendMessages1', 'sendMessages2' ), default = cms.untracked.PSet( enableOverFlowEx = cms.untracked.bool(False), enableDivByZeroEx = cms.untracked.bool(False), enableInvalidEx = cms.untracked.bool(False), enableUnderFlowEx = cms.untracked.bool(False) ), sendMessages1 = cms.untracked.PSet( enableOverFlowEx = cms.untracked.bool(False), enableDivByZeroEx = cms.untracked.bool(True), enableInvalidEx = cms.untracked.bool(False), enableUnderFlowEx = cms.untracked.bool(False) ), sendMessages2 = cms.untracked.PSet( enableOverFlowEx = cms.untracked.bool(False), enableDivByZeroEx = cms.untracked.bool(False), enableInvalidEx = cms.untracked.bool(True), enableUnderFlowEx = cms.untracked.bool(False) ) )

In this example, the "Divide By Zero" exception is enabled only for the module with label "sendMessages1", the "Invalid" exception is enabled only for the module with label sendMessages2 and no floating point exceptions are otherwise enabled.

The defaults for these options are currently all false. (in an earlier version DivByZero, Invalid, and Overflow defaulted to true, we hope to return to those defaults someday when the frequency of such exceptions has decreased)

Enabling exceptions is very useful if you are trying to track down where a floating point value of 'nan' or 'inf' is being generated and is even better if the goal is to eliminate them.

One can also control the precision of floating point operations in x87 FP processors as follows:

process.EnableFloatingPointExceptions = cms.Service("EnableFloatingPointExceptions", setPrecisionDouble = cms.untracked.bool(True) )

If set true (the default if the service is used), the floating precision in the x87 math processor will be set to round results of addition, subtraction, multiplication, division, and square root to 64 bits after each operation instead of the x87 default, which is 80 bits for values in registers (this is the default you get if this service is not used at all).

The precision control only affects Intel and AMD 32 bit CPUs under LINUX. We have not implemented precision control in the service for other CPUs yet (some other CPUs round to 64 bits by default and some other CPUs do not allow control of the precision of floating point calculations, the behavior of other CPUs may need more study in the future).

Definition at line 98 of file EnableFloatingPointExceptions.h.

Member Typedef Documentation

Definition at line 100 of file EnableFloatingPointExceptions.h.

Constructor & Destructor Documentation

edm::service::EnableFloatingPointExceptions::EnableFloatingPointExceptions ( ParameterSet const &  pset,
ActivityRegistry registry 
)

Definition at line 80 of file EnableFloatingPointExceptions.cc.

References defaultState_, echoState(), enableAndDisableExcept(), establishModuleEnvironments(), fpuState_, edm::ParameterSet::getUntrackedParameter(), postEndJob(), postModule(), postModuleBeginJob(), postModuleBeginLumi(), postModuleBeginRun(), postModuleEndJob(), postModuleEndLumi(), postModuleEndRun(), preModule(), preModuleBeginJob(), preModuleBeginLumi(), preModuleBeginRun(), preModuleEndJob(), preModuleEndLumi(), preModuleEndRun(), reportSettings_, setPrecision(), stateStack_, edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostModule(), edm::ActivityRegistry::watchPostModuleBeginJob(), edm::ActivityRegistry::watchPostModuleBeginLumi(), edm::ActivityRegistry::watchPostModuleBeginRun(), edm::ActivityRegistry::watchPostModuleEndJob(), edm::ActivityRegistry::watchPostModuleEndLumi(), edm::ActivityRegistry::watchPostModuleEndRun(), edm::ActivityRegistry::watchPreModule(), edm::ActivityRegistry::watchPreModuleBeginJob(), edm::ActivityRegistry::watchPreModuleBeginLumi(), edm::ActivityRegistry::watchPreModuleBeginRun(), edm::ActivityRegistry::watchPreModuleEndJob(), edm::ActivityRegistry::watchPreModuleEndLumi(), and edm::ActivityRegistry::watchPreModuleEndRun().

81  :
82  fpuState_(0),
83  defaultState_(0),
84  stateMap_(),
85  stateStack_(),
86  reportSettings_(false) {
87 
88  reportSettings_ = pset.getUntrackedParameter<bool>("reportSettings", false);
89  bool precisionDouble = pset.getUntrackedParameter<bool>("setPrecisionDouble", true);
90 
91  if (reportSettings_) {
92  edm::LogVerbatim("FPE_Enable") << "\nSettings in EnableFloatingPointExceptions constructor";
93  echoState();
94  }
95 
97 
101 
102  setPrecision(precisionDouble);
103 
104  // Note that we must watch all of the transitions even if there are no module specific settings.
105  // This is because the floating point environment may be modified by code outside of this service.
106  registry.watchPostEndJob(this,&EnableFloatingPointExceptions::postEndJob);
107 
108  registry.watchPreModuleBeginJob(this, &EnableFloatingPointExceptions::preModuleBeginJob);
109  registry.watchPostModuleBeginJob(this, &EnableFloatingPointExceptions::postModuleBeginJob);
110  registry.watchPreModuleEndJob(this, &EnableFloatingPointExceptions::preModuleEndJob);
111  registry.watchPostModuleEndJob(this, &EnableFloatingPointExceptions::postModuleEndJob);
112 
113  registry.watchPreModuleBeginRun(this, &EnableFloatingPointExceptions::preModuleBeginRun);
114  registry.watchPostModuleBeginRun(this, &EnableFloatingPointExceptions::postModuleBeginRun);
115  registry.watchPreModuleEndRun(this, &EnableFloatingPointExceptions::preModuleEndRun);
116  registry.watchPostModuleEndRun(this, &EnableFloatingPointExceptions::postModuleEndRun);
117 
118  registry.watchPreModuleBeginLumi(this, &EnableFloatingPointExceptions::preModuleBeginLumi);
119  registry.watchPostModuleBeginLumi(this, &EnableFloatingPointExceptions::postModuleBeginLumi);
120  registry.watchPreModuleEndLumi(this, &EnableFloatingPointExceptions::preModuleEndLumi);
121  registry.watchPostModuleEndLumi(this, &EnableFloatingPointExceptions::postModuleEndLumi);
122 
123  registry.watchPreModule(this, &EnableFloatingPointExceptions::preModule);
124  registry.watchPostModule(this, &EnableFloatingPointExceptions::postModule);
125  }
void preModuleEndRun(ModuleDescription const &description)
void postModuleEndLumi(ModuleDescription const &description)
void postModuleEndRun(ModuleDescription const &description)
void postModuleBeginJob(ModuleDescription const &description)
void preModuleEndJob(ModuleDescription const &description)
void preModuleBeginJob(ModuleDescription const &description)
void postModuleBeginLumi(ModuleDescription const &description)
std::map< std::string, fpu_flags_type > stateMap_
tuple pset
Definition: CrabTask.py:85
void preModuleBeginLumi(ModuleDescription const &description)
void postModule(ModuleDescription const &description)
void preModuleBeginRun(ModuleDescription const &description)
void preModule(ModuleDescription const &description)
void postModuleBeginRun(ModuleDescription const &description)
void preModuleEndLumi(ModuleDescription const &description)
void postModuleEndJob(ModuleDescription const &description)

Member Function Documentation

void edm::service::EnableFloatingPointExceptions::echoState ( ) const
private

Definition at line 410 of file EnableFloatingPointExceptions.cc.

Referenced by EnableFloatingPointExceptions(), establishModuleEnvironments(), postActions(), postEndJob(), and preActions().

410  {
411  feclearexcept(FE_ALL_EXCEPT);
412  fpu_flags_type femask = fegetexcept();
413  edm::LogVerbatim("FPE_Enable") << "Floating point exception mask is "
414  << std::showbase << std::hex << femask;
415 
416  if (femask & FE_DIVBYZERO)
417  edm::LogVerbatim("FPE_Enable") << "\tDivByZero exception is on";
418  else
419  edm::LogVerbatim("FPE_Enable") << "\tDivByZero exception is off";
420 
421  if (femask & FE_INVALID)
422  edm::LogVerbatim("FPE_Enable") << "\tInvalid exception is on";
423  else
424  edm::LogVerbatim("FPE_Enable") << "\tInvalid exception is off";
425 
426  if (femask & FE_OVERFLOW)
427  edm::LogVerbatim("FPE_Enable") << "\tOverFlow exception is on";
428  else
429  edm::LogVerbatim("FPE_Enable") << "\tOverflow exception is off";
430 
431  if (femask & FE_UNDERFLOW)
432  edm::LogVerbatim("FPE_Enable") << "\tUnderFlow exception is on";
433  else
434  edm::LogVerbatim("FPE_Enable") << "\tUnderFlow exception is off";
435  }
void edm::service::EnableFloatingPointExceptions::enableAndDisableExcept ( fpu_flags_type  target)
private

Definition at line 362 of file EnableFloatingPointExceptions.cc.

References cond::rpcobimon::current, and filterCSVwithJSON::target.

Referenced by EnableFloatingPointExceptions(), establishModuleEnvironments(), postActions(), and preActions().

362  {
363  feclearexcept(FE_ALL_EXCEPT);
364  fpu_flags_type current = fegetexcept();
365  fpu_flags_type exceptionsToModify = current ^ target;
366  fpu_flags_type exceptionsToEnable = 0;
367  fpu_flags_type exceptionsToDisable = 0;
368 
369  if (exceptionsToModify & FE_DIVBYZERO) {
370  if (target & FE_DIVBYZERO) {
371  exceptionsToEnable |= FE_DIVBYZERO;
372  }
373  else {
374  exceptionsToDisable |= FE_DIVBYZERO;
375  }
376  }
377  if (exceptionsToModify & FE_INVALID) {
378  if (target & FE_INVALID) {
379  exceptionsToEnable |= FE_INVALID;
380  }
381  else {
382  exceptionsToDisable |= FE_INVALID;
383  }
384  }
385  if (exceptionsToModify & FE_OVERFLOW) {
386  if (target & FE_OVERFLOW) {
387  exceptionsToEnable |= FE_OVERFLOW;
388  }
389  else {
390  exceptionsToDisable |= FE_OVERFLOW;
391  }
392  }
393  if (exceptionsToModify & FE_UNDERFLOW) {
394  if (target & FE_UNDERFLOW) {
395  exceptionsToEnable |= FE_UNDERFLOW;
396  }
397  else {
398  exceptionsToDisable |= FE_UNDERFLOW;
399  }
400  }
401  if (exceptionsToEnable != 0) {
402  feenableexcept(exceptionsToEnable);
403  }
404  if (exceptionsToDisable != 0) {
405  fedisableexcept(exceptionsToDisable);
406  }
407  }
void edm::service::EnableFloatingPointExceptions::establishModuleEnvironments ( ParameterSet const &  pset)
private

Definition at line 129 of file EnableFloatingPointExceptions.cc.

References def, defaultState_, echoState(), enableAndDisableExcept(), flags, fpuState_, edm::ParameterSet::getUntrackedParameter(), reportSettings_, and stateMap_.

Referenced by EnableFloatingPointExceptions().

129  {
130 
131  // Scan the module name list and set per-module values. Be careful to treat
132  // any user-specified default first. If there is one, use it to override our default.
133  // Then remove it from the list so we don't see it again while handling everything else.
134 
135  typedef std::vector<std::string> VString;
136 
137  std::string const def("default");
138  ParameterSet const empty_PSet;
139  VString const empty_VString;
140  VString moduleNames = pset.getUntrackedParameter<VString>("moduleNames", empty_VString);
141 
142  for (VString::const_iterator it(moduleNames.begin()), itEnd = moduleNames.end(); it != itEnd; ++it) {
143  ParameterSet modulePSet = pset.getUntrackedParameter<ParameterSet>(*it, empty_PSet);
144  bool enableDivByZeroEx = modulePSet.getUntrackedParameter<bool>("enableDivByZeroEx", false);
145  bool enableInvalidEx = modulePSet.getUntrackedParameter<bool>("enableInvalidEx", false);
146  bool enableOverFlowEx = modulePSet.getUntrackedParameter<bool>("enableOverFlowEx", false);
147  bool enableUnderFlowEx = modulePSet.getUntrackedParameter<bool>("enableUnderFlowEx", false);
148 
149  fpu_flags_type flags = 0;
150  if (enableDivByZeroEx) flags |= FE_DIVBYZERO;
151  if (enableInvalidEx) flags |= FE_INVALID;
152  if (enableOverFlowEx) flags |= FE_OVERFLOW;
153  if (enableUnderFlowEx) flags |= FE_UNDERFLOW;
154  enableAndDisableExcept(flags);
155 
156  fpuState_ = fegetexcept();
157  assert(flags == fpuState_);
158 
159  if (reportSettings_) {
160  edm::LogVerbatim("FPE_Enable") << "\nSettings for module " << *it;
161  echoState();
162  }
163  if (*it == def) {
165  }
166  else {
167  stateMap_[*it] = fpuState_;
168  }
169  }
170  }
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
std::map< std::string, fpu_flags_type > stateMap_
tuple pset
Definition: CrabTask.py:85
JetCorrectorParameters::Definitions def
Definition: classes.h:10
void edm::service::EnableFloatingPointExceptions::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 267 of file EnableFloatingPointExceptions.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addNode(), edm::ParameterSetDescription::addUntracked(), python.Node::node, edm::ConfigurationDescriptions::setComment(), edm::ParameterSetDescription::setComment(), and edm::ParameterDescriptionNode::setComment().

267  {
269 
270  desc.addUntracked<bool>("reportSettings", false)->setComment(
271  "Log FPE settings at different phases of the job."
272  );
273  desc.addUntracked<bool>("setPrecisionDouble", true)->setComment(
274  "Set the FPU to use double precision");
275 
277  validator.setComment("FPU exceptions to enable/disable for the requested module");
278  validator.addUntracked<bool>("enableDivByZeroEx", false)->setComment(
279  "Enable/disable exception for 'divide by zero'");
280  validator.addUntracked<bool>("enableInvalidEx", false)->setComment(
281  "Enable/disable exception for 'invalid' math operations (e.g. sqrt(-1))");
282  validator.addUntracked<bool>("enableOverFlowEx", false)->setComment(
283  "Enable/disable exception for numeric 'overflow' (value to big for type)");
284  validator.addUntracked<bool>("enableUnderFlowEx", false)->setComment(
285  "Enable/disable exception for numeric 'underflow' (value to small to be represented accurately)");
286 
287  edm::AllowedLabelsDescription<edm::ParameterSetDescription> node("moduleNames", validator, false);
288  node.setComment("Contains the names for PSets where the PSet name matches the label of a module for which you want to modify the FPE");
289  desc.addNode(node);
290 
291  descriptions.add("EnableFloatingPointExceptions", desc);
292  descriptions.setComment("This service allows you to control the FPU and its exceptions on a per module basis.");
293  }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
tuple node
Definition: Node.py:50
void setComment(std::string const &value)
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void edm::service::EnableFloatingPointExceptions::postActions ( ModuleDescription const &  description,
char const *  debugInfo 
)
private

Definition at line 329 of file EnableFloatingPointExceptions.cc.

References echoState(), enableAndDisableExcept(), fpuState_, edm::ModuleDescription::moduleLabel(), reportSettings_, and stateStack_.

Referenced by postModule(), postModuleBeginJob(), postModuleBeginLumi(), postModuleBeginRun(), postModuleEndJob(), postModuleEndLumi(), and postModuleEndRun().

329  {
330  // On exit from a module, set the state of the fpu back to what
331  // it was before entry
332  stateStack_.pop();
333  fpuState_ = stateStack_.top();
335 
336  if (reportSettings_) {
337  edm::LogVerbatim("FPE_Enable")
338  << "\nSettings for module label \""
339  << description.moduleLabel()
340  << "\" after "
341  << debugInfo;
342  echoState();
343  }
344  }
tuple description
Definition: idDealer.py:66
void edm::service::EnableFloatingPointExceptions::postEndJob ( )

Definition at line 173 of file EnableFloatingPointExceptions.cc.

References echoState(), and reportSettings_.

Referenced by EnableFloatingPointExceptions().

173  {
174 
175  if (reportSettings_) {
176  edm::LogVerbatim("FPE_Enable") << "\nSettings after endJob ";
177  echoState();
178  }
179  }
void edm::service::EnableFloatingPointExceptions::postModule ( ModuleDescription const &  description)

Definition at line 261 of file EnableFloatingPointExceptions.cc.

References postActions().

Referenced by EnableFloatingPointExceptions().

261  {
262  postActions(description, "event");
263  }
void postActions(ModuleDescription const &description, char const *debugInfo)
tuple description
Definition: idDealer.py:66
void edm::service::EnableFloatingPointExceptions::postModuleBeginJob ( ModuleDescription const &  description)

Definition at line 189 of file EnableFloatingPointExceptions.cc.

References postActions().

Referenced by EnableFloatingPointExceptions().

189  {
190  postActions(description, "beginJob");
191  }
void postActions(ModuleDescription const &description, char const *debugInfo)
tuple description
Definition: idDealer.py:66
void edm::service::EnableFloatingPointExceptions::postModuleBeginLumi ( ModuleDescription const &  description)

Definition at line 237 of file EnableFloatingPointExceptions.cc.

References postActions().

Referenced by EnableFloatingPointExceptions().

237  {
238  postActions(description, "beginLumi");
239  }
void postActions(ModuleDescription const &description, char const *debugInfo)
tuple description
Definition: idDealer.py:66
void edm::service::EnableFloatingPointExceptions::postModuleBeginRun ( ModuleDescription const &  description)

Definition at line 213 of file EnableFloatingPointExceptions.cc.

References postActions().

Referenced by EnableFloatingPointExceptions().

213  {
214  postActions(description, "beginRun");
215  }
void postActions(ModuleDescription const &description, char const *debugInfo)
tuple description
Definition: idDealer.py:66
void edm::service::EnableFloatingPointExceptions::postModuleEndJob ( ModuleDescription const &  description)

Definition at line 201 of file EnableFloatingPointExceptions.cc.

References postActions().

Referenced by EnableFloatingPointExceptions().

201  {
202  postActions(description, "endJob");
203  }
void postActions(ModuleDescription const &description, char const *debugInfo)
tuple description
Definition: idDealer.py:66
void edm::service::EnableFloatingPointExceptions::postModuleEndLumi ( ModuleDescription const &  description)

Definition at line 249 of file EnableFloatingPointExceptions.cc.

References postActions().

Referenced by EnableFloatingPointExceptions().

249  {
250  postActions(description, "endLumi");
251  }
void postActions(ModuleDescription const &description, char const *debugInfo)
tuple description
Definition: idDealer.py:66
void edm::service::EnableFloatingPointExceptions::postModuleEndRun ( ModuleDescription const &  description)

Definition at line 225 of file EnableFloatingPointExceptions.cc.

References postActions().

Referenced by EnableFloatingPointExceptions().

225  {
226  postActions(description, "endRun");
227  }
void postActions(ModuleDescription const &description, char const *debugInfo)
tuple description
Definition: idDealer.py:66
void edm::service::EnableFloatingPointExceptions::preActions ( ModuleDescription const &  description,
char const *  debugInfo 
)
private

Definition at line 298 of file EnableFloatingPointExceptions.cc.

References defaultState_, echoState(), enableAndDisableExcept(), fpuState_, moduleLabel(), edm::ModuleDescription::moduleLabel(), reportSettings_, stateMap_, and stateStack_.

Referenced by preModule(), preModuleBeginJob(), preModuleBeginLumi(), preModuleBeginRun(), preModuleEndJob(), preModuleEndLumi(), and preModuleEndRun().

299  {
300 
301  // On entry to a module, find the desired state of the fpu and set it
302  // accordingly. Note that any module whose label does not appear in
303  // our list gets the default settings.
304 
305  std::string const& moduleLabel = description.moduleLabel();
306  std::map<std::string, fpu_flags_type>::const_iterator iModule = stateMap_.find(moduleLabel);
307 
308  if (iModule == stateMap_.end()) {
310  }
311  else {
312  fpuState_ = iModule->second;
313  }
315  stateStack_.push(fpuState_);
316 
317  if (reportSettings_) {
318  edm::LogVerbatim("FPE_Enable")
319  << "\nSettings for module label \""
320  << moduleLabel
321  << "\" before "
322  << debugInfo;
323  echoState();
324  }
325  }
std::map< std::string, fpu_flags_type > stateMap_
tuple description
Definition: idDealer.py:66
const std::string * moduleLabel() const
Definition: HLTadd.h:40
void edm::service::EnableFloatingPointExceptions::preModule ( ModuleDescription const &  description)

Definition at line 255 of file EnableFloatingPointExceptions.cc.

References preActions().

Referenced by EnableFloatingPointExceptions().

255  {
256  preActions(description, "event");
257  }
tuple description
Definition: idDealer.py:66
void preActions(ModuleDescription const &description, char const *debugInfo)
void edm::service::EnableFloatingPointExceptions::preModuleBeginJob ( ModuleDescription const &  description)

Definition at line 183 of file EnableFloatingPointExceptions.cc.

References preActions().

Referenced by EnableFloatingPointExceptions().

183  {
184  preActions(description, "beginJob");
185  }
tuple description
Definition: idDealer.py:66
void preActions(ModuleDescription const &description, char const *debugInfo)
void edm::service::EnableFloatingPointExceptions::preModuleBeginLumi ( ModuleDescription const &  description)

Definition at line 231 of file EnableFloatingPointExceptions.cc.

References preActions().

Referenced by EnableFloatingPointExceptions().

231  {
232  preActions(description, "beginLumi");
233  }
tuple description
Definition: idDealer.py:66
void preActions(ModuleDescription const &description, char const *debugInfo)
void edm::service::EnableFloatingPointExceptions::preModuleBeginRun ( ModuleDescription const &  description)

Definition at line 207 of file EnableFloatingPointExceptions.cc.

References preActions().

Referenced by EnableFloatingPointExceptions().

207  {
208  preActions(description, "beginRun");
209  }
tuple description
Definition: idDealer.py:66
void preActions(ModuleDescription const &description, char const *debugInfo)
void edm::service::EnableFloatingPointExceptions::preModuleEndJob ( ModuleDescription const &  description)

Definition at line 195 of file EnableFloatingPointExceptions.cc.

References preActions().

Referenced by EnableFloatingPointExceptions().

195  {
196  preActions(description, "endJob");
197  }
tuple description
Definition: idDealer.py:66
void preActions(ModuleDescription const &description, char const *debugInfo)
void edm::service::EnableFloatingPointExceptions::preModuleEndLumi ( ModuleDescription const &  description)

Definition at line 243 of file EnableFloatingPointExceptions.cc.

References preActions().

Referenced by EnableFloatingPointExceptions().

243  {
244  preActions(description, "endLumi");
245  }
tuple description
Definition: idDealer.py:66
void preActions(ModuleDescription const &description, char const *debugInfo)
void edm::service::EnableFloatingPointExceptions::preModuleEndRun ( ModuleDescription const &  description)

Definition at line 219 of file EnableFloatingPointExceptions.cc.

References preActions().

Referenced by EnableFloatingPointExceptions().

219  {
220  preActions(description, "endRun");
221  }
tuple description
Definition: idDealer.py:66
void preActions(ModuleDescription const &description, char const *debugInfo)
void edm::service::EnableFloatingPointExceptions::setPrecision ( bool  precisionDouble)
private

Definition at line 347 of file EnableFloatingPointExceptions.cc.

Referenced by EnableFloatingPointExceptions().

347  {
348 #ifdef __linux__
349 #ifdef __i386__
350  if (precisionDouble) {
351  fpu_control_t cw;
352  _FPU_GETCW(cw);
353 
354  cw = (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE;
355  _FPU_SETCW(cw);
356  }
357 #endif
358 #endif
359  }

Member Data Documentation

fpu_flags_type edm::service::EnableFloatingPointExceptions::defaultState_
private
fpu_flags_type edm::service::EnableFloatingPointExceptions::fpuState_
private
bool edm::service::EnableFloatingPointExceptions::reportSettings_
private
std::map<std::string, fpu_flags_type> edm::service::EnableFloatingPointExceptions::stateMap_
private

Definition at line 144 of file EnableFloatingPointExceptions.h.

Referenced by establishModuleEnvironments(), and preActions().

std::stack<fpu_flags_type> edm::service::EnableFloatingPointExceptions::stateStack_
private