Skip to content

Commit

Permalink
traverser: add support for canceling brokerless resource vertices
Browse files Browse the repository at this point in the history
Problems: handling partial cancel for brokerless resources when default
pruning filters are set (ALL:core) and pruning filters are set for the
resources excluded from broker ranks (e.g., ALL:ssd). With ALL:core
configured, the final .free RPC frees all planner_multi-tracked
resources, which prevents a cleanup, full cancel. However, tracking
additional resources (e.g., ALL:ssd) successfully removes resource
allocations on those vertices only with a cleanup cancel.

Add capability to detect brokerless resource vertices and cancel the
vertices in a cleanup step.
  • Loading branch information
milroy committed Oct 17, 2024
1 parent 59e6aff commit 256d297
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions resource/traversers/dfu_impl_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,11 @@ int dfu_impl_t::mod_plan (vtx_t u, int64_t jobid, modify_data_t &mod_data)
if (mod_data.mod_type != job_modify_t::PARTIAL_CANCEL) {
(*m_graph)[u].schedule.allocations.erase (alloc_span);
} else {
// Add to brokerless resource set to execute in follow-up
// vertex cancel
// Need to convert to c_str () because interner is finalized
if (std::string ((*m_graph)[u].type.c_str ()) == "ssd")
mod_data.brokerless_res.insert (u);

Check warning on line 547 in resource/traversers/dfu_impl_update.cpp

View check run for this annotation

Codecov / codecov/patch

resource/traversers/dfu_impl_update.cpp#L547

Added line #L547 was not covered by tests
goto done;
}
} else if ((res_span = (*m_graph)[u].schedule.reservations.find (jobid))
Expand Down Expand Up @@ -838,6 +843,18 @@ int dfu_impl_t::remove (vtx_t root,
m_color.reset ();
if (root_has_jtag) {
rc = mod_dfv (root, jobid, mod_data);

// Need to re-run VTX_CANCEL in case brokerless resources (e.g., SSDs)
// were found in the previous VTX_CANCEL
if (mod_data.brokerless_res.size () > 0) {
mod_data.mod_type = job_modify_t::VTX_CANCEL;
for (const vtx_t &vtx : mod_data.brokerless_res) {
if ((rc = cancel_vertex (vtx, mod_data, jobid)) != 0) {
errno = EINVAL;
return rc;

Check warning on line 854 in resource/traversers/dfu_impl_update.cpp

View check run for this annotation

Codecov / codecov/patch

resource/traversers/dfu_impl_update.cpp#L850-L854

Added lines #L850 - L854 were not covered by tests
}
}
}
// Was the root vertex's job tag removed? If so, full_cancel
full_cancel =
((*m_graph)[root].idata.tags.find (jobid) == (*m_graph)[root].idata.tags.end ());
Expand Down

0 comments on commit 256d297

Please sign in to comment.