IOSS 2.0

Public Types | Public Member Functions | Private Attributes | List of all members
Ioss::ParallelUtils Class Reference

`#include <Ioss_ParallelUtils.h>`

## Public Types
enum | MinMax { DO_MAX, DO_MIN, DO_SUM }

## Public Member Functions
| ParallelUtils (MPI_Comm the_communicator)
| ~ParallelUtils ()=default
bool | get_environment (const std::string &name, std::string &value, bool sync_parallel) const
void | add_environment_properties (Ioss::PropertyManager &properties, bool do_print)
bool | get_environment (const std::string &name, int &value, bool sync_parallel) const
bool | get_environment (const std::string &name, bool sync_parallel) const
std::string | decode_filename (const std::string &filename, bool is_parallel) const
MPI_Comm | communicator () const
int | parallel_size () const
int | parallel_rank () const
void | attribute_reduction (int length, char buffer[]) const
int64_t | generate_guid (size_t id, int rank=-1) const
void | memory_stats (int64_t &min, int64_t &max, int64_t &avg) const
void | hwm_memory_stats (int64_t &min, int64_t &max, int64_t &avg) const
void | global_count (const IntVector &local_counts, IntVector &global_counts) const
void | global_count (const Int64Vector &local_counts, Int64Vector &global_counts) const
template<typename T >
T | global_minmax (T local_minmax, MinMax which) const
template<typename T >
void | global_array_minmax (std::vector< T > &local_minmax, MinMax which) const
template<typename T >
void | global_array_minmax (T *local_minmax, size_t count, MinMax which) const
template<typename T >
void | gather (T my_value, std::vector< T > &result) const
template<typename T >
void | all_gather (T my_value, std::vector< T > &result) const
template<typename T >
void | gather (std::vector< T > &my_values, std::vector< T > &result) const
void | progress (const std::string &output) const

## Private Attributes
MPI_Comm | communicator_

## Member Enumeration Documentation

## ◆ MinMax

enum Ioss::ParallelUtils::MinMax

Enumerator
DO_MAX |
DO_MIN |
DO_SUM |

## Constructor & Destructor Documentation

## ◆ ParallelUtils()

Ioss::ParallelUtils::ParallelUtils | ( | MPI_Comm | the_communicator | ) |
| explicit

## ◆ ~ParallelUtils()

Ioss::ParallelUtils::~ParallelUtils | ( |  | ) |
| default

## Member Function Documentation

## ◆ add_environment_properties()

void Ioss::ParallelUtils::add_environment_properties | ( | Ioss::PropertyManager & | properties,
|  | bool | do_print
| ) |  |

See if any external properties specified via the IOSS_PROPERTIES environment variable. If any found, add to `properties`. If `do_print` then output to cerr which properties were set

## ◆ all_gather()

template<typename T >

void Ioss::ParallelUtils::all_gather | ( | T | my_value,
|  | std::vector< T > & | result
| ) |  | const

## ◆ attribute_reduction()

void Ioss::ParallelUtils::attribute_reduction | ( | int | length,
|  | char | buffer[]
| ) |  | const

Global OR of attribute strings, the processors which have no knowledge of the value should initialize to '0' and the processors with knowledge set the appropriate values.

## ◆ communicator()

MPI_Comm Ioss::ParallelUtils::communicator | ( |  | ) | const
| inline

## ◆ decode_filename()

std::string Ioss::ParallelUtils::decode_filename | ( | const std::string & | filename,
|  | bool | is_parallel
| ) |  | const

## ◆ gather() [1/2]

template<typename T >

void Ioss::ParallelUtils::gather | ( | T | my_value,
|  | std::vector< T > & | result
| ) |  | const

## ◆ gather() [2/2]

template<typename T >

void Ioss::ParallelUtils::gather | ( | std::vector< T > & | my_values,
|  | std::vector< T > & | result
| ) |  | const

## ◆ generate_guid()

int64_t Ioss::ParallelUtils::generate_guid | ( | size_t | id,
|  | int | rank = `-1`
| ) |  | const

Generate a "globally unique id" which is unique over all entities of a specific type over all processors. Used by some applications for uniquely identifying an entity. If `rank` == -1, then use parallel_rank; otherwise use rank

## ◆ get_environment() [1/3]

bool Ioss::ParallelUtils::get_environment | ( | const std::string & | name,
|  | std::string & | value,
|  | bool | sync_parallel
| ) |  | const

Returns 'true' if 'name' is defined in the environment. The value of the environment variable is returned in 'value'. getenv system call is only done on processor 0. If '!sync_parallel', then don't push to other processors.

## ◆ get_environment() [2/3]

bool Ioss::ParallelUtils::get_environment | ( | const std::string & | name,
|  | int & | value,
|  | bool | sync_parallel
| ) |  | const

Returns 'true' if 'name' is defined in the environment. The value of the environment variable is converted to an integer via the atoi library call and returned in 'value'. No checking is done to ensure that the environment variable points to a valid integer. getenv system call is only done on processor 0. If '!sync_parallel', then don't push to other processors.

## ◆ get_environment() [3/3]

bool Ioss::ParallelUtils::get_environment | ( | const std::string & | name,
|  | bool | sync_parallel
| ) |  | const

Returns 'true' if 'name' is defined in the environment no matter what the value. Returns false otherwise. getenv system call is only done on processor 0. If '!sync_parallel', then don't push to other processors.

## ◆ global_array_minmax() [1/2]

template<typename T >

void Ioss::ParallelUtils::global_array_minmax | ( | std::vector< T > & | local_minmax,
|  | MinMax | which
| ) |  | const

## ◆ global_array_minmax() [2/2]

template<typename T >

void Ioss::ParallelUtils::global_array_minmax | ( | T * | local_minmax,
|  | size_t | count,
|  | MinMax | which
| ) |  | const

## ◆ global_count() [1/2]

void Ioss::ParallelUtils::global_count | ( | const IntVector & | local_counts,
|  | IntVector & | global_counts
| ) |  | const

Vector 'local_counts' contains the number of objects local to this processor. On exit, global_counts contains the total number of objects on all processors. Assumes that ordering is the same on all processors

## ◆ global_count() [2/2]

void Ioss::ParallelUtils::global_count | ( | const Int64Vector & | local_counts,
|  | Int64Vector & | global_counts
| ) |  | const

## ◆ global_minmax()

template<typename T >

T Ioss::ParallelUtils::global_minmax | ( | T | local_minmax,
|  | MinMax | which
| ) |  | const

## ◆ hwm_memory_stats()

void Ioss::ParallelUtils::hwm_memory_stats | ( | int64_t & | min,
|  | int64_t & | max,
|  | int64_t & | avg
| ) |  | const

Return high-water-mark min, max, average memory used by any process

## ◆ memory_stats()

void Ioss::ParallelUtils::memory_stats | ( | int64_t & | min,
|  | int64_t & | max,
|  | int64_t & | avg
| ) |  | const

Return min, max, average memory used by any process

## ◆ parallel_rank()

int Ioss::ParallelUtils::parallel_rank | ( |  | ) | const

## ◆ parallel_size()

int Ioss::ParallelUtils::parallel_size | ( |  | ) | const

## ◆ progress()

void Ioss::ParallelUtils::progress | ( | const std::string & | output | ) | const

## Member Data Documentation

## ◆ communicator_

MPI_Comm Ioss::ParallelUtils::communicator_
| private

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

- src/Ioss_ParallelUtils.h
- src/Ioss_ParallelUtils.C