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

Implement a function for computing the number of messages received per MPI process #7145

Merged
merged 1 commit into from Sep 6, 2018

Conversation

eldarkh
Copy link
Contributor

@eldarkh eldarkh commented Sep 4, 2018

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 for MPI versions higher than 2.2, and MPI_Reduce followed by MPI_scatter for older version - as discussed in #6954 this speeds things up a bit.

Copy link
Member

@masterleinad masterleinad left a 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?

* destination more than once in their destinations list.
*/
unsigned int
compute_point_to_point_communications(
Copy link
Member

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.

++dest_vector[el];

# if DEAL_II_MPI_VERSION_GTE(2, 2)
// Find how many processes will send to this one
Copy link
Member

Choose a reason for hiding this comment

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

Find out


return n_recv_from;
# else
// Find how many processes will send to this one
Copy link
Member

Choose a reason for hiding this comment

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

Find out

@eldarkh eldarkh force-pushed the simpl_p2p_comm branch 2 times, most recently from b41991d to 7c58e94 Compare September 4, 2018 15:13
@eldarkh
Copy link
Contributor Author

eldarkh commented Sep 4, 2018

@masterleinad I addressed your comments and added a changes/minor entry

@masterleinad
Copy link
Member

/run-tests

Copy link
Member

@bangerth bangerth left a 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.

* 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
Copy link
Member

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?

@eldarkh
Copy link
Contributor Author

eldarkh commented Sep 6, 2018

@bangerth I made the change, thanks for pointing it out

@bangerth bangerth merged commit da2daa8 into dealii:master Sep 6, 2018
@bangerth
Copy link
Member

bangerth commented Sep 6, 2018

Great, thanks @eldarkh !

@eldarkh eldarkh deleted the simpl_p2p_comm branch September 12, 2018 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a function for computing the number of messages received per MPI process
3 participants