2 // splitted from AliHLTConfiguration.cxx,v 1.25 2007/10/12 13:24:47
3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * for The ALICE HLT Project. *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
19 /** @file AliHLTTask.cxx
20 @author Matthias Richter
22 @brief Implementation of HLT tasks.
25 // see header file for class documentation
27 // refer to README to build package
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
40 #include "AliHLTTask.h"
41 #include "AliHLTConfiguration.h"
42 #include "AliHLTComponent.h"
43 #include "AliHLTComponentHandler.h"
46 /** ROOT macro for the implementation of ROOT specific class methods */
49 AliHLTTask::AliHLTTask()
51 fpConfiguration(NULL),
58 // see header file for class documentation
60 // refer to README to build package
62 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
65 AliHLTTask::AliHLTTask(AliHLTConfiguration* pConf)
67 fpConfiguration(pConf),
74 // see header file for function documentation
77 AliHLTTask::~AliHLTTask()
79 // see header file for function documentation
80 TObjLink* lnk=fListDependencies.FirstLink();
83 AliHLTTask* pTask=(AliHLTTask*)lnk->GetObject();
84 pTask->UnsetTarget(this);
87 lnk=fListTargets.FirstLink();
90 AliHLTTask* pTask=(AliHLTTask*)lnk->GetObject();
91 pTask->UnsetDependency(this);
95 if (fpComponent) delete fpComponent;
99 int AliHLTTask::Init(AliHLTConfiguration* pConf, AliHLTComponentHandler* pCH)
101 // see header file for function documentation
103 if (fpConfiguration!=NULL && pConf!=NULL && fpConfiguration!=pConf) {
104 HLTWarning("overriding existing reference to configuration object %p by %p",
105 fpConfiguration, pConf);
107 if (pConf!=NULL) fpConfiguration=pConf;
108 iResult=CreateComponent(fpConfiguration, pCH, fpComponent);
110 iResult=CustomInit(pCH);
115 int AliHLTTask::CreateComponent(AliHLTConfiguration* pConf, AliHLTComponentHandler* pCH, AliHLTComponent*& pComponent) const
117 // see header file for class documentation
122 const char** argv=NULL;
123 if ((iResult=pConf->GetArguments(&argv))>=0) {
124 argc=iResult; // just to make it clear
125 // TODO: we have to think about the optional environment parameter,
126 // currently just set to NULL.
127 iResult=pCH->CreateComponent(pConf->GetComponentID(), pComponent);
128 if (pComponent && iResult>=0) {
130 description.Form("chainid=%s", GetName());
131 pComponent->SetComponentDescription(description.Data());
132 const AliHLTAnalysisEnvironment* pEnv=pCH->GetEnvironment();
133 if ((iResult=pComponent->Init(pEnv, NULL, argc, argv))>=0) {
134 //HLTDebug("component %s (%p) created", pComponent->GetComponentID(), pComponent);
136 HLTError("Initialization of component \"%s\" failed with error %d", pComponent->GetComponentID(), iResult);
139 //HLTError("can not find component \"%s\" (%d)", pConf->GetComponentID(), iResult);
142 HLTError("can not get argument list for configuration %s (%s)", pConf->GetName(), pConf->GetComponentID());
146 HLTError("component handler instance needed for task initialization");
150 HLTError("configuration object instance needed for task initialization");
156 int AliHLTTask::Deinit()
158 // see header file for function documentation
161 AliHLTComponent* pComponent=GetComponent();
164 //HLTDebug("delete component %s (%p)", pComponent->GetComponentID(), pComponent);
165 pComponent->Deinit();
168 HLTWarning("task doesn't seem to be in initialized");
173 const char *AliHLTTask::GetName() const
175 // see header file for function documentation
177 return fpConfiguration->GetName();
178 return TObject::GetName();
181 AliHLTConfiguration* AliHLTTask::GetConf() const
183 // see header file for function documentation
184 return fpConfiguration;
187 AliHLTComponent* AliHLTTask::GetComponent() const
189 // see header file for function documentation
193 AliHLTTask* AliHLTTask::FindDependency(const char* id)
195 // see header file for function documentation
196 AliHLTTask* pTask=NULL;
198 pTask=(AliHLTTask*)fListDependencies.FindObject(id);
203 int AliHLTTask::FollowDependency(const char* id, TList* pTgtList)
205 // see header file for function documentation
208 AliHLTTask* pDep=NULL;
209 if ((pDep=(AliHLTTask*)fListDependencies.FindObject(id))!=NULL) {
210 if (pTgtList) pTgtList->Add(pDep);
213 TObjLink* lnk=fListDependencies.FirstLink();
214 while (lnk && iResult==0) {
215 pDep=(AliHLTTask*)lnk->GetObject();
217 if ((iResult=pDep->FollowDependency(id, pTgtList))>0) {
218 if (pTgtList) pTgtList->AddFirst(pDep);
233 void AliHLTTask::PrintDependencyTree(const char* id, int bFromConfiguration)
235 // see header file for function documentation
236 HLTLogKeyword("task dependencies");
239 if (bFromConfiguration) {
241 iResult=fpConfiguration->FollowDependency(id, &tgtList);
245 iResult=FollowDependency(id, &tgtList);
247 HLTMessage(" dependency level %d ", iResult);
248 TObjLink* lnk=tgtList.FirstLink();
250 char* pSpace = new char[iResult+1];
252 memset(pSpace, 32, iResult);
255 TObject* obj=lnk->GetObject();
256 HLTMessage(" %s^-- %s ", &pSpace[i--], obj->GetName());
266 int AliHLTTask::SetDependency(AliHLTTask* pDep)
268 // see header file for function documentation
271 if (FindDependency(pDep->GetName())==NULL) {
272 fListDependencies.Add(pDep);
282 int AliHLTTask::UnsetDependency(AliHLTTask* pDep)
284 // see header file for function documentation
285 fListDependencies.Remove(pDep);
286 if (fpConfiguration) {
287 fpConfiguration->InvalidateSources();
292 int AliHLTTask::CheckDependencies()
294 // see header file for function documentation
296 AliHLTConfiguration* pSrc=fpConfiguration->GetFirstSource();
298 if (FindDependency(pSrc->GetName())==NULL) {
299 //HLTDebug("dependency \"%s\" unresolved", pSrc->GetName());
302 pSrc=fpConfiguration->GetNextSource();
308 int AliHLTTask::Depends(AliHLTTask* pTask)
310 // see header file for function documentation
313 if (fpConfiguration) {
314 iResult=fpConfiguration->GetSource(pTask->GetName())!=NULL;
316 //HLTDebug("task \"%s\" depends on \"%s\"", GetName(), pTask->GetName());
318 //HLTDebug("task \"%s\" independend of \"%s\"", GetName(), pTask->GetName());
329 AliHLTTask* AliHLTTask::FindTarget(const char* id)
331 // see header file for function documentation
332 AliHLTTask* pTask=NULL;
334 pTask=(AliHLTTask*)fListTargets.FindObject(id);
339 int AliHLTTask::SetTarget(AliHLTTask* pTgt)
341 // see header file for function documentation
344 if (FindTarget(pTgt->GetName())==NULL) {
345 fListTargets.Add(pTgt);
355 int AliHLTTask::UnsetTarget(AliHLTTask* pTarget)
357 // see header file for function documentation
358 fListTargets.Remove(pTarget);
362 int AliHLTTask::StartRun()
364 // see header file for function documentation
366 int iNofInputDataBlocks=0;
367 AliHLTComponent* pComponent=GetComponent();
369 // determine the number of input data blocks provided from the source tasks
370 { // set scope for lnk as a local variable
371 TObjLink* lnk=fListDependencies.FirstLink();
372 while (lnk && iResult>=0) {
373 AliHLTTask* pSrcTask=(AliHLTTask*)lnk->GetObject();
375 if ((iResult=pSrcTask->GetNofMatchingDataTypes(this))>0) {
376 iNofInputDataBlocks+=iResult;
377 } else if (iResult==0) {
378 HLTWarning("source task %s (%p) does not provide any matching data type for task %s (%p)", pSrcTask->GetName(), pSrcTask, GetName(), this);
380 HLTError("task %s (%p): error getting matching data types for source task %s (%p)", GetName(), this, pSrcTask->GetName(), pSrcTask);
388 if (fBlockDataArray.size()>0) {
389 HLTWarning("block data array for task %s (%p) was not cleaned", GetName(), this);
390 fBlockDataArray.clear();
394 // the initialization of the component is done by the ComponentHandler after creation
396 //iResult=Init( AliHLTAnalysisEnvironment* environ, void* environ_param, int argc, const char** argv );
398 // allocate the data buffer, which controls the output buffer and subscriptions
400 fpDataBuffer=new AliHLTDataBuffer;
401 if (fpDataBuffer!=NULL) {
402 fpDataBuffer->SetLocalLoggingLevel(GetLocalLoggingLevel());
403 HLTDebug("created data buffer %p for task %s (%p)", fpDataBuffer, GetName(), this);
404 TObjLink* lnk=fListTargets.FirstLink();
405 while (lnk && iResult>=0) {
406 AliHLTTask* pTgtTask=(AliHLTTask*)lnk->GetObject();
408 if ((iResult=fpDataBuffer->SetConsumer(pTgtTask->GetComponent()))>=0) {
417 HLTFatal("can not create data buffer object, memory allocation failed");
423 // send the SOR event
427 HLTError("task %s (%p) does not have a component", GetName(), this);
433 int AliHLTTask::EndRun()
435 // see header file for function documentation
437 if (fBlockDataArray.size()>0) {
438 fBlockDataArray.clear();
441 AliHLTDataBuffer* pBuffer=fpDataBuffer;
448 int AliHLTTask::ProcessTask(Int_t eventNo, AliHLTUInt32_t eventType, AliHLTUInt64_t trgMask)
450 // see header file for function documentation
452 AliHLTComponent* pComponent=GetComponent();
453 if (pComponent && fpDataBuffer) {
454 HLTDebug("Processing task %s (%p) fpDataBuffer %p", GetName(), this, fpDataBuffer);
455 fpDataBuffer->Reset();
456 int iSourceDataBlock=0;
457 int iInputDataVolume=0;
459 AliHLTTask* pSrcTask=NULL;
460 AliHLTTaskPList subscribedTaskList;
461 TObjLink* lnk=fListDependencies.FirstLink();
463 // instances of SOR and EOR events to be kept
467 // generalize handling of the special blocks to be forwarded on SOR and EOR
468 // just adding a new specific handling for the ECS parameter block as a quick
472 // subscribe to all source tasks
473 fBlockDataArray.clear();
474 while (lnk && iResult>=0) {
475 pSrcTask=(AliHLTTask*)lnk->GetObject();
477 int iMatchingDB=pSrcTask->GetNofMatchingDataBlocks(this);
479 HLTError("task %s (%p): error getting no of matching data blocks from task %s (%p), error %d", GetName(), this, pSrcTask->GetName(), pSrcTask, iMatchingDB);
482 } else if (iMatchingDB==0) {
483 HLTDebug("source task %s (%p) does not provide any matching data type for task %s (%p)", pSrcTask->GetName(), pSrcTask, GetName(), this);
485 if ((iResult=pSrcTask->Subscribe(this, fBlockDataArray))>=0) {
487 AliHLTComponentBlockDataList::iterator block=fBlockDataArray.begin();
488 for (int i=0; block!=fBlockDataArray.end(); i++) {
490 bRemove|=(*block).fDataType==kAliHLTDataTypeSOR && !(iSOR<0 && (iSOR=i)>=0);
491 bRemove|=(*block).fDataType==kAliHLTDataTypeEOR && !(iEOR<0 && (iEOR=i)>=0);
492 bRemove|=(*block).fDataType==kAliHLTDataTypeECSParam && !(iECS<0 && (iECS=i)>=0);
493 //HLTInfo("block %d, iSOR=%d iEOR=%d remove=%d", i, iSOR, iEOR, bRemove);
494 if (i<iSourceDataBlock) {
496 } else if (bRemove) {
497 HLTDebug("remove duplicated event %s (%d)", AliHLTComponent::DataType2Text((*block).fDataType).c_str(), i);
498 pSrcTask->Release(&(*block), this);
499 block=fBlockDataArray.erase(block);
502 iInputDataVolume+=(*block).fSize;
503 // put the source task as many times into the list as it provides data blocks
504 // makes the bookkeeping for the data release easier
505 subscribedTaskList.push_back(pSrcTask);
509 HLTDebug("Task %s (%p) successfully subscribed to %d data block(s) of task %s (%p)", GetName(), this, iResult, pSrcTask->GetName(), pSrcTask);
510 iSourceDataBlock=fBlockDataArray.size();
513 HLTError("Task %s (%p): subscription to task %s (%p) failed with error %d", GetName(), this, pSrcTask->GetName(), pSrcTask, iResult);
517 HLTFatal("fatal internal error in ROOT list handling");
524 int iNofTrial=0; // repeat processing if component returns -ENOSPC
525 AliHLTUInt32_t iLastOutputDataSize=0;
528 long unsigned int iOutputDataSize=0;
529 AliHLTConfiguration* pConf=GetConf();
530 // check if there was a buffer size specified, query output size
531 // estimator from component otherwize
532 if (pConf && pConf->GetOutputBufferSize()>=0) {
533 iOutputDataSize=pConf->GetOutputBufferSize();
535 long unsigned int iConstBase=0;
536 double fInputMultiplier=0;
537 if (pComponent->GetComponentType()!=AliHLTComponent::kSink) {
538 pComponent->GetOutputDataSize(iConstBase, fInputMultiplier);
539 // add a small margin to the buffer to allow optional component
542 #if defined(__DEBUG) || defined(HLT_COMPONENT_STATISTICS)
543 for (AliHLTComponentBlockDataList::iterator element=fBlockDataArray.begin();
544 element!=fBlockDataArray.end(); element++) {
545 if (element->fDataType==kAliHLTDataTypeComponentStatistics) {
546 iConstBase+=element->fSize;
551 if (fInputMultiplier<0) {
552 HLTWarning("ignoring negative input multiplier");
555 iOutputDataSize=int(fInputMultiplier*iInputDataVolume) + iConstBase;
556 //HLTDebug("task %s: reqired output size %d", GetName(), iOutputDataSize);
559 // dont process again if the buffer size is the same
560 if (iLastOutputDataSize==iOutputDataSize) break;
561 HLTImportant("processing event %d again with buffer size %d", eventNo, iOutputDataSize);
563 AliHLTUInt8_t* pTgtBuffer=NULL;
564 if (iOutputDataSize>0) pTgtBuffer=fpDataBuffer->GetTargetBuffer(iOutputDataSize);
565 //HLTDebug("provided raw buffer %p", pTgtBuffer);
566 AliHLTComponentEventData evtData;
567 AliHLTComponent::FillEventData(evtData);
569 evtData.fEventID=(AliHLTEventID_t)eventNo;
570 evtData.fEventCreation_s=static_cast<AliHLTUInt32_t>(time(NULL));
571 AliHLTComponentTriggerData trigData;
572 AliHLTEventTriggerData evtTrigData;
573 trigData.fStructSize=sizeof(trigData);
574 trigData.fDataSize=sizeof(AliHLTEventTriggerData);
575 memset(&evtTrigData, 0, trigData.fDataSize);
576 evtTrigData.fCommonHeaderWordCnt=gkAliHLTCommonHeaderCount;
577 evtTrigData.fCommonHeader[5]=trgMask&0xffffffff;
579 evtTrigData.fCommonHeader[6]=trgMask&0x3ffff;
580 trigData.fData=&evtTrigData;
581 iLastOutputDataSize=iOutputDataSize;
582 AliHLTUInt32_t size=iOutputDataSize;
583 AliHLTUInt32_t outputBlockCnt=0;
584 AliHLTComponentBlockData* outputBlocks=NULL;
585 AliHLTComponentEventDoneData* edd=NULL;
586 if (pTgtBuffer!=NULL || iOutputDataSize==0) {
587 // add event type data block
588 // the block is removed immediately after processing from the list
589 AliHLTComponentBlockData eventTypeBlock;
590 AliHLTComponent::FillBlockData(eventTypeBlock);
592 eventTypeBlock.fDataType=kAliHLTDataTypeEvent;
593 eventTypeBlock.fSpecification=eventType;
594 fBlockDataArray.push_back(eventTypeBlock);
597 evtData.fBlockCnt=fBlockDataArray.size();
598 iResult=pComponent->ProcessEvent(evtData, &fBlockDataArray[0], trigData, pTgtBuffer, size, outputBlockCnt, outputBlocks, edd);
599 HLTDebug("component %s ProcessEvent finnished (%d): size=%d blocks=%d", pComponent->GetComponentID(), iResult, size, outputBlockCnt);
601 // EventDoneData is for the moment ignored in AliHLTSystem
603 HLTDebug("got EventDoneData size %d", edd->fDataSize);
604 delete [] reinterpret_cast<char*>(edd);
608 // remove event data block
609 fBlockDataArray.pop_back();
611 // check for forwarded blocks.
612 // loop over all output blocks and check
613 // 1. for duplicate blocks (pointing to same location in output buffer
614 // or to the same buffer)
615 // 2. for blocks forwarded from the input.
616 if (iResult>=0 && outputBlocks) {
617 if (fListTargets.First()!=NULL) {
618 AliHLTComponentBlockDataList segments;
619 for (AliHLTUInt32_t oblock=0; oblock<outputBlockCnt; oblock++) {
620 // consistency check for data reference
621 if (outputBlocks[oblock].fPtr!=NULL && outputBlocks[oblock].fPtr!=pTgtBuffer &&
622 outputBlocks[oblock].fOffset!=0) {
623 HLTWarning("output block %s 0x%08x has inconsistent data reference ptr=%p offset=0x%08x: "
624 "for new blocks use offset only, forwarded blocks have fPtr set only",
625 AliHLTComponent::DataType2Text(outputBlocks[oblock].fDataType).c_str(),
626 outputBlocks[oblock].fSpecification,
627 outputBlocks[oblock].fPtr, outputBlocks[oblock].fOffset);
630 // check for duplicates in the output
631 AliHLTUInt32_t checkblock=0;
632 for (; checkblock<oblock; checkblock++) {
633 if (outputBlocks[oblock].fPtr!=NULL && outputBlocks[oblock].fPtr!=pTgtBuffer &&
634 outputBlocks[checkblock].fPtr==outputBlocks[oblock].fPtr) {
635 if (outputBlocks[checkblock].fSize!=outputBlocks[oblock].fSize ||
636 outputBlocks[checkblock].fDataType!=outputBlocks[oblock].fDataType) {
637 HLTWarning("output blocks %d (%s 0x%08x) and %d (%s 0x%08x) have identical data references ptr=%p "
638 "but differ in data type and/or size: %d vs. %d",
640 AliHLTComponent::DataType2Text(outputBlocks[oblock].fDataType).c_str(),
641 outputBlocks[oblock].fSpecification,
643 AliHLTComponent::DataType2Text(outputBlocks[checkblock].fDataType).c_str(),
644 outputBlocks[checkblock].fSpecification,
645 outputBlocks[oblock].fPtr,
646 outputBlocks[oblock].fSize,
647 outputBlocks[checkblock].fSize);
649 // ignore from the second copy
653 if (checkblock<oblock) continue;
655 // search for the forwarded data blocks
656 // new data blocks are announced to the data buffer, forwarded data blocks
657 // to the publisher task. The publisher task of a forwarded data block is
658 // removed from the list in order to keep the buffer open. It will be releases
659 // when the subscribing task releases it
660 AliHLTUInt32_t iblock=0;
661 for (; iblock<fBlockDataArray.size(); iblock++) {
662 if (outputBlocks[oblock].fDataType==kAliHLTDataTypeEvent) {
663 // the event type data block is ignored if it was forwarded
666 if (fBlockDataArray[iblock].fPtr==outputBlocks[oblock].fPtr) {
667 assert(subscribedTaskList[iblock]!=NULL);
668 if (subscribedTaskList[iblock]==NULL) continue;
669 HLTDebug("forward segment %d (source task %s %p) to data buffer %p", iblock, pSrcTask->GetName(), pSrcTask, fpDataBuffer);
670 fpDataBuffer->Forward(subscribedTaskList[iblock], &fBlockDataArray[iblock]);
671 subscribedTaskList[iblock]=NULL; // not to be released in the loop further down
675 if (iblock==fBlockDataArray.size()) segments.push_back(outputBlocks[oblock]);
677 if (pTgtBuffer && segments.size()>0) {
678 iResult=fpDataBuffer->SetSegments(pTgtBuffer, &segments[0], segments.size());
681 // no forwarding, actually we dont even need to keep the data, this is a
682 // dead end (fListTargets empty)
683 //iResult=fpDataBuffer->SetSegments(pTgtBuffer, outputBlocks, outputBlockCnt);
685 delete [] outputBlocks; outputBlocks=NULL; outputBlockCnt=0;
687 fpDataBuffer->Reset();
689 if (fListTargets.First()!=NULL) {
690 if (iSOR>=0 && subscribedTaskList[iSOR]!=NULL) {
691 HLTDebug("forward SOR event segment %d (source task %s %p) to data buffer %p", iSOR, pSrcTask->GetName(), pSrcTask, fpDataBuffer);
692 fpDataBuffer->Forward(subscribedTaskList[iSOR], &fBlockDataArray[iSOR]);
693 subscribedTaskList[iSOR]=NULL; // not to be released in the loop further down
695 if (iEOR>=0 && subscribedTaskList[iEOR]!=NULL) {
696 HLTDebug("forward EOR event (%s) segment %d (source task %s %p) to data buffer %p", AliHLTComponent::DataType2Text(fBlockDataArray[iEOR].fDataType).c_str(), iEOR, pSrcTask->GetName(), pSrcTask, fpDataBuffer);
697 fpDataBuffer->Forward(subscribedTaskList[iEOR], &fBlockDataArray[iEOR]);
698 subscribedTaskList[iEOR]=NULL; // not to be released in the loop further down
700 if (iECS>=0 && subscribedTaskList[iECS]!=NULL) {
701 HLTDebug("forward EOR event (%s) segment %d (source task %s %p) to data buffer %p", AliHLTComponent::DataType2Text(fBlockDataArray[iECS].fDataType).c_str(), iECS, pSrcTask->GetName(), pSrcTask, fpDataBuffer);
702 fpDataBuffer->Forward(subscribedTaskList[iECS], &fBlockDataArray[iECS]);
703 subscribedTaskList[iECS]=NULL; // not to be released in the loop further down
707 HLTError("no target buffer available");
710 } while (iResult==-ENOSPC && iNofTrial++<1);
713 // now release all buffers which we have subscribed to
715 AliHLTTaskPList::iterator element;
716 while ((element=subscribedTaskList.begin())!=subscribedTaskList.end()) {
720 if ((iTempRes=pSrcTask->Release(&fBlockDataArray[iSourceDataBlock], this))>=0) {
721 HLTDebug("successfully released segment of task %s (%p)", pSrcTask->GetName(), pSrcTask);
723 HLTError("realease of task %s (%p) failed with error %d", pSrcTask->GetName(), pSrcTask, iTempRes);
726 subscribedTaskList.erase(element);
729 if (subscribedTaskList.size()>0) {
730 HLTError("could not release all data buffers");
733 HLTError("internal failure (not initialized component %p, data buffer %p)", fpComponent, fpDataBuffer);
739 int AliHLTTask::GetNofMatchingDataBlocks(const AliHLTTask* pConsumerTask) const
741 // see header file for function documentation
745 iResult=fpDataBuffer->FindMatchingDataBlocks(pConsumerTask->GetComponent(), NULL);
747 HLTFatal("internal data buffer missing");
756 int AliHLTTask::GetNofMatchingDataTypes(const AliHLTTask* pConsumerTask) const
758 // see header file for function documentation
761 AliHLTComponent* pComponent=GetComponent();
764 HLTError("component not initialized");
768 iResult=pComponent->FindMatchingDataTypes(pConsumerTask->GetComponent(), NULL);
770 HLTFatal("task initialization failed");
779 int AliHLTTask::Subscribe(const AliHLTTask* pConsumerTask, AliHLTComponentBlockDataList& blockDescList)
781 // see header file for function documentation
785 iResult=fpDataBuffer->Subscribe(pConsumerTask->GetComponent(), blockDescList);
787 HLTFatal("internal data buffer missing");
796 int AliHLTTask::Release(AliHLTComponentBlockData* pBlockDesc, const AliHLTTask* pConsumerTask)
798 // see header file for function documentation
800 if (pConsumerTask && pBlockDesc) {
802 iResult=fpDataBuffer->Release(pBlockDesc, pConsumerTask->GetComponent(), this);
804 HLTFatal("internal data buffer missing");
813 void AliHLTTask::PrintStatus()
815 // see header file for function documentation
816 HLTLogKeyword("task properties");
817 AliHLTComponent* pComponent=GetComponent();
819 HLTMessage(" component: %s (%p)", pComponent->GetComponentID(), pComponent);
821 HLTMessage(" no component set!");
823 if (fpConfiguration) {
824 AliHLTConfiguration* pSrc=fpConfiguration->GetFirstSource();
826 const char* pQualifier="unresolved";
827 if (FindDependency(pSrc->GetName()))
828 pQualifier="resolved";
829 HLTMessage(" source: %s (%s)", pSrc->GetName(), pQualifier);
830 pSrc=fpConfiguration->GetNextSource();
832 TObjLink* lnk = fListTargets.FirstLink();
834 TObject *obj = lnk->GetObject();
835 HLTMessage(" target: %s", obj->GetName());
839 HLTMessage(" task not initialized");
843 int AliHLTTask::CustomInit(AliHLTComponentHandler* /*pCH*/)
845 // default implementation nothing to do
849 int AliHLTTask::CustomCleanup()
851 // default implementation nothing to do
855 int AliHLTTask::LoggingVarargs(AliHLTComponentLogSeverity severity,
856 const char* originClass, const char* originFunc,
857 const char* file, int line, ... ) const
859 // see header file for function documentation
863 va_start(args, line);
865 AliHLTLogging::SetLogString(this, " (%p)", "%s_pfmt_: ", GetName());
866 iResult=SendMessage(severity, originClass, originFunc, file, line, AliHLTLogging::BuildLogString(NULL, args, true /*append*/));