source: src/comm/mpi/settings.hpp@ 894a5f

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

Parallel performance update.

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

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[894a5f]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{
22class Settings
23{
24public:
25 Settings();
26 ~Settings();
27
28 void ComputeSettings(Multigrid& sol, Multigrid& rhs, MPI_Comm& comm);
29
30 Grid& FinerGrid(const Grid& grid);
31 Grid& CoarserGrid(const Grid& grid);
32 Grid& GlobalCoarseGrid();
33
34 MPI_Comm CommunicatorGlobal(const Grid& grid);
35 MPI_Comm CommunicatorLocal(const Grid& grid);
36
37 MPI_Datatype& Datatype(const Index& begin, const Index& end, const Index& size_local, const Index& size_global);
38 VMG::MPI::DatatypesGlobal& DatatypesGlobal(const Grid& grid_old, const Grid& grid_new);
39 VMG::MPI::DatatypesLocal& DatatypesLocal(const Grid& grid);
40
41private:
42 Index GlobalDims(MPI_Comm comm, Index pos);
43 void AddDatatypeGlobal(const Grid& grid_old, const Grid& grid_new);
44
45 void CreateGlobalCommunicator(MPI_Comm& comm_global, const Grid* grid_1, const Grid* grid_2=NULL, const Grid* grid_3=NULL);
46 void CreateLocalCommunicator(MPI_Comm& comm_global, const Grid& grid);
47
48 std::map<int, MPI_Comm> communicators_global;
49 std::map<KeyUnsorted, MPI_Comm> communicators_local;
50 std::set<MPI_Comm> communicators_local_unique;
51 std::map<const Grid*, Grid*> finer_grids, coarser_grids;
52 std::map<KeyUnsorted, MPI_Datatype> datatypes;
53 std::map<KeyUnsorted, VMG::MPI::DatatypesGlobal> datatypes_global;
54 std::map<KeyUnsorted, VMG::MPI::DatatypesLocal> datatypes_local;
55 TempGrid* global_coarse_grid;
56};
57
58}
59
60}
61
62#endif /* SETTINGS_HPP_ */
Note: See TracBrowser for help on using the repository browser.