SENSEI
A frame work for generic in situ analytics
LibsimAnalysisAdaptor.h
1 #ifndef sensei_LibsimAnalysisAdaptor_h
2 #define sensei_LibsimAnalysisAdaptor_h
3 
4 #include "AnalysisAdaptor.h"
5 #include <string>
6 #include <mpi.h>
7 
8 namespace sensei
9 {
10 /// @cond
11 class LibsimImageProperties;
12 /// @endcond
13 
14 /** An implementation that invokes VisIt libsim. Run time configuration is
15  * specified using a VisIt session file (see AddRenderer or AddExtract).
16  */
17 class SENSEI_EXPORT LibsimAnalysisAdaptor : public AnalysisAdaptor
18 {
19 public:
20  /// Allocates an instance of LibsimAnalysisAdaptor.
21  static LibsimAnalysisAdaptor* New();
22 
23  senseiTypeMacro(LibsimAnalysisAdaptor, AnalysisAdaptor);
24 
25  /// @name Run time configuration
26  /// @{
27 
28  /// Set the file to write libsim debugging info to
29  void SetTraceFile(const std::string &traceFile);
30 
31  /// Set libsim specific options
32  void SetOptions(const std::string &options);
33 
34  /** Set the path to the VisIt install. Note that it is recommened to set
35  * VisIt spoecific enviornment variables instead of SetVisItDirectory.
36  */
37  void SetVisItDirectory(const std::string &dir);
38 
39  /// Set the libsim mode
40  void SetMode(const std::string &mode);
41 
42  /** If set then the adaptor will generate the nesting information for VisIt.
43  * If one wants to do subsetting in VisIt, setting this flag will give VisIt
44  * the information it needs to re-generate ghost zones based on the selected
45  * blocks. It is off by default because if not doing subsetting this
46  * information is not needed, and this information takes up a good deal of
47  * space and the algorithm used here is O(N^2) in the number of blocks.
48  */
49  void SetComputeNesting(int val);
50 
51  /** Initialize VisIt and Libsim after setting all desired run time
52  * configuration paramters.
53  */
54  void Initialize();
55 
56  /** Explicitly create VisIt plots and rendered output. We recommend
57  * using a VisIt session file instead of explictly creating plots.
58  *
59  * @param[in] frequency sets how many steps in between libsim processing
60  * @param[in] session the path to a VisIt generated session file
61  * @param[in] plot the name of a VisIt plot (do not use with session)
62  * @param[in] plotVars the name of the variable to plot (do not use with session)
63  * @param[in] slice if true a slice is taking (do not use with session)
64  * @param[in] project2d if true the slice is projected in 2D (do not use with session)
65  * @param[in] origin the point defining the slice plane (do not use with session)
66  * @param[in] normal the normal of the slice plane (do no not use with session)
67  * @param[in] imgProps descibes the rendering parameters (do not use with session)
68  */
69  bool AddRender(int frequency,
70  const std::string &session,
71  const std::string &plot,
72  const std::string &plotVars,
73  bool slice, bool project2d,
74  const double origin[3], const double normal[3],
75  const LibsimImageProperties &imgProps);
76 
77  /** Explicitly create VisIt extract based output. We recommend
78  * using a VisIt session file instead of explictly creating plots.
79  *
80  * @param[in] frequency sets how many steps in between libsim processing
81  * @param[in] session the path to a VisIt generated session file
82  * @param[in] plot the name of a VisIt plot (do not use with session)
83  * @param[in] plotVars the name of the variable to plot (do not use with session)
84  * @param[in] slice if true a slice is taking (do not use with session)
85  * @param[in] project2d if true the slice is projected in 2D (do not use with session)
86  * @param[in] origin the point defining the slice plane (do not use with session)
87  * @param[in] normal the normal of the slice plane (no not use with session)
88  * @param[in] filename the path to writre the data to
89  */
90  bool AddExport(int frequency,
91  const std::string &session,
92  const std::string &plot, const std::string &plotVars,
93  bool slice, bool project2d,
94  const double origin[3], const double normal[3],
95  const std::string &filename);
96  /// @}
97 
98  /// invoke in situ processing with VisIt Libsim
99  bool Execute(DataAdaptor* data, DataAdaptor**) override;
100 
101  /// shut down and cleanup VisIt Libsim.
102  int Finalize() override;
103 
104 protected:
107 
108 private:
109  LibsimAnalysisAdaptor(const LibsimAnalysisAdaptor&); // Not implemented.
110  void operator=(const LibsimAnalysisAdaptor&); // Not implemented.
111 
112  class PrivateData;
113  PrivateData *internals;
114 };
115 
116 }
117 
118 #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...
An implementation that invokes VisIt libsim.
Definition: LibsimAnalysisAdaptor.h:17
The base class for data consumers.
Definition: AnalysisAdaptor.h:24
SENSEI.
Definition: ADIOS2AnalysisAdaptor.h:27
Base class that defines the interface for fetching data from a simulation.
Definition: DataAdaptor.h:25