Skip to content

Commit

Permalink
remove duplicate inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Barthelemy committed Nov 10, 2023
1 parent e677f93 commit cc8fd06
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion Framework/src/CheckRunnerFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ DataProcessorSpec CheckRunnerFactory::create(CheckRunnerConfig checkRunnerConfig
allInputs.insert(allInputs.end(), config.inputSpecs.begin(), config.inputSpecs.end());
}

CheckRunner qcCheckRunner{ std::move(checkRunnerConfig), checkConfigs, allInputs };
// We can end up with duplicated inputs that will later lead to circular dependencies on the checkRunner device.
o2::framework::Inputs allInputsNoDups;
std::set<std::string> alreadySeen;
for(auto input: allInputs) {
if(alreadySeen.count(input.binding) == 0) {
allInputsNoDups.push_back(input);
}
alreadySeen.insert(input.binding);
}

CheckRunner qcCheckRunner{ std::move(checkRunnerConfig), checkConfigs, allInputsNoDups };

DataProcessorSpec newCheckRunner{ qcCheckRunner.getDeviceName(),
qcCheckRunner.getInputs(),
Expand Down
8 changes: 4 additions & 4 deletions Framework/test/testInfrastructureGenerator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ TEST_CASE("qc_factory_remote_test")
workflow.begin(), workflow.end(),
[](const DataProcessorSpec& d) {
return d.name.find("qc-check") != std::string::npos &&
d.inputs.size() == 7;
d.inputs.size() == 4;
});
REQUIRE(checkRunnerCount == 1);

Expand Down Expand Up @@ -260,7 +260,7 @@ TEST_CASE("qc_factory_standalone_test")
workflow.begin(), workflow.end(),
[](const DataProcessorSpec& d) {
return d.name.find("qc-check") != std::string::npos &&
d.inputs.size() == 7;
d.inputs.size() == 4;
});
REQUIRE(checkRunnerCount == 1);

Expand Down Expand Up @@ -367,7 +367,7 @@ TEST_CASE("qc_infrastructure_local_batch_test")
CHECK(workflow[4].outputs.size() == 0);
}
}

using namespace std;
TEST_CASE("qc_infrastructure_remote_batch_test")
{
std::string configFilePath = std::string("json://") + getTestDataDirectory() + "testSharedConfig.json";
Expand All @@ -390,7 +390,7 @@ TEST_CASE("qc_infrastructure_remote_batch_test")
workflow.begin(), workflow.end(),
[](const DataProcessorSpec& d) {
return d.name.find("qc-check") != std::string::npos &&
d.inputs.size() == 7;
d.inputs.size() == 4;
});
REQUIRE(checkRunnerCount == 1);

Expand Down

0 comments on commit cc8fd06

Please sign in to comment.