14#include "arcane/utils/ArcanePrecomp.h"
15#include "arcane/utils/TraceAccessor.h"
16#include "arcane/utils/NotImplementedException.h"
17#include "arcane/utils/TraceInfo.h"
18#include "arcane/utils/String.h"
19#include "arcane/utils/PlatformUtils.h"
21#include "arcane/core/IParallelMng.h"
23#include "arcane/parallel/IMultiReduce.h"
37class PostProcessingMng;
55 virtual bool isStrict()
const {
return m_is_strict; }
56 virtual void setStrict(
bool is_strict) { m_is_strict = is_strict; }
62 ReduceSumOfRealHelperMap::const_iterator i = m_sum_helpers.find(name);
64 if (i == m_sum_helpers.end()) {
66 m_sum_helpers.insert(std::make_pair(name, v));
75 typedef std::map<String, ReduceSumOfRealHelper*> ReduceSumOfRealHelperMap;
79 ReduceSumOfRealHelperMap m_sum_helpers;
89IMultiReduce* IMultiReduce::
90create(IParallelMng* pm)
92 return new MultiReduce(pm);
117 ReduceSumOfRealHelperMap::const_iterator i = m_sum_helpers.begin();
118 for (; i != m_sum_helpers.end(); ++i)
120 m_sum_helpers.clear();
130 ReduceSumOfRealHelperMap::const_iterator i = m_sum_helpers.begin();
131 for (; i != m_sum_helpers.end(); ++i)
132 _execStrict(i->second);
146 ReduceSumOfRealHelperMap::const_iterator i = m_sum_helpers.begin();
147 for (; i != m_sum_helpers.end(); ++i) {
149 values[index] = i->second->values()[0];
159 ReduceSumOfRealHelperMap::const_iterator i = m_sum_helpers.begin();
160 for (; i != m_sum_helpers.end(); ++i) {
162 i->second->setReducedValue(values[index]);
180 std::sort(std::begin(all_values), std::end(all_values));
182 for (
Integer i = 0, n = all_values.
size(); i < n; ++i)
183 sum += all_values[i];
Integer size() const
Number of elements in the vector.
Management of multiple reductions.
Interface of the parallelism manager for a subdomain.
virtual void gatherVariable(ConstArrayView< char > send_buf, Array< char > &recv_buf, Int32 rank)=0
Performs an all-gather operation across all processors.
virtual bool isStrict() const
Indicates if strict mode is used.
virtual ReduceSumOfRealHelper * getSumOfReal(const String &name)
Returns the name manager name. If a name manager name does not exist, it is created....
virtual void setStrict(bool is_strict)
Sets the strict mode.
virtual void execute()
Executes the reductions.
Class managing a reduction of a sum of values.
RealConstArrayView values() const
List of accumulated values.
void setReducedValue(Real v)
Positions the reduced value.
Unicode character string.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
@ ReduceSum
Sum of values.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Integer arcaneCheckArraySize(unsigned long long size)
Checks that size can be converted into an 'Integer' to serve as the size of an array....
Int32 Integer
Type representing an integer.
UniqueArray< Real > RealUniqueArray
Dynamic 1D array of reals.
double Real
Type representing a real number.
ArrayView< Real > RealArrayView
C equivalent of a 1D array of reals.