CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_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.5 2012/05/02 15:13:23 smorovic 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   U32 nExpectedEPs;
00089   char* dataPtr() const
00090   {
00091     return (char*)this+sizeof(_I2O_SM_PREAMBLE_MESSAGE_FRAME);
00092   }
00093 }
00094 I2O_SM_PREAMBLE_MESSAGE_FRAME, *PI2O_SM_PREAMBLE_MESSAGE_FRAME;
00095 
00096 
00100 typedef struct _I2O_SM_DATA_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME
00101 {
00102   U32   rbBufferID;
00103   U32   runID;
00104   U32   eventID;
00105   U32   outModID;
00106   U32   fuProcID;
00107   U32   fuGUID;
00108   char* dataPtr() const {
00109     return (char*)this+sizeof(_I2O_SM_DATA_MESSAGE_FRAME);
00110   }
00111 }
00112 I2O_SM_DATA_MESSAGE_FRAME, *PI2O_SM_DATA_MESSAGE_FRAME;
00113 
00114 
00118 typedef struct _I2O_FU_DATA_DISCARD_MESSAGE_FRAME
00119 {
00120   I2O_PRIVATE_MESSAGE_FRAME PvtMessageFrame;
00121   U32                       rbBufferID;
00122 }
00123 I2O_FU_DATA_DISCARD_MESSAGE_FRAME, *PI2O_FU_DATA_DISCARD_MESSAGE_FRAME;
00124 
00125 
00129 typedef struct _I2O_SM_DQM_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME
00130 {
00131   U32   rbBufferID;
00132   U32   runID;
00133   U32   eventAtUpdateID;
00134   U32   folderID;
00135   U32   fuProcID;
00136   U32   fuGUID;
00137   char* dataPtr() const
00138   {
00139     return (char*)this+sizeof(_I2O_SM_DQM_MESSAGE_FRAME);
00140   }
00141 }
00142 I2O_SM_DQM_MESSAGE_FRAME, *PI2O_SM_DQM_MESSAGE_FRAME;
00143 
00144 
00148 typedef struct _I2O_FU_DQM_DISCARD_MESSAGE_FRAME
00149 {
00150   I2O_PRIVATE_MESSAGE_FRAME PvtMessageFrame;
00151   U32                       rbBufferID;
00152 }
00153 I2O_FU_DQM_DISCARD_MESSAGE_FRAME, *PI2O_FU_DQM_DISCARD_MESSAGE_FRAME;
00154 
00155 
00159 typedef struct _I2O_SM_OTHER_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME
00160 {
00161   U32   otherData;
00162   char* dataPtr() const
00163   {
00164     return (char*)this+sizeof(_I2O_SM_OTHER_MESSAGE_FRAME);
00165   }
00166 }
00167 I2O_SM_OTHER_MESSAGE_FRAME, *PI2O_SM_OTHER_MESSAGE_FRAME;
00168 
00169 
00170 #endif