SENSEI
A frame work for generic in situ analytics
PlanarSlicePartitioner.h
1 #ifndef sensei_PlanarSlicePartitioner_h
2 #define sensei_PlanarSlicePartitioner_h
3 
4 #include "Partitioner.h"
5 #include <array>
6 
7 namespace sensei
8 {
9 
10 class PlanarSlicePartitioner;
11 using PlanarSlicePartitionerPtr = std::shared_ptr<sensei::PlanarSlicePartitioner>;
12 
13 /// @class PlanarSlicePartitioner
14 /// The slice paritioner determins which blocks intersect the plane
15 /// defined by a given point and normal. This blocks are partitioned
16 /// in consecutive blocks to ranks such that each rank gets approximately
17 /// the same number. Ranks will differ by at most 1 block.
18 class SENSEI_EXPORT PlanarSlicePartitioner : public sensei::Partitioner
19 {
20 public:
21  static sensei::PlanarSlicePartitionerPtr New()
22  { return PlanarSlicePartitionerPtr(new PlanarSlicePartitioner); }
23 
24  const char *GetClassName() override { return "PlanarSlicePartitioner"; }
25 
26  // set the point defining the slice plane
27  void SetPoint(const std::array<double,3> &p) { this->Point = p; }
28  void GetPoint(std::array<double,3> &p) { p = this->Point; }
29 
30  // set the normal defining the slice plane
31  void SetNormal(const std::array<double,3> &n) { this->Normal = n; }
32  void GetNormal(std::array<double,3> &n) { n = this->Normal; }
33 
34  // Initialize from XML
35  int Initialize(pugi::xml_node &node) override;
36 
37  // given an existing partitioning of data passed in the first MeshMetadata
38  // argument,return a new partittioning in the second MeshMetadata argument.
39  int GetPartition(MPI_Comm comm, const sensei::MeshMetadataPtr &in,
40  sensei::MeshMetadataPtr &out) override;
41 
42 protected:
43  PlanarSlicePartitioner() : Point{0.,0.,0.}, Normal{1.,0.,0.} {}
45 
46  std::array<double,3> Point;
47  std::array<double,3> Normal;
48 };
49 
50 }
51 
52 #endif
The slice paritioner determins which blocks intersect the plane defined by a given point and normal...
Definition: PlanarSlicePartitioner.h:18
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