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
Implement a function for computing the number of messages received per MPI process #7145
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.
Thanks for addressing this. I have a few comments below. Would mind to also add a changelog entry?
include/deal.II/base/mpi.h
Outdated
* destination more than once in their destinations list. | ||
*/ | ||
unsigned int | ||
compute_point_to_point_communications( |
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.
We usually prefix variables storing counts with n_
. Hence, I think compute_n_point_to_point_communications
would be a better name for this function.
source/base/mpi.cc
Outdated
++dest_vector[el]; | ||
|
||
# if DEAL_II_MPI_VERSION_GTE(2, 2) | ||
// Find how many processes will send to this one |
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.
Find out
source/base/mpi.cc
Outdated
|
||
return n_recv_from; | ||
# else | ||
// Find how many processes will send to this one |
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.
Find out
b41991d
to
7c58e94
Compare
@masterleinad I addressed your comments and added a |
/run-tests |
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.
Very nice, thanks for implementing this!
I have only one small update request.
include/deal.II/base/mpi.h
Outdated
* contains duplicate entries that means that multiple messages are | ||
* intended for a given destination. | ||
* | ||
* @return A list of processors that have indicated that they want to send |
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 no longer true. Can you update the return value description?
7c58e94
to
fe0d62c
Compare
@bangerth I made the change, thanks for pointing it out |
Great, thanks @eldarkh ! |
This pull request is to resolve #6954.
I implemented a new function that only computes the number of processes to expect communication from, without actually knowing what their ranks are. Currently in the library calls to
compute_point_to_point_communication_pattern()
are always followed by using the size of the returned vector, so the actual pattern is never used.The implementation uses
MPI_Reduce_scatter_block
forMPI
versions higher than 2.2, andMPI_Reduce
followed byMPI_scatter
for older version - as discussed in #6954 this speeds things up a bit.