SENSEI
A frame work for generic in situ analytics
IsoSurfacePartitioner.h
1 #ifndef sensei_IsoSurfacePartitioner_h
2 #define sensei_IsoSurfacePartitioner_h
3 
4 #include "Partitioner.h"
5 
6 #include <set>
7 #include <vector>
8 #include <string>
9 
10 namespace sensei
11 {
12 
13 class IsoSurfacePartitioner;
14 using IsoSurfacePartitionerPtr = std::shared_ptr<sensei::IsoSurfacePartitioner>;
15 
16 /// @class IsoSurfacePartitioner
17 /// The IsoSurfacePartitioner selects only blocks that are needed to
18 /// compute the desired set of iso surfaces. These blocks are partitioned
19 /// in consecutive spans to ranks such that each rank gets approximately
20 /// the same number. The number of blocks per rank will differ by at most 1.
21 class SENSEI_EXPORT IsoSurfacePartitioner : public sensei::Partitioner
22 {
23 public:
24  static sensei::IsoSurfacePartitionerPtr New()
25  { return IsoSurfacePartitionerPtr(new IsoSurfacePartitioner); }
26 
27  const char *GetClassName() override { return "IsoSurfacePartitioner"; }
28 
29  // add iso values
30  void SetIsoValues(const std::string &meshName,
31  const std::string &arrayName, int arrayCentering,
32  const std::vector<double> &vals);
33 
34  int GetIsoValues(std::string &meshName, std::string &arrayName,
35  int &arrayCentering, std::vector<double> &vals) const;
36 
37  // Initialize from XML
38  int Initialize(pugi::xml_node &node) override;
39 
40  // given an existing partitioning of data passed in the first MeshMetadata
41  // argument,return a new partittioning in the second MeshMetadata argument.
42  int GetPartition(MPI_Comm comm, const sensei::MeshMetadataPtr &in,
43  sensei::MeshMetadataPtr &out) override;
44 
45 protected:
46  IsoSurfacePartitioner() = default;
48 
49  std::string MeshName;
50  std::string ArrayName;
51  int ArrayCentering;
52  std::vector<double> IsoValues;
53 };
54 
55 }
56 
57 #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...
The IsoSurfacePartitioner selects only blocks that are needed to compute the desired set of iso surfa...
Definition: IsoSurfacePartitioner.h:21
represents the way data is partitioned for in-transit operation mode.
Definition: Partitioner.h:25
SENSEI.
Definition: ADIOS2AnalysisAdaptor.h:27