Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions 12 devices/aliceHLTwrapper/Component.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ int Component::init(int argc, char** argv)
{"run", required_argument, 0, 'r'},
{"msgsize", required_argument, 0, 's'},
{"output-mode", required_argument, 0, 'm'},
{"instance-id", required_argument, 0, 'i'},
{0, 0, 0, 0}
};

Expand All @@ -69,13 +70,14 @@ int Component::init(int argc, char** argv)
const char* componentLibrary = "";
const char* componentId = "";
const char* componentParameter = "";
const char* instanceId="";

// the configuration and calibration is fixed for every run and identified
// by the run no
int runNumber = 0;

optind = 1; // indicate new start of scanning, especially when getop has been used in a higher layer already
while ((c = getopt_long(argc, argv, "l:c:p:r:s:m:", programOptions, &iOption)) != -1) {
while ((c = getopt_long(argc, argv, "l:c:p:r:s:m:i:", programOptions, &iOption)) != -1) {
switch (c) {
case 'l':
componentLibrary = optarg;
Expand All @@ -99,6 +101,10 @@ int Component::init(int argc, char** argv)
std::stringstream(optarg) >> outputMode;
mFormatHandler.setOutputMode(outputMode);
} break;
case 'i': {
instanceId=optarg;
break;
}
case '?':
// TODO: more error handling
break;
Expand Down Expand Up @@ -143,7 +149,9 @@ int Component::init(int argc, char** argv)
}

// create component
if ((iResult=mpSystem->createComponent(componentId, NULL, parameters.size(), &parameters[0], &mProcessor, ""))<0) {
string description;
description+=" chainid="; description+=instanceId;
if ((iResult=mpSystem->createComponent(componentId, NULL, parameters.size(), &parameters[0], &mProcessor, description.c_str()))<0) {
// the ALICE HLT external interface uses the following error definition
// 0 success
// >0 error number
Expand Down
2 changes: 2 additions & 0 deletions 2 devices/aliceHLTwrapper/Component.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class Component {
/// list.
int process(vector<AliceO2::AliceHLT::MessageFormat::BufferDesc_t>& dataArray);

int getEventCount() const {return mEventCount;}

protected:

private:
Expand Down
14 changes: 12 additions & 2 deletions 14 devices/aliceHLTwrapper/WrapperDevice.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,16 @@ void WrapperDevice::Init()
std::unique_ptr<Component> component(new ALICE::HLT::Component);
if (!component.get()) return /*-ENOMEM*/;

if ((iResult=component->init(mArgv.size(), &mArgv[0]))<0) {
string idkey="--instance-id";
string id="";
id=GetProperty(FairMQDevice::Id, id);
vector<char*> argv;
argv.push_back(mArgv[0]);
argv.push_back(&idkey[0]);
argv.push_back(&id[0]);
if (mArgv.size()>1)
argv.insert(argv.end(), mArgv.begin()+1, mArgv.end());
if ((iResult=component->init(argv.size(), &argv[0]))<0) {
LOG(ERROR) << "component init failed with error code " << iResult;
throw std::runtime_error("component init failed");
return /*iResult*/;
Expand Down Expand Up @@ -174,7 +183,8 @@ void WrapperDevice::Run()
}
mLastSampleTime=duration.count();
if (duration.count()-mLastCalcTime>fLogIntervalInMs) {
LOG(INFO) << "------ processed " << mNSamples << " sample(s) ";
LOG(INFO) << "------ processed " << mNSamples << " sample(s) - total "
<< mComponent->getEventCount() << " sample(s)";
if (mNSamples > 0) {
LOG(INFO) << "------ min " << mMinTimeBetweenSample << "ms, max " << mMaxTimeBetweenSample << "ms avrg "
<< (duration.count() - mLastCalcTime) / mNSamples << "ms ";
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.