CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/FWCore/Services/src/JobReportService.cc

Go to the documentation of this file.
00001 
00002 // -*- C++ -*-
00003 //
00004 // Package:     Services
00005 // Class  :     JobReport
00006 //
00007 //
00008 // Original Author:  Marc Paterno
00009 //
00010 
00011 #include "FWCore/Services/src/JobReportService.h"
00012 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
00013 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
00014 
00015 namespace edm {
00016   namespace service {
00017 
00018     JobReportService::~JobReportService() {}
00019 
00020     JobReportService::JobReportService(ParameterSet const&, ActivityRegistry& reg) :
00021       JobReport() {
00022 
00023       reg.watchPostEndJob(this, &JobReportService::postEndJob);
00024       reg.watchJobFailure(this, &JobReportService::frameworkShutdownOnFailure);
00025 
00026       // We don't handle PreProcessEvent, because we have to know *which
00027       // input file* was the event read from. Only the InputSource that
00028       // did the reading knows this.
00029     }
00030 
00031     void
00032     JobReportService::postEndJob() {
00033       // This will be called at end-of-job (obviously).
00034       // Dump information to the MessageLogger's JobSummary.
00035 
00036       // ... not yet implemented ...
00037 
00038       // Maybe we should have a member function called from both
00039       // postEndJob() and frameworkShutdownOnFailure(), so that common
00040       // elements are reported through common code.
00041 
00042         //
00043        // Any files that are still open should be flushed to the report
00044       //
00045       impl()->flushFiles();
00046     }
00047 
00048     void
00049     JobReportService::frameworkShutdownOnFailure() {
00050       // Dump information to the MessageLogger's JobSummary
00051       // about the files that aren't already closed,
00052       // and whatever summary information is wanted.
00053 
00054       // Maybe we should have a member function called from both
00055       // postEndJob() and frameworkShutdownOnFailure(), so that common
00056       // elements are reported through common code.
00057       impl()->flushFiles();
00058     }
00059 
00060     void
00061     JobReportService::fillDescriptions(ConfigurationDescriptions& descriptions) {
00062       ParameterSetDescription desc;
00063       desc.setComment("Enables job reports.");
00064       descriptions.addDefault(desc);
00065     }
00066   } // namespace service
00067 } //namspace edm