Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
EvtRangeProcessor Class Referencefinalabstract

#include <EvtRangeProcessor.h>

Inheritance diagram for EvtRangeProcessor:
Collaboration diagram for EvtRangeProcessor:

Public Member Functions

 EvtRangeProcessor (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~EvtRangeProcessor () override
 
virtual StatusCode initialize () override
 
virtual int makePool ATLAS_NOT_THREAD_SAFE (int maxevt, int nprocs, const std::string &topdir) override
 
virtual StatusCode exec ATLAS_NOT_THREAD_SAFE () override
 
virtual StatusCode wait_once ATLAS_NOT_THREAD_SAFE (pid_t &pid) override
 
virtual void reportSubprocessStatuses () override
 
virtual void subProcessLogs (std::vector< std::string > &) override
 
virtual AthenaMP::AllWorkerOutputs_ptr generateOutputReport () override
 
virtual std::unique_ptr< AthenaInterprocess::ScheduledWorkbootstrap_func () override
 
virtual std::unique_ptr< AthenaInterprocess::ScheduledWorkexec_func () override
 
virtual std::unique_ptr< AthenaInterprocess::ScheduledWorkfin_func () override
 
virtual StatusCode finalize () override
 
virtual void useFdsRegistry (std::shared_ptr< AthenaInterprocess::FdsRegistry >) override
 
virtual void setRandString (const std::string &randStr) override
 
virtual void setMaxEvt (int maxEvt) override
 
virtual void setMPRunStop (const AthenaInterprocess::IMPRunStop *runStop) override
 
virtual void killChildren () override
 
virtual std::unique_ptr< AthenaInterprocess::ScheduledWork > virtual operator() ATLAS_NOT_THREAD_SAFE(const AthenaInterprocess std::unique_ptr< AthenaInterprocess::ScheduledWorkbootstrap_func ()=0
 
virtual std::unique_ptr< ScheduledWork > operator () ATLAS_NOT_THREAD_SAFE(const ScheduledWork &)=0
 

Protected Types

enum  ESRange_Status {
  ESRANGE_SUCCESS, ESRANGE_NOTFOUND, ESRANGE_SEEKFAILED, ESRANGE_PROCFAILED,
  ESRANGE_FILENOTMADE, ESRANGE_BADINPFILE
}
 
enum  Func_Flag { FUNC_BOOTSTRAP, FUNC_EXEC, FUNC_FIN }
 

Protected Member Functions

int mapAsyncFlag ATLAS_NOT_THREAD_SAFE (Func_Flag flag, pid_t pid=0)
 
int redirectLog (const std::string &rundir, bool addTimeStamp=true)
 
int updateIoReg (const std::string &rundir)
 
std::string fmterror (int errnum)
 
int reopenFds ()
 
int handleSavedPfc (const std::filesystem::path &dest_path)
 
void waitForSignal ()
 
IEvtSelector * evtSelector ()
 

Protected Attributes

int m_nprocs {-1}
 Number of workers spawned by the master process. More...
 
int m_maxEvt {-1}
 Maximum number of events assigned to the job. More...
 
std::string m_subprocTopDir
 Top run directory for subprocesses. More...
 
std::string m_subprocDirPrefix
 For ex. "worker__". More...
 
std::string m_evtSelName
 Name of the event selector. More...
 
AthenaInterprocess::ProcessGroupm_processGroup {nullptr}
 
const AthenaInterprocess::IMPRunStopm_mpRunStop {nullptr}
 
ServiceHandle< IEventProcessor > m_evtProcessor
 
ServiceHandle< IAppMgrUI > m_appMgr
 
ServiceHandle< IFileMgr > m_fileMgr
 
ServiceHandle< IIoComponentMgr > m_ioMgr
 
SmartIF< IEvtSelector > m_evtSelector
 
std::string m_fileMgrLog
 
std::shared_ptr< AthenaInterprocess::FdsRegistrym_fdsRegistry
 
std::string m_randStr
 
Gaudi::Property< bool > m_isPileup {this, "IsPileup", false, "Flag for configuring PileUpEventLoopMgr"}
 

Private Types

enum  ProcessState { PROC_STATE_INIT, PROC_STATE_EXEC, PROC_STATE_FIN, PROC_STATE_STOP }
 

Private Member Functions

StatusCode startProcess ATLAS_NOT_THREAD_SAFE ()
 
StatusCode setNewInputFile (const std::string &newFile)
 
void reportError (yampl::ISocket *socket, AthenaMPToolBase::ESRange_Status status)
 
int reopenFd (int fd, const std::string &name)
 

Private Attributes

Gaudi::Property< int > m_nEventsBeforeFork {this, "EventsBeforeFork", 0, "Number of events before forking"}
 
Gaudi::Property< std::string > m_channel2Scatterer {this, "Channel2Scatterer", {}}
 
Gaudi::Property< std::string > m_channel2EvtSel {this, "Channel2EvtSel", {}}
 
Gaudi::Property< bool > m_debug {this, "Debug", false}
 
int m_rankId {-1}
 Each worker has its own unique RankID from the range (0,...,m_nprocs-1) More...
 
int m_activeWorkers {0}
 Keep track of the number of workers. More...
 
std::string m_inpFile
 Cached name of the input file. To avoid reopening. More...
 
ServiceHandle< IChronoStatSvc > m_chronoStatSvc
 
ServiceHandle< IIncidentSvc > m_incidentSvc
 
SmartIF< IEvtSelectorSeekm_evtSeek
 
std::unique_ptr< AthenaInterprocess::SharedQueuem_sharedRankQueue
 
AthenaInterprocess::SharedQueuem_sharedFailedPidQueue {nullptr}
 
std::map< pid_t, int > m_nProcessedEvents
 
std::deque< pid_tm_finQueue
 
std::map< pid_t, ProcessStatem_procStates
 

Detailed Description

Definition at line 25 of file EvtRangeProcessor.h.

Member Enumeration Documentation

◆ ESRange_Status

enum AthenaMPToolBase::ESRange_Status
protectedinherited
Enumerator
ESRANGE_SUCCESS 
ESRANGE_NOTFOUND 
ESRANGE_SEEKFAILED 
ESRANGE_PROCFAILED 
ESRANGE_FILENOTMADE 
ESRANGE_BADINPFILE 

Definition at line 58 of file AthenaMPToolBase.h.

◆ Func_Flag

enum AthenaMPToolBase::Func_Flag
protectedinherited
Enumerator
FUNC_BOOTSTRAP 
FUNC_EXEC 
FUNC_FIN 

Definition at line 67 of file AthenaMPToolBase.h.

67  {
69  , FUNC_EXEC
70  , FUNC_FIN
71  };

◆ ProcessState

Enumerator
PROC_STATE_INIT 
PROC_STATE_EXEC 
PROC_STATE_FIN 
PROC_STATE_STOP 

Definition at line 56 of file EvtRangeProcessor.h.

56  {
61  };

Constructor & Destructor Documentation

◆ EvtRangeProcessor()

EvtRangeProcessor::EvtRangeProcessor ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 33 of file EvtRangeProcessor.cxx.

37  , m_chronoStatSvc("ChronoStatSvc", name)
38  , m_incidentSvc("IncidentSvc", name)
39 {
40  m_subprocDirPrefix = "worker_";
41 }

◆ ~EvtRangeProcessor()

EvtRangeProcessor::~EvtRangeProcessor ( )
overridevirtual

Definition at line 43 of file EvtRangeProcessor.cxx.

44 {
45 }

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/5]

StatusCode startProcess EvtRangeProcessor::ATLAS_NOT_THREAD_SAFE ( )
private

◆ ATLAS_NOT_THREAD_SAFE() [2/5]

virtual StatusCode exec EvtRangeProcessor::ATLAS_NOT_THREAD_SAFE ( )
overridevirtual

◆ ATLAS_NOT_THREAD_SAFE() [3/5]

int mapAsyncFlag AthenaMPToolBase::ATLAS_NOT_THREAD_SAFE ( Func_Flag  flag,
pid_t  pid = 0 
)
protectedinherited

◆ ATLAS_NOT_THREAD_SAFE() [4/5]

virtual int makePool EvtRangeProcessor::ATLAS_NOT_THREAD_SAFE ( int  maxevt,
int  nprocs,
const std::string &  topdir 
)
overridevirtual

◆ ATLAS_NOT_THREAD_SAFE() [5/5]

virtual StatusCode wait_once EvtRangeProcessor::ATLAS_NOT_THREAD_SAFE ( pid_t pid)
overridevirtual

Reimplemented from AthenaMPToolBase.

◆ bootstrap_func() [1/2]

std::unique_ptr< AthenaInterprocess::ScheduledWork > EvtRangeProcessor::bootstrap_func ( )
overridevirtual

Definition at line 357 of file EvtRangeProcessor.cxx.

358 {
359  if(m_debug) waitForSignal();
360 
361  std::unique_ptr<AthenaInterprocess::ScheduledWork> outwork(new AthenaInterprocess::ScheduledWork);
362  outwork->data = malloc(sizeof(int));
363  *(int*)(outwork->data) = 1; // Error code: for now use 0 success, 1 failure
364  outwork->size = sizeof(int);
365  // ...
366  // (possible) TODO: extend outwork with some error message, which will be eventually
367  // reported in the master proces
368  // ...
369 
370  // ________________________ Get RankID ________________________
371  //
372  if(!m_sharedRankQueue->receive_basic<int>(m_rankId)) {
373  ATH_MSG_ERROR("Unable to get rank ID!");
374  return outwork;
375  }
376  std::ostringstream workindex;
377  workindex<<m_rankId;
378 
379  // ________________________ Worker dir: mkdir ________________________
380  std::filesystem::path worker_rundir(m_subprocTopDir);
381  worker_rundir /= std::filesystem::path(m_subprocDirPrefix+workindex.str());
382  // TODO: this "worker_" can be made configurable too
383 
384  if(mkdir(worker_rundir.string().c_str(),S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)==-1) {
385  ATH_MSG_ERROR("Unable to make worker run directory: " << worker_rundir.string() << ". " << fmterror(errno));
386  return outwork;
387  }
388 
389  // ________________________ Redirect logs ________________________
390  if(!m_debug) {
391  if(redirectLog(worker_rundir.string()))
392  return outwork;
393 
394  ATH_MSG_INFO("Logs redirected in the AthenaMP event worker PID=" << getpid());
395  }
396 
397  // ________________________ Update Io Registry ____________________________
398  if(updateIoReg(worker_rundir.string()))
399  return outwork;
400 
401  ATH_MSG_INFO("Io registry updated in the AthenaMP event worker PID=" << getpid());
402 
403  // ________________________ SimParams & DigiParams & PDGTABLE.MeV ____________________________
404  std::filesystem::path abs_worker_rundir = std::filesystem::absolute(worker_rundir);
405  if(std::filesystem::is_regular_file("SimParams.db"))
406  COPY_FILE_HACK("SimParams.db", abs_worker_rundir.string()+"/SimParams.db");
407  if(std::filesystem::is_regular_file("DigitParams.db"))
408  COPY_FILE_HACK("DigitParams.db", abs_worker_rundir.string()+"/DigitParams.db");
409  if(std::filesystem::is_regular_file("PDGTABLE.MeV"))
410  COPY_FILE_HACK("PDGTABLE.MeV", abs_worker_rundir.string()+"/PDGTABLE.MeV");
411 
412  // _______________________ Handle saved PFC (if any) ______________________
413  if(handleSavedPfc(abs_worker_rundir))
414  return outwork;
415 
416  // ________________________ reopen descriptors ____________________________
417  if(reopenFds())
418  return outwork;
419 
420  ATH_MSG_INFO("File descriptors re-opened in the AthenaMP event worker PID=" << getpid());
421 
422 
423  // ________________________ I/O reinit ________________________
424  if(!m_ioMgr->io_reinitialize().isSuccess()) {
425  ATH_MSG_ERROR("Failed to reinitialize I/O");
426  return outwork;
427  } else {
428  ATH_MSG_DEBUG("Successfully reinitialized I/O");
429  }
430 
431  // ________________________ Event selector restart ________________________
432  IService* evtSelSvc = dynamic_cast<IService*>(evtSelector());
433  if(!evtSelSvc) {
434  ATH_MSG_ERROR("Failed to dyncast event selector to IService");
435  return outwork;
436  }
437  if(!evtSelSvc->start().isSuccess()) {
438  ATH_MSG_ERROR("Failed to restart the event selector");
439  return outwork;
440  } else {
441  ATH_MSG_DEBUG("Successfully restarted the event selector");
442  }
443 
444  // ________________________ Restart background event selectors in pileup jobs ________________________
445  if(m_isPileup) {
446  const std::list<IService*>& service_list = serviceLocator()->getServices();
447  std::list<IService*>::const_iterator itSvc = service_list.begin(),
448  itSvcLast = service_list.end();
449  for(;itSvc!=itSvcLast;++itSvc) {
450  IEvtSelector* evtsel = dynamic_cast<IEvtSelector*>(*itSvc);
451  if(evtsel && (evtsel != evtSelector())) {
452  if((*itSvc)->start().isSuccess())
453  ATH_MSG_DEBUG("Restarted event selector " << (*itSvc)->name());
454  else {
455  ATH_MSG_ERROR("Failed to restart event selector " << (*itSvc)->name());
456  return outwork;
457  }
458  }
459  }
460  }
461 
462  // ________________________ Worker dir: chdir ________________________
463  if(chdir(worker_rundir.string().c_str())==-1) {
464  ATH_MSG_ERROR("Failed to chdir to " << worker_rundir.string());
465  return outwork;
466  }
467 
468  // Declare success and return
469  *(int*)(outwork->data) = 0;
470  return outwork;
471 }

◆ bootstrap_func() [2/2]

virtual std::unique_ptr<AthenaInterprocess::ScheduledWork> virtual operator () ATLAS_NOT_THREAD_SAFE ( const AthenaInterprocess std::unique_ptr<AthenaInterprocess::ScheduledWork> AthenaMPToolBase::bootstrap_func ( )
pure virtualinherited

◆ evtSelector()

IEvtSelector* AthenaMPToolBase::evtSelector ( )
inlineprotectedinherited

Definition at line 83 of file AthenaMPToolBase.h.

83 { return m_evtSelector; }

◆ exec_func()

std::unique_ptr< AthenaInterprocess::ScheduledWork > EvtRangeProcessor::exec_func ( )
overridevirtual

Implements AthenaMPToolBase.

Definition at line 473 of file EvtRangeProcessor.cxx.

474 {
475  ATH_MSG_INFO("Exec function in the AthenaMP worker PID=" << getpid());
476 
477  int nEvt(1);
478  int nEventsProcessed(0);
479 
480  std::queue<std::string> queueTokens;
481 
482  // Get the yampl connection channels
483  yampl::ISocketFactory* socketFactory = new yampl::SocketFactory();
484  std::string socket2ScattererName = m_channel2Scatterer.value() + std::string("_") + m_randStr;
485  yampl::ISocket* socket2Scatterer = socketFactory->createClientSocket(yampl::Channel(socket2ScattererName,yampl::LOCAL),yampl::MOVE_DATA);
486  ATH_MSG_INFO("Created CLIENT socket to the Scatterer: " << socket2ScattererName);
487  std::ostringstream pidstr;
488  pidstr << getpid();
489 
490  // Construct a "welcome" message to be sent to the EvtRangeScatterer
491  std::string ping = pidstr.str() + std::string(" ready for event processing");
492 
493  while(true) {
494  void* message2scatterer = malloc(ping.size());
495  memcpy(message2scatterer,ping.data(),ping.size());
496  socket2Scatterer->send(message2scatterer,ping.size());
497  ATH_MSG_INFO("Sent a welcome message to the Scatterer");
498 
499  // Get the response - list of tokens - from the scatterer.
500  // The format of the response: | ResponseSize | RangeID, | evtEvtRange[,evtToken] |
501  char *responseBuffer(0);
502  std::string strPeerId;
503  ssize_t responseSize = socket2Scatterer->recv(responseBuffer,strPeerId);
504  // If response size is 0 then break the loop
505  if(responseSize==1) {
506  ATH_MSG_INFO("Empty range received. Terminating the loop");
507  break;
508  }
509 
510  std::string responseStr(responseBuffer,responseSize);
511  ATH_MSG_INFO("Received response from the Scatterer : " << responseStr);
512 
513  // Start timing
514  System::ProcessTime time_start = System::getProcessTime();
515 
516  size_t startpos(0);
517  size_t endpos = responseStr.find(',');
518  while(endpos!=std::string::npos) {
519  queueTokens.push(responseStr.substr(startpos,endpos-startpos));
520  startpos = endpos+1;
521  endpos = responseStr.find(',',startpos);
522  }
523  queueTokens.push(responseStr.substr(startpos));
524  // Actually the first element in the tokens queue is the RangeID. Get it
525  std::string rangeID = queueTokens.front();
526  queueTokens.pop();
527  ATH_MSG_INFO("Received RangeID=" << rangeID);
528  // Fire an incident
529  m_incidentSvc->fireIncident(FileIncident(name(),"NextEventRange",rangeID));
530 
531  // Here we need to support two formats of the responseStr
532  // Format 1. RangeID,startEvent,endEvent
533  // Format 2. RangeID,fileName,startEvent,endEvent
534  //
535  // The difference between these two is that for Format 2 we first
536  // need to update InputCollections property on the Event Selector
537  // and only after that proceed with seeking
538  //
539  // The seeking part is identical for Format 1 and 2
540 
542 
543  // Determine the format
544  std::string filename("");
545  if(queueTokens.front().find("PFN:")==0) {
546  // We have Format 2
547  // Update InputCollections property of the Event Selector with the file name from Event Range
548  filename = queueTokens.front().substr(4);
549  if(setNewInputFile(filename).isFailure()) {
550  ATH_MSG_WARNING("Failed to set input file for the range: " << rangeID);
552  reportError(socket2Scatterer,rangeStatus);
553  m_incidentSvc->fireIncident(FileIncident(name(),"NextEventRange","dummy"));
554  continue;
555  }
556  queueTokens.pop();
557  }
558 
559  // Get the number of events to process
560  int startEvent = std::atoi(queueTokens.front().c_str());
561  queueTokens.pop();
562  int endEvent = std::atoi(queueTokens.front().c_str());
563  queueTokens.pop();
564  ATH_MSG_INFO("Range fields. File Name: " << (filename.empty()?"N/A":filename)
565  << ", First Event:" << startEvent
566  << ", Last Event:" << endEvent);
567 
568  // Process the events
569  IEvtSelector::Context* ctx = nullptr;
570  if (evtSelector()->createContext (ctx).isFailure()) {
571  ATH_MSG_WARNING("Failed to create IEventSelector context.");
573  }
574  else {
575  for(int i(startEvent-1); i<endEvent; ++i) {
576  StatusCode sc = m_evtSeek->seek(*ctx, i);
577  if(sc.isRecoverable()) {
578  ATH_MSG_WARNING("Event " << i << " from range: " << rangeID << " not in the input file");
580  break;
581  }
582  else if(sc.isFailure()) {
583  ATH_MSG_WARNING("Failed to seek to " << i << " in range: " << rangeID);
585  break;
586  }
587  ATH_MSG_INFO("Seek to " << i << " succeeded");
588  m_chronoStatSvc->chronoStart("AthenaMP_nextEvent");
589  sc = m_evtProcessor->nextEvent(nEvt++);
590 
591  m_chronoStatSvc->chronoStop("AthenaMP_nextEvent");
592  if(sc.isFailure()){
593  ATH_MSG_WARNING("Failed to process the event " << i << " in range:" << rangeID);
595  break;
596  }
597  else {
598  ATH_MSG_DEBUG("Event processed");
599  nEventsProcessed++;
600  }
601  }
602  }
603  if (evtSelector()->releaseContext (ctx).isFailure()) {
604  ATH_MSG_WARNING("Failed to release IEventSelector context.");
605  }
606 
607  // Fire dummy NextEventRange incident in order to cut the previous output and report it
608  m_incidentSvc->fireIncident(FileIncident(name(),"NextEventRange","dummy"));
609  if(rangeStatus!=AthenaMPToolBase::ESRANGE_SUCCESS) {
610  reportError(socket2Scatterer,rangeStatus);
611  continue;
612  }
613 
614  // Event range successfully processed
615  std::string strOutpFile;
616  // Get the full path of the event range output file
617  for(std::filesystem::directory_iterator fdIt(std::filesystem::current_path()); fdIt!=std::filesystem::directory_iterator(); fdIt++) {
618  if(fdIt->path().string().rfind(rangeID) == fdIt->path().string().size()-rangeID.size()) {
619  if(strOutpFile.empty()) {
620  strOutpFile = fdIt->path().string();
621  }
622  else {
623  strOutpFile += (std::string(",")+fdIt->path().string());
624  }
625  }
626  }
627 
628  // Stop timing
629  System::ProcessTime time_delta = System::getProcessTime() - time_start;
630 
631  // Prepare the output report
632  if(!strOutpFile.empty()) {
633  // We need to combine the output file name with
634  // 1. RangeID (requested by JEDI)
635  // 2. CPU time
636  // 3. Wall time
637  std::ostringstream outputReportStream;
638  outputReportStream << strOutpFile
639  << ",ID:" << rangeID
640  << ",CPU:" << time_delta.cpuTime<System::Sec>()
641  << ",WALL:" << time_delta.elapsedTime<System::Sec>();
642  std::string outputFileReport = outputReportStream.str();
643 
644  // Report the output
645  message2scatterer = malloc(outputFileReport.size());
646  memcpy(message2scatterer,outputFileReport.data(),outputFileReport.size());
647  socket2Scatterer->send(message2scatterer,outputFileReport.size());
648  ATH_MSG_INFO("Reported the output " << outputFileReport);
649  }
650  else {
651  // This is an error: range successfully processed but no outputs were made
652  ATH_MSG_WARNING("Failed to make an output file for range: " << rangeID);
654  }
655  } // Main "event loop"
656 
657  if(m_evtProcessor->executeRun(0).isFailure()) {
658  ATH_MSG_WARNING("Could not finalize the Run");
659  }
660 
661  std::unique_ptr<AthenaInterprocess::ScheduledWork> outwork(new AthenaInterprocess::ScheduledWork);
662 
663  // Return value: "ERRCODE|Func_Flag|NEvt"
664  int outsize = 2*sizeof(int)+sizeof(AthenaMPToolBase::Func_Flag);
665  void* outdata = malloc(outsize);
666  *(int*)(outdata) = 0; // Error code: for now use 0 success, 1 failure
668  memcpy((char*)outdata+sizeof(int),&func,sizeof(func));
669  memcpy((char*)outdata+sizeof(int)+sizeof(func),&nEventsProcessed,sizeof(int));
670 
671  outwork->data = outdata;
672  outwork->size = outsize;
673  // ...
674  // (possible) TODO: extend outwork with some error message, which will be eventually
675  // reported in the master proces
676  // ...
677 
678  delete socket2Scatterer;
679  delete socketFactory;
680 
681  return outwork;
682 }

◆ fin_func()

std::unique_ptr< AthenaInterprocess::ScheduledWork > EvtRangeProcessor::fin_func ( )
overridevirtual

Implements AthenaMPToolBase.

Definition at line 684 of file EvtRangeProcessor.cxx.

685 {
686  ATH_MSG_INFO("Fin function in the AthenaMP worker PID=" << getpid());
687 
688  if(m_appMgr->stop().isFailure()) {
689  ATH_MSG_WARNING("Unable to stop AppMgr");
690  }
691  else {
692  if(m_appMgr->finalize().isFailure()) {
693  std::cout << "Unable to finalize AppMgr" << std::endl;
694  }
695  }
696 
697  std::unique_ptr<AthenaInterprocess::ScheduledWork> outwork(new AthenaInterprocess::ScheduledWork);
698 
699  // Return value: "ERRCODE|Func_Flag|NEvt" (Here NEvt=-1)
700  int outsize = 2*sizeof(int)+sizeof(AthenaMPToolBase::Func_Flag);
701  void* outdata = malloc(outsize);
702  *(int*)(outdata) = 0; // Error code: for now use 0 success, 1 failure
704  memcpy((char*)outdata+sizeof(int),&func,sizeof(func));
705  int nEvt = -1;
706  memcpy((char*)outdata+sizeof(int)+sizeof(func),&nEvt,sizeof(int));
707 
708  outwork->data = outdata;
709  outwork->size = outsize;
710 
711  return outwork;
712 }

◆ finalize()

StatusCode AthenaMPToolBase::finalize ( )
overridevirtualinherited

Reimplemented in SharedEvtQueueConsumer, SharedHiveEvtQueueConsumer, EvtRangeScatterer, and SharedWriterTool.

Definition at line 86 of file AthenaMPToolBase.cxx.

87 {
88  return StatusCode::SUCCESS;
89 }

◆ fmterror()

std::string AthenaMPToolBase::fmterror ( int  errnum)
protectedinherited

Definition at line 332 of file AthenaMPToolBase.cxx.

333 {
334  char buf[256];
335  strerror_r(errnum, buf, sizeof(buf));
336  return std::string(buf);
337 }

◆ generateOutputReport()

AthenaMP::AllWorkerOutputs_ptr EvtRangeProcessor::generateOutputReport ( )
overridevirtual

Reimplemented from AthenaMPToolBase.

Definition at line 351 of file EvtRangeProcessor.cxx.

352 {
354  return jobOutputs;
355 }

◆ handleSavedPfc()

int AthenaMPToolBase::handleSavedPfc ( const std::filesystem::path &  dest_path)
protectedinherited

Definition at line 395 of file AthenaMPToolBase.cxx.

396 {
397  if(std::filesystem::is_regular_file("PoolFileCatalog.xml.AthenaMP-saved"))
398  COPY_FILE_HACK("PoolFileCatalog.xml.AthenaMP-saved",dest_path.string()+"/PoolFileCatalog.xml");
399  return 0;
400 }

◆ initialize()

StatusCode EvtRangeProcessor::initialize ( )
overridevirtual

Reimplemented from AthenaMPToolBase.

Definition at line 47 of file EvtRangeProcessor.cxx.

48 {
49  ATH_MSG_DEBUG("In initialize");
50 
52  m_evtSeek = serviceLocator()->service(m_evtSelName);
53  ATH_CHECK(m_evtSeek.isValid());
54  ATH_CHECK(m_chronoStatSvc.retrieve());
55  ATH_CHECK(m_incidentSvc.retrieve());
56 
57  return StatusCode::SUCCESS;
58 }

◆ killChildren()

void AthenaMPToolBase::killChildren ( )
overridevirtualinherited

Definition at line 200 of file AthenaMPToolBase.cxx.

201 {
203  kill(child.getProcessID(),SIGKILL);
204  }
205 }

◆ operator()

virtual std::unique_ptr<ScheduledWork> AthenaInterprocess::IMessageDecoder::operator ( ) const &
pure virtualinherited

◆ redirectLog()

int AthenaMPToolBase::redirectLog ( const std::string &  rundir,
bool  addTimeStamp = true 
)
protectedinherited

Definition at line 268 of file AthenaMPToolBase.cxx.

269 {
270  // Redirect both stdout and stderr to the same file AthenaMP.log
271  int dup2result1(0), dup2result2(0);
272 
273  int newout = open(std::string(rundir+"/AthenaMP.log").c_str(),O_CREAT | O_RDWR, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
274  if(newout==-1) {
275  ATH_MSG_ERROR("Unable to open log file in the run directory. " << fmterror(errno));
276  return -1;
277  }
278  dup2result1 = dup2(newout, STDOUT_FILENO);
279  dup2result2 = dup2(newout, STDERR_FILENO);
280  TEMP_FAILURE_RETRY(close(newout));
281  if(dup2result1==-1) {
282  ATH_MSG_ERROR("Unable to redirect standard output. " << fmterror(errno));
283  return -1;
284  }
285  if(dup2result2==-1) {
286  ATH_MSG_ERROR("Unable to redirect standard error. " << fmterror(errno));
287  return -1;
288  }
289 
290  if(addTimeStamp) {
291  SmartIF<IProperty> propertyServer(msgSvc());
292  if(propertyServer==0) {
293  ATH_MSG_ERROR("Unable to cast message svc to IProperty");
294  return -1;
295  }
296 
297  std::string propertyName("Format");
298  std::string oldFormat("");
299  StringProperty formatProp(propertyName,oldFormat);
300  StatusCode sc = propertyServer->getProperty(&formatProp);
301  if(sc.isFailure()) {
302  ATH_MSG_WARNING("Message Service does not have Format property");
303  }
304  else {
305  oldFormat = formatProp.value();
306  if(oldFormat.find("%t")==std::string::npos) {
307  // Add time stamps
308  std::string newFormat("%t " + oldFormat);
309  StringProperty newFormatProp(propertyName,newFormat);
310  ATH_CHECK(propertyServer->setProperty(newFormatProp), -1);
311  }
312  else {
313  ATH_MSG_DEBUG("MsgSvc format already contains timestamps. Nothing to be done");
314  }
315  }
316  }
317 
318  return 0;
319 }

◆ reopenFd()

int AthenaMPToolBase::reopenFd ( int  fd,
const std::string &  name 
)
privateinherited

Definition at line 418 of file AthenaMPToolBase.cxx.

419 {
420  ATH_MSG_DEBUG("Attempting to reopen descriptor for " << name);
421  int old_openflags = fcntl(fd,F_GETFL,0);
422  switch(old_openflags & O_ACCMODE) {
423  case O_RDONLY: {
424  ATH_MSG_DEBUG("The File Access Mode is RDONLY");
425  break;
426  }
427  case O_WRONLY: {
428  ATH_MSG_DEBUG("The File Access Mode is WRONLY");
429  break;
430  }
431  case O_RDWR: {
432  ATH_MSG_DEBUG("The File Access Mode is RDWR");
433  break;
434  }
435  }
436 
437  int old_descflags = fcntl(fd,F_GETFD,0);
438  off_t oldpos = lseek(fd,0,SEEK_CUR);
439  if(oldpos==-1) {
440  if(errno==ESPIPE) {
441  ATH_MSG_WARNING("Dealing with PIPE. Skipping ... (FIXME!)");
442  }
443  else {
444  ATH_MSG_ERROR("When re-opening file descriptors lseek failed on " << name << ". " << fmterror(errno));
445  return -1;
446  }
447  }
448  else {
449  Io::Fd newfd = open(name.c_str(),old_openflags);
450  if(newfd==-1) {
451  ATH_MSG_ERROR("When re-opening file descriptors unable to open " << name << " for reading. " << fmterror(errno));
452  return -1;
453  }
454  if(lseek(newfd,oldpos,SEEK_SET)==-1){
455  ATH_MSG_ERROR("When re-opening file descriptors lseek failed on the newly opened " << name << ". " << fmterror(errno));
456  TEMP_FAILURE_RETRY(close(newfd));
457  return -1;
458  }
459  TEMP_FAILURE_RETRY(close(fd));
460  if(dup2(newfd,fd)==-1) {
461  ATH_MSG_ERROR("When re-opening file descriptors unable to duplicate descriptor for " << name << ". " << fmterror(errno));
462  TEMP_FAILURE_RETRY(close(newfd));
463  return -1;
464  }
465  if(fcntl(fd,F_SETFD,old_descflags)==-1) {
466  ATH_MSG_ERROR("When re-opening file descriptors unable to set descriptor flags for " << name << ". " << fmterror(errno));
467  TEMP_FAILURE_RETRY(close(newfd));
468  return -1;
469  }
470  TEMP_FAILURE_RETRY(close(newfd));
471  }
472  return 0;
473 }

◆ reopenFds()

int AthenaMPToolBase::reopenFds ( )
protectedinherited

Definition at line 339 of file AthenaMPToolBase.cxx.

340 {
341  // Reopen file descriptors.
342  // First go over all open files, which have been registered with the FileMgr
343  // Then also check the FdsRegistry, in case it contains some files not registered with the FileMgr
344  std::set<int> fdLog;
345 
346  // Query the FileMgr contents
347  std::vector<const Io::FileAttr*> filemgrFiles;
348  std::vector<const Io::FileAttr*>::const_iterator itFile;
349  unsigned filenum = m_fileMgr->getFiles(filemgrFiles); // Get attributes for open files only. We don't care about closed ones at this point
350  if(filenum!=filemgrFiles.size())
351  ATH_MSG_WARNING("getFiles returned " << filenum << " while vector size is " << filemgrFiles.size());
352 
353  for(itFile=filemgrFiles.begin();itFile!=filemgrFiles.end();++itFile) {
354  ATH_MSG_DEBUG("* " << **itFile);
355  const std::string& filename = (**itFile).name();
356  Io::Fd fd = (**itFile).fd();
357 
358  if(fd==-1) {
359  // It is legal to have fd=-1 for remote inputs
360  // On the other hand, these inputs should not remain open after fork. The issue being tracked at ATEAM-434.
361  // So, this hopefully is a temporary patch
362  ATH_MSG_WARNING("FD=-1 detected on an open file retrieved from FileMgr. Skip FD reopening. File name: " << filename);
363  continue;
364  }
365 
366  if(reopenFd(fd,filename))
367  return -1;
368 
369  fdLog.insert(fd);
370  }
371 
372  // Check the FdsRegistry
373  for(const AthenaInterprocess::FdsRegistryEntry& regEntry : *m_fdsRegistry) {
374  if(fdLog.find(regEntry.fd)!=fdLog.end()) {
375  ATH_MSG_DEBUG("The file from FdsRegistry " << regEntry.name << " was registered with FileMgr. Skip reopening");
376  }
377  else {
378  ATH_MSG_WARNING("The file " << regEntry.name << " has not been registered with the FileMgr!");
379 
380  if(regEntry.fd==-1) {
381  // Same protection as the one above
382  ATH_MSG_WARNING("FD=-1 detected on an open file retrieved from FD Registry. Skip FD reopening. File name: " << regEntry.name);
383  continue;
384  }
385 
386  if(reopenFd(regEntry.fd,regEntry.name))
387  return -1;
388 
389  fdLog.insert(regEntry.fd);
390  }
391  }
392  return 0;
393 }

◆ reportError()

void EvtRangeProcessor::reportError ( yampl::ISocket *  socket,
AthenaMPToolBase::ESRange_Status  status 
)
private

Definition at line 773 of file EvtRangeProcessor.cxx.

774 {
775  pid_t pid = getpid();
776  size_t messageSize = sizeof(pid_t)+sizeof(AthenaMPToolBase::ESRange_Status);
777  void* message2scatterer = malloc(messageSize);
778  memcpy(message2scatterer,&pid,sizeof(pid_t));
779  memcpy((pid_t*)message2scatterer+1,&status,sizeof(AthenaMPToolBase::ESRange_Status));
780  socket->send(message2scatterer,messageSize);
781 }

◆ reportSubprocessStatuses()

void EvtRangeProcessor::reportSubprocessStatuses ( )
overridevirtual

Reimplemented from AthenaMPToolBase.

Definition at line 321 of file EvtRangeProcessor.cxx.

322 {
323  ATH_MSG_INFO("Statuses of event processors");
324  const std::vector<AthenaInterprocess::ProcessStatus>& statuses = m_processGroup->getStatuses();
325  for(size_t i=0; i<statuses.size(); ++i) {
326  // Get the number of events processed by this worker
327  std::map<pid_t,int>::const_iterator it = m_nProcessedEvents.find(statuses[i].pid);
328  std::ostringstream ostr;
329  if(it==m_nProcessedEvents.end())
330  ostr << "N/A";
331  else
332  ostr << it->second;
333  ATH_MSG_INFO("*** Process PID=" << statuses[i].pid
334  << ". Status " << ((statuses[i].exitcode)?"FAILURE":"SUCCESS")
335  << ". Number of events processed: " << ostr.str());
336  }
337 }

◆ setMaxEvt()

virtual void AthenaMPToolBase::setMaxEvt ( int  maxEvt)
inlineoverridevirtualinherited

Definition at line 44 of file AthenaMPToolBase.h.

44 {m_maxEvt=maxEvt;}

◆ setMPRunStop()

virtual void AthenaMPToolBase::setMPRunStop ( const AthenaInterprocess::IMPRunStop runStop)
inlineoverridevirtualinherited

Definition at line 45 of file AthenaMPToolBase.h.

45 {m_mpRunStop=runStop;}

◆ setNewInputFile()

StatusCode EvtRangeProcessor::setNewInputFile ( const std::string &  newFile)
private

Definition at line 739 of file EvtRangeProcessor.cxx.

740 {
741  if(m_inpFile == newFile) return StatusCode::SUCCESS;
742 
743  // Get Property Server
744  IProperty* propertyServer = dynamic_cast<IProperty*>(evtSelector());
745  if(!propertyServer) {
746  ATH_MSG_ERROR("Unable to dyn-cast the event selector to IProperty");
747  return StatusCode::FAILURE;
748  }
749 
750  std::string propertyName("InputCollections");
751  if(m_inpFile.empty()) {
752  std::vector<std::string> vect;
753  StringArrayProperty inputFileList(propertyName, vect);
754  if(propertyServer->getProperty(&inputFileList).isFailure()) {
755  ATH_MSG_ERROR("Failed to get InputCollections property value of the Event Selector");
756  return StatusCode::FAILURE;
757  }
758  if(newFile==inputFileList.value()[0]) {
759  m_inpFile = newFile;
760  return StatusCode::SUCCESS;
761  }
762  }
763  std::vector<std::string> vect{newFile,};
764  StringArrayProperty newInputFileList(propertyName, vect);
765  if(propertyServer->setProperty(newInputFileList).isFailure()) {
766  ATH_MSG_ERROR("Unable to update " << newInputFileList.name() << " property on the Event Selector");
767  return StatusCode::FAILURE;
768  }
769  m_inpFile=newFile;
770  return StatusCode::SUCCESS;
771 }

◆ setRandString()

void AthenaMPToolBase::setRandString ( const std::string &  randStr)
overridevirtualinherited

Definition at line 195 of file AthenaMPToolBase.cxx.

196 {
197  m_randStr = randStr;
198 }

◆ subProcessLogs()

void EvtRangeProcessor::subProcessLogs ( std::vector< std::string > &  filenames)
overridevirtual

Definition at line 339 of file EvtRangeProcessor.cxx.

340 {
341  filenames.clear();
342  for(int i=0; i<m_nprocs; ++i) {
343  std::ostringstream workerIndex;
344  workerIndex << i;
345  std::filesystem::path worker_rundir(m_subprocTopDir);
346  worker_rundir /= std::filesystem::path(m_subprocDirPrefix+workerIndex.str());
347  filenames.push_back(worker_rundir.string()+std::string("/AthenaMP.log"));
348  }
349 }

◆ updateIoReg()

int AthenaMPToolBase::updateIoReg ( const std::string &  rundir)
protectedinherited

Definition at line 321 of file AthenaMPToolBase.cxx.

322 {
323  ATH_CHECK(m_ioMgr.retrieve(), -1);
324 
325  // update the IoRegistry for the new workdir - make sure we use absolute path
327  ATH_CHECK(m_ioMgr->io_update_all(abs_rundir.string()), -1);
328 
329  return 0;
330 }

◆ useFdsRegistry()

void AthenaMPToolBase::useFdsRegistry ( std::shared_ptr< AthenaInterprocess::FdsRegistry registry)
overridevirtualinherited

Definition at line 190 of file AthenaMPToolBase.cxx.

191 {
193 }

◆ waitForSignal()

void AthenaMPToolBase::waitForSignal ( )
protectedinherited

Definition at line 402 of file AthenaMPToolBase.cxx.

403 {
404  ATH_MSG_INFO("Bootstrap worker PID " << getpid() << " - waiting for SIGUSR1");
405  sigset_t mask, oldmask;
406 
408 
409  sigemptyset (&mask);
410  sigaddset (&mask, SIGUSR1);
411 
412  sigprocmask (SIG_BLOCK, &mask, &oldmask);
414  sigsuspend (&oldmask);
415  sigprocmask (SIG_UNBLOCK, &mask, NULL);
416 }

Member Data Documentation

◆ m_activeWorkers

int EvtRangeProcessor::m_activeWorkers {0}
private

Keep track of the number of workers.

Definition at line 69 of file EvtRangeProcessor.h.

◆ m_appMgr

ServiceHandle<IAppMgrUI> AthenaMPToolBase::m_appMgr
protectedinherited

Definition at line 95 of file AthenaMPToolBase.h.

◆ m_channel2EvtSel

Gaudi::Property<std::string> EvtRangeProcessor::m_channel2EvtSel {this, "Channel2EvtSel", {}}
private

Definition at line 65 of file EvtRangeProcessor.h.

◆ m_channel2Scatterer

Gaudi::Property<std::string> EvtRangeProcessor::m_channel2Scatterer {this, "Channel2Scatterer", {}}
private

Definition at line 64 of file EvtRangeProcessor.h.

◆ m_chronoStatSvc

ServiceHandle<IChronoStatSvc> EvtRangeProcessor::m_chronoStatSvc
private

Definition at line 72 of file EvtRangeProcessor.h.

◆ m_debug

Gaudi::Property<bool> EvtRangeProcessor::m_debug {this, "Debug", false}
private

Definition at line 66 of file EvtRangeProcessor.h.

◆ m_evtProcessor

ServiceHandle<IEventProcessor> AthenaMPToolBase::m_evtProcessor
protectedinherited

Definition at line 94 of file AthenaMPToolBase.h.

◆ m_evtSeek

SmartIF<IEvtSelectorSeek> EvtRangeProcessor::m_evtSeek
private

Definition at line 74 of file EvtRangeProcessor.h.

◆ m_evtSelector

SmartIF<IEvtSelector> AthenaMPToolBase::m_evtSelector
protectedinherited

Definition at line 98 of file AthenaMPToolBase.h.

◆ m_evtSelName

std::string AthenaMPToolBase::m_evtSelName
protectedinherited

Name of the event selector.

Definition at line 89 of file AthenaMPToolBase.h.

◆ m_fdsRegistry

std::shared_ptr<AthenaInterprocess::FdsRegistry> AthenaMPToolBase::m_fdsRegistry
protectedinherited

Definition at line 100 of file AthenaMPToolBase.h.

◆ m_fileMgr

ServiceHandle<IFileMgr> AthenaMPToolBase::m_fileMgr
protectedinherited

Definition at line 96 of file AthenaMPToolBase.h.

◆ m_fileMgrLog

std::string AthenaMPToolBase::m_fileMgrLog
protectedinherited

Definition at line 99 of file AthenaMPToolBase.h.

◆ m_finQueue

std::deque<pid_t> EvtRangeProcessor::m_finQueue
private

Definition at line 80 of file EvtRangeProcessor.h.

◆ m_incidentSvc

ServiceHandle<IIncidentSvc> EvtRangeProcessor::m_incidentSvc
private

Definition at line 73 of file EvtRangeProcessor.h.

◆ m_inpFile

std::string EvtRangeProcessor::m_inpFile
private

Cached name of the input file. To avoid reopening.

Definition at line 70 of file EvtRangeProcessor.h.

◆ m_ioMgr

ServiceHandle<IIoComponentMgr> AthenaMPToolBase::m_ioMgr
protectedinherited

Definition at line 97 of file AthenaMPToolBase.h.

◆ m_isPileup

Gaudi::Property<bool> AthenaMPToolBase::m_isPileup {this, "IsPileup", false, "Flag for configuring PileUpEventLoopMgr"}
protectedinherited

Definition at line 103 of file AthenaMPToolBase.h.

◆ m_maxEvt

int AthenaMPToolBase::m_maxEvt {-1}
protectedinherited

Maximum number of events assigned to the job.

Definition at line 86 of file AthenaMPToolBase.h.

◆ m_mpRunStop

const AthenaInterprocess::IMPRunStop* AthenaMPToolBase::m_mpRunStop {nullptr}
protectedinherited

Definition at line 92 of file AthenaMPToolBase.h.

◆ m_nEventsBeforeFork

Gaudi::Property<int> EvtRangeProcessor::m_nEventsBeforeFork {this, "EventsBeforeFork", 0, "Number of events before forking"}
private

Definition at line 63 of file EvtRangeProcessor.h.

◆ m_nProcessedEvents

std::map<pid_t,int> EvtRangeProcessor::m_nProcessedEvents
private

Definition at line 79 of file EvtRangeProcessor.h.

◆ m_nprocs

int AthenaMPToolBase::m_nprocs {-1}
protectedinherited

Number of workers spawned by the master process.

Definition at line 85 of file AthenaMPToolBase.h.

◆ m_processGroup

AthenaInterprocess::ProcessGroup* AthenaMPToolBase::m_processGroup {nullptr}
protectedinherited

Definition at line 91 of file AthenaMPToolBase.h.

◆ m_procStates

std::map<pid_t,ProcessState> EvtRangeProcessor::m_procStates
private

Definition at line 81 of file EvtRangeProcessor.h.

◆ m_randStr

std::string AthenaMPToolBase::m_randStr
protectedinherited

Definition at line 101 of file AthenaMPToolBase.h.

◆ m_rankId

int EvtRangeProcessor::m_rankId {-1}
private

Each worker has its own unique RankID from the range (0,...,m_nprocs-1)

Definition at line 68 of file EvtRangeProcessor.h.

◆ m_sharedFailedPidQueue

AthenaInterprocess::SharedQueue* EvtRangeProcessor::m_sharedFailedPidQueue {nullptr}
private

Definition at line 77 of file EvtRangeProcessor.h.

◆ m_sharedRankQueue

std::unique_ptr<AthenaInterprocess::SharedQueue> EvtRangeProcessor::m_sharedRankQueue
private

Definition at line 76 of file EvtRangeProcessor.h.

◆ m_subprocDirPrefix

std::string AthenaMPToolBase::m_subprocDirPrefix
protectedinherited

For ex. "worker__".

Definition at line 88 of file AthenaMPToolBase.h.

◆ m_subprocTopDir

std::string AthenaMPToolBase::m_subprocTopDir
protectedinherited

Top run directory for subprocesses.

Definition at line 87 of file AthenaMPToolBase.h.


The documentation for this class was generated from the following files:
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:159
python.DQPostProcessMod.rundir
def rundir(fname)
Definition: DQPostProcessMod.py:116
pid_t
int32_t pid_t
Definition: FPGATrackSimTypes.h:19
AthenaInterprocess::ProcessGroup::getStatuses
const std::vector< ProcessStatus > & getStatuses() const
Definition: ProcessGroup.cxx:204
AthenaMPToolBase::waitForSignal
void waitForSignal()
Definition: AthenaMPToolBase.cxx:402
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
AthenaMPToolBase::ESRANGE_BADINPFILE
@ ESRANGE_BADINPFILE
Definition: AthenaMPToolBase.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
plot_material.mkdir
def mkdir(path, recursive=True)
Definition: plot_material.py:16
LArBadChanBlobUtils::Channel
Identifier32::value_type Channel
Definition: LArBadChanBlobUtils.h:24
AthenaMPToolBase::m_processGroup
AthenaInterprocess::ProcessGroup * m_processGroup
Definition: AthenaMPToolBase.h:91
AthenaInterprocess::ScheduledWork
Definition: IMessageDecoder.h:12
EvtRangeProcessor::m_debug
Gaudi::Property< bool > m_debug
Definition: EvtRangeProcessor.h:66
EvtRangeProcessor::m_sharedRankQueue
std::unique_ptr< AthenaInterprocess::SharedQueue > m_sharedRankQueue
Definition: EvtRangeProcessor.h:76
AthenaMPToolBase::m_randStr
std::string m_randStr
Definition: AthenaMPToolBase.h:101
AthenaMPToolBase::m_nprocs
int m_nprocs
Number of workers spawned by the master process.
Definition: AthenaMPToolBase.h:85
AthenaMPToolBase::ESRange_Status
ESRange_Status
Definition: AthenaMPToolBase.h:58
AthenaMPToolBase::FUNC_FIN
@ FUNC_FIN
Definition: AthenaMPToolBase.h:70
AthenaInterprocess::ProcessGroup::getChildren
const std::vector< Process > & getChildren() const
Definition: ProcessGroup.cxx:197
plotting.yearwise_luminosity.absolute
absolute
Definition: yearwise_luminosity.py:29
skel.it
it
Definition: skel.GENtoEVGEN.py:407
AthenaMPToolBase::fmterror
std::string fmterror(int errnum)
Definition: AthenaMPToolBase.cxx:332
DeMoUpdate.statuses
list statuses
Definition: DeMoUpdate.py:568
AthenaMPToolBase::m_evtSelName
std::string m_evtSelName
Name of the event selector.
Definition: AthenaMPToolBase.h:89
athena.exitcode
int exitcode
Definition: athena.py:161
AthenaMPToolBase::ESRANGE_SEEKFAILED
@ ESRANGE_SEEKFAILED
Definition: AthenaMPToolBase.h:61
EvtRangeProcessor::m_inpFile
std::string m_inpFile
Cached name of the input file. To avoid reopening.
Definition: EvtRangeProcessor.h:70
EvtRangeProcessor::m_evtSeek
SmartIF< IEvtSelectorSeek > m_evtSeek
Definition: EvtRangeProcessor.h:74
EvtRangeProcessor::m_rankId
int m_rankId
Each worker has its own unique RankID from the range (0,...,m_nprocs-1)
Definition: EvtRangeProcessor.h:68
EvtRangeProcessor::PROC_STATE_EXEC
@ PROC_STATE_EXEC
Definition: EvtRangeProcessor.h:58
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
Fd
IIoSvc::Fd Fd
Definition: IoSvc.cxx:22
sigaddset
#define sigaddset(x, y)
Definition: SealSignal.h:84
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthenaMPToolBase::FUNC_EXEC
@ FUNC_EXEC
Definition: AthenaMPToolBase.h:69
COPY_FILE_HACK
#define COPY_FILE_HACK(_src, _dest)
Definition: copy_file_icc_hack.h:15
sigset_t
int sigset_t
Definition: SealSignal.h:80
AthenaMPToolBase::m_evtSelector
SmartIF< IEvtSelector > m_evtSelector
Definition: AthenaMPToolBase.h:98
AthenaMPToolBase::m_appMgr
ServiceHandle< IAppMgrUI > m_appMgr
Definition: AthenaMPToolBase.h:95
EvtRangeProcessor::m_nProcessedEvents
std::map< pid_t, int > m_nProcessedEvents
Definition: EvtRangeProcessor.h:79
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthenaMPToolBase::m_isPileup
Gaudi::Property< bool > m_isPileup
Definition: AthenaMPToolBase.h:103
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
AthenaMPToolBase::Func_Flag
Func_Flag
Definition: AthenaMPToolBase.h:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
AthenaMPToolBase::reopenFd
int reopenFd(int fd, const std::string &name)
Definition: AthenaMPToolBase.cxx:418
AthenaMPToolBase::AthenaMPToolBase
AthenaMPToolBase()
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
AthenaMPToolBase::evtSelector
IEvtSelector * evtSelector()
Definition: AthenaMPToolBase.h:83
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AthenaMPToolBase_d::pauseForDebug
void pauseForDebug(int)
Definition: AthenaMPToolBase.cxx:27
AthenaMPToolBase::ESRANGE_SUCCESS
@ ESRANGE_SUCCESS
Definition: AthenaMPToolBase.h:59
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigInDetValidation_Base.malloc
malloc
Definition: TrigInDetValidation_Base.py:132
AthenaMPToolBase::updateIoReg
int updateIoReg(const std::string &rundir)
Definition: AthenaMPToolBase.cxx:321
AthenaMPToolBase::initialize
virtual StatusCode initialize() override
Definition: AthenaMPToolBase.cxx:47
AthenaMPToolBase::m_mpRunStop
const AthenaInterprocess::IMPRunStop * m_mpRunStop
Definition: AthenaMPToolBase.h:92
ReadFromCoolCompare.fd
fd
Definition: ReadFromCoolCompare.py:196
EvtRangeProcessor::reportError
void reportError(yampl::ISocket *socket, AthenaMPToolBase::ESRange_Status status)
Definition: EvtRangeProcessor.cxx:773
EvtRangeProcessor::m_chronoStatSvc
ServiceHandle< IChronoStatSvc > m_chronoStatSvc
Definition: EvtRangeProcessor.h:72
AthenaMPToolBase::ESRANGE_PROCFAILED
@ ESRANGE_PROCFAILED
Definition: AthenaMPToolBase.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
AthenaMPToolBase::m_ioMgr
ServiceHandle< IIoComponentMgr > m_ioMgr
Definition: AthenaMPToolBase.h:97
EvtRangeProcessor::setNewInputFile
StatusCode setNewInputFile(const std::string &newFile)
Definition: EvtRangeProcessor.cxx:739
AthenaMPToolBase::redirectLog
int redirectLog(const std::string &rundir, bool addTimeStamp=true)
Definition: AthenaMPToolBase.cxx:268
AthenaInterprocess::Process
Definition: Process.h:17
EvtRangeProcessor::m_channel2Scatterer
Gaudi::Property< std::string > m_channel2Scatterer
Definition: EvtRangeProcessor.h:64
LArG4FSStartPointFilter.outdata
outdata
Definition: LArG4FSStartPointFilter.py:62
Cut::signal
@ signal
Definition: SUSYToolsAlg.cxx:67
grepfile.filenames
list filenames
Definition: grepfile.py:34
Trk::open
@ open
Definition: BinningType.h:40
AthenaMPToolBase::m_maxEvt
int m_maxEvt
Maximum number of events assigned to the job.
Definition: AthenaMPToolBase.h:86
EvtRangeProcessor::PROC_STATE_INIT
@ PROC_STATE_INIT
Definition: EvtRangeProcessor.h:57
EvtRangeProcessor::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Definition: EvtRangeProcessor.h:73
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthenaInterprocess::FdsRegistryEntry
Definition: FdsRegistry.h:13
AthenaMP::AllWorkerOutputs_ptr
std::unique_ptr< AllWorkerOutputs > AllWorkerOutputs_ptr
Definition: IAthenaMPTool.h:32
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
merge.status
status
Definition: merge.py:17
AthenaMPToolBase::m_subprocDirPrefix
std::string m_subprocDirPrefix
For ex. "worker__".
Definition: AthenaMPToolBase.h:88
AthenaMPToolBase::m_subprocTopDir
std::string m_subprocTopDir
Top run directory for subprocesses.
Definition: AthenaMPToolBase.h:87
EvtRangeProcessor::PROC_STATE_FIN
@ PROC_STATE_FIN
Definition: EvtRangeProcessor.h:59
EvtRangeProcessor::PROC_STATE_STOP
@ PROC_STATE_STOP
Definition: EvtRangeProcessor.h:60
AthenaMPToolBase::ESRANGE_NOTFOUND
@ ESRANGE_NOTFOUND
Definition: AthenaMPToolBase.h:60
AthenaMPToolBase::handleSavedPfc
int handleSavedPfc(const std::filesystem::path &dest_path)
Definition: AthenaMPToolBase.cxx:395
AthenaMPToolBase::m_fileMgr
ServiceHandle< IFileMgr > m_fileMgr
Definition: AthenaMPToolBase.h:96
AthenaMP::AllWorkerOutputs
std::map< std::string, SingleWorkerOutputs > AllWorkerOutputs
Definition: IAthenaMPTool.h:29
AthenaMPToolBase::FUNC_BOOTSTRAP
@ FUNC_BOOTSTRAP
Definition: AthenaMPToolBase.h:68
AthenaMPToolBase::reopenFds
int reopenFds()
Definition: AthenaMPToolBase.cxx:339
sigemptyset
#define sigemptyset(x)
Definition: SealSignal.h:82
AthenaMPToolBase::ESRANGE_FILENOTMADE
@ ESRANGE_FILENOTMADE
Definition: AthenaMPToolBase.h:63
AthenaMPToolBase::m_fdsRegistry
std::shared_ptr< AthenaInterprocess::FdsRegistry > m_fdsRegistry
Definition: AthenaMPToolBase.h:100
AthenaMPToolBase_d::sig_done
std::atomic< bool > sig_done
Definition: AthenaMPToolBase.cxx:26
AthenaMPToolBase::m_evtProcessor
ServiceHandle< IEventProcessor > m_evtProcessor
Definition: AthenaMPToolBase.h:94