ATLAS Offline Software
AthenaSharedMemoryTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /* file contains the implementation for the AthenaSharedMemoryTool class.
6  * @author Peter van Gemmeren <gemmeren@anl.gov>
7  **/
8 
10 
11 #include "GaudiKernel/FileIncident.h"
12 
13 #include <boost/exception/diagnostic_information.hpp>
14 #include <boost/interprocess/shared_memory_object.hpp>
15 #include <boost/interprocess/mapped_region.hpp>
16 
17 #include <optional>
18 #include <sstream>
19 
20 const std::size_t maxTokenLength = 512;
21 
22 namespace {
23 struct ShareEventHeader {
24  enum ProcessStatus { CLEARED, FILLED, LOCKED, UNLOCKED, UNKNOWN };
25  ProcessStatus evtProcessStatus;
26  long evtSeqNumber;
27  long fileSeqNumber;
28  std::size_t evtSize;
29  std::size_t evtOffset;
30  unsigned int evtCoreStatusFlag;
31  char token[maxTokenLength];
32 };
33 } // anonymous namespace
34 
35 //___________________________________________________________________________
37  const std::string& name,
38  const IInterface* parent) : AthAlgTool(type, name, parent),
39  m_maxSize(64 * 1024 * 1024),
40  m_maxDataClients(256),
41  m_num(-1),
42  m_lastClient(-1),
43  m_dataClients(),
44  m_payload(nullptr),
45  m_status(nullptr),
46  m_fileSeqNumber(0),
47  m_isServer(false),
48  m_isClient(false),
49  m_incidentSvc("IncidentSvc", name) {
50  declareProperty("SharedMemoryName", m_sharedMemory = name);
51  declareInterface<IAthenaIPCTool>(this);
52 }
53 
54 //___________________________________________________________________________
56  delete m_payload; m_payload = nullptr;
57  delete m_status; m_status = nullptr;
58 }
59 
60 //___________________________________________________________________________
62  ATH_MSG_INFO("Initializing " << name());
63  if (!::AthAlgTool::initialize().isSuccess()) {
64  ATH_MSG_FATAL("Cannot initialize AthAlgTool base class.");
65  return(StatusCode::FAILURE);
66  }
67  // Retrieve IncidentSvc
68  if (!m_incidentSvc.retrieve().isSuccess()) {
69  ATH_MSG_FATAL("Cannot get IncidentSvc");
70  return(StatusCode::FAILURE);
71  }
72  return(StatusCode::SUCCESS);
73 }
74 
75 //___________________________________________________________________________
77  ATH_MSG_INFO("in stop()");
78  if (m_isClient && m_num > 0) {
79  ATH_MSG_INFO("Client stop() inform Server: " << m_num);
80  m_num = -1;
81  while (lockObject("stop").isRecoverable()) {
82  usleep(100);
83  }
84  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(m_status->get_address());
85  while (evtH->evtProcessStatus != ShareEventHeader::UNLOCKED) {
86  usleep(100);
87  }
88  }
89  return(StatusCode::SUCCESS);
90 }
91 
92 //___________________________________________________________________________
94  ATH_MSG_INFO("in finalize()");
95  if (m_isServer) {
96  try {
98  } catch(boost::interprocess::interprocess_exception &e) {
99  ATH_MSG_WARNING("Cannot remove shared memory " << m_sharedMemory.value() << ": " << boost::diagnostic_information(e));
100  }
101  const std::string statusName = m_sharedMemory.value() + "_status";
102  try {
104  } catch(boost::interprocess::interprocess_exception &e) {
105  ATH_MSG_WARNING("Cannot remove shared memory " << statusName << ": " << boost::diagnostic_information(e));
106  }
107  }
108  // Release IncidentSvc
109  if (!m_incidentSvc.release().isSuccess()) {
110  ATH_MSG_WARNING("Cannot release IncidentSvc.");
111  }
112  return(::AthAlgTool::finalize());
113 }
114 
115 //___________________________________________________________________________
116 StatusCode AthenaSharedMemoryTool::makeServer(int num, const std::string& streamPortSuffix) {
117  if (m_isServer || m_isClient) {
118  ATH_MSG_ERROR("Cannot make AthenaSharedMemoryTool a Server.");
119  return(StatusCode::FAILURE);
120  }
121  if (num > m_maxDataClients) {
122  ATH_MSG_ERROR("Too many clients for AthenaSharedMemoryTool Server.");
123  return(StatusCode::FAILURE);
124  }
125  m_num = num;
126  m_isServer = true;
127  ATH_MSG_DEBUG("Creating shared memory object with name \"" << m_sharedMemory.value() << "\"");
128  std::optional<boost::interprocess::shared_memory_object> shm;
129  try {
130  shm.emplace(boost::interprocess::create_only, m_sharedMemory.value().c_str(), boost::interprocess::read_write);
131  } catch(boost::interprocess::interprocess_exception &e) {
132  ATH_MSG_ERROR("Cannot create shared memory " << m_sharedMemory.value() << ": " << boost::diagnostic_information(e));
133  return StatusCode::FAILURE;
134  }
135  shm->truncate(m_maxSize);
136  m_payload = new boost::interprocess::mapped_region(*shm, boost::interprocess::read_write, 0, m_maxSize);
137  const std::string statusName = m_sharedMemory.value() + "_status";
138  std::optional<boost::interprocess::shared_memory_object> shm_status;
139  try {
140  shm_status.emplace(boost::interprocess::create_only, statusName.c_str(), boost::interprocess::read_write);
141  } catch(boost::interprocess::interprocess_exception &e) {
142  ATH_MSG_ERROR("Cannot create shared memory " << statusName << ": " << boost::diagnostic_information(e));
143  return StatusCode::FAILURE;
144  }
145  shm_status->truncate(num * sizeof(ShareEventHeader));
146  m_status = new boost::interprocess::mapped_region(*shm_status, boost::interprocess::read_write, 0, num * sizeof(ShareEventHeader));
147  ShareEventHeader evtH = { ShareEventHeader::UNLOCKED, -1, -1, 0, 0, 0, "" };
148  std::memcpy(evtH.token, streamPortSuffix.c_str(), maxTokenLength - 1);
149  evtH.token[maxTokenLength - 1] = 0;
150  for (int i = 0; i < num; i++) {
151  std::memcpy(static_cast<char*>(m_status->get_address()) + i * sizeof(ShareEventHeader), &evtH, sizeof(ShareEventHeader));
152  }
153  return(StatusCode::SUCCESS);
154 }
155 
156 //___________________________________________________________________________
158  return(m_isServer);
159 }
160 
161 //___________________________________________________________________________
162 StatusCode AthenaSharedMemoryTool::makeClient(int num, std::string& streamPortSuffix) {
163  if (m_isServer) {
164  ATH_MSG_ERROR("Cannot make AthenaSharedMemoryTool a Client.");
165  return(StatusCode::FAILURE);
166  }
167  if (num >= m_maxDataClients) {
168  ATH_MSG_ERROR("Too many clients for AthenaSharedMemoryTool.");
169  return(StatusCode::FAILURE);
170  }
171  if (m_num > 0 && num <= 0) {// stop running client
172  ATH_MSG_DEBUG("Stop AthenaSharedMemoryTool Client.");
173  m_num = -1;
174  while (lockObject("stop").isRecoverable()) {
175  usleep(100);
176  }
177  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(m_status->get_address());
178  while (evtH->evtProcessStatus != ShareEventHeader::UNLOCKED) {
179  usleep(100);
180  }
181  delete m_payload ; m_payload = nullptr;
182  delete m_status ; m_status = nullptr;
183  m_isClient = false;
184  return(StatusCode::SUCCESS);
185  }
186  while (!m_isClient) {
187  try { // Check whether Server created shared memory object
188  const std::string statusName = m_sharedMemory.value() + "_status";
189  boost::interprocess::shared_memory_object shm_status(boost::interprocess::open_only,
190  statusName.c_str(),
191  boost::interprocess::read_write);
192  m_status = new boost::interprocess::mapped_region(shm_status, boost::interprocess::read_write, num * sizeof(ShareEventHeader), sizeof(ShareEventHeader));
193  boost::interprocess::shared_memory_object shm(boost::interprocess::open_only,
194  m_sharedMemory.value().c_str(),
195  boost::interprocess::read_write);
196  m_payload = new boost::interprocess::mapped_region(shm, boost::interprocess::read_write, 0, m_maxSize);
197  m_isClient = true;
198  } catch (boost::interprocess::interprocess_exception& e) {
199  usleep(100000);
200  }
201  }
202  if (m_num <= 0 && num > 0) {
203  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(m_status->get_address());
204  streamPortSuffix.assign(evtH->token);
205  while (lockObject("start").isRecoverable()) {
206  usleep(100);
207  }
208  while (evtH->evtProcessStatus != ShareEventHeader::UNLOCKED) {
209  usleep(100);
210  }
211  m_num = num;
212  }
213  return(StatusCode::SUCCESS);
214 }
215 
216 //___________________________________________________________________________
218  return(m_isClient);
219 }
220 
221 //___________________________________________________________________________
222 StatusCode AthenaSharedMemoryTool::putEvent(long eventNumber, const void* source, std::size_t nbytes, unsigned int status) const {
223  if (nbytes > m_maxSize) {
224  ATH_MSG_ERROR("Event size = " << nbytes << " greater than maximum for eventNumber = " << eventNumber);
225  return(StatusCode::FAILURE);
226  }
227  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(m_status->get_address());
228  if (evtH->evtProcessStatus != ShareEventHeader::UNLOCKED) {
229  ATH_MSG_DEBUG("Waiting for putEvent, eventNumber = " << eventNumber);
230  return(StatusCode::RECOVERABLE);
231  }
232  if (source == nullptr && nbytes == 0) {
233  ATH_MSG_DEBUG("putEvent got last Event marker");
234  evtH->evtSeqNumber = 0;
235  evtH->fileSeqNumber = 0;
236  evtH->evtSize = 0;
237  evtH->evtOffset = 0;
238  m_status->flush(0, sizeof(ShareEventHeader));
239  return(StatusCode::SUCCESS);
240  }
241  evtH->evtProcessStatus = ShareEventHeader::CLEARED;
242  if (source != nullptr && source != m_payload->get_address()) {
243  std::memcpy(m_payload->get_address(), source, nbytes);
244  m_payload->flush(0, nbytes);
245  }
246  evtH->evtSeqNumber = eventNumber;
247  evtH->fileSeqNumber = m_fileSeqNumber;
248  evtH->evtSize = nbytes;
249  evtH->evtOffset = 0;
250  evtH->evtCoreStatusFlag = status;
251  m_status->flush(0, sizeof(ShareEventHeader));
252  evtH->evtProcessStatus = ShareEventHeader::FILLED;
253  return(StatusCode::SUCCESS);
254 }
255 
256 //___________________________________________________________________________
258  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(m_status->get_address());
259  if (evtH->evtProcessStatus == ShareEventHeader::LOCKED) {
260  const std::size_t nbytes = evtH->evtSize;
261  if (target != nullptr) {
262  char* buf = new char[nbytes];
263  std::memcpy(buf, static_cast<char*>(m_payload->get_address()) + evtH->evtOffset, nbytes);
264  *target = buf;
265  }
266  status = evtH->evtCoreStatusFlag;
267  } else {
268  ATH_MSG_ERROR("No event locked");
269  return(StatusCode::FAILURE);
270  }
271  evtH->evtProcessStatus = ShareEventHeader::UNLOCKED;
272  return(StatusCode::SUCCESS);
273 }
274 
275 //___________________________________________________________________________
277  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(m_status->get_address());
278  if (evtH->evtSeqNumber > eventNumber) {
279  ATH_MSG_ERROR("eventNumber = " << eventNumber << ", already processed");
280  return(StatusCode::FAILURE);
281  }
282  if (evtH->evtSeqNumber == 0 && evtH->fileSeqNumber == 0 && evtH->evtSize == 0) {
283  ATH_MSG_DEBUG("Server has been terminated");
284  return(StatusCode::FAILURE);
285  }
286  if (evtH->evtSeqNumber != eventNumber || evtH->evtProcessStatus != ShareEventHeader::FILLED) {
287  ATH_MSG_DEBUG("Waiting for lockEvent, eventNumber = " << eventNumber);
288  return(StatusCode::RECOVERABLE);
289  }
290  if (evtH->fileSeqNumber != m_fileSeqNumber && m_fileSeqNumber > 0) {
291  FileIncident endFileIncident(name(), "EndInputFile", "SHM");
292  m_incidentSvc->fireIncident(endFileIncident);
293  const_cast<AthenaSharedMemoryTool*>(this)->m_fileSeqNumber = evtH->fileSeqNumber;
294  FileIncident beginFileIncident(name(), "BeginInputFile", "SHM");
295  m_incidentSvc->fireIncident(beginFileIncident);
296  }
297  ATH_MSG_DEBUG("Locking eventNumber = " << eventNumber);
298  evtH->evtProcessStatus = ShareEventHeader::LOCKED;
299  return(StatusCode::SUCCESS);
300 }
301 
302 //___________________________________________________________________________
303 StatusCode AthenaSharedMemoryTool::putObject(const void* source, size_t nbytes, int num) {
304  if (nbytes > m_maxSize) {
305  ATH_MSG_ERROR("Object size = " << nbytes << " greater than maximum for client = " << num);
306  return(StatusCode::FAILURE);
307  }
308  void* status = static_cast<char*>(m_status->get_address()) + num * sizeof(ShareEventHeader);
309  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(status);
310  ShareEventHeader::ProcessStatus evtStatus = evtH->evtProcessStatus; // read only once
311  if (evtStatus != ShareEventHeader::CLEARED) {
312  ATH_MSG_DEBUG("Waiting for CLEARED putObject, client = " << num << ", in state " << evtStatus);
313  return(StatusCode::RECOVERABLE);
314  }
315  if (source == nullptr) {
316  evtH->evtSize = evtH->evtOffset;
317  evtH->evtOffset = 0;
318  m_payload->flush(0 + evtH->evtOffset, evtH->evtSize);
319  m_status->flush(num * sizeof(ShareEventHeader), sizeof(ShareEventHeader));
320  evtH->evtProcessStatus = ShareEventHeader::FILLED;
321  } else {
322  if (evtH->evtOffset + sizeof(size_t) + nbytes > m_maxSize) {
323  ATH_MSG_ERROR("Object location = " << evtH->evtOffset << " greater than maximum for client = " << num);
324  return(StatusCode::FAILURE);
325  }
326  bool first = (evtH->evtOffset == 0);
327  std::memcpy(static_cast<char*>(m_payload->get_address()) + evtH->evtOffset, &nbytes, sizeof(size_t));
328  evtH->evtOffset += sizeof(size_t);
329  std::memcpy(static_cast<char*>(m_payload->get_address()) + evtH->evtOffset, source, nbytes);
330  evtH->evtOffset += nbytes;
331  if (evtH->evtSize == m_maxSize) {
332  evtH->evtSize = evtH->evtOffset;
333  }
334  if (first) {
335  evtH->evtSize = m_maxSize;
336  m_payload->flush(0, evtH->evtOffset);
337  m_status->flush(num * sizeof(ShareEventHeader), sizeof(ShareEventHeader));
338  }
339  }
340  return(StatusCode::SUCCESS);
341 }
342 
343 //___________________________________________________________________________
345  if (target == nullptr) {
346  return(StatusCode::SUCCESS);
347  }
348  void* status = static_cast<char*>(m_status->get_address()) + num * sizeof(ShareEventHeader);
349  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(status);
350  ShareEventHeader::ProcessStatus evtStatus = evtH->evtProcessStatus; // read only once
351  size_t evtSize = evtH->evtSize; // read only once
352  if (evtStatus != ShareEventHeader::FILLED) {
353  ATH_MSG_DEBUG("Waiting for FILLED getObject, client = " << num);
354  nbytes = 0;
355  return(StatusCode::RECOVERABLE);
356  }
357  if (evtH->evtOffset < evtSize) {
358  std::memcpy(&nbytes, static_cast<char*>(m_payload->get_address()) + evtH->evtOffset, sizeof(size_t));
359  evtH->evtOffset += sizeof(size_t);
360  *target = static_cast<char*>(m_payload->get_address()) + evtH->evtOffset;
361  evtH->evtOffset += nbytes;
362  }
363  if (evtH->evtOffset == evtSize) {
364  evtH->evtOffset = 0;
365  m_status->flush(num * sizeof(ShareEventHeader), sizeof(ShareEventHeader));
366  while (evtH->evtProcessStatus != ShareEventHeader::FILLED) {
367  usleep(10);
368  }
369  evtH->evtProcessStatus = ShareEventHeader::UNLOCKED;
370  }
371 
372  return(StatusCode::SUCCESS);
373 }
374 
375 //___________________________________________________________________________
376 StatusCode AthenaSharedMemoryTool::clearObject(const char** tokenString, int& num) {
377  if (m_isClient) {
378  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(m_status->get_address());
379  if (evtH->evtProcessStatus != ShareEventHeader::CLEARED) {
380  ATH_MSG_DEBUG("Waiting for FILL clearObject");
381  return(StatusCode::RECOVERABLE);
382  }
383  *tokenString = evtH->token;
384  evtH->evtProcessStatus = ShareEventHeader::UNLOCKED;
385  return(StatusCode::SUCCESS);
386  }
387 
388  for (int i = 1; i <= m_num; i++) { // FIXME: PvG, do round robin
389  void* status = static_cast<char*>(m_status->get_address()) + i * sizeof(ShareEventHeader);
390  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(status);
391  ShareEventHeader::ProcessStatus evtStatus = evtH->evtProcessStatus; // read only once
392  if (evtStatus == ShareEventHeader::FILLED) {
393  ATH_MSG_DEBUG("Waiting for UNFILL clearObject, client = " << i);
394  return(StatusCode::RECOVERABLE);
395  } else if (i == num && evtStatus != ShareEventHeader::LOCKED) {
396  ATH_MSG_DEBUG("Waiting for LOCK clearObject, client = " << i);
397  return(StatusCode::RECOVERABLE);
398  }
399  if (m_lastClient < 0 || m_lastClient == i) { // If Writer is not yet released, only consider last client
400  if ((i == num || num < 0) && evtStatus == ShareEventHeader::LOCKED) {
401  *tokenString = evtH->token;
402  num = i;
403  ATH_MSG_DEBUG("Setting LOCK clearObject, for client = " << num << ": " << evtH->token);
404  m_lastClient = -1;
405  // break;
406  }
407  }
408  }
409 
410  if (num > 0 && *tokenString != nullptr) {
411  m_lastClient = -1; // Release Writer from last client
412  void* status = static_cast<char*>(m_status->get_address()) + num * sizeof(ShareEventHeader);
413  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(status);
414  if (strncmp(*tokenString, "wait", 4) == 0) {
415  ATH_MSG_INFO("Server clearObject() got wait, client = " << num);
416  evtH->evtProcessStatus = ShareEventHeader::UNLOCKED;
417  m_lastClient = num; // Keep Writer allocated
418  num = -1;
419  return(StatusCode::SUCCESS);
420  }
421  if (strncmp(*tokenString, "release", 7) == 0) {
422  ATH_MSG_INFO("Server clearObject() got release, client = " << num);
423  evtH->evtProcessStatus = ShareEventHeader::UNLOCKED;
424  num = -1;
425  return(StatusCode::SUCCESS);
426  }
427  if (strncmp(*tokenString, "start", 5) == 0) {
428  ATH_MSG_INFO("Server clearObject() got start, client = " << num << ", of " << m_num - 1);
429  if (m_dataClients.empty()) { // Annouce all workers to prevent early writer termination
430  for (int i = 1; i < m_num - 1; i++) m_dataClients.insert(i);
431  }
432  m_dataClients.insert(num);
433  evtH->evtProcessStatus = ShareEventHeader::UNLOCKED;
434  num = -1;
435  return(StatusCode::SUCCESS);
436  }
437  if (strncmp(*tokenString, "stop", 4) == 0) {
438  ATH_MSG_INFO("Server clearObject() got stop, client = " << num);
439  m_dataClients.erase(num);
440  evtH->evtProcessStatus = ShareEventHeader::UNLOCKED;
441  if (m_dataClients.empty()) {
442  ATH_MSG_INFO("Server clearObject() got stop, client ALL: " << m_num);
443  if (num == m_num - 1) { // mother process
444  return(StatusCode::SUCCESS);
445  }
446  return(StatusCode::FAILURE);
447  }
448  num = -1;
449  return(StatusCode::SUCCESS);
450  }
451  evtH->evtSize = 0;
452  m_status->flush(0, sizeof(ShareEventHeader));
453  evtH->evtProcessStatus = ShareEventHeader::CLEARED;
454  return(StatusCode::SUCCESS);
455  }
456  return(StatusCode::RECOVERABLE);
457 }
458 
459 //___________________________________________________________________________
460 StatusCode AthenaSharedMemoryTool::lockObject(const char* tokenString, int num) {
461  if (strlen(tokenString) >= maxTokenLength) {
462  ATH_MSG_ERROR("Token = " << tokenString << ", too long for AthenaSharedMemoryTool");
463  return(StatusCode::FAILURE);
464  }
465  void* status = static_cast<char*>(m_status->get_address()) + num * sizeof(ShareEventHeader);
466  ShareEventHeader* evtH = static_cast<ShareEventHeader*>(status);
467  if (evtH->evtProcessStatus != ShareEventHeader::UNLOCKED) {
468  ATH_MSG_DEBUG("Waiting for UNLOCKED lockObject: " << tokenString);
469  return(StatusCode::RECOVERABLE);
470  }
471  strncpy(evtH->token, tokenString, maxTokenLength - 1); evtH->token[maxTokenLength - 1] = 0;
472  if (m_isServer) {
473  evtH->evtSize = 0;
474  m_status->flush(num * sizeof(ShareEventHeader), sizeof(ShareEventHeader));
475  evtH->evtProcessStatus = ShareEventHeader::CLEARED;
476  } else {
477  m_status->flush(num * sizeof(ShareEventHeader), sizeof(ShareEventHeader));
478  evtH->evtProcessStatus = ShareEventHeader::LOCKED;
479  }
480  return(StatusCode::SUCCESS);
481 }
python.StoreID.UNKNOWN
int UNKNOWN
Definition: StoreID.py:16
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
AthenaSharedMemoryTool::m_status
boost::interprocess::mapped_region * m_status
Definition: AthenaSharedMemoryTool.h:67
AthenaSharedMemoryTool::m_isServer
bool m_isServer
Definition: AthenaSharedMemoryTool.h:69
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
AthenaSharedMemoryTool::stop
StatusCode stop()
Definition: AthenaSharedMemoryTool.cxx:76
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthenaSharedMemoryTool::m_maxDataClients
const int m_maxDataClients
Definition: AthenaSharedMemoryTool.h:62
AthenaSharedMemoryTool::finalize
StatusCode finalize()
Definition: AthenaSharedMemoryTool.cxx:93
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AthenaSharedMemoryTool::makeClient
StatusCode makeClient(int num, std::string &streamPortSuffix)
Definition: AthenaSharedMemoryTool.cxx:162
AthenaSharedMemoryTool::isServer
bool isServer() const
Definition: AthenaSharedMemoryTool.cxx:157
initialize
void initialize()
Definition: run_EoverP.cxx:894
AthenaSharedMemoryTool::~AthenaSharedMemoryTool
virtual ~AthenaSharedMemoryTool()
Destructor.
Definition: AthenaSharedMemoryTool.cxx:55
AthenaSharedMemoryTool::getLockedEvent
StatusCode getLockedEvent(void **target, unsigned int &status) const
Definition: AthenaSharedMemoryTool.cxx:257
AthenaSharedMemoryTool::m_lastClient
int m_lastClient
Definition: AthenaSharedMemoryTool.h:64
PixelModuleFeMask_create_db.remove
string remove
Definition: PixelModuleFeMask_create_db.py:83
AthenaSharedMemoryTool.h
This file contains the class definition for the AthenaSharedMemoryTool class.
AthenaSharedMemoryTool::putObject
StatusCode putObject(const void *source, size_t nbytes, int num=0)
Definition: AthenaSharedMemoryTool.cxx:303
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthenaSharedMemoryTool::makeServer
StatusCode makeServer(int num, const std::string &streamPortSuffix)
Definition: AthenaSharedMemoryTool.cxx:116
AthenaSharedMemoryTool::m_isClient
bool m_isClient
Definition: AthenaSharedMemoryTool.h:70
lumiFormat.i
int i
Definition: lumiFormat.py:85
AthenaSharedMemoryTool::AthenaSharedMemoryTool
AthenaSharedMemoryTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Service Constructor.
Definition: AthenaSharedMemoryTool.cxx:36
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
AthenaSharedMemoryTool::m_sharedMemory
StringProperty m_sharedMemory
Definition: AthenaSharedMemoryTool.h:60
AthenaSharedMemoryTool::m_dataClients
std::set< int > m_dataClients
Definition: AthenaSharedMemoryTool.h:65
AthenaSharedMemoryTool::clearObject
StatusCode clearObject(const char **tokenString, int &num)
Definition: AthenaSharedMemoryTool.cxx:376
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AthenaSharedMemoryTool::m_payload
boost::interprocess::mapped_region * m_payload
Definition: AthenaSharedMemoryTool.h:66
AthenaSharedMemoryTool::getObject
StatusCode getObject(void **target, size_t &nbytes, int num=0)
Definition: AthenaSharedMemoryTool.cxx:344
taskman.statusName
statusName
Definition: taskman.py:461
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AthenaSharedMemoryTool::lockEvent
StatusCode lockEvent(long eventNumber) const
Definition: AthenaSharedMemoryTool.cxx:276
AthenaSharedMemoryTool::m_maxSize
const size_t m_maxSize
Definition: AthenaSharedMemoryTool.h:61
AthenaSharedMemoryTool::isClient
bool isClient() const
Definition: AthenaSharedMemoryTool.cxx:217
AthenaSharedMemoryTool::m_fileSeqNumber
long m_fileSeqNumber
Definition: AthenaSharedMemoryTool.h:68
maxTokenLength
const std::size_t maxTokenLength
Definition: AthenaSharedMemoryTool.cxx:20
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
copySelective.target
string target
Definition: copySelective.py:37
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:536
copySelective.source
string source
Definition: copySelective.py:32
AthenaSharedMemoryTool
This class provides the IPCTool for SharedMemory objects.
Definition: AthenaSharedMemoryTool.h:33
merge.status
status
Definition: merge.py:17
AthAlgTool
Definition: AthAlgTool.h:26
AthenaSharedMemoryTool::m_num
int m_num
Definition: AthenaSharedMemoryTool.h:63
AthenaSharedMemoryTool::lockObject
StatusCode lockObject(const char *tokenString, int num=0)
Definition: AthenaSharedMemoryTool.cxx:460
AthenaSharedMemoryTool::initialize
StatusCode initialize()
Gaudi Service Interface method implementations:
Definition: AthenaSharedMemoryTool.cxx:61
AthenaSharedMemoryTool::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Definition: AthenaSharedMemoryTool.h:71