Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <AthenaMPToolBase.h>
Definition at line 23 of file AthenaMPToolBase.h.
◆ ESRange_Status
Enumerator |
---|
ESRANGE_SUCCESS | |
ESRANGE_NOTFOUND | |
ESRANGE_SEEKFAILED | |
ESRANGE_PROCFAILED | |
ESRANGE_FILENOTMADE | |
ESRANGE_BADINPFILE | |
Definition at line 58 of file AthenaMPToolBase.h.
◆ Func_Flag
◆ AthenaMPToolBase() [1/3]
AthenaMPToolBase::AthenaMPToolBase |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~AthenaMPToolBase()
AthenaMPToolBase::~AthenaMPToolBase |
( |
| ) |
|
|
overridevirtual |
◆ AthenaMPToolBase() [2/3]
AthenaMPToolBase::AthenaMPToolBase |
( |
| ) |
|
|
private |
◆ AthenaMPToolBase() [3/3]
◆ ATLAS_NOT_THREAD_SAFE() [1/2]
int mapAsyncFlag AthenaMPToolBase::ATLAS_NOT_THREAD_SAFE |
( |
Func_Flag |
flag, |
|
|
pid_t |
pid = 0 |
|
) |
| |
|
protected |
◆ ATLAS_NOT_THREAD_SAFE() [2/2]
virtual StatusCode wait_once AthenaMPToolBase::ATLAS_NOT_THREAD_SAFE |
( |
pid_t & |
pid | ) |
|
|
overridevirtual |
◆ bootstrap_func()
◆ evtSelector()
IEvtSelector* AthenaMPToolBase::evtSelector |
( |
| ) |
|
|
inlineprotected |
◆ exec_func()
◆ fin_func()
◆ finalize()
StatusCode AthenaMPToolBase::finalize |
( |
| ) |
|
|
overridevirtual |
◆ fmterror()
std::string AthenaMPToolBase::fmterror |
( |
int |
errnum | ) |
|
|
protected |
Definition at line 332 of file AthenaMPToolBase.cxx.
335 strerror_r(errnum, buf,
sizeof(buf));
336 return std::string(buf);
◆ generateOutputReport()
Reimplemented in EvtRangeProcessor, EvtRangeScatterer, and SharedWriterTool.
Definition at line 118 of file AthenaMPToolBase.cxx.
123 ATH_MSG_WARNING(
name() <<
" cannot make output report because FileMgr has not been configured to write log file!");
130 std::ostringstream workindex;
143 std::ifstream inpStream(
logFile.string().c_str());
144 std::set<std::string> reportedFiles;
145 while(!inpStream.eof()) {
146 std::getline(inpStream,
line);
147 if(
line.find(
"WRITE")!=std::string::npos) {
150 std::vector<std::string>
entries;
151 while(startpos<
line.size()) {
152 while(
line[startpos]==
' ')
155 size_t endpos =
line.find(
' ',startpos);
156 if(endpos==std::string::npos) endpos =
line.size();
157 entries.push_back(
line.substr(startpos,endpos-startpos));
164 if(reportedFiles.find(
basename.string())==reportedFiles.end())
165 reportedFiles.insert(
basename.string());
170 if(
it1==jobOutputs->end()) {
176 newOutput.
filename = absolutename.string();
180 newOutput.
shared = (
line.find(
"SHARED")!=std::string::npos);
182 (*jobOutputs)[
basename.string()].push_back(newOutput);
◆ handleSavedPfc()
int AthenaMPToolBase::handleSavedPfc |
( |
const std::filesystem::path & |
dest_path | ) |
|
|
protected |
Definition at line 395 of file AthenaMPToolBase.cxx.
397 if(std::filesystem::is_regular_file(
"PoolFileCatalog.xml.AthenaMP-saved"))
398 COPY_FILE_HACK(
"PoolFileCatalog.xml.AthenaMP-saved",dest_path.string()+
"/PoolFileCatalog.xml");
◆ initialize()
StatusCode AthenaMPToolBase::initialize |
( |
| ) |
|
|
overridevirtual |
◆ killChildren()
void AthenaMPToolBase::killChildren |
( |
| ) |
|
|
overridevirtual |
◆ operator()
virtual std::unique_ptr<ScheduledWork> AthenaInterprocess::IMessageDecoder::operator |
( |
| ) |
const & |
|
pure virtualinherited |
◆ operator=()
◆ redirectLog()
int AthenaMPToolBase::redirectLog |
( |
const std::string & |
rundir, |
|
|
bool |
addTimeStamp = true |
|
) |
| |
|
protected |
Definition at line 268 of file AthenaMPToolBase.cxx.
271 int dup2result1(0), dup2result2(0);
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);
278 dup2result1 = dup2(newout, STDOUT_FILENO);
279 dup2result2 = dup2(newout, STDERR_FILENO);
280 TEMP_FAILURE_RETRY(close(newout));
281 if(dup2result1==-1) {
285 if(dup2result2==-1) {
291 SmartIF<IProperty> propertyServer(
msgSvc());
292 if(propertyServer==0) {
297 std::string propertyName(
"Format");
298 std::string oldFormat(
"");
299 StringProperty formatProp(propertyName,oldFormat);
300 StatusCode sc = propertyServer->getProperty(&formatProp);
305 oldFormat = formatProp.value();
306 if(oldFormat.find(
"%t")==std::string::npos) {
308 std::string newFormat(
"%t " + oldFormat);
309 StringProperty newFormatProp(propertyName,newFormat);
310 ATH_CHECK(propertyServer->setProperty(newFormatProp), -1);
313 ATH_MSG_DEBUG(
"MsgSvc format already contains timestamps. Nothing to be done");
◆ reopenFd()
int AthenaMPToolBase::reopenFd |
( |
int |
fd, |
|
|
const std::string & |
name |
|
) |
| |
|
private |
Definition at line 418 of file AthenaMPToolBase.cxx.
421 int old_openflags = fcntl(
fd,F_GETFL,0);
422 switch(old_openflags & O_ACCMODE) {
437 int old_descflags = fcntl(
fd,F_GETFD,0);
438 off_t oldpos = lseek(
fd,0,SEEK_CUR);
454 if(lseek(newfd,oldpos,SEEK_SET)==-1){
456 TEMP_FAILURE_RETRY(close(newfd));
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));
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));
470 TEMP_FAILURE_RETRY(close(newfd));
◆ reopenFds()
int AthenaMPToolBase::reopenFds |
( |
| ) |
|
|
protected |
Definition at line 339 of file AthenaMPToolBase.cxx.
347 std::vector<const Io::FileAttr*> filemgrFiles;
348 std::vector<const Io::FileAttr*>::const_iterator itFile;
349 unsigned filenum =
m_fileMgr->getFiles(filemgrFiles);
350 if(filenum!=filemgrFiles.size())
351 ATH_MSG_WARNING(
"getFiles returned " << filenum <<
" while vector size is " << filemgrFiles.size());
353 for(itFile=filemgrFiles.begin();itFile!=filemgrFiles.end();++itFile) {
355 const std::string&
filename = (**itFile).name();
362 ATH_MSG_WARNING(
"FD=-1 detected on an open file retrieved from FileMgr. Skip FD reopening. File name: " <<
filename);
374 if(fdLog.find(regEntry.fd)!=fdLog.end()) {
375 ATH_MSG_DEBUG(
"The file from FdsRegistry " << regEntry.name <<
" was registered with FileMgr. Skip reopening");
378 ATH_MSG_WARNING(
"The file " << regEntry.name <<
" has not been registered with the FileMgr!");
380 if(regEntry.fd==-1) {
382 ATH_MSG_WARNING(
"FD=-1 detected on an open file retrieved from FD Registry. Skip FD reopening. File name: " << regEntry.name);
386 if(
reopenFd(regEntry.fd,regEntry.name))
389 fdLog.insert(regEntry.fd);
◆ reportSubprocessStatuses()
void AthenaMPToolBase::reportSubprocessStatuses |
( |
| ) |
|
|
overridevirtual |
◆ setMaxEvt()
virtual void AthenaMPToolBase::setMaxEvt |
( |
int |
maxEvt | ) |
|
|
inlineoverridevirtual |
◆ setMPRunStop()
◆ setRandString()
void AthenaMPToolBase::setRandString |
( |
const std::string & |
randStr | ) |
|
|
overridevirtual |
◆ updateIoReg()
int AthenaMPToolBase::updateIoReg |
( |
const std::string & |
rundir | ) |
|
|
protected |
◆ useFdsRegistry()
◆ waitForSignal()
void AthenaMPToolBase::waitForSignal |
( |
| ) |
|
|
protected |
Definition at line 402 of file AthenaMPToolBase.cxx.
404 ATH_MSG_INFO(
"Bootstrap worker PID " << getpid() <<
" - waiting for SIGUSR1");
412 sigprocmask (SIG_BLOCK, &
mask, &oldmask);
414 sigsuspend (&oldmask);
415 sigprocmask (SIG_UNBLOCK, &
mask, NULL);
◆ m_appMgr
◆ m_evtProcessor
◆ m_evtSelector
SmartIF<IEvtSelector> AthenaMPToolBase::m_evtSelector |
|
protected |
◆ m_evtSelName
std::string AthenaMPToolBase::m_evtSelName |
|
protected |
◆ m_fdsRegistry
◆ m_fileMgr
◆ m_fileMgrLog
std::string AthenaMPToolBase::m_fileMgrLog |
|
protected |
◆ m_ioMgr
◆ m_isPileup
Gaudi::Property<bool> AthenaMPToolBase::m_isPileup {this, "IsPileup", false, "Flag for configuring PileUpEventLoopMgr"} |
|
protected |
◆ m_maxEvt
int AthenaMPToolBase::m_maxEvt {-1} |
|
protected |
◆ m_mpRunStop
◆ m_nprocs
int AthenaMPToolBase::m_nprocs {-1} |
|
protected |
◆ m_processGroup
◆ m_randStr
std::string AthenaMPToolBase::m_randStr |
|
protected |
◆ m_subprocDirPrefix
std::string AthenaMPToolBase::m_subprocDirPrefix |
|
protected |
◆ m_subprocTopDir
std::string AthenaMPToolBase::m_subprocTopDir |
|
protected |
The documentation for this class was generated from the following files:
const std::vector< ProcessStatus > & getStatuses() const
path
python interpreter configuration --------------------------------------—
const std::vector< Process > & getChildren() const
AllWorkerOutputs::iterator AllWorkerOutputsIterator
std::vector< WorkerOutput > SingleWorkerOutputs
#define COPY_FILE_HACK(_src, _dest)
msgSvc
Provide convenience handles for various services.
std::vector< HWIdentifier >::iterator it1
::StatusCode StatusCode
StatusCode definition for legacy code.
#define ATH_MSG_WARNING(x)
std::unique_ptr< AllWorkerOutputs > AllWorkerOutputs_ptr
std::map< std::string, SingleWorkerOutputs > AllWorkerOutputs