CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/EventFilter/Utilities/interface/i2oEvfMsgs.h

Go to the documentation of this file.
00001 #ifndef I2OEVFMSGS_H
00002 #define I2OEVFMSGS_H
00003 
00004 
00005 #include "i2o/i2o.h"
00006 #include <string.h>
00007 
00008 
00009 //#include "IOPool/Streamer/interface/MsgTools.h"
00010 
00011 /*
00012    Description:
00013    ------------
00014    define communication protocoll between FUResourceBroker ('FU') and
00015    StorageManager ('SM').
00016    
00017    $Id: i2oEvfMsgs.h,v 1.4 2008/10/14 11:40:19 schiefer Exp $
00018 */
00019 
00020 // I2O function codes: *_SM_* / *_FU_* according to who *receives* the message
00021 #define I2O_SM_PREAMBLE     0x001a
00022 #define I2O_SM_DATA         0x001b
00023 #define I2O_SM_ERROR        0x001c
00024 #define I2O_SM_OTHER        0x001d
00025 #define I2O_SM_DQM          0x001e
00026 #define I2O_FU_DATA_DISCARD 0x001f
00027 #define I2O_FU_DQM_DISCARD  0x0020
00028 
00029 //
00030 // RunNumber_t and EventNumber_t are unsigned long variables
00031 // We will use U32 instead for 64-bit compatibility
00032 //
00033 // source (FU/HLT) id could be compressed into fewer bytes!
00034 //
00035 // max I2O frame is (2**16 - 1) * 4 = 65535 * 4 = 262140
00036 // but this size should also be a multiple of 64 bits (8 bytes)
00037 #define I2O_ABSOLUTE_MAX_SIZE 262136
00038 
00039 // Illustrate calculation of max data I2O frame for given KB:
00040 // If 32KB (e.g. for MTCC-I) max = (2**13 - 1) * 4 = 32764 
00041 // but to be a multiple of 8 bytes it needs to be = 32760
00042 //
00043 // Actual value can be defined to any multiple of 8 bytes
00044 // and less than I2O_ABSOLUTE_MAX_SIZE
00045 // set the default if no value is given in the output module
00046 #define I2O_MAX_SIZE 64000
00047 
00048 // max data I2O frame needs to be calculated as e.g.
00049 // I2O_MAX_SIZE - headers = I2O_MAX_SIZE - 28 -136
00050 // now done dynamically in e.g. FUStreamerI2OWriter.cc
00051 //
00052 // maximum characters for the source class name and url
00053 #define MAX_I2O_SM_URLCHARS 50
00054 
00055 
00060 struct _I2O_SM_MULTIPART_MESSAGE_FRAME
00061 {
00062   I2O_PRIVATE_MESSAGE_FRAME PvtMessageFrame;
00063   U32                       dataSize;
00064   char                      hltURL[MAX_I2O_SM_URLCHARS];
00065   char                      hltClassName[MAX_I2O_SM_URLCHARS];
00066   U32                       hltLocalId;
00067   U32                       hltInstance;
00068   U32                       hltTid;
00069   U32                       numFrames;
00070   U32                       frameCount;
00071   U32                       originalSize;
00072 };
00073 
00074 typedef struct _I2O_SM_MULTIPART_MESSAGE_FRAME
00075 I2O_SM_MULTIPART_MESSAGE_FRAME, *PI2O_SM_MULTIPART_MESSAGE_FRAME;
00076 
00077 
00082 typedef struct _I2O_SM_PREAMBLE_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME
00083 {
00084   U32 rbBufferID;
00085   U32 outModID;
00086   U32 fuProcID;
00087   U32 fuGUID;
00088   char* dataPtr() const
00089   {
00090     return (char*)this+sizeof(_I2O_SM_PREAMBLE_MESSAGE_FRAME);
00091   }
00092 }
00093 I2O_SM_PREAMBLE_MESSAGE_FRAME, *PI2O_SM_PREAMBLE_MESSAGE_FRAME;
00094 
00095 
00099 typedef struct _I2O_SM_DATA_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME
00100 {
00101   U32   rbBufferID;
00102   U32   runID;
00103   U32   eventID;
00104   U32   outModID;
00105   U32   fuProcID;
00106   U32   fuGUID;
00107   char* dataPtr() const {
00108     return (char*)this+sizeof(_I2O_SM_DATA_MESSAGE_FRAME);
00109   }
00110 }
00111 I2O_SM_DATA_MESSAGE_FRAME, *PI2O_SM_DATA_MESSAGE_FRAME;
00112 
00113 
00117 typedef struct _I2O_FU_DATA_DISCARD_MESSAGE_FRAME
00118 {
00119   I2O_PRIVATE_MESSAGE_FRAME PvtMessageFrame;
00120   U32                       rbBufferID;
00121 }
00122 I2O_FU_DATA_DISCARD_MESSAGE_FRAME, *PI2O_FU_DATA_DISCARD_MESSAGE_FRAME;
00123 
00124 
00128 typedef struct _I2O_SM_DQM_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME
00129 {
00130   U32   rbBufferID;
00131   U32   runID;
00132   U32   eventAtUpdateID;
00133   U32   folderID;
00134   U32   fuProcID;
00135   U32   fuGUID;
00136   char* dataPtr() const
00137   {
00138     return (char*)this+sizeof(_I2O_SM_DQM_MESSAGE_FRAME);
00139   }
00140 }
00141 I2O_SM_DQM_MESSAGE_FRAME, *PI2O_SM_DQM_MESSAGE_FRAME;
00142 
00143 
00147 typedef struct _I2O_FU_DQM_DISCARD_MESSAGE_FRAME
00148 {
00149   I2O_PRIVATE_MESSAGE_FRAME PvtMessageFrame;
00150   U32                       rbBufferID;
00151 }
00152 I2O_FU_DQM_DISCARD_MESSAGE_FRAME, *PI2O_FU_DQM_DISCARD_MESSAGE_FRAME;
00153 
00154 
00158 typedef struct _I2O_SM_OTHER_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME
00159 {
00160   U32   otherData;
00161   char* dataPtr() const
00162   {
00163     return (char*)this+sizeof(_I2O_SM_OTHER_MESSAGE_FRAME);
00164   }
00165 }
00166 I2O_SM_OTHER_MESSAGE_FRAME, *PI2O_SM_OTHER_MESSAGE_FRAME;
00167 
00168 
00169 #endif