134 std::ostringstream randStream;
136 ATH_MSG_INFO(
"Using random components for IPC object names: " << randStream.str());
145 if(pDetStore->record(evtQueue,
"AthenaMPEventQueue_"+randStream.str()).isFailure()) {
146 ATH_MSG_FATAL(
"Unable to record the pointer to the Shared Event queue into Detector Store");
148 return StatusCode::FAILURE;
156 if(pDetStore->record(failedPidQueue,
"AthenaMPFailedPidQueue_"+randStream.str()).isFailure()) {
157 ATH_MSG_FATAL(
"Unable to record the pointer to the Failed PID queue into Detector Store");
158 delete failedPidQueue;
159 return StatusCode::FAILURE;
171 srand((
unsigned)
time(0));
172 std::ostringstream randname;
179 ATH_MSG_WARNING(
"The job will attempt to save it with the name " << backupDir <<
" and create new top directory from scratch");
183 strerror_r(errno, buf,
sizeof(buf));
185 return StatusCode::FAILURE;
188 if(
mkdir(
m_workerTopDir.value().c_str(),S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)==0)
break;
194 strerror_r(errno, buf,
sizeof(buf));
196 return StatusCode::FAILURE;
206 incSvc->fireIncident(Incident(
name(),
"BeforeFork"));
219 auto sharedWriterTool =
m_tools[
"SharedWriterTool"];
222 if(sharedWriterWithFAFE) {
223 m_dataShare = SmartIF<IDataShare>(serviceLocator()->service(
"AthenaPoolSharedIOCnvSvc"));
226 (*sharedWriterTool)->useFdsRegistry(
registry);
227 (*sharedWriterTool)->setRandString(randStream.str());
231 ATH_MSG_FATAL(
"makePool failed for " << (*sharedWriterTool)->name());
232 return StatusCode::FAILURE;
239 StatusCode mySc = (*sharedWriterTool)->exec();
240 if(!mySc.isSuccess()) {
242 return StatusCode::FAILURE;
247 ATH_MSG_FATAL(
"Cannot make mother process a client for Conversion Service");
248 return StatusCode::FAILURE;
260 if(!scEvtProc.isSuccess()) {
261 if(nEventsToProcess) {
262 ATH_MSG_FATAL(
"Unable to process first " << nEventsToProcess <<
" events in the master");
265 ATH_MSG_FATAL(
"Unable to process first event in the master");
281 if(sharedWriterWithFAFE && !
m_dataShare->makeClient(0).isSuccess()) {
282 ATH_MSG_FATAL(
"Cannot make mother process not client for Conversion Service");
283 return StatusCode::FAILURE;
293 for(;
it!=itLast; ++
it) {
294 if(sharedWriterWithFAFE && (*it)->name() ==
"AthMpEvtLoopMgr.SharedWriterTool")
continue;
296 (*it)->setRandString(randStream.str());
297 (*it)->setMaxEvt(maxevt);
298 (*it)->setMPRunStop(
this);
300 incSvc->fireIncident(Incident(
name(),
"PreFork"));
305 return StatusCode::FAILURE;
314 return StatusCode::FAILURE;
319 if(sharedWriterWithFAFE && (*it)->name() ==
"AthMpEvtLoopMgr.SharedWriterTool")
continue;
320 if((*it)->exec().isFailure()) {
321 ATH_MSG_FATAL(
"Unable to submit work to the tool " << (*it)->name());
322 return StatusCode::FAILURE;
339 std::vector<std::string> logs;
341 (*it)->subProcessLogs(logs);
342 for(
size_t i=0;
i<logs.size();++
i) {
343 std::cout <<
"\n File: " << logs[
i] <<
"\n" << std::endl;
345 log.open(logs[
i].c_str(),std::ifstream::in);
349 std::cout <<
line << std::endl;