SENSEI
A frame work for generic in situ analytics
PlanarPartitioner.h
1 #ifndef sensei_PlanarPartitioner_h
2 #define sensei_PlanarPartitioner_h
3 
4 #include "Partitioner.h"
5 
6 namespace sensei
7 {
8 
9 class PlanarPartitioner;
10 using PlanarPartitionerPtr = std::shared_ptr<sensei::PlanarPartitioner>;
11 
12 /// @class PlanarPartitioner
13 /// The cyclic distribution method will distribute blocks to a rank
14 /// such that consecutive blocks are distributed over consecutive
15 /// ranks in a round-robin fashion in chunks of length specified by
16 /// the PlaneSize. The class looks for PlaneSize in the XML attribute
17 /// `cycle_size`.
18 class SENSEI_EXPORT PlanarPartitioner : public sensei::Partitioner
19 {
20 public:
21  static sensei::PlanarPartitionerPtr New()
22  { return PlanarPartitionerPtr(new PlanarPartitioner); }
23 
24  const char *GetClassName() override { return "PlanarPartitioner"; }
25 
26  // given an existing partitioning of data passed in the first MeshMetadata
27  // argument,return a new partittioning in the second MeshMetadata argument.
28  // blocks are distributed in a round-robin fashion in chunks of length
29  // specified by the PlaneSize.
30  int GetPartition(MPI_Comm comm, const sensei::MeshMetadataPtr &in,
31  sensei::MeshMetadataPtr &out) override;
32 
33  // Set/get the PlaneSize. This controls how many blocks are assigned to
34  // each rank in each iteration of the partitioning process.
35  void SetPlaneSize(unsigned int size) { this->PlaneSize = size; }
36  unsigned int GetPlaneSize(){ return this->PlaneSize; }
37 
38  // Initialize from XML
39  int Initialize(pugi::xml_node &node) override;
40 
41 protected:
42  PlanarPartitioner() : PlaneSize(1) {}
43  PlanarPartitioner(const PlanarPartitioner &) = default;
44 
45  unsigned int PlaneSize;
46 };
47 
48 }
49 
50 #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
The cyclic distribution method will distribute blocks to a rank such that consecutive blocks are dist...
Definition: PlanarPartitioner.h:18