1

I'm implementing an Allreduce algorithm inside the mca/coll framework.

The algorithm I'm implementing needs each node to send at each step of the computation only a part of the vector (like a ring allreduce), but the size of this part and the position can change.

More importantly, I should be able to send non contiguous part of the vector.

I was thinking about using a custom mpi datatype, the problem is that the normal MPI_Datatype ... is just the final implementation on what is inside the mca (and the others) module(s).

I need to know how to create such custom datatype using only the low level calls of the module (no MPI_...).

For the send and recv part I was thinking about using the ompi_datatype_sendrcv (implemented in ompi/datatype/ompi_datatype_sendrcv.c) but suggestions even on this are welcome.

3
  • 1
    You can use the PMPI_* subroutines instead of the MPI_* ones in order not to confuse profilers or tools. What would be the issue with using PMPI_* subroutines? If you really want to use the internals, look at the C bindings (e.g. ompi/mpi/c/type_contiguous.c), there is generally a straightforward mapping between the C MPI_* subroutines and the internal ompi_* one. Commented Jul 9, 2024 at 13:26
  • I discarded the idea of using pmpi, because the aim of what I'm doing is to be consistent with the OpenMPI codebase and maybe try to do a pull request once I've finished to implement my algorithm (I believe that the algorithm I'm implementing should be faster than the ones already in the library for some usecases) Commented Jul 9, 2024 at 13:43
  • 1
    I would suggest you start implementing your algorithms with the PMPI_* subroutine, and if you can showcase some performance benefits, open a pull request. the reviewer(s) will guide you on how to use the internal calls if needed. Commented Jul 9, 2024 at 14:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.