source: XIOS/dev/dev_trunk_graph/src/mpi_tools.hpp @ 2030

Last change on this file since 2030 was 2019, checked in by yushan, 3 years ago

Graph intermedia commit to a tmp branch

  • Property svn:executable set to *
File size: 821 bytes
Line 
1#ifndef __XIOS_MPI_TOOLS_HPP__
2#define __XIOS_MPI_TOOLS_HPP__
3
4#include <string>
5
6namespace xios
7{
8
9  int MPI_Bcast_string(std::string& str, int root, MPI_Comm comm) ;
10
11  template<typename T> 
12  MPI_Datatype MPI_GetType(void) ;
13
14  template<>
15  MPI_Datatype MPI_GetType<char>(void) { return MPI_CHAR ;}
16
17  template<>
18  MPI_Datatype MPI_GetType<short int>(void) { return MPI_SHORT ;}
19
20  template<>
21  MPI_Datatype MPI_GetType<int>(void) { return MPI_INT ;}
22
23  template<>
24  MPI_Datatype MPI_GetType<size_t>(void) { return MPI_SIZE_T ;}
25
26  template<>
27  MPI_Datatype MPI_GetType<float>(void) { return MPI_FLOAT ;}
28
29  template<>
30  MPI_Datatype MPI_GetType<double>(void) { return MPI_DOUBLE ;}
31
32  template<>
33  MPI_Datatype MPI_GetType<long double>(void) { return MPI_LONG_DOUBLE ;}
34
35
36} 
37#endif
Note: See TracBrowser for help on using the repository browser.