Skip to content

Commit 9683dee

Browse files
committed
DPL: avoid asserting the workflow is empty
This is a property that depends on user input, so an empty workflow is actually possible and should be handled. This currently breaks if the empty workflow is provided in debug mode.
1 parent d26f229 commit 9683dee

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Framework/Core/src/DeviceSpecHelpers.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,10 @@ void DeviceSpecHelpers::dataProcessorSpecs2DeviceSpecs(const WorkflowSpec& workf
11181118
{
11191119
// Always check for validity of the workflow before instanciating it
11201120
DeviceSpecHelpers::validate(workflow);
1121+
// In case the workflow is empty, we simply do not need to instanciate any device.
1122+
if (workflow.empty()) {
1123+
return;
1124+
}
11211125
std::vector<LogicalForwardInfo> availableForwardsInfo;
11221126
std::vector<DeviceConnectionEdge> logicalEdges;
11231127
std::vector<DeviceConnectionId> connections;

Framework/Core/src/WorkflowHelpers.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,10 @@ void WorkflowHelpers::constructGraph(const WorkflowSpec& workflow,
756756
std::vector<OutputSpec>& outputs,
757757
std::vector<LogicalForwardInfo>& forwardedInputsInfo)
758758
{
759-
assert(!workflow.empty());
759+
// In case the workflow is empty, we do not have anything to do.
760+
if (workflow.empty()) {
761+
return;
762+
}
760763

761764
// This is the state. Oif is the iterator I use for the searches.
762765
std::vector<LogicalOutputInfo> availableOutputsInfo;

0 commit comments

Comments
 (0)