#include <SharedEvtQueueProvider.h>
Definition at line 14 of file SharedEvtQueueProvider.h.
◆ SharedEvtQueueProvider() [1/3]
SharedEvtQueueProvider::SharedEvtQueueProvider |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~SharedEvtQueueProvider()
SharedEvtQueueProvider::~SharedEvtQueueProvider |
( |
| ) |
|
|
overridevirtual |
◆ SharedEvtQueueProvider() [2/3]
SharedEvtQueueProvider::SharedEvtQueueProvider |
( |
| ) |
|
|
private |
◆ SharedEvtQueueProvider() [3/3]
◆ addEventsToQueue()
void SharedEvtQueueProvider::addEventsToQueue |
( |
| ) |
|
|
private |
◆ ATLAS_NOT_THREAD_SAFE() [1/2]
virtual StatusCode exec SharedEvtQueueProvider::ATLAS_NOT_THREAD_SAFE |
( |
| ) |
|
|
overridevirtual |
◆ ATLAS_NOT_THREAD_SAFE() [2/2]
virtual int makePool SharedEvtQueueProvider::ATLAS_NOT_THREAD_SAFE |
( |
int |
maxevt, |
|
|
int |
nprocs, |
|
|
const std::string & |
topdir |
|
) |
| |
|
overridevirtual |
◆ bootstrap_func()
Definition at line 110 of file SharedEvtQueueProvider.cxx.
114 *(
int*)(outwork->data) = 1;
115 outwork->size =
sizeof(
int);
126 if(
mkdir(counter_rundir.string().c_str(),S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)==-1) {
127 ATH_MSG_ERROR(
"Unable to make event counter run directory: " << counter_rundir.string() <<
". " << fmterror(errno) );
132 if(redirectLog(counter_rundir.string()))
135 ATH_MSG_INFO(
"Logs redirected in the AthenaMP event event counter PID=" << getpid() );
138 if(updateIoReg(counter_rundir.string()))
141 ATH_MSG_INFO(
"Io registry updated in the AthenaMP event event counter PID=" << getpid() );
145 if(handleSavedPfc(abs_counter_rundir))
152 ATH_MSG_INFO(
"File descriptors re-opened in the AthenaMP event event counter PID=" << getpid() );
156 SmartIF<IIncidentSvc> incsvc(serviceLocator()->service(
"IncidentSvc"));
162 incsvc->addListener(
this,
"EndInputFile");
168 m_evtShare = SmartIF<IEventShare>(m_evtSelector);
170 ATH_MSG_ERROR(
"Failed to dyncast event selector to IEventShare" );
173 if(!
m_evtShare->makeServer(m_nprocs+1).isSuccess()) {
174 ATH_MSG_ERROR(
"Failed to make the event selector a share server");
177 ATH_MSG_DEBUG(
"Successfully made the event selector a share server");
183 if(!m_ioMgr->io_reinitialize().isSuccess()) {
192 SmartIF<IService> evtSelSvc(m_evtSelector);
194 ATH_MSG_ERROR(
"Failed to dyncast event selector to IService" );
197 if(!evtSelSvc->start().isSuccess()) {
201 ATH_MSG_DEBUG(
"Successfully restarted the event selector" );
205 if(chdir(counter_rundir.string().c_str())==-1) {
206 ATH_MSG_ERROR(
"Failed to chdir to " << counter_rundir.string() );
211 *(
int*)(outwork->data) = 0;
◆ exec_func()
Definition at line 215 of file SharedEvtQueueProvider.cxx.
217 ATH_MSG_INFO(
"Exec function in the AthenaMP Event Counter PID=" << getpid());
222 IEvtSelector::Context* evtContext(
nullptr);
226 SmartIF<IProperty> propertyServer(m_evtSelector);
227 if(propertyServer==0) {
228 ATH_MSG_ERROR(
"Unable to cast event selector to IProperty" );
232 std::string propertyName(
"SkipEvents");
233 IntegerProperty skipEventsProp(std::move(propertyName),
skipEvents);
234 if(propertyServer->getProperty(&skipEventsProp).isFailure()) {
235 ATH_MSG_INFO(
"Event Selector does not have SkipEvents property" );
243 StatusCode sc = m_evtSelector->createContext(evtContext);
245 ATH_MSG_ERROR(
"Failed to create the event selector context");
251 if(!m_evtSelector->next(*evtContext).isSuccess()) {
252 ATH_MSG_ERROR(
"Unexpected error: EventsBeforeFork>EventsInInputFiles");
269 while(!m_evtSelector || m_evtSelector->next(*evtContext).isSuccess()) {
291 <<
", Event Chunk size in the queue is " <<
m_nChunkSize);
302 if(m_appMgr->stop().isFailure()) {
307 if(m_appMgr->finalize().isFailure()) {
308 std::cerr <<
"Unable to finalize AppMgr" << std::endl;
317 *(
int*)(outwork->data) = (all_ok?0:1);
318 outwork->size =
sizeof(
int);
◆ fin_func()
◆ generateOutputReport()
◆ handle()
void SharedEvtQueueProvider::handle |
( |
const Incident & |
inc | ) |
|
|
overridevirtual |
Definition at line 337 of file SharedEvtQueueProvider.cxx.
341 const FileIncident* fileInc =
dynamic_cast<const FileIncident*
>(&inc);
347 if(fileInc->type()==
"EndInputFile") {
◆ operator=()
◆ subProcessLogs()
void SharedEvtQueueProvider::subProcessLogs |
( |
std::vector< std::string > & |
filenames | ) |
|
|
overridevirtual |
◆ m_evtShare
SmartIF<IEventShare> SharedEvtQueueProvider::m_evtShare |
|
private |
◆ m_nChunkSize
Gaudi::Property<int> SharedEvtQueueProvider::m_nChunkSize {this, "ChunkSize", 1} |
|
private |
◆ m_nChunkStart
int SharedEvtQueueProvider::m_nChunkStart {0} |
|
private |
◆ m_nEventsBeforeFork
Gaudi::Property<int> SharedEvtQueueProvider::m_nEventsBeforeFork {this, "EventsBeforeFork", 0, "Number of events before forking"} |
|
private |
◆ m_nEvtCounted
int SharedEvtQueueProvider::m_nEvtCounted {0} |
|
private |
◆ m_nEvtRequested
int SharedEvtQueueProvider::m_nEvtRequested {-1} |
|
private |
◆ m_nPositionInChunk
int SharedEvtQueueProvider::m_nPositionInChunk {0} |
|
private |
◆ m_nprocesses
int SharedEvtQueueProvider::m_nprocesses {-1} |
|
private |
We use this data member for adding negative numbers at the end of the event queue.
We cannot use m_nprocs for this purpose in order to avoid generating Output File Reports by Shared Queue Providers.
Definition at line 52 of file SharedEvtQueueProvider.h.
◆ m_sharedEventQueue
◆ m_useSharedReader
Gaudi::Property<bool> SharedEvtQueueProvider::m_useSharedReader {this, "UseSharedReader", false, "Use shared reader"} |
|
private |
The documentation for this class was generated from the following files: