2 #define FUSHMBUFFER_H 1
11 #include <sys/types.h>
51 unsigned int rawCellSize,
52 unsigned int recoCellSize,
53 unsigned int dqmCellSize);
115 unsigned int fuProcessId,
118 unsigned int dataSize,
119 unsigned int nExpectedEPs);
123 unsigned int outModId,
124 unsigned int fuProcessId,
127 unsigned int dataSize);
130 unsigned int fuProcessId,
131 unsigned int iRawCell,
135 unsigned int evtAtUpdate,
136 unsigned int folderId,
137 unsigned int fuProcessId,
140 unsigned int dataSize);
152 unsigned int nRawCells,
153 unsigned int nRecoCells,
154 unsigned int nDqmCells,
155 unsigned int rawCellSize =0x400000,
156 unsigned int recoCellSize=0x400000,
157 unsigned int dqmCellSize =0x400000);
163 static unsigned int size(
bool segmentationMode,
164 unsigned int nRawCells,
165 unsigned int nRecoCells,
166 unsigned int nDqmCells,
167 unsigned int rawCellSize,
168 unsigned int recoCellSize,
169 unsigned int dqmCellSize);
193 unsigned int& iNext);
197 unsigned int& iLast);
220 bool setEvtDiscard(
unsigned int index,
unsigned int discard,
bool checkValue=
false,
bool lockShm=
true);
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)
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_
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()
unsigned int dqmWriteIndex_
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 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_
void discardOrphanedRecoCell(unsigned int iCell)
bool setClientPrcId(pid_t prcId)
std::string sem_print_s()
void discardRawCell(FUShmRawCell *cell)
void postRawIndexToWrite(unsigned int index)
unsigned int nextRawReadIndex()
FUShmRawCell * rawCell(unsigned int iCell)
unsigned int recoReadOffset_
unsigned int nClients() const
static const char * shmKeyPath_
unsigned int rawWriteNext_
unsigned int recoWriteIndex_
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 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()
key_t dqmCellShmKey(unsigned int iCell)
dqm::State_t dqmState(unsigned int index)
unsigned int rawReadNext_
unsigned int rawCellPayloadSize_
unsigned int nextRecoWriteIndex()
unsigned int rawDiscardIndex_
unsigned int nextRawWriteIndex()
FUShmRawCell * rawCellToWrite()
unsigned int rawReadLast_
unsigned int rawWriteOffset_
unsigned int dqmCellTotalSize_
unsigned int dqmReadIndex_
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 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)
static int sem_destroy(int semid)
static int shm_create(key_t key, int size)
unsigned int nDqmCells() const
void sem_init(int isem, int value)
unsigned int evtPrcIdOffset_
unsigned int recoWriteOffset_
int incEvtDiscard(unsigned int index, bool lockShm=true)
unsigned int rawCellOffset_
unsigned int recoReadNext_
unsigned int indexForEvtPrcId(pid_t evtNumber)
unsigned int recoReadIndex_
key_t shmKey(unsigned int iCell, unsigned int offset)
void finishReadingRawCell(FUShmRawCell *cell)
unsigned int recoCellOffset_
std::string timeStamp(TimePoint_t)
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)