-
-
Notifications
You must be signed in to change notification settings - Fork 122
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 MPI_IN_PLACE for MPI Operations #232
Conversation
…MPI_IN_PLACE, and tests.
… and tests. Also fixes a typo on Allgather!(buf, count, comm)
While I'm at it, I've got two very minor issues regarding the code:
The fact that it is underscore is intended or it's a typo?
Do you agree with those two modifications? |
Yes, I agree. |
This reverts commit d814a5d.
- Rename `allreduce(sendbuf, op, comm)` to `Allreduce(sendbuf, op, comm)` for consistency + fix test - Move `Allreduce!(send, recv, count op::Function, comm)` converting user provided-functions from `mpi-op.jl` to `mpi-base.jl`
I renamed |
Prefer using internally methods with `counts` specified. Fix a `Scatter` docstring
Throw assertion if recvbuf is too small when calling Allgather! to prevent Segmentation fault + Test
Sorry for the delay. To me this looks good to merge, anyone else want to review? |
No problems. I took the liberty of editing the README to document the allocating and the non-allocating versions of the various communications, and their support for IN_PLACE. Feel free to edit/delete it if you don't like my changes. |
Since there were no more comments on this I think it's ready to merge. Should the commits be squashed into one, or is it OK like this? |
If you want me to squash the commits or do anything just let me know. |
OK, I used the "squash and merge" button, which mostly worked except that it created an extra empty commit, sorry for that but I guess it's now carved in stone. Anyway, many thanks for this big PR! |
* Extract the value of MPI_IN_PLACE during build phase * Add non allocating version of MPI_Allreduce, support for MPI_IN_PLACE, and tests. * Add non allocating version of MPI_Scatter, another method supporting MPI_IN_PLACE, and tests. * Add non allocating version of MPI_Allgather, support for MPI_IN_PLACE, and tests. * Add non allocating version of MPI_Allgatherv, support for MPI_IN_PLACE, and tests. * Add non allocating version of MPI_Alltoall, support for MPI_IN_PLACE, and tests. * Add non allocating version of Alltoallv and tests * Modify definition of IN_PLACE and revert function signatures to the old type. * Make the compiler check if a function can accept ConstantPtr. * Allreduce: - Rename `allreduce(sendbuf, op, comm)` to `Allreduce(sendbuf, op, comm)` for consistency + fix test - Move `Allreduce!(send, recv, count op::Function, comm)` converting user provided-functions from `mpi-op.jl` to `mpi-base.jl` * Reduce: - Add nonallocating version `Reduce!` - Move and rename `Reduce(send, recv, count op::Function, comm)` converting user provided-functions from `mpi-op.jl` to `mpi-base.jl` * Add Reduce_in_place! function * Modify allreduce tests to test N-dimensional tensors * Gather: Add a non-allocating version * Add Gather_in_place! * Add non-allocating Gatherv and support for MPI.IN_PLACE + tests * Add Gatherv_in_place! * Add non-allocating Scatterv! and Scatterv_in_place
(This is a fixed #230.)
Hi,
I would like to implement non allocating versions for several MPI operations, as well as support for MPI_IN_PLACE.
This PR defines a new variable, MPI.IN_PLACE of type
Ptr{Cvoid}
, and refactors the code of the following functions to implement a non-allocating version which acceptsMPI.IN_PLACE
if supported by MPI.For the following functions, calling
MPI_IN_PLACE
is slightly less straightforward, so I felt that the best way to support it would be to create a new method calledXXX_in_place!
.If you think this is not a good idea, feel free to propose a better solution.
The last three functions listed above are still missing, and if you are interested I'll be glad to include them in the PR.
I believe all CI test failures on OpenMPI-MacOS and 32bit-Windows to be unrelated to the PR.
--
Filippo