-
-
Notifications
You must be signed in to change notification settings - Fork 888
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
Add organizer dependencies #1069
Conversation
Just to be clear, with dependencies you mean parent nodes, right? |
Yes, I can rename it if that helps clarify. |
Well, I don't like |
|
Hmm, if we don't use the terminology |
Approved. 👍 |
6f7eade
to
38538b0
Compare
This change adds a `predecessors` method to the vertices returned from the `oragnizer::build` method. The `children` of a vertex are also renamed to `successors` for consistency. The existing `children` method still exists for backwards compatibility.
Codecov ReportPatch coverage:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## wip #1069 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 142 142
Lines 25156 25238 +82
=========================================
+ Hits 25156 25238 +82
☔ View full report in Codecov by Sentry. |
Updated the commit message to match others. I also decided to keep |
@@ -178,11 +178,13 @@ class basic_organizer final { | |||
* @param vtype True if the vertex is a top-level one, false otherwise. | |||
* @param data The data associated with the vertex. | |||
* @param edges The indices of the children in the adjacency list. | |||
* @param edges The indices of the dependencies in the adjacency list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edges
-> predecessors
?
@@ -178,11 +178,13 @@ class basic_organizer final { | |||
* @param vtype True if the vertex is a top-level one, false otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vtype
should go away, isn't it?
|
||
/** | ||
* @brief Returns the list of successors for a given vertex. | ||
* @return The list of successors' indices for the vertex. | ||
*/ | ||
const std::vector<std::size_t> &children() const noexcept { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this one here is fine but I'd add a [[deprecated("use ::successors")]]
too.
@@ -63,15 +63,30 @@ TEST(Organizer, EmplaceFreeFunction) { | |||
ASSERT_FALSE(graph[2u].top_level()); | |||
ASSERT_FALSE(graph[3u].top_level()); | |||
|
|||
ASSERT_EQ(graph[0u].children().size(), 2u); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since children
still exists, please, do not drop its tests or the coverage tool will complain. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping @cjhowedev 🙂
Available on |
Adds the indices of the in edges of organizer vertices, so that dependencies can be checked for completion before running a vertex's task. Also simplifies how the
is_top_level
field is calculated to reuse the passed in dependencies.