CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/FWCore/Services/src/EnableFloatingPointExceptions.h

Go to the documentation of this file.
00001 #ifndef FWCore_Services_FpeHandler_h
00002 #define FWCore_Services_FpeHandler_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Services
00006 // Class  :     EnableFloatingPointExceptions
00007 // 
00080 //
00081 // Original Author:  E. Sexton-Kennedy
00082 //         Created:  Tue Apr 11 13:43:16 CDT 2006
00083 //
00084 
00085 #include <string>
00086 #include <map>
00087 #include <stack>
00088 
00089 namespace edm {
00090 
00091    class ParameterSet;
00092    class ActivityRegistry;
00093    class ModuleDescription;
00094    class ConfigurationDescriptions;
00095 
00096    namespace service {
00097 
00098       class EnableFloatingPointExceptions {
00099       public:
00100          typedef int fpu_flags_type;
00101          EnableFloatingPointExceptions(ParameterSet const& pset,
00102                                        ActivityRegistry & registry);
00103 
00104          void postEndJob();
00105 
00106          void preModuleBeginJob(ModuleDescription const& description);
00107          void postModuleBeginJob(ModuleDescription const& description);
00108          void preModuleEndJob(ModuleDescription const& description);
00109          void postModuleEndJob(ModuleDescription const& description);
00110 
00111          void preModuleBeginRun(ModuleDescription const& description);
00112          void postModuleBeginRun(ModuleDescription const& description);
00113          void preModuleEndRun(ModuleDescription const& description);
00114          void postModuleEndRun(ModuleDescription const& description);
00115 
00116          void preModuleBeginLumi(ModuleDescription const& description);
00117          void postModuleBeginLumi(ModuleDescription const& description);
00118          void preModuleEndLumi(ModuleDescription const& description);
00119          void postModuleEndLumi(ModuleDescription const& description);
00120 
00121          void preModule(ModuleDescription const& description);
00122          void postModule(ModuleDescription const& description);
00123 
00124          static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
00125 
00126       private:
00127 
00128          void establishModuleEnvironments(ParameterSet const& pset);
00129 
00130          void preActions(ModuleDescription const& description,
00131                          char const* debugInfo);
00132 
00133          void postActions(ModuleDescription const& description,
00134                           char const* debugInfo);
00135 
00136          void setPrecision(bool precisionDouble);
00137 
00138          void enableAndDisableExcept(fpu_flags_type target);
00139 
00140          void echoState() const;
00141 
00142          fpu_flags_type fpuState_;
00143          fpu_flags_type defaultState_;
00144          std::map<std::string, fpu_flags_type> stateMap_;
00145          std::stack<fpu_flags_type> stateStack_;
00146          bool reportSettings_;
00147       };
00148    }
00149 }
00150 #endif