source: XIOS/trunk/extern/remap/src/mpi_routing.hpp @ 694

Last change on this file since 694 was 694, checked in by rlacroix, 9 years ago

Fix compilation issues caused by the new "remap" library.

Use our MPI header so that C++ bindings are always disabled.

File size: 1.5 KB
Line 
1#ifndef  __MPI_ROUTING_HPP__
2#define  __MPI_ROUTING_HPP__
3
4#include "mpi.hpp"
5#include <vector>
6#include "mpi_cascade.hpp"
7
8namespace sphereRemap {
9
10class CMPIRouting
11{
12
13        MPI_Comm communicator;
14        int mpiRank;
15        int mpiSize;
16
17        int  nbSource;
18        int *sourceRank;
19        std::vector<int> nbSourceElement;
20        int  totalSourceElement;
21        std::vector<int> sourceElementIndex;
22
23        int  nbTarget;
24        int *targetRank;
25        std::vector<int> nbTargetElement;
26        std::vector<int> targetElementIndex;
27        int  totalTargetElement;
28
29
30public:
31        CMPIRouting(MPI_Comm comm);
32        ~CMPIRouting();
33        template<typename T> void init(const std::vector<T>& route, CMPICascade *cascade = NULL);
34        int getTotalSourceElement(void);
35
36        template<typename T> void transferToTarget(T *targetElement, T *sourceElement);
37        template<typename T, typename t_pack, typename t_unpack> void transferToTarget(T *targetElement, T *sourceElement, t_pack pack, t_unpack unpack);
38
39        template<typename T> void transferFromSource(T *targetElement, T *sourceElement);
40        template<typename T, typename t_pack, typename t_unpack> void transferFromSource(T *targetElement, T *sourceElement, t_pack pack, t_unpack unpack);
41
42};
43
44template <typename T>
45void alltoalls_known(const std::vector<std::vector<T> >& send, std::vector<std::vector<T> >& recv,
46                     const std::vector<int>& ranks, MPI_Comm communicator);
47
48template <typename T>
49void alltoalls_unknown(const std::vector<std::vector<T> >& send, std::vector<std::vector<T> >& recv,
50                       const std::vector<int>& ranks, MPI_Comm communicator);
51}
52#endif
Note: See TracBrowser for help on using the repository browser.