TECA
The Toolkit for Extreme Climate Analysis
teca_cf_block_time_step_mapper Class Reference

Maps time steps to files in fixed sized blocks. More...

#include <teca_cf_block_time_step_mapper.h>

Inheritance diagram for teca_cf_block_time_step_mapper:
[legend]
Collaboration diagram for teca_cf_block_time_step_mapper:
[legend]

Public Member Functions

int initialize (MPI_Comm comm, long first_step, long last_step, long steps_per_file, const std::string &index_request_key)
 
p_teca_cf_layout_manager get_layout_manager (long time_step) override
 given a time step returns the associated layout manager More...
 
int to_stream (std::ostream &os) override
 print a summary to the stream More...
 
virtual p_teca_cf_layout_manager get_layout_manager (long time_step)
 given a time step returns the associated layout manager More...
 
virtual int get_layout_manager (const unsigned long temporal_extent[2], std::vector< p_teca_cf_layout_manager > &managers)
 
- Public Member Functions inherited from teca_cf_time_step_mapper
virtual bool initialized ()
 returns true if the mapper has been successfully initialized More...
 
virtual int finalize ()
 
virtual int get_upstream_requests (teca_metadata base_req, std::vector< teca_metadata > &up_reqs)
 construct requests for this rank More...
 
virtual int get_layout_manager (const unsigned long temporal_extent[2], std::vector< p_teca_cf_layout_manager > &managers)
 
template<typename op_t >
int file_table_apply (const op_t &op)
 

Static Public Member Functions

static p_teca_cf_block_time_step_mapper New ()
 allocate and return a new object More...
 

Protected Member Functions

 teca_cf_block_time_step_mapper (const teca_cf_block_time_step_mapper &)=delete
 
 teca_cf_block_time_step_mapper (const teca_cf_block_time_step_mapper &&)=delete
 
void operator= (const teca_cf_block_time_step_mapper &)=delete
 
void operator= (const teca_cf_block_time_step_mapper &&)=delete
 
int get_file_id (long time_step, long &file_id)
 
- Protected Member Functions inherited from teca_cf_time_step_mapper
 teca_cf_time_step_mapper (const teca_cf_time_step_mapper &)=delete
 
 teca_cf_time_step_mapper (const teca_cf_time_step_mapper &&)=delete
 
void operator= (const teca_cf_time_step_mapper &)=delete
 
void operator= (const teca_cf_time_step_mapper &&)=delete
 
int alloc_file_comms ()
 create/free the per-file communicators More...
 
int free_file_comms ()
 

Protected Attributes

long n_time_steps_per_file
 
- Protected Attributes inherited from teca_cf_time_step_mapper
MPI_Comm comm
 communicator to partition into per-file communicators More...
 
std::string index_initializer_key
 pipeline control key names More...
 
std::string index_request_key
 
long start_time_step
 user provided overrides More...
 
long end_time_step
 
long n_time_steps
 time_steps to request by rank More...
 
std::vector< long > block_size
 
std::vector< long > block_start
 
long n_files
 output files More...
 
std::vector< std::set< int > > file_ranks
 
std::vector< MPI_Comm > file_comms
 per file communicators More...
 
file_table_t file_table
 

Additional Inherited Members

- Protected Types inherited from teca_cf_time_step_mapper
using file_table_t = std::unordered_map< long, p_teca_cf_layout_manager >
 the file table maps from a time step to a specific layout manager More...
 

Detailed Description

Maps time steps to files in fixed sized blocks.

Member Function Documentation

◆ get_layout_manager() [1/3]

virtual int teca_cf_time_step_mapper::get_layout_manager
inline

given an inclusive range of time steps, get the corresponding layout managers that can be used to create, define and write the data to disk. When more than one manager is returned, each should be passed the data, giving it a chance to write the subset it is responsible for to disk.

Parameters
[in]temporal_extentthe first and last step that will be written
[out]managera vector of teca_cf_layout_manager instances that need to be called to write the data.
Returns
zero if successful.

◆ get_layout_manager() [2/3]

virtual p_teca_cf_layout_manager teca_cf_time_step_mapper::get_layout_manager
inline

given a time step returns the associated layout manager

◆ get_layout_manager() [3/3]

p_teca_cf_layout_manager teca_cf_block_time_step_mapper::get_layout_manager ( long  time_step)
overridevirtual

given a time step returns the associated layout manager

Reimplemented from teca_cf_time_step_mapper.

◆ initialize()

int teca_cf_block_time_step_mapper::initialize ( MPI_Comm  comm,
long  first_step,
long  last_step,
long  steps_per_file,
const std::string &  index_request_key 
)

initialize based on input metadata. this is a collective call creates communicator groups for each file and creates the file layout managers for the local rank. After this call on can access file managers to create, define and write local datasets to the NetCDF files in cf format.

◆ New()

static p_teca_cf_block_time_step_mapper teca_cf_block_time_step_mapper::New ( )
inlinestatic

allocate and return a new object

◆ to_stream()

int teca_cf_block_time_step_mapper::to_stream ( std::ostream &  os)
overridevirtual

print a summary to the stream

Implements teca_cf_time_step_mapper.


The documentation for this class was generated from the following file: