Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:07

0001 
0002 // -*- C++ -*-
0003 //
0004 // Package:     Services
0005 // Class  :     JobReport
0006 //
0007 //
0008 // Original Author:  Marc Paterno
0009 //
0010 
0011 #include "FWCore/Services/src/JobReportService.h"
0012 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0014 
0015 namespace edm {
0016   namespace service {
0017 
0018     JobReportService::~JobReportService() {}
0019 
0020     JobReportService::JobReportService(ParameterSet const&, ActivityRegistry& reg) : JobReport() {
0021       reg.watchPostEndJob(this, &JobReportService::postEndJob);
0022       reg.watchJobFailure(this, &JobReportService::frameworkShutdownOnFailure);
0023 
0024       // We don't handle PreProcessEvent, because we have to know *which
0025       // input file* was the event read from. Only the InputSource that
0026       // did the reading knows this.
0027     }
0028 
0029     void JobReportService::postEndJob() {
0030       // This will be called at end-of-job (obviously).
0031       // Dump information to the MessageLogger's JobSummary.
0032 
0033       // ... not yet implemented ...
0034 
0035       // Maybe we should have a member function called from both
0036       // postEndJob() and frameworkShutdownOnFailure(), so that common
0037       // elements are reported through common code.
0038 
0039       //
0040       // Any files that are still open should be flushed to the report
0041       //
0042       impl()->flushFiles();
0043     }
0044 
0045     void JobReportService::frameworkShutdownOnFailure() {
0046       // Dump information to the MessageLogger's JobSummary
0047       // about the files that aren't already closed,
0048       // and whatever summary information is wanted.
0049 
0050       // Maybe we should have a member function called from both
0051       // postEndJob() and frameworkShutdownOnFailure(), so that common
0052       // elements are reported through common code.
0053       impl()->flushFiles();
0054     }
0055 
0056     void JobReportService::fillDescriptions(ConfigurationDescriptions& descriptions) {
0057       ParameterSetDescription desc;
0058       desc.setComment("Enables job reports.");
0059       descriptions.addDefault(desc);
0060     }
0061   }  // namespace service
0062 }  // namespace edm