source: XIOS3/trunk/src/mpi_tools.hpp @ 2586

Last change on this file since 2586 was 2576, checked in by ymipsl, 10 months ago

Implement tracking of unfree communicators.

YM

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