]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
a few fixes for rare bugs/malfunctions
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Aug 2008 12:08:14 +0000 (12:08 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Aug 2008 12:08:14 +0000 (12:08 +0000)
- AliHLTProcessor/AliHLTDataSource: setting the output size to zero by default
  if the high level component interface is used. This handles the case of a component
  using the high level interface, but not publishing an output block for a particular
  event -> PubSub relies on output size zero if no data has been written
- toolbox publisher components handle output size correctly
- AliHLTTask: increase headroom in the output buffer to allow small extra data blocks
  from the base class
- HLTOUT handler for kAliHLTDataTypeComponentTable added
- TPCEsdWriterComponent handles output size correctly for SOR/EOR events

HLT/BASE/AliHLTDataSource.cxx
HLT/BASE/AliHLTProcessor.cxx
HLT/BASE/AliHLTTask.cxx
HLT/BASE/util/AliHLTAgentUtil.cxx
HLT/BASE/util/AliHLTFilePublisher.cxx
HLT/BASE/util/AliHLTOUTPublisherComponent.cxx
HLT/BASE/util/AliHLTRawReaderPublisherComponent.cxx
HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx

index ea8418fc5ae23f5c35d823d7d97ccd72fa17955c..3065fe95b87af378ee5854d6e5f44eca8323babd 100644 (file)
@@ -85,11 +85,12 @@ int AliHLTDataSource::DoProcessing( const AliHLTComponentEventData& evtData,
 int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& evtData,
                                AliHLTComponentTriggerData& trigData,
                                AliHLTUInt8_t* /*outputPtr*/, 
-                               AliHLTUInt32_t& /*size*/,
+                               AliHLTUInt32_t& size,
                                vector<AliHLTComponentBlockData>& /*outputBlocks*/ )
 {
   // we just forward to the high level method, all other parameters already
   // have been stored internally
+  size=0;
   return GetEvent(evtData, trigData);
 }
 
index f441e1d2808a03a3d989ddbfc5453d3bce5cbd53..bcb22ac7fd1fe709c979262d7b5ed839644d5a7e 100644 (file)
@@ -63,11 +63,12 @@ int AliHLTProcessor::DoEvent( const AliHLTComponentEventData& evtData,
                              const AliHLTComponentBlockData* /*blocks*/, 
                              AliHLTComponentTriggerData& trigData,
                              AliHLTUInt8_t* /*outputPtr*/, 
-                             AliHLTUInt32_t& /*size*/,
+                             AliHLTUInt32_t& size,
                              vector<AliHLTComponentBlockData>& /*outputBlocks*/ )
 {
   // we just forward to the high level method, all other parameters already
   // have been stored internally
+  size=0;
   return DoEvent(evtData, trigData);
 }
 
index 251ded8e8dea8b3785d28a004be2aadb311e60a4..eaae250b6b2352cb2b63a41b1b6e126d384c4398 100644 (file)
@@ -527,8 +527,12 @@ int AliHLTTask::ProcessTask(Int_t eventNo, AliHLTUInt32_t eventType)
       } else {
       long unsigned int iConstBase=0;
       double fInputMultiplier=0;
-      if (pComponent->GetComponentType()!=AliHLTComponent::kSink)
+      if (pComponent->GetComponentType()!=AliHLTComponent::kSink) {
        pComponent->GetOutputDataSize(iConstBase, fInputMultiplier);
+       // add a small margin to the buffer to allow optional component
+       // statistics
+       iConstBase+=100;
+      }
       if (fInputMultiplier<0) {
        HLTWarning("ignoring negative input multiplier");
        fInputMultiplier=0;
index 8202710570fdd545c7ec3c2879d60e94396429bb..44b754d0e8d1802e680ba2ce7a17cfe289f0875d 100644 (file)
@@ -128,7 +128,8 @@ int AliHLTAgentUtil::GetHandlerDescription(AliHLTComponentDataType dt,
   // see header file for class documentation
 
   // handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
-  if (dt==kAliHLTDataTypeComponentStatistics) {
+  if (dt==kAliHLTDataTypeComponentStatistics ||
+      dt==kAliHLTDataTypeComponentTable) {
       desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
       return 1;
   }
@@ -142,7 +143,8 @@ AliHLTOUTHandler* AliHLTAgentUtil::GetOutputHandler(AliHLTComponentDataType dt,
   // see header file for class documentation
 
   // handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
-  if (dt==kAliHLTDataTypeComponentStatistics) {
+  if (dt==kAliHLTDataTypeComponentStatistics ||
+      dt==kAliHLTDataTypeComponentTable) {
     if (fCompStatDataHandler==NULL)
       fCompStatDataHandler=new AliHLTOUTHandlerChain("chains=UTIL-compstat-writer");
     return fCompStatDataHandler;
index caaeb91fde781aba4a4d1b7efb1697d7b3d02489..d317c77319848884ffbb796aee41647f3a74f5e6 100644 (file)
@@ -331,6 +331,8 @@ int AliHLTFilePublisher::GetEvent( const AliHLTComponentEventData& /*evtData*/,
 
   // process data events only
   if (!IsDataEvent()) return 0;
+  AliHLTUInt32_t capacity=size;
+  size=0;
 
   int iResult=0;
   TObjLink *lnk=fpCurrent;
@@ -350,7 +352,7 @@ int AliHLTFilePublisher::GetEvent( const AliHLTComponentEventData& /*evtData*/,
        if (pFileDesc && (pFile=*pFileDesc)!=NULL) {
          int iCopy=pFile->GetSize();
          pFile->Seek(0);
-         if (iCopy+iTotalSize<=(int)size) {
+         if (iCopy+iTotalSize<=(int)capacity) {
            if (pFile->ReadBuffer((char*)outputPtr+iTotalSize, iCopy)!=0) {
              // ReadBuffer returns 1 in case of failure and 0 in case of success
              iResult=-EIO;
index 502aeaddda78ec51b4750b9313bb2ab27f94acff..7786d1db6b9b4daa7d51cabfb29f6f862c0ca6c2 100644 (file)
@@ -195,6 +195,8 @@ int AliHLTOUTPublisherComponent::GetEvent( const AliHLTComponentEventData& /*evt
 {
   // see header file for class documentation
   int iResult=0;
+  AliHLTUInt32_t capacity=size;
+  size=0;
 
   // process data events only
   if (!IsDataEvent()) return 0;
@@ -252,7 +254,7 @@ int AliHLTOUTPublisherComponent::GetEvent( const AliHLTComponentEventData& /*evt
        const AliHLTUInt8_t* pBuffer=NULL;
        AliHLTUInt32_t bufferSize=0;
        if ((iResult=pHLTOUT->GetDataBuffer(pBuffer, bufferSize))>=0) {
-         if (bufferSize+offset<=size) {
+         if (bufferSize+offset<=capacity) {
            memcpy(outputPtr+offset, pBuffer, bufferSize);
            AliHLTComponentBlockData bd;
            FillBlockData( bd );
@@ -272,7 +274,7 @@ int AliHLTOUTPublisherComponent::GetEvent( const AliHLTComponentEventData& /*evt
       if (iResult==-ENOENT) iResult=0;
 
       // indicate too little space in buffer for repeated processing
-      if (offset>size) {
+      if (offset>capacity) {
        iResult=-ENOSPC;
       }
     } else if (GetEventCount()<5) {
@@ -292,8 +294,6 @@ int AliHLTOUTPublisherComponent::GetEvent( const AliHLTComponentEventData& /*evt
   // finally set the output size
   if (iResult>=0)
     size=offset;
-  else
-    size=0;
 
   return iResult;
 }
index 16fe5de12baa2bff6ce569524214444e276c5a44..6b321dcb6e8ab57624e820f13a0fa0c0ee10211b 100644 (file)
@@ -222,6 +222,8 @@ int AliHLTRawReaderPublisherComponent::GetEvent(const AliHLTComponentEventData&
 {
   // see header file for class documentation
   int iResult=0;
+  AliHLTUInt32_t capacity=size;
+  size=0;
 
   // process data events only
   if (!IsDataEvent()) return 0;
@@ -252,7 +254,7 @@ int AliHLTRawReaderPublisherComponent::GetEvent(const AliHLTComponentEventData&
        continue;
       }
       processedIds.push_back(id);
-      if (readSize+offset<=size) {
+      if (readSize+offset<=capacity) {
        memcpy(outputPtr+offset, pHeader, sizeof(AliRawDataHeader));
        if (readSize>sizeof(AliRawDataHeader)) {
          if (!pRawReader->ReadNext(outputPtr+offset+sizeof(AliRawDataHeader), readSize-sizeof(AliRawDataHeader))) {
@@ -289,7 +291,7 @@ int AliHLTRawReaderPublisherComponent::GetEvent(const AliHLTComponentEventData&
        if (curr!=processedIds.end() && *curr<=id) {
          curr++;
        } else {
-         if (sizeof(AliRawDataHeader)<=size-offset) {
+         if (sizeof(AliRawDataHeader)<=capacity-offset) {
            HLTInfo("add empty data block for equipment id %d", id);
            memcpy(outputPtr+offset, &header, sizeof(AliRawDataHeader));
            AliHLTComponentBlockData bd;
@@ -312,10 +314,9 @@ int AliHLTRawReaderPublisherComponent::GetEvent(const AliHLTComponentEventData&
        }
       }
     }
-    if (offset<=size) {
+    if (offset<=capacity) {
       size=offset;
     } else {
-      size=0;
       outputBlocks.clear();
     }
   } else {
index 0a4ae783834c1cfe68a389d9a9286740ead02b29..026152ff5653b0a87a4086049fec3f618a718fc7 100644 (file)
@@ -414,11 +414,14 @@ int AliHLTTPCEsdWriterComponent::AliConverter::DoEvent(const AliHLTComponentEven
                                                       const AliHLTComponentBlockData* blocks, 
                                                       AliHLTComponentTriggerData& /*trigData*/,
                                                       AliHLTUInt8_t* /*outputPtr*/, 
-                                                      AliHLTUInt32_t& /*size*/,
+                                                      AliHLTUInt32_t& size,
                                                       AliHLTComponentBlockDataList& /*outputBlocks*/ )
 {
   // see header file for class documentation
   int iResult=0;
+  // no direct writing to the output buffer
+  size=0;
+
   assert(fBase);
   if (!fESD) {
     fESD = new AliESDEvent;