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

[Feature] Implementing MPI_IN_PLACE for reductions #228

Closed
PhilipVinc opened this issue Jan 16, 2019 · 2 comments
Closed

[Feature] Implementing MPI_IN_PLACE for reductions #228

PhilipVinc opened this issue Jan 16, 2019 · 2 comments

Comments

@PhilipVinc
Copy link
Contributor

Hi,

I would like to implement functionality to perform reduction with MPI_IN_PLACE, so that the output buffer is the same as the input buffer.
I would gladly contribute this back to the repository, if someone could guide me towards implementing this correctly.

For Allreduce I'm thinking about adding a method to mpi-base.jl with this signature

Allreduce!(sendbuf::MPIBuffertype{T}, op::Union{Op,Function}, comm::Comm) where T = 
    Allreduce!(Ptr{Cvoid}(1), sendbuf, length(sendbuf), op, comm)

something similar can be done for Reduce.

Also, Ptr{Cvoid}(1) corresponds to the definition of MPI_IN_PLACE=(void*)1 taken from mpi.h.
I am uncertain on what is the correct way to include it so that it becomes available as MPI.MPI_IN_PLACE.

@PhilipVinc
Copy link
Contributor Author

I implemented the above into philipvinc/in_place branch at https://github.com/PhilipVinc/MPI.jl/tree/philipvinc/in_place

At the moment I have added support for

  • Allreduce, Allreducev
  • Allgather

If a maintainer confirms that you are interested in this, and helps me with a list of methods to support, I would gladly add those, along with tests, and submit a PR.

@PhilipVinc
Copy link
Contributor Author

Closed by #232

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

No branches or pull requests

1 participant