31 #define SHM_DESCRIPTOR_KEYID 1
41 const char* FUShmBuffer::shmKeyPath_ =
42 (getenv(
"FUSHM_KEYFILE") ==
NULL ?
"/dev/null"
43 : getenv(
"FUSHM_KEYFILE"));
44 const char* FUShmBuffer::semKeyPath_ =
45 (getenv(
"FUSEM_KEYFILE") ==
NULL ?
"/dev/null"
46 : getenv(
"FUSEM_KEYFILE"));
53 FUShmBuffer::FUShmBuffer(
bool segmentationMode,
unsigned int nRawCells,
54 unsigned int nRecoCells,
unsigned int nDqmCells,
55 unsigned int rawCellSize,
unsigned int recoCellSize,
56 unsigned int dqmCellSize) :
57 segmentationMode_(segmentationMode), nClientsMax_(128),
58 nRawCells_(nRawCells), rawCellPayloadSize_(rawCellSize),
59 nRecoCells_(nRecoCells), recoCellPayloadSize_(recoCellSize),
60 nDqmCells_(nDqmCells), dqmCellPayloadSize_(dqmCellSize) {
168 key_t* keyAddr = (key_t*) ((
unsigned long)
this +
rawCellOffset_);
240 unsigned int *iWrite, *iRead;
250 *iRead++ = 0xffffffff;
261 *iRead++ = 0xffffffff;
272 *iRead++ = 0xffffffff;
289 return semctl(
semid(), 1, GETVAL);
294 return semctl(
semid(), 2, GETVAL);
305 stringstream details;
306 details <<
"state==evt::EMPTY assertion failed! Actual state is " << state <<
", iCell = " << iCell;
325 stringstream details;
327 <<
"state==evt::RAWWRITTEN ||state==evt::EMPTY ||state==evt::STOP"
328 <<
"||state==evt::LUMISECTION assertion failed! Actual state is "
329 << state <<
", iCell = " << iCell;
361 stringstream details;
362 details <<
"state==dqm::WRITTEN || state==dqm::EMPTY assertion failed! Actual state is "
363 << state <<
", iCell = " << iCell;
380 stringstream details;
381 details <<
"state==evt::PROCESSED || state==evt::SENT || "
382 <<
"state==evt::EMPTY || state==evt::STOP || "
383 <<
"state==evt::USEDLS assertion failed! Actual state is "
384 << state <<
", index = " << cell->
index();
396 stringstream details;
397 details <<
"state==evt::RAWWRITING assertion failed! Actual state is "
398 << state <<
", index = " << cell->
index();
413 stringstream details;
414 details <<
"state==evt::RAWREADING assertion failed! Actual state is "
415 << state <<
", index = " << cell->
index();
441 stringstream details;
442 details <<
"state==dqm::SENDING||state==dqm::EMPTY assertion failed! Actual state is "
443 << state <<
", index = " << cell->
index();
462 stringstream details;
463 details <<
"state==evt::PROCESSING||state==evt::SENT||state==evt::EMPTY||"
464 <<
"state==evt::STOP||state==evt::LUMISECTION||state==evt::RECOWRITTEN assertion failed! Actual state is "
465 << state <<
", iCell = " << iCell;
530 stringstream details;
531 details <<
"state==dqm::EMPTY||state==dqm::SENT assertion failed! Actual state is "
532 << state <<
", iCell = " << iCell;
552 std::cout <<
"=================releaseRawCell state " << state << std::endl;
553 stringstream details;
554 details <<
"state==evt::DISCARDING||state==evt::RAWWRITING||"
555 <<
"state==evt::EMPTY||state==evt::STOP||state==evt::USEDLS"
556 <<
" assertion failed! Actual state is " << state <<
", index = " << cell->
index();
578 stringstream details;
579 details <<
"state==evt::RAWWRITING assertion failed! Actual state is "
580 << state <<
", index = " << cell->
index();
599 stringstream details;
600 details <<
"state==evt::RAWWRITING assertion failed! Actual state is "
601 << state <<
", index = " << cell->
index();
694 unsigned int fuProcessId,
unsigned int fuGuid,
unsigned char *
data,
695 unsigned int dataSize,
unsigned int nExpectedEPs) {
697 cout <<
"FUShmBuffer::writeRecoInitMsg() ERROR: buffer overflow."
705 cell->
writeInitMsg(outModId, fuProcessId, fuGuid, data, dataSize,nExpectedEPs);
715 unsigned int evtNumber,
unsigned int outModId,
716 unsigned int fuProcessId,
unsigned int fuGuid,
unsigned char *
data,
717 unsigned int dataSize) {
719 cout <<
"FUShmBuffer::writeRecoEventData() ERROR: buffer overflow."
735 cell->
writeEventData(rawCellIndex, runNumber, evtNumber, outModId,
736 fuProcessId, fuGuid, data, dataSize);
747 unsigned int fuProcessId,
unsigned int iRawCell,
bool checkValue) {
750 unsigned int dataSize =
sizeof(uint32_t) * (4 + 1024) + raw->
eventSize();
751 unsigned char *
data =
new unsigned char[dataSize];
752 uint32_t *
pos = (uint32_t*) data;
760 *pos++ = (uint32_t) 2;
761 *pos++ = (uint32_t) runNumber;
765 for (
unsigned int i = 0;
i < 1024;
i++)
766 *pos++ = (uint32_t) raw->
fedSize(
i);
821 unsigned int evtAtUpdate,
unsigned int folderId,
822 unsigned int fuProcessId,
unsigned int fuGuid,
unsigned char *
data,
823 unsigned int dataSize) {
825 cout <<
"FUShmBuffer::writeDqmEventData() ERROR: buffer overflow."
835 stringstream details;
836 details <<
"state==dqm::EMPTY assertion failed! Actual state is " << state
837 <<
", iCell = " << iCell;
841 cell->
writeData(runNumber, evtAtUpdate, folderId, fuProcessId, fuGuid,
853 cout <<
"--> current sem values:" << endl <<
" lock=" << semctl(
semid(), 0,
854 GETVAL) << endl <<
" wraw=" << semctl(
semid(), 1, GETVAL)
855 <<
" rraw=" << semctl(
semid(), 2, GETVAL) << endl <<
" wdsc="
856 << semctl(
semid(), 3, GETVAL) <<
" rdsc=" << semctl(
semid(), 4,
857 GETVAL) << endl <<
" wrec=" << semctl(
semid(), 5, GETVAL)
858 <<
" rrec=" << semctl(
semid(), 6, GETVAL) << endl <<
" wdqm="
859 << semctl(
semid(), 7, GETVAL) <<
" rdqm=" << semctl(
semid(), 8,
865 ostr <<
"--> current sem values:" << endl <<
" lock=" << semctl(
semid(), 0,
866 GETVAL) << endl <<
" wraw=" << semctl(
semid(), 1, GETVAL)
867 <<
" rraw=" << semctl(
semid(), 2, GETVAL) << endl <<
" wdsc="
868 << semctl(
semid(), 3, GETVAL) <<
" rdsc=" << semctl(
semid(), 4,
869 GETVAL) << endl <<
" wrec=" << semctl(
semid(), 5, GETVAL)
870 <<
" rrec=" << semctl(
semid(), 6, GETVAL) << endl <<
" wdqm="
871 << semctl(
semid(), 7, GETVAL) <<
" rdqm=" << semctl(
semid(), 8,
880 std::string stateName;
886 stateName =
"RAWWRITING";
888 stateName =
"RAWRITTEN";
890 stateName =
"RAWREADING";
892 stateName =
"RAWREAD";
894 stateName =
"PROCESSING";
896 stateName =
"PROCESSED";
898 stateName =
"RECOWRITING";
900 stateName =
"RECOWRITTEN";
902 stateName =
"SENDING";
906 stateName =
"DISCARDING";
907 cout <<
"evt " << index <<
" in state '" << stateName <<
"'." << endl;
913 cout <<
"dqm evt " << index <<
" in state '" << state <<
"'." << endl;
918 unsigned int nRawCells,
unsigned int nRecoCells,
919 unsigned int nDqmCells,
unsigned int rawCellSize,
920 unsigned int recoCellSize,
unsigned int dqmCellSize) {
923 cout <<
"FUShmBuffer::createShmBuffer: "
924 <<
"REMOVAL OF OLD SHARED MEM SEGMENTS SUCCESSFULL." << endl;
927 int size =
sizeof(
unsigned int) * 7;
936 cout <<
"FUShmBuffer::createShmBuffer() FAILED: nattch=" <<
shm_nattch(
942 unsigned int*
p = (
unsigned int*) shmAddr;
943 *p++ = segmentationMode;
954 nDqmCells, rawCellSize, recoCellSize, dqmCellSize);
966 cout <<
"FUShmBuffer::createShmBuffer FAILED: nattch=" <<
shm_nattch(
972 nRawCells, nRecoCells, nDqmCells, rawCellSize, recoCellSize,
975 cout <<
"FUShmBuffer::createShmBuffer(): CREATED shared memory buffer."
977 cout <<
" segmentationMode="
978 << segmentationMode << endl;
988 int size =
sizeof(
unsigned int) * 7;
996 unsigned int *
p = (
unsigned int*) shmAddr;
997 bool segmentationMode = *p++;
1001 unsigned int rawCellSize = *p++;
1002 unsigned int recoCellSize = *p++;
1003 unsigned int dqmCellSize = *p++;
1006 cout <<
"FUShmBuffer::getShmBuffer():" <<
" segmentationMode="
1007 << segmentationMode <<
" nRawCells=" << nRawCells <<
" nRecoCells="
1008 << nRecoCells <<
" nDqmCells=" << nDqmCells <<
" rawCellSize="
1009 << rawCellSize <<
" recoCellSize=" << recoCellSize
1010 <<
" dqmCellSize=" << dqmCellSize << endl;
1014 nDqmCells, rawCellSize, recoCellSize, dqmCellSize);
1026 cout <<
"FUShmBuffer::getShmBuffer() FAILED: nattch=" <<
shm_nattch(
1031 nRawCells, nRecoCells, nDqmCells, rawCellSize, recoCellSize,
1034 cout <<
"FUShmBuffer::getShmBuffer(): shared memory buffer RETRIEVED. PID:" << getpid()
1036 cout <<
" segmentationMode="
1037 << segmentationMode << endl;
1047 int size =
sizeof(
unsigned int) * 7;
1055 unsigned int*
p = (
unsigned int*) shmAddr;
1056 bool segmentationMode = *p++;
1060 unsigned int rawCellSize = *p++;
1061 unsigned int recoCellSize = *p++;
1062 unsigned int dqmCellSize = *p++;
1067 nDqmCells, rawCellSize, recoCellSize, dqmCellSize);
1079 for (; att < 10; att++) {
1081 cout << att <<
" FUShmBuffer::releaseSharedMemory(): nattch="
1083 <<
", failed attempt to release shared memory." << endl;
1092 if (segmentationMode) {
1094 nRawCells, nRecoCells, nDqmCells, rawCellSize, recoCellSize,
1129 unsigned int nRecoCells,
unsigned int nDqmCells,
1130 unsigned int rawCellSize,
unsigned int recoCellSize,
1131 unsigned int dqmCellSize) {
1140 unsigned int realSize = (segmentationMode) ? offset +
sizeof(key_t)
1141 * (nRawCells + nRecoCells +
nDqmCells) : offset + rawCellTotalSize
1142 * nRawCells + recoCellTotalSize * nRecoCells + dqmCellTotalSize
1145 unsigned int result = realSize / 0x10 * 0x10 + (realSize % 0x10 > 0) * 0x10;
1153 if (result == (key_t) -1)
1154 cout <<
"FUShmBuffer::getShmDescriptorKey: failed " <<
"for file "
1162 if (result == (key_t) -1)
1163 cout <<
"FUShmBuffer::getShmKey: ftok() failed " <<
"for file "
1171 if (result == (key_t) -1)
1172 cout <<
"FUShmBuffer::getSemKey: ftok() failed " <<
"for file "
1180 int shmid = shmget(key, 1, 0644);
1184 shmctl(shmid, IPC_STAT, &shmstat);
1185 cout <<
"FUShmBuffer found segment for key 0x " << hex << key << dec
1186 <<
" created by process " << shmstat.shm_cpid <<
" owned by "
1187 << shmstat.shm_perm.uid <<
" permissions " << hex
1188 << shmstat.shm_perm.mode << dec << endl;
1189 shmctl(shmid, IPC_RMID, &shmstat);
1191 shmid = shmget(key, size, IPC_CREAT | 0644);
1194 cout <<
"FUShmBuffer::shm_create(" << key <<
"," << size
1195 <<
") failed: " << strerror(err) << endl;
1202 int shmid = shmget(key, size, 0644);
1205 cout <<
"FUShmBuffer::shm_get(" << key <<
"," << size <<
") failed: "
1206 << strerror(err) << endl;
1216 cout <<
"FUShmBuffer::shm_attach(" << shmid <<
") failed: "
1217 << strerror(err) << endl;
1225 shmctl(shmid, IPC_STAT, &shmstat);
1226 return shmstat.shm_nattch;
1232 int result = shmctl(shmid, IPC_RMID, &shmstat);
1234 cout <<
"FUShmBuffer::shm_destroy(shmid=" << shmid <<
") failed."
1241 int semid = semget(key, nsem, IPC_CREAT | 0666);
1244 cout <<
"FUShmBuffer::sem_create(key=" << key <<
",nsem=" << nsem
1245 <<
") failed: " << strerror(err) << endl;
1252 int semid = semget(key, nsem, 0666);
1255 cout <<
"FUShmBuffer::sem_get(key=" << key <<
",nsem=" << nsem
1256 <<
") failed: " << strerror(err) << endl;
1263 int result = semctl(semid, 0, IPC_RMID);
1265 cout <<
"FUShmBuffer::sem_destroy(semid=" << semid <<
") failed."
1276 unsigned int& iNext) {
1278 unsigned int* pindex = (
unsigned int*) ((
unsigned long)
this +
offset);
1280 iNext = (iNext + 1) % nCells;
1281 unsigned int result = *pindex;
1288 unsigned int nCells,
unsigned int& iLast) {
1290 unsigned int* pindex = (
unsigned int*) ((
unsigned long)
this +
offset);
1293 iLast = (iLast + 1) % nCells;
1359 unsigned int *pevt = (
unsigned int*) ((
unsigned long)
this
1365 XCEPT_ASSERT(
false,
evf::Exception,
"This point should not be reached!");
1373 if ((*pevt++) == prcid)
1376 XCEPT_ASSERT(
false,
evf::Exception,
"This point should not be reached!");
1383 stringstream details;
1384 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1396 stringstream details;
1397 details <<
"index<nDqmCells_ assertion failed! Actual index is " <<
index;
1409 stringstream details;
1410 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1413 unsigned int *pevt = (
unsigned int*) ((
unsigned long)
this
1422 stringstream details;
1423 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1434 stringstream details;
1435 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1446 stringstream details;
1447 details <<
"index<nClientsMax_ assertion failed! Actual index is " <<
index;
1458 stringstream details;
1459 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1467 if (lockShm)
lock();
1476 stringstream details;
1477 details <<
"index<nDqmCells_ assertion failed! Actual index is " <<
index;
1492 stringstream details;
1493 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1498 unsigned int *pcount = (
unsigned int*) ((
unsigned long)
this
1501 if (lockShm)
lock();
1503 if (*pcount < discard)
1515 stringstream details;
1516 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1521 unsigned int *pcount = (
unsigned int*) ((
unsigned long)
this
1524 if (lockShm)
lock();
1534 stringstream details;
1535 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1538 unsigned int *pevt = (
unsigned int*) ((
unsigned long)
this
1550 stringstream details;
1551 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1565 stringstream details;
1566 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1581 stringstream details;
1582 details <<
"nClients_<nClientsMax_ assertion failed! Actual nClients is "
1589 if ((*prcid) == prcId) {
1605 unsigned int iClient(0);
1606 while (iClient <
nClients_ && (*prcid) != prcId) {
1618 pid_t*
next = prcid;
1636 cout <<
"FUShmBuffer::rawCell(" << iCell <<
") ERROR: " <<
"iCell="
1637 << iCell <<
" >= nRawCells()=" <<
nRawCells_ << endl;
1659 cout <<
"FUShmBuffer::recoCell(" << iCell <<
") ERROR: " <<
"iCell="
1660 << iCell <<
" >= nRecoCells=" <<
nRecoCells_ << endl;
1682 cout <<
"FUShmBuffer::dqmCell(" << iCell <<
") ERROR: " <<
"iCell="
1683 << iCell <<
" >= nDqmCells=" <<
nDqmCells_ << endl;
1703 stringstream details;
1704 details <<
"index<nRawCells_ assertion failed! Actual index is " <<
index;
1707 unsigned int *pcount = (
unsigned int*) ((
unsigned long)
this
1711 if(!(*pcount > 0)) {
1712 stringstream details;
1713 details <<
"*pcount>0 assertion failed! Value at pcount is " << *pcount <<
" for cell index " <<
index;
1718 bool result = (*pcount == 0);
1726 cout <<
"FUShmBuffer::shmKey() ERROR: only valid in segmentationMode!"
1730 key_t* addr = (key_t*) ((
unsigned long)
this +
offset);
1731 for (
unsigned int i = 0;
i < iCell;
i++)
1739 cout <<
"FUShmBuffer::rawCellShmKey() ERROR: " <<
"iCell>=nRawCells: "
1749 cout <<
"FUShmBuffer::recoCellShmKey() ERROR: "
1750 <<
"iCell>=nRecoCells: " << iCell <<
">=" <<
nRecoCells_
1760 cout <<
"FUShmBuffer::dqmCellShmKey() ERROR: " <<
"iCell>=nDqmCells: "
1769 if (semctl(
semid(), isem, SETVAL, value) < 0) {
1770 cout <<
"FUShmBuffer: FATAL ERROR in semaphore initialization." << endl;
1776 struct sembuf sops[1];
1777 sops[0].sem_num = isem;
1778 sops[0].sem_op = -1;
1779 sops[0].sem_flg = 0;
1780 if (semop(
semid(), sops, 1) == -1) {
1781 cout <<
"FUShmBuffer: ERROR in semaphore operation sem_wait." << endl;
1789 struct sembuf sops[1];
1790 sops[0].sem_num = isem;
1792 sops[0].sem_flg = 0;
1793 if (semop(
semid(), sops, 1) == -1) {
1794 cout <<
"FUShmBuffer: ERROR in semaphore operation sem_post." << endl;
void discardRecoCell(unsigned int iCell)
unsigned int clientPrcIdOffset_
key_t recoCellShmKey(unsigned int iCell)
FUShmRawCell * rawCellToRead()
FUShmRawCell * rawCellToDiscard()
void postRawIndexToRead(unsigned int index)
unsigned int nRecoCells() const
void writeRawLumiSectionEvent(unsigned int)
static int shm_nattch(int shmid)
unsigned int index() const
void initialize(unsigned int index)
bool setEvtPrcId(unsigned int index, pid_t prcId)
unsigned int dqmWriteNext_
static void * shm_attach(int shmid)
void postDqmIndexToWrite(unsigned int index)
unsigned int rawReadOffset_
void initialize(unsigned int index)
static unsigned int size(unsigned int payloadSize)
unsigned int nextRecoReadIndex()
unsigned int dqmReadLast_
unsigned int recoCellPayloadSize_
unsigned int dqmReadOffset_
bool writeRecoEventData(unsigned int runNumber, unsigned int evtNumber, unsigned int outModId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize)
bool writeErrorEventData(unsigned int runNumber, unsigned int fuProcessId, unsigned int iRawCell, bool checkValue)
unsigned int nextIndex(unsigned int offset, unsigned int nCells, unsigned int &iNext)
bool writeDqmEventData(unsigned int runNumber, unsigned int evtAtUpdate, unsigned int folderId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize)
void scheduleRawCellForDiscardServerSide(unsigned int iCell)
unsigned int dqmWriteLast_
static FUShmBuffer * getShmBuffer()
int nbRawCellsToRead() const
void printDqmState(unsigned int index)
void releaseRawCell(FUShmRawCell *cell)
unsigned int evtDiscardOffset_
static const char * semKeyPath_
unsigned int dqmStateOffset_
pid_t clientPrcId(unsigned int index)
static key_t getShmDescriptorKey()
static int shm_get(key_t key, int size)
unsigned int dqmWriteOffset_
unsigned int recoWriteLast_
static bool releaseSharedMemory()
static int sem_create(key_t key, int nsem)
bool removeClientPrcId(pid_t prcId)
static unsigned int size(bool segmentationMode, unsigned int nRawCells, unsigned int nRecoCells, unsigned int nDqmCells, unsigned int rawCellSize, unsigned int recoCellSize, unsigned int dqmCellSize)
FUShmDqmCell * dqmCellToRead()
unsigned int evtNumberOffset_
unsigned int dqmCellOffset_
evt::State_t evtState(unsigned int index)
bool writeRecoInitMsg(unsigned int outModId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize, unsigned int nExpectedEPs)
void discardDqmCell(unsigned int iCell)
unsigned int evtNumber() const
void writeInitMsg(unsigned int outModId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize, unsigned int nExpectedEPs)
unsigned int nextDqmReadIndex()
time_t evtTimeStamp(unsigned int index)
unsigned int evtNumber(unsigned int index)
unsigned int recoWriteNext_
void initialize(unsigned int shmid, unsigned int semid)
void writeRecoEmptyEvent()
bool setEvtNumber(unsigned int index, unsigned int evtNumber)
void postDqmIndexToRead(unsigned int index)
unsigned int evtStateOffset_
static unsigned int size(unsigned int payloadSize)
unsigned int rawCellIndex() const
void initialize(unsigned int index)
void discardOrphanedRecoCell(unsigned int iCell)
bool setClientPrcId(pid_t prcId)
unsigned int getlbn(const unsigned char *)
std::string sem_print_s()
void discardRawCell(FUShmRawCell *cell)
void postRawIndexToWrite(unsigned int index)
unsigned int nextRawReadIndex()
unsigned char * payloadAddr() const
FUShmRawCell * rawCell(unsigned int iCell)
unsigned int recoReadOffset_
static const char * shmKeyPath_
unsigned int rawWriteNext_
pid_t evtPrcId(unsigned int index)
void finishWritingRawCell(FUShmRawCell *cell)
unsigned int nbRawCellsToWrite() const
bool setEvtDiscard(unsigned int index, unsigned int discard, bool checkValue=false, bool lockShm=true)
key_t rawCellShmKey(unsigned int iCell)
static int shm_destroy(int shmid)
unsigned int nRawCells() const
bool setEvtState(unsigned int index, evt::State_t state, bool lockShm=true)
FUShmRecoCell * recoCell(unsigned int iCell)
void writeRawEmptyEvent()
bool rawCellReadyForDiscard(unsigned int index)
unsigned int offset(bool)
unsigned char * fedAddr(unsigned int i) const
unsigned int dqmCellPayloadSize_
static FUShmBuffer * createShmBuffer(bool semgmentationMode, unsigned int nRawCells, unsigned int nRecoCells, unsigned int nDqmCells, unsigned int rawCellSize=0x400000, unsigned int recoCellSize=0x400000, unsigned int dqmCellSize=0x400000)
void finishReadingDqmCell(FUShmDqmCell *cell)
void scheduleRawEmptyCellForDiscard()
unsigned int recoReadLast_
void finishReadingRecoCell(FUShmRecoCell *cell)
unsigned int nextDqmWriteIndex()
void writeErrorEvent(unsigned int rawCellIndex, unsigned int runNumber, unsigned int evtNumber, unsigned int fuProcessId, unsigned char *data, unsigned int dataSize)
key_t dqmCellShmKey(unsigned int iCell)
dqm::State_t dqmState(unsigned int index)
unsigned int rawReadNext_
unsigned int rawCellPayloadSize_
unsigned int nextRecoWriteIndex()
unsigned int eventSize() const
unsigned int rawDiscardIndex_
unsigned int nextRawWriteIndex()
FUShmRawCell * rawCellToWrite()
unsigned int rawReadLast_
unsigned int rawWriteOffset_
unsigned int dqmCellTotalSize_
bool setEvtTimeStamp(unsigned int index, time_t timeStamp)
unsigned int rawWriteLast_
void writeDqmEmptyEvent()
unsigned int dqmReadNext_
unsigned int recoCellTotalSize_
void postRecoIndexToRead(unsigned int index)
unsigned int index() const
void setLumiSection(unsigned int)
unsigned int indexForEvtNumber(unsigned int evtNumber)
void printEvtState(unsigned int index)
char data[epos_bytes_allocation]
unsigned int nClientsMax_
static int sem_get(key_t key, int nsem)
FUShmRecoCell * recoCellToRead()
unsigned int rawCellTotalSize_
FUShmBuffer(bool segmentationMode, unsigned int nRawCells, unsigned int nRecoCells, unsigned int nDqmCells, unsigned int rawCellSize, unsigned int recoCellSize, unsigned int dqmCellSize)
void writeData(unsigned int runNumber, unsigned int evtAtUpdate, unsigned int folderId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize)
static int sem_destroy(int semid)
#define SHM_DESCRIPTOR_KEYID
static int shm_create(key_t key, int size)
unsigned int nDqmCells() const
unsigned int fedSize(unsigned int i) const
void sem_init(int isem, int value)
unsigned int evtPrcIdOffset_
unsigned int recoWriteOffset_
int incEvtDiscard(unsigned int index, bool lockShm=true)
void writeEventData(unsigned int rawCellIndex, unsigned int runNumber, unsigned int evtNumber, unsigned int outModId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize)
static unsigned int size(unsigned int payloadSize)
unsigned int rawCellOffset_
unsigned int recoReadNext_
unsigned int indexForEvtPrcId(pid_t evtNumber)
key_t shmKey(unsigned int iCell, unsigned int offset)
void finishReadingRawCell(FUShmRawCell *cell)
tuple size
Write out results.
unsigned int recoCellOffset_
std::string timeStamp(TimePoint_t)
void setEventTypeStopper()
void postRecoIndexToWrite(unsigned int index)
bool setDqmState(unsigned int index, dqm::State_t state)
void postIndex(unsigned int index, unsigned int offset, unsigned int nCells, unsigned int &iLast)
FUShmDqmCell * dqmCell(unsigned int iCell)
void scheduleRawEmptyCellForDiscardServerSide(FUShmRawCell *cell)
unsigned int evtTimeStampOffset_
void scheduleRawCellForDiscard(unsigned int iCell)