-
Notifications
You must be signed in to change notification settings - Fork 3
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
Communication graph and Gantt chart #6
Conversation
example/mpi_trapezoidal.jl
Outdated
@@ -86,6 +86,8 @@ MPITape.print_mytape() | |||
tape_merged = MPITape.merge() | |||
if rank == 0 # Master | |||
MPITape.print_merged(tape_merged) | |||
display(MPITape.plot_merged(tape_merged)) | |||
readline() |
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.
The plot isn't interactive, right? Might be better to just directly save as png/pdf.
src/communication_graph.jl
Outdated
|
||
function srcdest_to_rankarray(srcdest, rank) | ||
if srcdest in ["all", "each", "some"] | ||
return vcat(collect(0:getcommsize()-1)) |
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.
Das vcat
ist hier überflüssig, oder nicht?
Ist wahrscheinlich auch nicht ganz korrekt, da z.B. bei "some" nicht alle ranks involviert sind (siehe z.B. MPI_Scan). Hängt aber auch einfach davon ab wie genau wir das darstellen wollen.
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.
Ja, das müssen wir irgendwann sicher noch einmal umbauen - insbesondere, wenn wir communicators unterstützen wollen. Für die meisten collectives reicht es im Moment aber, denke ich.
src/communication_graph.jl
Outdated
if typeof(srcdest) <: Integer | ||
return [srcdest] | ||
end | ||
if srcdest == nothing |
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.
isnothing(srcdest)
ist eleganter / besser.
src/communication_graph.jl
Outdated
|
||
function MPIEventNeighbors(ev::MPIEvent) | ||
srcdest = getsrcdest(ev) | ||
if srcdest == nothing |
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.
isnothing(srcdest)
ist eleganter / besser.
src/communication_graph.jl
Outdated
opendsts = srcdest_to_rankarray(srcdest[:dest], ev.rank) | ||
# Delete rank from recvs or sends it if is root! | ||
if length(opensrcs) == 1 && (opensrcs[1] in opendsts) | ||
deleteat!(opendsts, findfirst(x->x==opensrcs[1], opendsts)) |
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.
Tipp: findfirst(x->x==opensrcs[1], opendsts)
kannst du auch als findfirst(isequal(opensrcs[1]), opendsts)
schreiben.
src/communication_graph.jl
Outdated
srcdest = (src = nothing, dest = nothing) | ||
end | ||
opensrcs = srcdest_to_rankarray(srcdest[:src], ev.rank) | ||
opendsts = srcdest_to_rankarray(srcdest[:dest], ev.rank) |
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.
Würde vielleicht opendsts
in opendests
umbenennen, damit wir einheitlich source als src und destination als dest abkürzen.
src/communication_graph.jl
Outdated
# Construct data structure for linked list of MPI calls | ||
for e in tape | ||
push!(open_links, MPIEventNeighbors(e)) | ||
end |
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.
Direkt open_links = MPIEventNeighbors[MPIEventNeighbors(e) for e in tape]
?
if isempty(ev.args_subset) | ||
return nothing | ||
end | ||
if haskey(ev.args_subset, :tag) |
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.
Verstehe die tag Geschichte nicht ganz. Ist haskey(ev.args_subset, :tag)
aktuell nicht einfach immer false
?
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.
Ich nutze die Funktion beim Matchen der MPI Events. Im Moment hat sie keinen Effekt, da sie immer nothing zurück gibt, aber sobald wir tags in unserem NamedTuple hinzufügen, sollten sie damit auch direkt berücksichtigt werden.
I also added support for #1 with the function |
Looks nice! I was first slightly confused that there are no BTW, there is a
|
This PR does the following changes: