Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:28:42

0001 // ----------------------------------------------------------------------
0002 //
0003 // HardwiredDefaults.cc
0004 //
0005 // All the hardwired defaults, organized by which JobMode they apply to
0006 //
0007 // JobModes:
0008 //  JobModeGrid
0009 //  JobModeAnalysis
0010 //
0011 // Initial Version:  mf 6/18/07
0012 //
0013 // Changes:
0014 //
0015 // 7/7/08   mf  Statistics with different threshold (WARNING level)
0016 //
0017 // 7/10/08  mf  New mode:  infos --> ReleaseValidationJobMode
0018 //          Statistics at INFO threshold
0019 //          Default limit for INFO at 5 rather than 0
0020 //
0021 // ----------------------------------------------------------------------
0022 
0023 #include "FWCore/MessageService/src/MessageLoggerDefaults.h"
0024 
0025 #include <iostream>
0026 
0027 namespace edm {
0028   namespace service {
0029 
0030     edm::JobMode MessageLoggerDefaults::mode(std::string const& jm) {
0031       if (jm.empty())
0032         return GridJobMode;  // no -mode option = grid
0033       if (jm == "grid")
0034         return GridJobMode;
0035       if (jm == "infos")
0036         return ReleaseValidationJobMode;
0037       if (jm == "analysis")
0038         return AnalysisJobMode;
0039       if (jm == "nil")
0040         return NilJobMode;
0041       std::cerr << "Unrecognized Job Mode Option: " << jm << " -- defaulting to analysis mode ";
0042       return AnalysisJobMode;
0043     }
0044 
0045     void MessageLoggerDefaults::hardwireGridJobMode() {
0046       //    std::cerr << " ======= hardwireGridJobMode() \n";
0047       destinations.push_back("cerr");
0048       categories.push_back("FwkReport");
0049       categories.push_back("FwkSummary");
0050       categories.push_back("Root_NoDictionary");
0051       statistics.push_back("cerr_stats");
0052       // cerr destination -
0053       //      note that using the name cerr is OK since it is not std::cerr
0054       //      but when we want to use default as a name, we have to be circumspect
0055       {
0056         Destination cerr;         // PSet cerr
0057         cerr.threshold = "INFO";  // string threshold = "INFO"
0058         Category INFO_limits;     // PSet INFO = { ... }
0059         INFO_limits.limit = 0;    // int32 limit = 0
0060         cerr.sev["INFO"] = INFO_limits;
0061         Category default_for_dest;          // PSet default
0062         default_for_dest.limit = 10000000;  // int32 limit = 10000000
0063         cerr.category["default"] = default_for_dest;
0064         Category FwkReport;          // PSet FwkReport
0065         FwkReport.limit = 10000000;  // int32 limit = 10000000
0066         FwkReport.reportEvery = 1;   // int32 reportEvery = 1
0067         cerr.category["FwkReport"] = FwkReport;
0068         Category FwkSummary;          // PSet FwkSummary
0069         FwkSummary.limit = 10000000;  // int32 limit = 10000000
0070         FwkSummary.reportEvery = 1;   // int32 reportEvery = 1
0071         cerr.category["FwkSummary"] = FwkSummary;
0072         Category Root_NoDictionary;   // PSet Root_NoDictionary
0073         Root_NoDictionary.limit = 0;  // int32 limit = 0
0074         cerr.category["Root_NoDictionary"] = Root_NoDictionary;
0075         destination["cerr"] = cerr;
0076       }
0077       {
0078         Destination cerr_stats;            // PSet cerr_stats
0079         cerr_stats.threshold = "WARNING";  // string threshold = "WARNING"
0080         cerr_stats.output = "cerr";        // string output = "cerr"
0081         destination["cerr_stats"] = cerr_stats;
0082       }
0083 
0084     }  // hardwireGridJobMode
0085 
0086     void MessageLoggerDefaults::hardwireReleaseValidationJobMode() {
0087       //    std::cerr << " ======= hardwireReleaseValidationJobMode() \n";
0088       destinations.push_back("cerr");
0089       categories.push_back("FwkReport");
0090       categories.push_back("FwkSummary");
0091       categories.push_back("Root_NoDictionary");
0092       statistics.push_back("cerr_stats");
0093       // cerr destination -
0094       //      note that using the name cerr is OK since it is not std::cerr
0095       //      but when we want to use default as a name, we have to be circumspect
0096       {
0097         Destination cerr;         // PSet cerr
0098         cerr.threshold = "INFO";  // string threshold = "INFO"
0099         Category INFO_limits;     // PSet INFO = { ... }
0100         INFO_limits.limit = 5;    // int32 limit = 5
0101         cerr.sev["INFO"] = INFO_limits;
0102         Category default_for_dest;          // PSet default
0103         default_for_dest.limit = 10000000;  // int32 limit = 10000000
0104         cerr.category["default"] = default_for_dest;
0105         Category FwkReport;          // PSet FwkReport
0106         FwkReport.limit = 10000000;  // int32 limit = 10000000
0107         FwkReport.reportEvery = 1;   // int32 reportEvery = 1
0108         cerr.category["FwkReport"] = FwkReport;
0109         Category FwkSummary;          // PSet FwkSummary
0110         FwkSummary.limit = 10000000;  // int32 limit = 10000000
0111         FwkSummary.reportEvery = 1;   // int32 reportEvery = 1
0112         cerr.category["FwkSummary"] = FwkSummary;
0113         Category Root_NoDictionary;   // PSet Root_NoDictionary
0114         Root_NoDictionary.limit = 0;  // int32 limit = 0
0115         cerr.category["Root_NoDictionary"] = Root_NoDictionary;
0116         destination["cerr"] = cerr;
0117       }
0118       {
0119         Destination cerr_stats;         // PSet cerr_stats
0120         cerr_stats.threshold = "INFO";  // string threshold = "INFO"
0121         cerr_stats.output = "cerr";     // string output = "cerr"
0122         destination["cerr_stats"] = cerr_stats;
0123       }
0124 
0125     }  // hardwireReleaseValidationJobMode
0126 
0127     void MessageLoggerDefaults::hardwireAnalysisJobMode() {
0128       //    std::cerr << " ======= hardwireAnalysisJobMode() \n";
0129       destinations.push_back("warnings");
0130       categories.push_back("FwkReport");
0131       categories.push_back("FwkSummary");
0132       categories.push_back("Root_NoDictionary");
0133       statistics.push_back("cerr");
0134       // cerr destination -
0135       //      note that using the name cerr is OK since it is not std::cerr
0136       //      but when we want to use default as a name, we have to be circumspect
0137       {
0138         Destination warnings;         // PSet warnings
0139         warnings.threshold = "INFO";  // string threshold = "INFO"
0140         Category INFO_limits;         // PSet INFO = { ... }
0141         INFO_limits.limit = 0;        // int32 limit = 0
0142         warnings.sev["INFO"] = INFO_limits;
0143         Category default_for_dest;      // PSet default
0144         default_for_dest.limit = 1000;  // int32 limit = 1000
0145         warnings.category["default"] = default_for_dest;
0146         Category FwkReport;           // PSet FwkReport
0147         FwkReport.limit = 10000000;   // int32 limit = 10000000
0148         FwkReport.reportEvery = 100;  // int32 reportEvery = 100
0149         warnings.category["FwkReport"] = FwkReport;
0150         Category FwkSummary;          // PSet FwkSummary
0151         FwkSummary.limit = 10000000;  // int32 limit = 10000000
0152         warnings.category["FwkSummary"] = FwkSummary;
0153         Category Root_NoDictionary;   // PSet Root_NoDictionary
0154         Root_NoDictionary.limit = 0;  // int32 limit = 0
0155         warnings.category["Root_NoDictionary"] = Root_NoDictionary;
0156         destination["warnings"] = warnings;
0157       }
0158       {
0159         Destination cerr;         // PSet cerr
0160         cerr.threshold = "INFO";  // string threshold = "INFO"
0161         destination["cerr"] = cerr;
0162       }
0163     }  // hardwireAnalysisJobMode
0164 
0165     void MessageLoggerDefaults::hardwireNilJobMode() {
0166       //    std::cerr << " ======= hardwireNilJobMode() \n";
0167     }  // hardwireNilJobMode
0168 
0169   }  // end of namespace service
0170 }  // end of namespace edm