TECA
teca_index_executive.h
1 #ifndef teca_index_executive_h
2 #define teca_index_executive_h
3 
4 #include "teca_shared_object.h"
5 #include "teca_algorithm_executive.h"
6 #include "teca_metadata.h"
7 #include "teca_mpi.h"
8 
9 #include <vector>
10 
11 TECA_SHARED_OBJECT_FORWARD_DECL(teca_index_executive)
12 
13 
36 {
37 public:
38  TECA_ALGORITHM_EXECUTIVE_STATIC_NEW(teca_index_executive)
39 
40  int initialize(MPI_Comm comm, const teca_metadata &md) override;
41  teca_metadata get_next_request() override;
42 
43  // set the index to process
44  void set_index(long s);
45 
46  // set the first time step in the series to process.
47  // default is 0.
48  void set_start_index(long s);
49 
50  // set the last time step in the series to process.
51  // default is -1. negative number results in the last
52  // available time step being used.
53  void set_end_index(long s);
54 
55  // set the stride to process time steps at. default
56  // is 1
57  void set_stride(long s);
58 
59  // set the extent to process. the default is the
60  // whole_extent.
61  void set_extent(unsigned long *ext);
62  void set_extent(const std::vector<unsigned long> &ext);
63 
64  // set the bounds to process. If nothging is set then
65  // extent as provided by set_extent is used.
66  void set_bounds(double *bounds);
67  void set_bounds(const std::vector<double> &bounds);
68 
69  // set the list of arrays to process
70  void set_arrays(const std::vector<std::string> &arrays);
71 
72 protected:
74 
75 private:
76  std::vector<teca_metadata> requests;
77  std::string index_initializer_key;
78  std::string index_request_key;
79  long start_index;
80  long end_index;
81  long stride;
82  std::vector<unsigned long> extent;
83  std::vector<double> bounds;
84  std::vector<std::string> arrays;
85 };
86 
87 #endif
teca_metadata
Definition: teca_metadata.h:17
teca_index_executive
Definition: teca_index_executive.h:36
teca_algorithm_executive
Definition: teca_algorithm_executive.h:25