#ifndef __MPI_ROUTING_HPP__ #define __MPI_ROUTING_HPP__ #include "mpi.hpp" #include #include "mpi_cascade.hpp" namespace sphereRemap { class CMPIRouting { MPI_Comm communicator; int mpiRank; int mpiSize; int nbSource; int *sourceRank; std::vector nbSourceElement; int totalSourceElement; std::vector sourceElementIndex; int nbTarget; int *targetRank; std::vector nbTargetElement; std::vector targetElementIndex; int totalTargetElement; public: CMPIRouting(MPI_Comm comm); ~CMPIRouting(); template void init(const std::vector& route, CMPICascade *cascade = NULL); int getTotalSourceElement(void); template void transferToTarget(T *targetElement, T *sourceElement); template void transferToTarget(T *targetElement, T *sourceElement, t_pack pack, t_unpack unpack); template void transferFromSource(T *targetElement, T *sourceElement); template void transferFromSource(T *targetElement, T *sourceElement, t_pack pack, t_unpack unpack); }; template void alltoalls_known(const std::vector >& send, std::vector >& recv, const std::vector& ranks, MPI_Comm communicator); template void alltoalls_unknown(const std::vector >& send, std::vector >& recv, const std::vector& ranks, MPI_Comm communicator); } #endif