chombo-discharge
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, int > partition (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. More...
 
Real min (const Real &a_input) noexcept
 Get the minimum of the input, reduced over MPI ranks (in the Chombo communicator) More...
 
int min (const int &a_input) noexcept
 Get the minimum of the input, reduced over MPI ranks (in the Chombo communicator) More...
 
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) More...
 
std::pair< Real, RealVect > min (const Real &a_val, const RealVect &a_pos) noexcept
 Get the minimum value and the position corresponding to the minimum value of a_val. More...
 
Real max (const Real &a_input) noexcept
 Get the maximum of the input, reduced over MPI ranks (in the Chombo communicator) More...
 
int max (const int &a_input) noexcept
 Get the maximum of the input, reduced over MPI ranks (in the Chombo communicator) More...
 
long long max (const long long &a_input) noexcept
 Get the maximum of the input, reduced over MPI ranks (in the Chombo communicator) More...
 
std::pair< Real, RealVect > max (const Real &a_val, const RealVect &a_pos) noexcept
 Get the maximum value and the position corresponding to the maximum value of a_val. More...
 
std::pair< Real, int > maxRank (const Real &a_val) noexcept
 Get the maximum value and the rank having the maximum value. More...
 
std::pair< Real, int > minRank (const Real &a_val) noexcept
 Get the minimum value and the rank having the minimum value. More...
 
Real average (const Real &a_val) noexcept
 Compute the average (across MPI ranks) of the input value. More...
 
Real sum (const Real &a_value) noexcept
 Compute the sum across all MPI ranks. More...
 
int sum (const int &a_value) noexcept
 Compute the sum across all MPI ranks. More...
 
long sum (const long &a_value) noexcept
 Compute the sum across all MPI ranks. More...
 
long long sum (const long long &a_value) noexcept
 Compute the sum across all MPI ranks. More...
 
unsigned long long sum (const unsigned long long &a_value) noexcept
 Compute the sum across all MPI ranks. More...
 
Real standardDeviation (const Real &a_value) noexcept
 Compute the standard deviation of the input value. More...
 
void vectorSum (Vector< Real > &a_data) noexcept
 Perform a summation of all the MPI ranks's input data. More...
 
void vectorSum (Vector< int > &a_data) noexcept
 Perform a summation of all the MPI ranks's input data. More...
 
void vectorSum (Vector< long int > &a_data) noexcept
 Perform a summation of all the MPI ranks's input data. More...
 
void vectorSum (Vector< long long int > &a_data) noexcept
 Perform a summation of all the MPI ranks's input data. More...
 

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

◆ 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/5]

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/5]

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/5]

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/5]

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/5]

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.

◆ vectorSum() [1/4]

void ParallelOps::vectorSum ( 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

◆ vectorSum() [2/4]

void ParallelOps::vectorSum ( 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

◆ vectorSum() [3/4]

void ParallelOps::vectorSum ( 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

◆ vectorSum() [4/4]

void ParallelOps::vectorSum ( 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