TECA
The Toolkit for Extreme Climate Analysis
teca_index_executive Class Reference

An executive that generates requests using a upstream or user defined index. More...

#include <teca_index_executive.h>

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

Public Member Functions

std::shared_ptr< teca_index_executiveshared_from_this ()
 
std::shared_ptr< teca_index_executive const > shared_from_this () const
 
int initialize (MPI_Comm comm, const teca_metadata &md) override
 
teca_metadata get_next_request () override
 
void set_index (long s)
 set the index to process More...
 
void set_start_index (long s)
 
void set_end_index (long s)
 
void set_stride (long s)
 Set the stride to process time steps at. The default is 1. More...
 
void set_extent (unsigned long *ext)
 Set the extent to process. The default is taken from whole_extent key. More...
 
void set_extent (const std::vector< unsigned long > &ext)
 Set the extent to process. The default is taken from whole_extent key. More...
 
void set_bounds (double *bounds)
 
void set_bounds (const std::vector< double > &bounds)
 
void set_arrays (const std::vector< std::string > &arrays)
 Set the list of arrays to process. More...
 
void set_device_ids (const std::vector< int > &device_ids)
 Set the list of devices to assign work to. More...
 
- Public Member Functions inherited from teca_algorithm_executive
void set_verbose (int a_verbose)
 
int get_verbose () const
 

Static Public Member Functions

static p_teca_index_executive New ()
 
- Static Public Member Functions inherited from teca_algorithm_executive
static p_teca_algorithm_executive New ()
 

Additional Inherited Members

- Protected Member Functions inherited from teca_algorithm_executive
 teca_algorithm_executive (const teca_algorithm_executive &)=default
 
 teca_algorithm_executive (teca_algorithm_executive &&)=default
 
teca_algorithm_executiveoperator= (const teca_algorithm_executive &)=default
 
teca_algorithm_executiveoperator= (teca_algorithm_executive &&)=default
 

Detailed Description

An executive that generates requests using a upstream or user defined index.

An extent or bounds to subset by, and list of arrays can be optionally set. This executive partitions an index set approximately equally accross the available MPI ranks. Each rank is assigned a unique set of CUDA devices if CUDA devices are available. Within each rank requests are issued to the assigned CUDA devices by setting the device_id key in the request. Upstream algorithms should examine the device_id key and use the given device for calculaitons. A device_id of -1 indicates that the CPU should be used for calculations. Algorithms that do not have a CUDA implementation will make use of the CPU and ignore the device_id field.

Metadata keys:

Requires:

Key Description
index_initializer_key holds the name of the key that tells how many
indices are available. the named key must also be
present and should contain the number of indices
available
index_request_key holds the name of the key used to request a
specific index. request are generated with this
name set to a specific index to be processed some
upstream algorithm is expected to produce the
data associated with the given index

Exports:

Key Description
index_request_key The name of the key holding the requested index
<index_request_key> the requested index
device_id the CPU (-1) or CUDA device (0 - n-1 devices) to
use for calculations
bounds the [x0 x1 y0 y1 z0 z1] spatial bounds requested
(optional)
extent the [i0 i1 j0 j1 k0 k1] index space grid extent
requested (optional)
arrays a list of arrays requested (optional)

Member Function Documentation

◆ New()

static p_teca_index_executive teca_index_executive::New ( )
inlinestatic

Allocate a new teca_index_executive

◆ set_arrays()

void teca_index_executive::set_arrays ( const std::vector< std::string > &  arrays)

Set the list of arrays to process.

◆ set_bounds()

void teca_index_executive::set_bounds ( double *  bounds)

Set the bounds to process. If nothing is set then extent as provided by ::set_extent is used.

◆ set_device_ids()

void teca_index_executive::set_device_ids ( const std::vector< int > &  device_ids)

Set the list of devices to assign work to.

◆ set_end_index()

void teca_index_executive::set_end_index ( long  s)

Set the last time step in the series to process. default is -1. negative number results in the last available time step being used.

◆ set_extent() [1/2]

void teca_index_executive::set_extent ( const std::vector< unsigned long > &  ext)

Set the extent to process. The default is taken from whole_extent key.

◆ set_extent() [2/2]

void teca_index_executive::set_extent ( unsigned long *  ext)

Set the extent to process. The default is taken from whole_extent key.

◆ set_index()

void teca_index_executive::set_index ( long  s)

set the index to process

◆ set_stride()

void teca_index_executive::set_stride ( long  s)

Set the stride to process time steps at. The default is 1.


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