UFO
ufo::ParallelObsDistribution Class Reference

Describes how observations in an ObsSpace are distributed across MPI processes. More...

#include <ParallelObsDistribution.h>

Public Member Functions

 ParallelObsDistribution (const ioda::ObsSpace &obsspace)
 Construct an object describing the distribution of observations in obsspace across MPI processes. More...
 
size_t globalObsCount () const
 Return the total number of observations held by all MPI processes. More...
 
const std::vector< int > & localObsCounts () const
 Return a vector whose ith element is the number of observations held by the MPI process with rank i. More...
 
const std::vector< int > & localObsIdDisplacements () const
 Return a vector whose ith element is the total number of observations held by the MPI processes with ranks less than i. More...
 

Private Attributes

size_t globalObsCount_
 
std::vector< int > localObsCounts_
 
std::vector< int > localObsIdDisplacements_
 

Related Functions

(Note that these are not member functions.)

template<typename T >
std::vector< T > getGlobalVariableValues (const ioda::ObsSpace &obsspace, const ParallelObsDistribution &obsDistribution, const std::string &variable, const std::string &group)
 Return a vector containing the values of variable variable@group for all observations held by process 0, then all observations held by process 1 etc. More...
 

Detailed Description

Describes how observations in an ObsSpace are distributed across MPI processes.

Definition at line 19 of file src/ufo/utils/ParallelObsDistribution.h.

Constructor & Destructor Documentation

◆ ParallelObsDistribution()

ufo::ParallelObsDistribution::ParallelObsDistribution ( const ioda::ObsSpace &  obsspace)
explicit

Construct an object describing the distribution of observations in obsspace across MPI processes.

Definition at line 13 of file ParallelObsDistribution.cc.

Member Function Documentation

◆ globalObsCount()

size_t ufo::ParallelObsDistribution::globalObsCount ( ) const
inline

Return the total number of observations held by all MPI processes.

Definition at line 26 of file src/ufo/utils/ParallelObsDistribution.h.

Here is the caller graph for this function:

◆ localObsCounts()

const std::vector<int>& ufo::ParallelObsDistribution::localObsCounts ( ) const
inline

Return a vector whose ith element is the number of observations held by the MPI process with rank i.

The returned vector can be passed to the recvcounts parameter of eckit::mpi::Comm::allGatherv().

Definition at line 33 of file src/ufo/utils/ParallelObsDistribution.h.

Here is the caller graph for this function:

◆ localObsIdDisplacements()

const std::vector<int>& ufo::ParallelObsDistribution::localObsIdDisplacements ( ) const
inline

Return a vector whose ith element is the total number of observations held by the MPI processes with ranks less than i.

The returned vector can be passed to the recvcounts parameter of eckit::mpi::Comm::displs().

Definition at line 40 of file src/ufo/utils/ParallelObsDistribution.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ getGlobalVariableValues()

template<typename T >
std::vector< T > getGlobalVariableValues ( const ioda::ObsSpace &  obsspace,
const ParallelObsDistribution obsDistribution,
const std::string &  variable,
const std::string &  group 
)
related

Return a vector containing the values of variable variable@group for all observations held by process 0, then all observations held by process 1 etc.

Template Parameters
TType of the variable values. Must be int, float, double or util::DateTime, otherwise a linking error will occur.

Definition at line 30 of file ParallelObsDistribution.cc.

Member Data Documentation

◆ globalObsCount_

size_t ufo::ParallelObsDistribution::globalObsCount_
private

Definition at line 43 of file src/ufo/utils/ParallelObsDistribution.h.

◆ localObsCounts_

std::vector<int> ufo::ParallelObsDistribution::localObsCounts_
private

Definition at line 44 of file src/ufo/utils/ParallelObsDistribution.h.

◆ localObsIdDisplacements_

std::vector<int> ufo::ParallelObsDistribution::localObsIdDisplacements_
private

Definition at line 45 of file src/ufo/utils/ParallelObsDistribution.h.


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