65 :
m_maxVSize(iConfig.getUntrackedParameter<double>(
"maxVSize", 0) * 1000.),
66 m_maxRSS(iConfig.getUntrackedParameter<double>(
"maxRSS", 0) * 1000.),
67 m_maxTime(iConfig.getUntrackedParameter<double>(
"maxTime", 0) * 60. * 60.),
92 bool expected =
false;
93 if (
m_doingCheck.compare_exchange_strong(expected,
true, std::memory_order_acq_rel)) {
106 <<
"Exceeded maximum allowed VSize of " <<
m_maxVSize / 1000. <<
" GB (VSize is " << pi.
vsize / 1000. <<
")";
111 <<
"Exceeded maximum allowed RSS of " <<
m_maxRSS / 1000. <<
" GB (VSize is " << pi.
rss / 1000. <<
")";
116 <<
"Exceeded maximum allowed time of " <<
m_maxTime / 60. / 60. <<
" hours";
127 ->
setComment(
"Maximum allowed VSize for the job in GB. Ignored if set to 0.");
128 desc.
addUntracked<
double>(
"maxRSS", 0.)->
setComment(
"Maximum allowd RSS for the job in GB. Ignored if set to 0.");
130 ->
setComment(
"Maximum allowd wallclock time for the job in hours. Ignored if set to 0.");
131 descriptions.
add(
"ResourceEnforcer", desc);
void setComment(std::string const &value)
unsigned int m_nEventsToSkip
void watchPreallocate(Preallocate::slot_type const &iSlot)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void watchPostEvent(PostEvent::slot_type const &iSlot)
void postEventProcessing(edm::StreamContext const &)
unsigned int maxNumberOfStreams() const
ResourceEnforcer(edm::ParameterSet const &iConfig, edm::ActivityRegistry &iAR)
std::atomic< bool > m_doingCheck
#define DEFINE_FWK_SERVICE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ProcInfoFetcher m_fetcher
std::atomic< unsigned int > m_eventCount