source: src/comm/mpi/settings.hpp@ 06e153

Last change on this file since 06e153 was ac6d04, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Merge recent changes of the vmg library into ScaFaCos.

Includes a fix for the communication problems on Jugene.

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

  • Property mode set to 100644
File size: 1.7 KB
Line 
1#ifndef SETTINGS_HPP_
2#define SETTINGS_HPP_
3
4#ifndef HAVE_MPI
5#error You need MPI in order to compile VMG::MPI::Settings
6#endif
7
8#include <map>
9#include <set>
10
11#include "comm/mpi/datatypes_global.hpp"
12#include "comm/mpi/datatypes_local.hpp"
13#include "comm/mpi/key.hpp"
14
15namespace VMG
16{
17
18class TempGrid;
19
20namespace MPI
21{
22
23class DatatypesGlobal;
24
25class Settings
26{
27public:
28 Settings();
29 ~Settings();
30
31 void ComputeSettings(Multigrid& sol, Multigrid& rhs, MPI_Comm& comm);
32
33 Grid& FinerGrid(const Grid& grid);
34 Grid& CoarserGrid(const Grid& grid);
35
36 MPI_Comm CommunicatorGlobal(const Grid& grid) const;
37 MPI_Comm CommunicatorLocal(const Grid& grid) const;
38
39 MPI_Datatype& Datatype(const Index& begin, const Index& end,
40 const Index& size_local, const Index& size_global,
41 const int& level);
42 VMG::MPI::DatatypesGlobal& DatatypesGlobal(const Grid& grid_old, const Grid& grid_new, const int& direction);
43 VMG::MPI::DatatypesLocal& DatatypesLocal(const Grid& grid);
44
45private:
46 Index GlobalDims(MPI_Comm comm, Index pos);
47 void AddDatatypeGlobal(const Grid& grid_old, const Grid& grid_new, const int& direction);
48
49 void CreateGlobalCommunicator(MPI_Comm& comm_global, const Grid* grid_1, const Grid* grid_2=NULL, const Grid* grid_3=NULL);
50 void CreateLocalCommunicator(MPI_Comm& comm_global, const Grid& grid);
51
52 std::map<int, MPI_Comm> communicators_global;
53 std::map<KeyUnsorted, MPI_Comm> communicators_local;
54 std::set<MPI_Comm> communicators_local_unique;
55 std::map<const Grid*, Grid*> finer_grids, coarser_grids;
56 std::map<KeyUnsorted, MPI_Datatype> datatypes;
57 std::map<KeyUnsorted, VMG::MPI::DatatypesGlobal> datatypes_global;
58 std::map<KeyUnsorted, VMG::MPI::DatatypesLocal> datatypes_local;
59};
60
61}
62
63}
64
65#endif /* SETTINGS_HPP_ */
Note: See TracBrowser for help on using the repository browser.