-
Notifications
You must be signed in to change notification settings - Fork 37
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 capability to output task graph #1099
Conversation
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.
This is really cool and a powerful debugging tool. My approval comes from testing this utility in various downstream applications. All looks good to me. It even appears to be working with the iterative tasking infrastructure. And it has already uncovered various issues that needed addressing! 😬
My only comment is a non-blocker but for a future PR: It would be cool to thread these graphs through outputs so that they could be dumped to file, e.g., at the beginning of a simulation. In the meantime, however, as a debugging tool, calling std::cout << my_task_collection
should be sufficient.
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.
LGTM. Looks like now the user has to call WriteTaskGraph by hand? That's probably for the best.
If I interpret this correctly, the task graph appending is optional--and this doesn't break downstream?
Also could we support
PARTHENON_ADDTASK(tasklist, dependency, _VA_ARGS_)
as sugar for the call around TF
?
Yeah, currently the user has to do something like
Yes, this should have no impact on downstream codes. Although there is a label attached to all tasks now, it has no impact unless you call the output stream operator on a The vector of tasks that gets appended to for output of the graph is a temporary and has no impact on the internal task lists of
I don't quite see what this would buy us? |
👍 would be kind of nice to have the driver do it automatically.
Not super important... but can we add guard rails for that?
👍
I just find |
Yeah, agreed, but let's leave for a future PR.
I just included a check in
Josh and I thought this sort of pattern was a quick to implement, minimally invasive way to update old task list building code, but I agree that it can be a little obscure (which partially inspired the task function acronym choice...). |
👍
👍
Yeah. That's fine. Like I said it's a taste thing. |
PR Summary
This PR adds the functionality to output the graph of a
TaskList
,TaskRegion
, orTaskCollection
in the Graphviz format. I do not explicitly add the connectivity betweenTaskRegion
s, so they show up as disconnected graphs. It is pretty trivial to pull out the graph because of #917. Initially, I used thenameof
library for writing out function names, but I am not actually convinced this is necessary. I think we get everything we want withLet me know if you have thoughts on this. After reading the internet for a while, I am pretty sure that there is no way to get the names of tasks within task lists themselves since they are effectively function pointers and no name information is available (hence the need to allow passing a string naming the task).
Results look like (from the sparse advection test without refinement and a single block):
PR Checklist