11 #include "GaudiKernel/IEvtSelector.h"
12 #include "GaudiKernel/IConversionSvc.h"
13 #include "GaudiKernel/IIoComponentMgr.h"
19 ,
const std::string&
name
20 ,
const IInterface*
parent)
23 , m_sharedRankQueue(nullptr)
40 return StatusCode::SUCCESS;
48 return StatusCode::SUCCESS;
51 int SharedWriterTool::makePool(
int ,
int nprocs,
const std::string& topdir)
63 IProperty* propertyServer =
dynamic_cast<IProperty*
>(
m_cnvSvc);
64 if(propertyServer==0) {
65 ATH_MSG_ERROR(
"Unable to cast conversion service to IProperty");
69 std::string propertyName =
"ParallelCompression";
70 bool parallelCompression(
false);
71 BooleanProperty parallelCompressionProp(propertyName,parallelCompression);
72 if(propertyServer->getProperty(¶llelCompressionProp).isFailure()) {
73 ATH_MSG_INFO(
"Conversion service does not have ParallelCompression property");
77 if(serviceLocator()->service(
"PoolSvc",
poolSvc).isFailure() ||
poolSvc==0) {
80 else if(parallelCompressionProp.value()) {
81 propertyServer =
dynamic_cast<IProperty*
>(
poolSvc);
82 if (propertyServer==0 || propertyServer->setProperty(
"FileOpen",
"update").isFailure()) {
110 return StatusCode::FAILURE;
116 return StatusCode::FAILURE;
118 return StatusCode::SUCCESS;
126 filenames.push_back(writer_rundir.string()+std::string(
"/AthenaMP.log"));
160 *(
int*)(outwork->
data) = 1;
178 if(
mkdir(writer_rundir.string().c_str(),S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)==-1) {
179 ATH_MSG_ERROR(
"Unable to make writer run directory: " << writer_rundir.string() <<
". " <<
fmterror(errno));
188 ATH_MSG_INFO(
"Logs redirected in the AthenaMP Shared Writer PID=" << getpid());
195 ATH_MSG_INFO(
"Io registry updated in the AthenaMP Shared Writer PID=" << getpid());
206 ATH_MSG_INFO(
"File descriptors re-opened in the AthenaMP Shared Writer PID=" << getpid());
210 StatusCode sc = serviceLocator()->service(
"AthenaRootSharedWriterSvc", sharedWriterSvc);
211 if(
sc.isFailure() || sharedWriterSvc ==
nullptr) {
212 ATH_MSG_WARNING(
"Error retrieving AthenaRootSharedWriterSvc from SharedWriterTool::bootstrap_func()");
218 ATH_MSG_ERROR(
"Failed to make the conversion service a share server");
222 ATH_MSG_DEBUG(
"Successfully made the conversion service a share server");
226 if(!
m_ioMgr->io_reinitialize().isSuccess()) {
234 if(chdir(writer_rundir.string().c_str())==-1) {
235 ATH_MSG_ERROR(
"Failed to chdir to " << writer_rundir.string());
240 *(
int*)(outwork->
data) = 0;
246 ATH_MSG_INFO(
"Exec function in the AthenaMP Shared Writer PID=" << getpid());
250 StatusCode sc = serviceLocator()->service(
"AthenaRootSharedWriterSvc", sharedWriterSvc);
251 if(
sc.isFailure() || sharedWriterSvc==0) {
269 if(
m_appMgr->finalize().isFailure()) {
270 std::cerr <<
"Unable to finalize AppMgr" << std::endl;
277 *(
int*)(outwork->
data) = (all_ok?0:1);
292 *(
int*)(outwork->
data) = 0;