Skip to content

Commit

Permalink
Merge pull request #23956 from Dr15Jones/avoidDoubleCPUcounting_10_2
Browse files Browse the repository at this point in the history
Avoid double counting CPU usage in ExternalLHEProducer [CMSSW_10_2]
  • Loading branch information
cmsbuild committed Jul 25, 2018
2 parents 6104850 + 4269922 commit 1eb8d7b
Showing 1 changed file with 0 additions and 9 deletions.
Expand Up @@ -58,7 +58,6 @@ Description: [one line class summary]

#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/RandomNumberGenerator.h"
#include "FWCore/Utilities/interface/TimingServiceBase.h"

#include "FWCore/MessageLogger/interface/MessageLogger.h"

Expand Down Expand Up @@ -450,14 +449,6 @@ ExternalLHEProducer::executeScript()
break;
}
} while (true);
edm::Service<edm::TimingServiceBase> ts;
if(ts.isAvailable()) {
struct rusage ru;
getrusage(RUSAGE_CHILDREN,&ru);
double time = static_cast<double>(ru.ru_stime.tv_sec) + (static_cast<double>(ru.ru_stime.tv_usec) * 1E-6) +
static_cast<double>(ru.ru_utime.tv_sec) + (static_cast<double>(ru.ru_utime.tv_usec) * 1E-6);
ts->addToCPUTime(time);
}
if (rc) {
throw cms::Exception("ExternalLHEProducer") << "Child failed with exit code " << rc << ".";
}
Expand Down

0 comments on commit 1eb8d7b

Please sign in to comment.