CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HardwiredDefaults.cc
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 //
3 // HardwiredDefaults.cc
4 //
5 // All the hardwired defaults, organized by which JobMode they apply to
6 //
7 // JobModes:
8 // JobModeGrid
9 // JobModeAnalysis
10 //
11 // Initial Version: mf 6/18/07
12 //
13 // Changes:
14 //
15 // 7/7/08 mf Statistics with different threshold (WARNING level)
16 //
17 // 7/10/08 mf New mode: infos --> ReleaseValidationJobMode
18 // Statistics at INFO threshold
19 // Default limit for INFO at 5 rather than 0
20 //
21 // ----------------------------------------------------------------------
22 
23 
24 
26 
27 #include <iostream>
28 
29 namespace edm {
30 namespace service {
31 
34 mode(std::string const & jm)
35 {
36  if (jm == "") return GridJobMode; // no -mode option = grid
37  if (jm == "grid") return GridJobMode;
38  if (jm == "infos") return ReleaseValidationJobMode;
39  if (jm == "analysis") return AnalysisJobMode;
40  if (jm == "nil") return NilJobMode;
41  std::cerr << "Unrecognized Job Mode Option: " << jm
42  << " -- defaulting to analysis mode ";
43  return AnalysisJobMode;
44 }
45 
48 {
49  // std::cerr << " ======= hardwireGridJobMode() \n";
50  destinations.push_back ( "cerr" );
51  categories.push_back ( "FwkJob" );
52  categories.push_back ( "FwkReport" );
53  categories.push_back ( "FwkSummary" );
54  categories.push_back ( "Root_NoDictionary" );
55  statistics.push_back ( "cerr_stats" );
56  // cerr destination -
57  // note that using the name cerr is OK since it is not std::cerr
58  // but when we want to use default as a name, we have to be circumspect
59  { Destination cerr; // PSet cerr
60  cerr.threshold = "INFO"; // string threshold = "INFO"
61  Category INFO_limits; // PSet INFO = { ... }
62  INFO_limits.limit = 0; // int32 limit = 0
63  cerr.sev["INFO"] = INFO_limits;
64  Category default_for_dest; // PSet default
65  default_for_dest.limit = 10000000; // int32 limit = 10000000
66  cerr.category["default"] = default_for_dest;
67  Category FwkReport; // PSet FwkReport
68  FwkReport.limit = 10000000; // int32 limit = 10000000
69  FwkReport.reportEvery = 1; // int32 reportEvery = 1
70  cerr.category["FwkReport"] = FwkReport;
71  Category FwkSummary; // PSet FwkSummary
72  FwkSummary.limit = 10000000; // int32 limit = 10000000
73  FwkSummary.reportEvery = 1; // int32 reportEvery = 1
74  cerr.category["FwkSummary"] = FwkSummary;
75  Category FwkJob; // PSet FwkJob
76  FwkJob.limit = 0; // int32 limit = 0
77  cerr.category["FwkJob"] = FwkJob;
78  Category Root_NoDictionary; // PSet Root_NoDictionary
79  Root_NoDictionary.limit = 0; // int32 limit = 0
80  cerr.category["Root_NoDictionary"] = Root_NoDictionary;
81  destination["cerr"] = cerr;
82  }
83  { Destination FrameworkJobReport; // PSet FrameworkJobReport
84  Category default_for_dest; // PSet default
85  default_for_dest.limit = 0; // int32 limit = 0
86  FrameworkJobReport.category["default"] = default_for_dest;
87  Category FwkJob; // PSet FwkJob
88  FwkJob.limit = 10000000; // int32 limit = 10000000
89  FrameworkJobReport.category["FwkJob"] = FwkJob;
90  destination["FrameworkJobReport"] = FrameworkJobReport;
91  }
92  { Destination cerr_stats; // PSet cerr_stats
93  cerr_stats.threshold = "WARNING"; // string threshold = "WARNING"
94  cerr_stats.output = "cerr"; // string output = "cerr"
95  destination["cerr_stats"] = cerr_stats;
96  }
97 
98 } // hardwireGridJobMode
99 
102 {
103  // std::cerr << " ======= hardwireReleaseValidationJobMode() \n";
104  destinations.push_back ( "cerr" );
105  categories.push_back ( "FwkJob" );
106  categories.push_back ( "FwkReport" );
107  categories.push_back ( "FwkSummary" );
108  categories.push_back ( "Root_NoDictionary" );
109  statistics.push_back ( "cerr_stats" );
110  // cerr destination -
111  // note that using the name cerr is OK since it is not std::cerr
112  // but when we want to use default as a name, we have to be circumspect
113  { Destination cerr; // PSet cerr
114  cerr.threshold = "INFO"; // string threshold = "INFO"
115  Category INFO_limits; // PSet INFO = { ... }
116  INFO_limits.limit = 5; // int32 limit = 5
117  cerr.sev["INFO"] = INFO_limits;
118  Category default_for_dest; // PSet default
119  default_for_dest.limit = 10000000; // int32 limit = 10000000
120  cerr.category["default"] = default_for_dest;
121  Category FwkReport; // PSet FwkReport
122  FwkReport.limit = 10000000; // int32 limit = 10000000
123  FwkReport.reportEvery = 1; // int32 reportEvery = 1
124  cerr.category["FwkReport"] = FwkReport;
125  Category FwkSummary; // PSet FwkSummary
126  FwkSummary.limit = 10000000; // int32 limit = 10000000
127  FwkSummary.reportEvery = 1; // int32 reportEvery = 1
128  cerr.category["FwkSummary"] = FwkSummary;
129  Category FwkJob; // PSet FwkJob
130  FwkJob.limit = 0; // int32 limit = 0
131  cerr.category["FwkJob"] = FwkJob;
132  Category Root_NoDictionary; // PSet Root_NoDictionary
133  Root_NoDictionary.limit = 0; // int32 limit = 0
134  cerr.category["Root_NoDictionary"] = Root_NoDictionary;
135  destination["cerr"] = cerr;
136  }
137  { Destination FrameworkJobReport; // PSet FrameworkJobReport
138  Category default_for_dest; // PSet default
139  default_for_dest.limit = 0; // int32 limit = 0
140  FrameworkJobReport.category["default"] = default_for_dest;
141  Category FwkJob; // PSet FwkJob
142  FwkJob.limit = 10000000; // int32 limit = 10000000
143  FrameworkJobReport.category["FwkJob"] = FwkJob;
144  destination["FrameworkJobReport"] = FrameworkJobReport;
145  }
146  { Destination cerr_stats; // PSet cerr_stats
147  cerr_stats.threshold = "INFO"; // string threshold = "INFO"
148  cerr_stats.output = "cerr"; // string output = "cerr"
149  destination["cerr_stats"] = cerr_stats;
150  }
151 
152 } // hardwireReleaseValidationJobMode
153 
156 {
157  // std::cerr << " ======= hardwireAnalysisJobMode() \n";
158  destinations.push_back ( "warnings" );
159  categories.push_back ( "FwkJob" );
160  categories.push_back ( "FwkReport" );
161  categories.push_back ( "FwkSummary" );
162  categories.push_back ( "Root_NoDictionary" );
163  statistics.push_back ( "cerr" );
164  // cerr destination -
165  // note that using the name cerr is OK since it is not std::cerr
166  // but when we want to use default as a name, we have to be circumspect
167  { Destination warnings; // PSet warnings
168  warnings.threshold = "INFO"; // string threshold = "INFO"
169  Category INFO_limits; // PSet INFO = { ... }
170  INFO_limits.limit = 0; // int32 limit = 0
171  warnings.sev["INFO"] = INFO_limits;
172  Category default_for_dest; // PSet default
173  default_for_dest.limit = 1000 ; // int32 limit = 1000
174  warnings.category["default"] = default_for_dest;
175  Category FwkReport; // PSet FwkReport
176  FwkReport.limit = 10000000; // int32 limit = 10000000
177  FwkReport.reportEvery = 100; // int32 reportEvery = 100
178  warnings.category["FwkReport"] = FwkReport;
179  Category FwkSummary; // PSet FwkSummary
180  FwkSummary.limit = 10000000; // int32 limit = 10000000
181  warnings.category["FwkSummary"] = FwkSummary;
182  Category FwkJob; // PSet FwkJob
183  FwkJob.limit = 0; // int32 limit = 0
184  warnings.category["FwkJob"] = FwkJob;
185  Category Root_NoDictionary; // PSet Root_NoDictionary
186  Root_NoDictionary.limit = 0; // int32 limit = 0
187  warnings.category["Root_NoDictionary"] = Root_NoDictionary;
188  destination["warnings"] = warnings;
189  }
190  { Destination cerr; // PSet cerr
191  cerr.threshold = "INFO"; // string threshold = "INFO"
192  destination["cerr"] = cerr;
193  }
194 } // hardwireAnalysisJobMode
195 
198 {
199  // std::cerr << " ======= hardwireNilJobMode() \n";
200 } // hardwireNilJobMode
201 
202 
203 } // end of namespace service
204 } // end of namespace edm
205 
tuple FrameworkJobReport
std::vector< std::string > statistics
std::vector< std::string > destinations
std::map< std::string, Destination > destination
static edm::JobMode mode(std::string const &jm)
JobMode
Definition: JobMode.h:15
std::vector< std::string > categories