source: src/comm/mpi/comm_info.hpp@ 138f86

Last change on this file since 138f86 was dfed1c, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Major vmg update.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1136 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file comm_info.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Nov 21 13:27:22 2011
5 *
6 * @brief Stores some MPI-relevant information.
7 *
8 */
9
10#ifndef COMM_INFO_HPP_
11#define COMM_INFO_HPP_
12
13#ifndef HAVE_MPI
14#error MPI is needed to compile this class
15#endif
16
17#include <mpi.h>
18
19#include <map>
20
21#include "base/tuple.hpp"
22#include "comm/mpi/comm_key.hpp"
23#include "comm/mpi/datatype.hpp"
24
25namespace VMG
26{
27
28class Index;
29class Grid;
30class Multigrid;
31
32namespace MPI
33{
34
35class CommInfo
36{
37public:
38 CommInfo();
39 virtual ~CommInfo();
40
41 MPI_Comm GetCommunicator(const Grid& grid);
42 MPI_Comm GetCommunicator(const GlobalIndices& global, const void* addr);
43 MPI_Comm GetUnionCommunicator(const Grid& grid_1, const Grid& grid_2);
44 Datatypes& GetDatatypes(const Grid& grid);
45
46 Index Pos(const Grid& grid);
47 Index Procs(const Grid& grid);
48
49 void SetCommGlobal(MPI_Comm& comm_global_)
50 {
51 comm_global = comm_global_;
52 }
53
54private:
55 std::map<const Grid*, VMG::MPI::Datatypes> datatypes;
56 std::map<CommKey, MPI_Comm> communicators;
57
58 MPI_Comm comm_global;
59 int max_level;
60
61 static Index GetGlobalDims(MPI_Comm comm, Index pos);
62};
63
64}
65
66}
67
68#endif /* COMM_INFO_HPP_ */
Note: See TracBrowser for help on using the repository browser.