Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't prune traversal by leaf vertex subplans #1314

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions resource/traversers/dfu_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ int dfu_impl_t::by_subplan (const jobmeta_t &meta,
int saved_errno = errno;
planner_multi_t *p = (*m_graph)[u].idata.subplans[s];

if (!p) {
// Subplan is null if u is a leaf.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the subplan be NULL for any other reasons? Are there any more checks needed here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this in person this afternoon. If it's null for any other reason, it's unintentional, but checking if the vertex is a leaf or not is an unfortunately tricky/expensive operation to use in something that gets called this much.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can think of a fast way to determine if the vertex is not a leaf that can be a follow-up PR. The only place I can think of where such an error could creep in is here, and the function should exit and cause the graph initialization/re-initialization to fail:

if (!(p = subtree_plan (u, avail, types))) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting for posterity that I tested pruning filter configurations that skip intermediate vertices (e.g., cluster:core, node:core, to skip rack vertices) and observed that the rack vertex subplan is not null. Apparently the code creates the planners in the intermediate vertices anyway.

// TODO: handle the unlikely case
// where the subplan is null for another
// reason
rc = 0;
goto done;
}
if (resource.user_data.empty ()) {
// If user_data is empty, no data is available to prune with.
rc = 0;
Expand Down
2 changes: 2 additions & 0 deletions t/data/resource/commands/advanced/cmds06.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
match allocate @TEST_SRCDIR@/data/resource/jobspecs/issues/issue1260.yaml
quit
19 changes: 19 additions & 0 deletions t/data/resource/expected/advanced/006.R.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---------ssd0[1024:x]
------------core0[1:x]
------------core1[1:x]
------------core2[1:x]
------------core3[1:x]
------------core4[1:x]
------------core5[1:x]
------------core6[1:x]
------------core7[1:x]
------------core8[1:x]
------------core9[1:x]
---------compute-01[1:x]
------rack0[1:s]
---compute0[1:s]
INFO: =============================
INFO: JOBID=1
INFO: RESOURCES=ALLOCATED
INFO: SCHEDULED AT=Now
INFO: =============================
Loading
Loading