SENSEI
A frame work for generic in situ analytics
Partitioner.h
1 #ifndef sensei_Partitioner_h
2 #define sensei_Partitioner_h
3 
4 #include "MeshMetadata.h"
5 #include "Error.h"
6 
7 #include <memory>
8 #include <mpi.h>
9 
10 namespace pugi { class xml_node; }
11 
12 namespace sensei
13 {
14 class Partitioner;
15 using PartitionerPtr = std::shared_ptr<sensei::Partitioner>;
16 
17 /// @class Partitioner
18 /// @brief represents the way data is partitioned for in-transit operation mode.
19 ///
20 /// given a collection of data and set of ranks, partition the data to a new
21 /// set of ranks. the collection of data and its assigmment to ranks is
22 /// described by MeshMetadata. The partitioner is not responsible for moving
23 /// data, only deciding how it should be layed out and distributed after the
24 /// move.
25 class SENSEI_EXPORT Partitioner
26 {
27 public:
28  // return the name of the class
29  virtual const char *GetClassName() = 0;
30 
31  // given an existing partitioning of data passed in the first MeshMetadata
32  // argument,return a new partittioning in the second MeshMetadata argument.
33  virtual int GetPartition(MPI_Comm comm, const sensei::MeshMetadataPtr &in,
34  sensei::MeshMetadataPtr &out) = 0;
35 
36  // initialize the partitioner from the XML node.
37  virtual int Initialize(pugi::xml_node &)
38  {
39  SENSEI_STATUS("Configured " << this->GetClassName())
40  return 0;
41  }
42 
43  // enable/disable generation of debugging output
44  virtual void SetVerbose(int val){ this->Verbose = val; }
45  virtual int GetVerbose(){ return this->Verbose; }
46 
47  Partitioner() : Verbose(0) {}
48  virtual ~Partitioner() {}
49 
50 protected:
51  int Verbose;
52 };
53 
54 }
55 
56 #endif
int Initialize(MPI_Comm comm, const std::string &fileName, InTransitDataAdaptor *&dataAdaptor)
Creates a sensei::ConfigurableAnalysis adaptor and sensei::InTransitDataAdaptor based on a SENSEI XML...
represents the way data is partitioned for in-transit operation mode.
Definition: Partitioner.h:25
SENSEI.
Definition: ADIOS2AnalysisAdaptor.h:27
Definition: ADIOS2DataAdaptor.h:10