Skip to content

Commit baeac29

Browse files
committed
traverser: add support for planner reinitialization
Problem: traverser has no means of reinitialization for an existing planner. Elastic operations like attach and remove require planner reinitialization. Running basic initialization will remove counts for resources scheduled. Check to see if the planner exists and update it (reinitialize). Create a new planner if it doesn't (initialize).
1 parent 561ec6f commit baeac29

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

resource/traversers/dfu_impl.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,12 @@ int dfu_impl_t::prime_pruning_filter (const subsystem_t &s, vtx_t u,
11321132
}
11331133
}
11341134

1135-
if (!avail.empty () && !types.empty ()) {
1135+
if (avail.empty () || types.empty ()) {
1136+
rc = 0;
1137+
goto done;
1138+
}
1139+
1140+
if ( (*m_graph)[u].idata.subplans[s] == NULL) {
11361141
errno = 0;
11371142
planner_multi_t *p = NULL;
11381143
if (!(p = subtree_plan (u, avail, types)) ) {
@@ -1141,6 +1146,9 @@ int dfu_impl_t::prime_pruning_filter (const subsystem_t &s, vtx_t u,
11411146
goto done;
11421147
}
11431148
(*m_graph)[u].idata.subplans[s] = p;
1149+
} else {
1150+
planner_multi_update ((*m_graph)[u].idata.subplans[s], &avail[0],
1151+
&types[0], types.size ());
11441152
}
11451153
rc = 0;
11461154
done:

0 commit comments

Comments
 (0)