chombo-discharge
Loading...
Searching...
No Matches
Functions
ParallelOps Namespace Reference

For putting a bunch of often-used MPI reductions in one place. More...

Functions

void barrier () noexcept
 MPI barrier.
 
std::pair< int, intpartition (const int a_N) noexcept
 Partition the input number such that each MPI rank gets an equal chunk. We assume that N is the length of some container whose indexing starts at 0.
 
Real min (const Real &a_input) noexcept
 Get the minimum of the input, reduced over MPI ranks (in the Chombo communicator)
 
int min (const int &a_input) noexcept
 Get the minimum of the input, reduced over MPI ranks (in the Chombo communicator)
 
long long int min (const long long int &a_input) noexcept
 Get the minimum of the input, reduced over MPI ranks (in the Chombo communicator)
 
std::pair< Real, RealVectmin (const Real &a_val, const RealVect &a_pos) noexcept
 Get the minimum value and the position corresponding to the minimum value of a_val.
 
Real max (const Real &a_input) noexcept
 Get the maximum of the input, reduced over MPI ranks (in the Chombo communicator)
 
int max (const int &a_input) noexcept
 Get the maximum of the input, reduced over MPI ranks (in the Chombo communicator)
 
long long max (const long long &a_input) noexcept
 Get the maximum of the input, reduced over MPI ranks (in the Chombo communicator)
 
std::pair< Real, RealVectmax (const Real &a_val, const RealVect &a_pos) noexcept
 Get the maximum value and the position corresponding to the maximum value of a_val.
 
std::pair< Real, intmaxRank (const Real &a_val) noexcept
 Get the maximum value and the rank having the maximum value.
 
std::pair< Real, intminRank (const Real &a_val) noexcept
 Get the minimum value and the rank having the minimum value.
 
Real average (const Real &a_val) noexcept
 Compute the average (across MPI ranks) of the input value.
 
Real sum (const Real &a_value) noexcept
 Compute the sum across all MPI ranks.
 
int sum (const int &a_value) noexcept
 Compute the sum across all MPI ranks.
 
long sum (const long &a_value) noexcept
 Compute the sum across all MPI ranks.
 
long long sum (const long long &a_value) noexcept
 Compute the sum across all MPI ranks.
 
unsigned long long sum (const unsigned long long &a_value) noexcept
 Compute the sum across all MPI ranks.
 
Real standardDeviation (const Real &a_value) noexcept
 Compute the standard deviation of the input value.
 
void sum (Vector< Real > &a_data) noexcept
 Perform a summation of all the MPI ranks's input data.
 
void sum (Vector< int > &a_data) noexcept
 Perform a summation of all the MPI ranks's input data.
 
void sum (Vector< long int > &a_data) noexcept
 Perform a summation of all the MPI ranks's input data.
 
void sum (Vector< long long int > &a_data) noexcept
 Perform a summation of all the MPI ranks's input data.
 
Vector< intgather (const int &a_localValue) noexcept
 Gather local values – return a vector of local values.
 
Vector< Realgather (const Real &a_localValue) noexcept
 Gather local values – return a vector of local values.
 

Detailed Description

For putting a bunch of often-used MPI reductions in one place.

Function Documentation

◆ average()

Real ParallelOps::average ( const Real a_val)
inlinenoexcept

Compute the average (across MPI ranks) of the input value.

Parameters
[in]a_valValue to take the average of

◆ gather() [1/2]

Vector< int > ParallelOps::gather ( const int a_localValue)
inlinenoexcept

Gather local values – return a vector of local values.

Parameters
[in]a_localValueLocal value per MPI rank

◆ gather() [2/2]

Vector< Real > ParallelOps::gather ( const Real a_localValue)
inlinenoexcept

Gather local values – return a vector of local values.

Parameters
[in]a_localValueLocal value per MPI rank

◆ max() [1/4]

int ParallelOps::max ( const int a_input)
inlinenoexcept

Get the maximum of the input, reduced over MPI ranks (in the Chombo communicator)

Parameters
[in]a_inputData input.

◆ max() [2/4]

long long ParallelOps::max ( const long long a_input)
inlinenoexcept

Get the maximum of the input, reduced over MPI ranks (in the Chombo communicator)

Parameters
[in]a_inputData input.

◆ max() [3/4]

Real ParallelOps::max ( const Real a_input)
inlinenoexcept

Get the maximum of the input, reduced over MPI ranks (in the Chombo communicator)

Parameters
[in]a_inputData input.

◆ max() [4/4]

std::pair< Real, RealVect > ParallelOps::max ( const Real a_val,
const RealVect a_pos 
)
inlinenoexcept

Get the maximum value and the position corresponding to the maximum value of a_val.

This returns the value a_val and position a_pos such that they correspond to the input variables for the processer which held the largest value a_val.

◆ maxRank()

std::pair< Real, int > ParallelOps::maxRank ( const Real a_val)
inlinenoexcept

Get the maximum value and the rank having the maximum value.

Parameters
[in]a_valValue to be compared.

◆ min() [1/4]

int ParallelOps::min ( const int a_input)
inlinenoexcept

Get the minimum of the input, reduced over MPI ranks (in the Chombo communicator)

Parameters
[in]a_inputData input. Returns the smallest.

◆ min() [2/4]

long long int ParallelOps::min ( const long long int a_input)
inlinenoexcept

Get the minimum of the input, reduced over MPI ranks (in the Chombo communicator)

Parameters
[in]a_inputData input. Returns the smallest.

◆ min() [3/4]

Real ParallelOps::min ( const Real a_input)
inlinenoexcept

Get the minimum of the input, reduced over MPI ranks (in the Chombo communicator)

Parameters
[in]a_inputData input. Returns the smallest.

◆ min() [4/4]

std::pair< Real, RealVect > ParallelOps::min ( const Real a_val,
const RealVect a_pos 
)
inlinenoexcept

Get the minimum value and the position corresponding to the minimum value of a_val.

This returns the value a_val and position a_pos such that they correspond to the input variables for the processer which held the smallest value a_val.

◆ minRank()

std::pair< Real, int > ParallelOps::minRank ( const Real a_val)
inlinenoexcept

Get the minimum value and the rank having the minimum value.

Parameters
[in]a_valValue to be compared.

◆ partition()

std::pair< int, int > ParallelOps::partition ( const int  a_N)
inlinenoexcept

Partition the input number such that each MPI rank gets an equal chunk. We assume that N is the length of some container whose indexing starts at 0.

Returns start/stop indices along N. For example, if using two MPI ranks with N = 10 the first rank obtains pair(0,4) and the second rank get (5,9)

Parameters
[in]a_NSome container size.

◆ standardDeviation()

Real ParallelOps::standardDeviation ( const Real a_value)
inlinenoexcept

Compute the standard deviation of the input value.

Parameters
[in]a_valueValue to compute the standard deviation of.

◆ sum() [1/9]

int ParallelOps::sum ( const int a_value)
inlinenoexcept

Compute the sum across all MPI ranks.

Parameters
[in]a_valueValue to the take the sum of.

◆ sum() [2/9]

long ParallelOps::sum ( const long a_value)
inlinenoexcept

Compute the sum across all MPI ranks.

Parameters
[in]a_valueValue to the take the sum of.

◆ sum() [3/9]

long long ParallelOps::sum ( const long long a_value)
inlinenoexcept

Compute the sum across all MPI ranks.

Parameters
[in]a_valueValue to the take the sum of.

◆ sum() [4/9]

Real ParallelOps::sum ( const Real a_value)
inlinenoexcept

Compute the sum across all MPI ranks.

Parameters
[in]a_valueValue to the take the sum of.

◆ sum() [5/9]

unsigned long long ParallelOps::sum ( const unsigned long long a_value)
inlinenoexcept

Compute the sum across all MPI ranks.

Parameters
[in]a_valueValue to the take the sum of.

◆ sum() [6/9]

void ParallelOps::sum ( Vector< int > &  a_data)
inlinenoexcept

Perform a summation of all the MPI ranks's input data.

This performs a rank-wise summation. If rank 1 has data (1,2,3) and rank 2 has data (3,4,5), the output data on both ranks is (4,6,8).

Parameters
[in,out]a_dataOn

◆ sum() [7/9]

void ParallelOps::sum ( Vector< long int > &  a_data)
inlinenoexcept

Perform a summation of all the MPI ranks's input data.

This performs a rank-wise summation. If rank 1 has data (1,2,3) and rank 2 has data (3,4,5), the output data on both ranks is (4,6,8).

Parameters
[in,out]a_dataOn

◆ sum() [8/9]

void ParallelOps::sum ( Vector< long long int > &  a_data)
inlinenoexcept

Perform a summation of all the MPI ranks's input data.

This performs a rank-wise summation. If rank 1 has data (1,2,3) and rank 2 has data (3,4,5), the output data on both ranks is (4,6,8).

Parameters
[in,out]a_dataOn

◆ sum() [9/9]

void ParallelOps::sum ( Vector< Real > &  a_data)
inlinenoexcept

Perform a summation of all the MPI ranks's input data.

This performs a rank-wise summation. If rank 1 has data (1,2,3) and rank 2 has data (3,4,5), the output data on both ranks is (4,6,8).

Parameters
[in,out]a_dataOn