This repository was archived by the owner on Mar 20, 2023. It is now read-only.
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
Update MPI wrappers to be more flexible and handle C++/MPI types correctly #490
Open
Description
Currently MPI wrappers implemented in coreneuron/mpi/mpispike.cpp have quite some limitations:
- they were derived from old C style code
- for different argument types there are different functions i.e. code duplication (e.g. nrnmpi_dbl_allreduce_vec for double and long argument type)
- doesn't handle type like size_t correctly (see this)
- MPI Op type is passed as int 1, 2, 3 (quite unintuitive API)
- When #ranks < 2, not all functions avoid calling MPI functions
We should rewrite them to avoid repeated code and address above limitations. I assume @alkino will be interested to re-write this. @olupton and @ohm314 can provide input if these should be refactored/implemented in certain way.
P.S. the reason for avoiding calling MPI routines for #ranks < 2 is that MPI compiled library can be used in serial or parallel execution. In serial execution NEURON doesn't initialise MPI and libraries like HPE-MPT end-up with floating point exceptions.