source: XIOS3/trunk/src/mpi_tools.hpp

Last change on this file was 2614, checked in by ymipsl, 4 months ago
  • Permit now usage of contex_group into xml file for more modularity
  • Src path is now relative to parent file, except if path is an absolute path

YM

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#ifndef __XIOS_MPI_TOOLS_HPP__
2#define __XIOS_MPI_TOOLS_HPP__
3
4#include <string>
5#include <map>
6
7namespace xios
8{
9
10  int MPI_Bcast_string(std::string& str, int root, MPI_Comm comm) ;
11
12  template<typename T> 
13  MPI_Datatype MPI_GetType(void) ;
14
15  template<> 
16  MPI_Datatype MPI_GetType<bool>(void) ;
17
18  template<>
19  MPI_Datatype MPI_GetType<char>(void);
20
21  template<>
22  MPI_Datatype MPI_GetType<short int>(void);
23
24  template<>
25  MPI_Datatype MPI_GetType<int>(void);
26
27  template<>
28  MPI_Datatype MPI_GetType<size_t>(void);
29
30  template<>
31  MPI_Datatype MPI_GetType<float>(void);
32
33  template<>
34  MPI_Datatype MPI_GetType<double>(void);
35
36  template<>
37  MPI_Datatype MPI_GetType<long double>(void);
38
39  class CCommTrack
40  {
41    private:
42    static std::map<MPI_Comm,std::string> commTrack_ ;
43   
44    public:
45    static void registerComm(const MPI_Comm& comm) ;
46
47    static void releaseComm(const MPI_Comm& comm) ;
48
49    static void dumpComm(void) ;
50
51    static const std::map<MPI_Comm,std::string>& getCommTrack(void) {return commTrack_ ;}
52  } ;
53} 
54#endif
Note: See TracBrowser for help on using the repository browser.