CMS 3D CMS Logo

Namespaces | Classes | Functions | Variables
edm::service Namespace Reference

Namespaces

 monitor_file_utilities
 
 tracer
 

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  FixMissingStreamerInfos
 
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 (ROCmService const *)
 
bool isProcessWideService (DependencyGraph 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 743 of file InitRootHandlers.cc.

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

Referenced by cmssw_stacktrace_fork().

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

◆ cmssw_stacktrace_fork()

void edm::service::cmssw_stacktrace_fork ( )
static

Definition at line 712 of file InitRootHandlers.cc.

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

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

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

94 { 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 145 of file InitRootHandlers.cc.

145 { 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 ( ROCmService const *  )
inline

Definition at line 332 of file ROCmService.cc.

332 { return true; }

◆ isProcessWideService() [15/16]

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

Definition at line 423 of file DependencyGraph.cc.

423 { 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 976 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.

976  {
977  os << "[" << se.count << "] " << se.event << " vsize = " << se.vsize << " deltaVsize = " << se.deltaVsize
978  << " rss = " << se.rss << " delta = " << se.deltaRss;
979 
980  if (se.monitorPssAndPrivate) {
981  os << " private = " << se.privateSize << " pss = " << se.pss;
982  }
983  return os;
984  }

◆ operator<<() [2/2]

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

Definition at line 986 of file SimpleMemoryCheck.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::sm().

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

◆ 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 760 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 759 of file InitRootHandlers.cc.