Skip to content

Commit b1dfebc

Browse files
committed
DPL: add dryRun function to simulate processing
1 parent 93e9e59 commit b1dfebc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Framework/Core/src/runDataProcessing.cxx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,18 @@ void doUnknownException(std::string const& s, char const* processName)
10141014
}
10151015
}
10161016

1017+
[[maybe_unused]] AlgorithmSpec dryRun(DeviceSpec const& spec)
1018+
{
1019+
return AlgorithmSpec{adaptStateless(
1020+
[&routes = spec.outputs](DataAllocator& outputs) {
1021+
LOG(INFO) << "Dry run enforced. Creating dummy messages to simulate computation happended";
1022+
for (auto& route : routes) {
1023+
auto concrete = DataSpecUtils::asConcreteDataMatcher(route.matcher);
1024+
outputs.make<int>(Output{concrete.origin, concrete.description, concrete.subSpec}, 2);
1025+
}
1026+
})};
1027+
}
1028+
10171029
void doDefaultWorkflowTerminationHook()
10181030
{
10191031
//LOG(INFO) << "Process " << getpid() << " is exiting.";

0 commit comments

Comments
 (0)