1 #ifndef teca_cf_writer_h
2 #define teca_cf_writer_h
4 #include "teca_config.h"
6 #include "teca_threaded_algorithm.h"
7 #include "teca_metadata.h"
84 TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
85 TECA_SET_ALGORITHM_PROPERTIES()
93 TECA_ALGORITHM_PROPERTY(std::
string, file_name)
103 TECA_ALGORITHM_PROPERTY(std::
string, date_format)
110 TECA_ALGORITHM_PROPERTY(
long, first_step)
117 TECA_ALGORITHM_PROPERTY(
long, last_step)
129 enum {invalid=0, number_of_steps=1, daily=2, monthly=3, seasonal=4, yearly=5};
130 TECA_ALGORITHM_PROPERTY_V(
int, layout)
132 void set_layout_to_number_of_steps() { this->set_layout(number_of_steps); }
133 void set_layout_to_daily() { this->set_layout(daily); }
134 void set_layout_to_monthly() { this->set_layout(monthly); }
135 void set_layout_to_seasonal() { this->set_layout(seasonal); }
136 void set_layout_to_yearly() { this->set_layout(yearly); }
144 if ((mode == number_of_steps) || (mode == daily) ||
145 (mode == monthly) || (mode == seasonal) || (mode == yearly))
161 TECA_ALGORITHM_PROPERTY(
unsigned int, steps_per_file)
168 TECA_ALGORITHM_PROPERTY(
int, mode_flags)
181 TECA_ALGORITHM_PROPERTY(
int, use_unlimited_dim)
191 TECA_ALGORITHM_PROPERTY(
int, compression_level)
202 TECA_ALGORITHM_PROPERTY(
int, collective_buffer)
210 TECA_ALGORITHM_PROPERTY(
int, flush_files)
217 TECA_ALGORITHM_PROPERTY(
int, move_variables_to_root)
226 TECA_ALGORITHM_VECTOR_PROPERTY(std::
string, point_array)
233 TECA_ALGORITHM_VECTOR_PROPERTY(std::
string, information_array)
251 TECA_ALGORITHM_PROPERTY_V(
int, partitioner)
254 void set_partitioner(const std::
string &part);
257 void set_partitioner_to_temporal() { this->set_partitioner(temporal); }
268 if ((mode == temporal) || (mode == spatial) || (mode ==space_time))
271 TECA_ERROR(
"Invalid partitioner mode " << mode)
284 TECA_ALGORITHM_PROPERTY(
long, number_of_spatial_partitions)
291 TECA_ALGORITHM_PROPERTY(
int, partition_x)
298 TECA_ALGORITHM_PROPERTY(
int, partition_y)
305 TECA_ALGORITHM_PROPERTY(
int, partition_z)
312 TECA_ALGORITHM_PROPERTY(
long, minimum_block_size_x)
319 TECA_ALGORITHM_PROPERTY(
long, minimum_block_size_y)
326 TECA_ALGORITHM_PROPERTY(
long, minimum_block_size_z)
336 TECA_ALGORITHM_PROPERTY(
long, number_of_temporal_partitions)
345 TECA_ALGORITHM_PROPERTY(
long, temporal_partition_size)
355 TECA_ALGORITHM_PROPERTY(
int, index_executive_compatability)
358 TECA_ALGORITHM_PROPERTY(
int, stride)
367 const_p_teca_dataset execute(
unsigned int port,
368 const std::vector<const_p_teca_dataset> &input_data,
374 std::vector<
teca_metadata> get_upstream_request(
unsigned int port,
383 std::
string file_name;
384 std::
string date_format;
385 long number_of_spatial_partitions;
389 long minimum_block_size_x;
390 long minimum_block_size_y;
391 long minimum_block_size_z;
392 long number_of_temporal_partitions;
393 long temporal_partition_size;
398 int index_executive_compatability;
399 unsigned int steps_per_file;
401 int use_unlimited_dim;
402 int collective_buffer;
403 int compression_level;
405 int move_variables_to_root;
408 std::vector<std::
string> point_arrays;
409 std::vector<std::
string> information_arrays;
412 internals_t *internals;
The interface to TECA pipeline architecture.
Definition: teca_algorithm.h:244
A writer for Cartesian meshes in NetCDF CF2 format.
Definition: teca_cf_writer.h:75
const char * get_partitioner_name() const
void set_partitioner_to_spatial()
enables spatial partitioner
Definition: teca_cf_writer.h:260
void set_partitioner_to_space_time()
enables space-time partitioner
Definition: teca_cf_writer.h:263
int validate_partitioner(int mode)
Definition: teca_cf_writer.h:266
@ spatial
map spatial extents to MPI ranks, time is processed sequentially
Definition: teca_cf_writer.h:247
@ temporal
map time steps to MPI ranks
Definition: teca_cf_writer.h:246
const char * get_layout_name() const
int validate_layout(int mode)
Definition: teca_cf_writer.h:142
int set_layout(const std::string &layout)
set the layout mode from a string.
This is the base class defining a threaded algorithm.
Definition: teca_threaded_algorithm.h:71
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.
#define TECA_ERROR(_msg)
Constructs an error message and sends it to the stderr stream.
Definition: teca_common.h:161