Memosa-FVM  0.2
StorageSiteMerger.h
Go to the documentation of this file.
1 // This file os part of FVM
2 // Copyright (c) 2012 FVM Authors
3 // See LICENSE file for terms.
4 
5 #ifndef _STORAGESITEMERGER_H_
6 #define _STORAGESITEMERGER_H_
7 #ifdef FVM_PARALLEL
8 
9 #include <mpi.h>
10 #include "StorageSite.h"
11 #include <cassert>
12 #include <set>
13 
14 class StorageSiteMerger
15 {
16 public:
17  StorageSiteMerger( int target_proc_id, const set<int>& group, const StorageSite& cell_site );
18  ~StorageSiteMerger();
19 
20  shared_ptr<StorageSite> merge();
21  void debug_print();
22 
23  int getSelfCount() const { return _mergeSiteSize; }
24  int getGhostCount() const { return _mergeSiteGhostSize; }
25  int getCount() const { return _mergeSiteSize + _mergeSiteGhostSize; }
26 
27 private:
28  StorageSiteMerger(const StorageSiteMerger&);
29  void init();
30 
31 
32  int _count;
33  int _selfCount;
34  int _offset;
35 
36  int _groupID;
37  const set<int>& _group;
38  const StorageSite& _cellSite;
39  int _mergeSiteSize;
40  int _mergeSiteGhostSize;
41 
42  MPI::Intracomm _comm;
43 
44  //const StorageSite* const _parent;
45  StorageSite::ScatterMap _scatterMap;
46  StorageSite::GatherMap _gatherMap;
47 
48  int _scatterProcID;
49  int _gatherProcID;
50 
51 
52 };
53 
54 
55 #endif
56 #endif
map< const StorageSite *, shared_ptr< Array< int > > > ScatterMap
Definition: StorageSite.h:23
map< const StorageSite *, shared_ptr< Array< int > > > GatherMap
Definition: StorageSite.h:24