chombo-discharge
Loading...
Searching...
No Matches
CD_ParallelOps.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_PARALLELOPS_H
14#define CD_PARALLELOPS_H
15
16// Chombo includes
17#include <RealVect.H>
18
19// Our includes
20#include <CD_NamespaceHeader.H>
21
25namespace ParallelOps {
26
30 inline void
31 barrier() noexcept;
32
42 partition(int a_N) noexcept;
43
49 inline Real
50 min(const Real& a_input) noexcept;
51
57 inline int
58 min(const int& a_input) noexcept;
59
65 inline long long int
66 min(const long long int& a_input) noexcept;
67
77 min(const Real& a_val, const RealVect& a_pos) noexcept;
78
84 inline Real
85 max(const Real& a_input) noexcept;
86
92 inline int
93 max(const int& a_input) noexcept;
94
100 inline long long
101 max(const long long& a_input) noexcept;
102
112 max(const Real& a_val, const RealVect& a_pos) noexcept;
113
120 maxRank(const Real& a_val) noexcept;
121
128 minRank(const Real& a_val) noexcept;
129
135 inline Real
136 average(const Real& a_val) noexcept;
137
143 inline Real
144 sum(const Real& a_value) noexcept;
145
151 inline int
152 sum(const int& a_value) noexcept;
153
159 inline long
160 sum(const long& a_value) noexcept;
161
167 inline long long
168 sum(const long long& a_value) noexcept;
169
175 inline unsigned long long
176 sum(const unsigned long long& a_value) noexcept;
177
183 inline Real
184 standardDeviation(const Real& a_value) noexcept;
185
192 inline void
193 sum(Vector<Real>& a_data) noexcept;
194
201 inline void
202 sum(Vector<int>& a_data) noexcept;
203
210 inline void
211 sum(Vector<long int>& a_data) noexcept;
212
219 inline void
221
227 inline Vector<int>
228 gather(const int& a_localValue) noexcept;
229
235 inline Vector<Real>
236 gather(const Real& a_localValue) noexcept;
237} // namespace ParallelOps
238
239#include <CD_NamespaceFooter.H>
240
241#include <CD_ParallelOpsImplem.H>
242
243#endif
Implementation of CD_ParallelOps.H.
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26
For putting a bunch of often-used MPI reductions in one place.
Definition CD_ParallelOps.H:25
Real max(const Real &a_input) noexcept
Get the maximum of the input, reduced over MPI ranks (in the Chombo communicator)
Definition CD_ParallelOpsImplem.H:177
std::pair< Real, int > maxRank(const Real &a_val) noexcept
Get the maximum value and the rank having the maximum value.
Definition CD_ParallelOpsImplem.H:294
Real average(const Real &a_val) noexcept
Compute the average (across MPI ranks) of the input value.
Definition CD_ParallelOpsImplem.H:501
Real standardDeviation(const Real &a_value) noexcept
Compute the standard deviation of the input value.
Definition CD_ParallelOpsImplem.H:513
Vector< int > gather(const int &a_localValue) noexcept
Gather local values – return a vector of local values.
Definition CD_ParallelOpsImplem.H:540
std::pair< Real, int > minRank(const Real &a_val) noexcept
Get the minimum value and the rank having the minimum value.
Definition CD_ParallelOpsImplem.H:324
Real min(const Real &a_input) noexcept
Get the minimum of the input, reduced over MPI ranks (in the Chombo communicator)
Definition CD_ParallelOpsImplem.H:59
Real sum(const Real &a_value) noexcept
Compute the sum across all MPI ranks.
Definition CD_ParallelOpsImplem.H:354
std::pair< int, int > partition(int a_N) noexcept
Partition the input number such that each MPI rank gets an equal chunk. We assume that N is the lengt...
Definition CD_ParallelOpsImplem.H:36
void barrier() noexcept
MPI barrier.
Definition CD_ParallelOpsImplem.H:26