INMOST
A toolkit for distributed mathematical modeling
inmost_partitioner.h
1 
2 #ifndef INMOST_PARTITIONER_H_INCLUDED
3 #define INMOST_PARTITIONER_H_INCLUDED
4 #include "inmost.h"
5 
6 #if defined(USE_PARTITIONER) && !defined(USE_MESH)
7 #pragma message("USE_PARTITIONER require USE_MESH")
8 #undef USE_PARTITIONER
9 #endif
10 
11 
12 #if defined(USE_PARTITIONER)
13 
14 namespace INMOST
15 {
18  {
19  public:
23  enum Type
24  {
38  };
39  enum Action
40  {
43  Refine
44  };
45  private:
46  enum Type pt;
47  enum Action pa;
48  void * pzz;
49  Tag weight_tag;
50  Mesh * m;
51 
52  std::set<std::string> sets;
53  public:
60  static void Initialize(int * argc, char *** argv);
63  static void Finalize();
66  Partitioner(const Partitioner & other);
67  Partitioner & operator =(Partitioner const & other);
68  ~Partitioner();
70  void AddSet(std::string set_name) { sets.insert(set_name); }
71  bool RemSet(std::string set_name)
72  {
73  std::set<std::string>::iterator f = sets.find(set_name);
74  if (f != sets.end())
75  {
76  sets.erase(f);
77  return true;
78  }
79  else return false;
80  }
81  void ClearSets() { sets.clear(); }
84  void Evaluate();
89  void SetMethod(enum Type t, enum Action a = Repartition);
91  void SetWeight(Tag weight);
93  void ResetWeight();
94 
99  };
100 }
101 #endif //USE_PARTITIONER
102 
103 
104 #endif //INMOST_PARTITIONER_H_INCLUDED
Main class to modify or improve the mesh distribution for better load balancing.
Type
Type of the Partitioner can be currently used in this version of INMOST.
@ Zoltan_HSFC
Zoltan geometry-based method using Hilbert Space-Filling Curve partitioning.
@ MetisRecContig
Metis partitioner using METIS_PartGraphRecursive with contiguous option.
@ MetisKway
Metis partitioner using METIS_PartGraphKway.
@ Parmetis
Parmetis partitioner with the original interface.
@ Zoltan_RCB
Zoltan geometry-based method using Recursive Coordinate Bisection.
@ MetisKwayContig
Metis partitioner using METIS_PartGraphKway with contiguous option.
@ Zoltan_PHG
Zoltan topology-based method using Partitioning of HyperGraph.
@ Zoltan_RIB
Zoltan geometry-based method using Recursive Inertial Bisection.
@ Zoltan_Scotch
Scotch partitioner with the Zoltan package interface.
@ Zoltan_Parmetis
Parmetis partitioner with the Zoltan package interface.
@ MetisRec
Metis partitioner using METIS_PartGraphRecursive.
@ INNER_RCM
Internal serial only partitioner based on the Reverse Cuthill–McKee algorithm ordering.
@ INNER_KMEANS
Internal parallel paritioner based on K-means clustering.
@ Refine
Refine the current partition assuming only small changes of mesh distribution.
@ Partition
Partition "from scratch", not taking into account the current mesh distribution.
@ Repartition
Repartition the existing partition but try to stay close to the current mesh distribution.
void AddSet(std::string set_name)
Account for sets in the partitioner.
Mesh * GetMesh()
Get the Mesh pointer for the current partitioner.
Partitioner(Mesh *m)
The default constructor of the partitioner for the specified mesh.
void SetWeight(Tag weight)
Compute the specific weights for the selected partitioner.
static void Initialize(int *argc, char ***argv)
Initialize the use of partitioner.
Tag GetWeight()
Get the Tag of the computed weights for the current partitioner.
void Evaluate()
Evaluate the earlier specified partitioner.
void ResetWeight()
Reset the computed weights for the partitioner.
void SetMethod(enum Type t, enum Action a=Repartition)
Set the partitioner method to be used.
static void Finalize()
Finalize the use of partitioner.
This class provides the access to the individual mesh datum and general information about it.
Definition: inmost_data.h:193