CMS 3D CMS Logo

Classes | Functions | Variables
edm::service Namespace Reference

Classes

class  AbstractMLscribe
 
class  CheckTransitions
 
struct  close_and_delete
 
class  ConcurrentModuleTimer
 
class  CondorStatusService
 
class  CPU
 
class  ELadministrator
 
class  ELdestination
 
class  ELlimitsTable
 
class  ELoutput
 
class  ELstatistics
 
class  IgProfService
 
class  InitRootHandlers
 
class  JeProfService
 
class  JobReportService
 
class  LoadAllDictionaries
 
class  MessageLogger
 
struct  MessageLoggerDefaults
 
class  MessageServicePSetValidation
 
class  PrescaleService
 
struct  ProcInfo
 
class  ProcInfoFetcher
 
class  ProductRegistryDumper
 
class  RandomNumberGeneratorService
 
class  ResourceEnforcer
 
class  ResourceInformationService
 
class  SimpleMemoryCheck
 
class  SingleThreadMSPresence
 
class  SiteLocalConfigService
 
struct  smapsInfo
 
class  StallMonitor
 
class  SystemBounds
 
class  TestService
 
class  ThreadSafeLogMessageLoggerScribe
 
class  Timing
 
class  Tracer
 
class  TriggerNamesService
 
class  UnixSignalService
 

Functions

int cmssw_stacktrace (void *)
 
static void cmssw_stacktrace_fork ()
 
static std::string d2str (double d)
 
static std::string d2str (double d)
 
static double getChildrenCPU ()
 
static double getCPU ()
 
static std::chrono::steady_clock::time_point getTime ()
 
static std::string i2str (int i)
 
bool isProcessWideService (void const *)
 
bool isProcessWideService (JobReportService const *)
 
bool isProcessWideService (TFileAdaptor const *)
 
bool isProcessWideService (ZombieKillerService const *)
 
bool isProcessWideService (CPU const *)
 
bool isProcessWideService (ResourceInformationService const *)
 
bool isProcessWideService (CondorStatusService const *)
 
bool isProcessWideService (IgProfService const *)
 
bool isProcessWideService (JeProfService const *)
 
bool isProcessWideService (TFileService const *)
 
bool isProcessWideService (SiteLocalConfigService const *)
 
bool isProcessWideService (InitRootHandlers const *)
 
bool isProcessWideService (MessageLogger const *)
 
bool isProcessWideService (DependencyGraph const *)
 
bool isProcessWideService (ROCmService const *)
 
bool isProcessWideService (CUDAService const *)
 
static std::vector< std::chrono::steady_clock::time_point > & moduleTimeStack ()
 
std::ostream & operator<< (std::ostream &os, SimpleMemoryCheck::SignificantEvent const &se)
 
std::ostream & operator<< (std::ostream &os, SimpleMemoryCheck::SignificantModule const &se)
 
static double popStack ()
 
static void pushStack (bool configuredInTopLevelProcess)
 
static std::string ui2str (unsigned int i)
 

Variables

static constexpr char dashC [] = "-c"
 
static const std::string hereMsg = "available via this destination"
 
static const std::string noosMsg = "No ostream"
 
static const std::string notELoutputMsg = "This destination is not an ELoutput"
 
static constexpr char pstackName [] = "(CMSSW stack trace helper)"
 

Function Documentation

◆ cmssw_stacktrace()

int edm::service::cmssw_stacktrace ( void *  )

Definition at line 740 of file InitRootHandlers.cc.

References GCPpyPlots::argv, and edm::service::InitRootHandlers::getPstackArgv().

Referenced by cmssw_stacktrace_fork().

740  {
741  set_default_signals();
742 
744  // NOTE: this is NOT async-signal-safe at CERN's lxplus service.
745  // CERN uses LD_PRELOAD to replace execv with a function from libsnoopy which
746  // calls dlsym.
747 #ifdef __linux__
748  syscall(SYS_execve, "/bin/sh", argv, __environ);
749 #else
750  execv("/bin/sh", argv);
751 #endif
752  ::abort();
753  return 1;
754  }
static char const *const * getPstackArgv()

◆ cmssw_stacktrace_fork()

void edm::service::cmssw_stacktrace_fork ( )
static

Definition at line 709 of file InitRootHandlers.cc.

References clone(), cmssw_stacktrace(), and mps_update::status.

Referenced by edm::service::InitRootHandlers::stacktraceHelperThread().

709  {
710  char child_stack[4 * 1024];
711  char* child_stack_ptr = child_stack + 4 * 1024;
712  // On Linux, we currently use jemalloc. This registers pthread_atfork handlers; these
713  // handlers are *not* async-signal safe. Hence, a deadlock is possible if we invoke
714  // fork() from our signal handlers. Accordingly, we use clone (not POSIX, but AS-safe)
715  // as that is closer to the 'raw metal' syscall and avoids pthread_atfork handlers.
716  int pid =
717 #ifdef __linux__
718  clone(edm::service::cmssw_stacktrace, child_stack_ptr, CLONE_VM | CLONE_FS | SIGCHLD, nullptr);
719 #else
720  fork();
721  if (child_stack_ptr) {
722  } // Suppress 'unused variable' warning on non-Linux
723  if (pid == 0) {
725  }
726 #endif
727  if (pid == -1) {
728  full_cerr_write("(Attempt to perform stack dump failed.)\n");
729  } else {
730  int status;
731  if (waitpid(pid, &status, 0) == -1) {
732  full_cerr_write("(Failed to wait on stack dump output.)\n");
733  }
734  if (status) {
735  full_cerr_write("(GDB stack trace failed unexpectedly)\n");
736  }
737  }
738  }
int cmssw_stacktrace(void *)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135

◆ d2str() [1/2]

static std::string edm::service::d2str ( double  d)
static

Definition at line 148 of file Timing.cc.

References ztail::d, and submitPVValidationJobs::t.

148  {
149  std::stringstream t;
150  t << d;
151  return t.str();
152  }
d
Definition: ztail.py:151

◆ d2str() [2/2]

static std::string edm::service::d2str ( double  d)
static

Definition at line 275 of file SimpleMemoryCheck.cc.

References ztail::d, and submitPVValidationJobs::t.

Referenced by edm::service::SimpleMemoryCheck::eventStatOutput(), edm::service::Timing::postEndJob(), and edm::service::SimpleMemoryCheck::postEndJob().

275  {
276  std::ostringstream t;
277  t << d;
278  return t.str();
279  }
d
Definition: ztail.py:151

◆ getChildrenCPU()

static double edm::service::getChildrenCPU ( )
static

Definition at line 162 of file Timing.cc.

References usage().

Referenced by edm::service::Timing::postEndJob().

162  {
163  struct rusage usage;
164 
165  getrusage(RUSAGE_CHILDREN, &usage);
166  double totalCPUTime = (double)usage.ru_utime.tv_sec + (double(usage.ru_utime.tv_usec) * 1E-6);
167  totalCPUTime += (double)usage.ru_stime.tv_sec + (double(usage.ru_stime.tv_usec) * 1E-6);
168 
169  return totalCPUTime;
170  }
void usage()
Definition: array2xmlEB.cc:14

◆ getCPU()

static double edm::service::getCPU ( )
static

Definition at line 172 of file Timing.cc.

References usage().

Referenced by edm::service::Timing::beginProcessing(), edm::service::Timing::getTotalCPU(), and edm::service::Timing::postEndJob().

172  {
173  struct rusage usage;
174  getrusage(RUSAGE_SELF, &usage);
175 
176  double totalCPUTime = 0.0;
177  // User code
178  totalCPUTime = (double)usage.ru_utime.tv_sec + (double(usage.ru_utime.tv_usec) * 1E-6);
179  // System functions
180  totalCPUTime += (double)usage.ru_stime.tv_sec + (double(usage.ru_stime.tv_usec) * 1E-6);
181 
182  // Additionally, add in CPU usage from our child processes.
183  getrusage(RUSAGE_CHILDREN, &usage);
184  totalCPUTime += (double)usage.ru_utime.tv_sec + (double(usage.ru_utime.tv_usec) * 1E-6);
185  totalCPUTime += (double)usage.ru_stime.tv_sec + (double(usage.ru_stime.tv_usec) * 1E-6);
186 
187  return totalCPUTime;
188  }
void usage()
Definition: array2xmlEB.cc:14

◆ getTime()

static std::chrono::steady_clock::time_point edm::service::getTime ( )
static

◆ i2str()

static std::string edm::service::i2str ( int  i)
static

Definition at line 281 of file SimpleMemoryCheck.cc.

References mps_fire::i, and submitPVValidationJobs::t.

Referenced by edm::service::SimpleMemoryCheck::eventStatOutput(), and edm::service::SimpleMemoryCheck::postEndJob().

281  {
282  std::ostringstream t;
283  t << i;
284  return t.str();
285  }

◆ isProcessWideService() [1/16]

bool edm::service::isProcessWideService ( void const *  )
inline

Definition at line 29 of file ServiceMakerBase.h.

29 { return false; }

◆ isProcessWideService() [2/16]

bool edm::service::isProcessWideService ( JobReportService const *  )
inline

Definition at line 46 of file JobReportService.h.

46 { return true; }

◆ isProcessWideService() [3/16]

bool edm::service::isProcessWideService ( TFileAdaptor const *  )
inline

Definition at line 54 of file TFileAdaptor.h.

54 { return true; }

◆ isProcessWideService() [4/16]

bool edm::service::isProcessWideService ( ZombieKillerService const *  )
inline

Definition at line 55 of file ZombieKillerService.cc.

55 { return true; }

◆ isProcessWideService() [5/16]

bool edm::service::isProcessWideService ( CPU const *  )
inline

Definition at line 71 of file CPU.cc.

71 { return true; }

◆ isProcessWideService() [6/16]

bool edm::service::isProcessWideService ( ResourceInformationService const *  )
inline

Definition at line 77 of file ResourceInformationService.cc.

77 { return true; }

◆ isProcessWideService() [7/16]

bool edm::service::isProcessWideService ( CondorStatusService const *  )
inline

Definition at line 86 of file CondorStatusUpdater.cc.

86 { return true; }

◆ isProcessWideService() [8/16]

bool edm::service::isProcessWideService ( IgProfService const *  )
inline

Definition at line 91 of file IgProfService.h.

91 { return true; }

◆ isProcessWideService() [9/16]

bool edm::service::isProcessWideService ( JeProfService const *  )
inline

Definition at line 95 of file JeProfService.cc.

95 { return true; }

◆ isProcessWideService() [10/16]

bool edm::service::isProcessWideService ( TFileService const *  )
inline

Definition at line 98 of file TFileService.h.

Referenced by edm::serviceregistry::ServiceMaker< T, TMaker >::processWideService().

98 { return true; }

◆ isProcessWideService() [11/16]

bool edm::service::isProcessWideService ( SiteLocalConfigService const *  )
inline

Definition at line 110 of file SiteLocalConfigService.h.

110 { return true; }

◆ isProcessWideService() [12/16]

bool edm::service::isProcessWideService ( InitRootHandlers const *  )
inline

Definition at line 144 of file InitRootHandlers.cc.

144 { return true; }

◆ isProcessWideService() [13/16]

bool edm::service::isProcessWideService ( MessageLogger const *  )
inline

Definition at line 195 of file MessageLogger.h.

195 { return true; }

◆ isProcessWideService() [14/16]

bool edm::service::isProcessWideService ( DependencyGraph const *  )
inline

Definition at line 343 of file DependencyGraph.cc.

343 { return true; }

◆ isProcessWideService() [15/16]

bool edm::service::isProcessWideService ( ROCmService const *  )
inline

Definition at line 390 of file ROCmService.cc.

390 { return true; }

◆ isProcessWideService() [16/16]

bool edm::service::isProcessWideService ( CUDAService const *  )
inline

Definition at line 482 of file CUDAService.cc.

482 { return true; }

◆ moduleTimeStack()

static std::vector<std::chrono::steady_clock::time_point>& edm::service::moduleTimeStack ( )
static

Definition at line 193 of file Timing.cc.

Referenced by popStack(), and pushStack().

193  {
194  static thread_local std::vector<std::chrono::steady_clock::time_point> s_stack;
195  return s_stack;
196  }

◆ operator<<() [1/2]

std::ostream & edm::service::operator<< ( std::ostream &  os,
SimpleMemoryCheck::SignificantEvent const &  se 
)

Definition at line 972 of file SimpleMemoryCheck.cc.

References edm::service::SimpleMemoryCheck::SignificantEvent::count, edm::service::SimpleMemoryCheck::SignificantEvent::deltaRss, edm::service::SimpleMemoryCheck::SignificantEvent::deltaVsize, edm::service::SimpleMemoryCheck::SignificantEvent::event, edm::service::SimpleMemoryCheck::SignificantEvent::monitorPssAndPrivate, edm::service::SimpleMemoryCheck::SignificantEvent::privateSize, edm::service::SimpleMemoryCheck::SignificantEvent::pss, edm::service::SimpleMemoryCheck::SignificantEvent::rss, and edm::service::SimpleMemoryCheck::SignificantEvent::vsize.

972  {
973  os << "[" << se.count << "] " << se.event << " vsize = " << se.vsize << " deltaVsize = " << se.deltaVsize
974  << " rss = " << se.rss << " delta = " << se.deltaRss;
975 
976  if (se.monitorPssAndPrivate) {
977  os << " private = " << se.privateSize << " pss = " << se.pss;
978  }
979  return os;
980  }

◆ operator<<() [2/2]

std::ostream & edm::service::operator<< ( std::ostream &  os,
SimpleMemoryCheck::SignificantModule const &  se 
)

Definition at line 982 of file SimpleMemoryCheck.cc.

References edm::service::SimpleMemoryCheck::SignificantModule::eventMaxDeltaV, edm::service::SimpleMemoryCheck::SignificantModule::maxDeltaVsize, edm::service::SimpleMemoryCheck::SignificantModule::maxEarlyVsize, edm::service::SimpleMemoryCheck::SignificantModule::postEarlyCount, edm::service::SimpleMemoryCheck::SignificantModule::totalDeltaVsize, and edm::service::SimpleMemoryCheck::SignificantModule::totalEarlyVsize.

982  {
983  if (sm.postEarlyCount > 0) {
984  os << "\nPost Early Events: TotalDeltaVsize: " << sm.totalDeltaVsize
985  << " (avg: " << sm.totalDeltaVsize / sm.postEarlyCount << "; max: " << sm.maxDeltaVsize << " during "
986  << sm.eventMaxDeltaV << ")";
987  }
988  if (sm.totalEarlyVsize > 0) {
989  os << "\n Early Events: TotalDeltaVsize: " << sm.totalEarlyVsize << " (max: " << sm.maxEarlyVsize << ")";
990  }
991 
992  return os;
993  }

◆ popStack()

static double edm::service::popStack ( )
static

Definition at line 198 of file Timing.cc.

References cms::cuda::assert(), getTime(), moduleTimeStack(), and submitPVValidationJobs::t.

Referenced by edm::service::Timing::postCommon().

198  {
199  auto& modStack = moduleTimeStack();
200  assert(!modStack.empty());
201  auto curr_module_time = modStack.back();
202  modStack.pop_back();
203  std::chrono::duration<double, std::ratio<1, 1>> t = getTime() - curr_module_time;
204  return t.count();
205  }
static std::chrono::steady_clock::time_point getTime()
Definition: Timing.cc:160
assert(be >=bs)
static std::vector< std::chrono::steady_clock::time_point > & moduleTimeStack()
Definition: Timing.cc:193

◆ pushStack()

static void edm::service::pushStack ( bool  configuredInTopLevelProcess)
static

Definition at line 207 of file Timing.cc.

References getTime(), and moduleTimeStack().

Referenced by edm::service::Timing::preModule(), edm::service::Timing::preModuleGlobal(), edm::service::Timing::preModuleStream(), edm::service::Timing::preOpenFile(), edm::service::Timing::preSourceEvent(), edm::service::Timing::preSourceLumi(), and edm::service::Timing::preSourceRun().

207  {
208  if (!configuredInTopLevelProcess) {
209  return;
210  }
211  auto& modStack = moduleTimeStack();
212  modStack.push_back(getTime());
213  }
static std::chrono::steady_clock::time_point getTime()
Definition: Timing.cc:160
static std::vector< std::chrono::steady_clock::time_point > & moduleTimeStack()
Definition: Timing.cc:193

◆ ui2str()

static std::string edm::service::ui2str ( unsigned int  i)
static

Definition at line 154 of file Timing.cc.

References mps_fire::i, and submitPVValidationJobs::t.

Referenced by edm::service::Timing::postEndJob().

154  {
155  std::stringstream t;
156  t << i;
157  return t.str();
158  }

Variable Documentation

◆ dashC

constexpr char edm::service::dashC[] = "-c"
static

Definition at line 757 of file InitRootHandlers.cc.

◆ hereMsg

const std::string edm::service::hereMsg = "available via this destination"
static

Definition at line 83 of file ELdestination.cc.

◆ noosMsg

const std::string edm::service::noosMsg = "No ostream"
static

◆ notELoutputMsg

const std::string edm::service::notELoutputMsg = "This destination is not an ELoutput"
static

Definition at line 85 of file ELdestination.cc.

Referenced by edm::service::ELdestination::changeFile().

◆ pstackName

constexpr char edm::service::pstackName[] = "(CMSSW stack trace helper)"
static

Definition at line 756 of file InitRootHandlers.cc.