14#include "arcane/utils/ArcanePrecomp.h"
16#include "arcane/utils/ArrayView.h"
18#include "arcane/utils/Real2.h"
19#include "arcane/utils/Real3.h"
20#include "arcane/utils/Real2x2.h"
21#include "arcane/utils/Real3x3.h"
22#include "arcane/utils/HPReal.h"
24#include "arcane/core/ParallelNonBlockingCollectiveDispatcher.h"
25#include "arcane/core/IParallelMng.h"
26#include "arcane/core/Timer.h"
39ParallelNonBlockingCollectiveDispatcher::
52, m_unsigned_long_long(0)
67ParallelNonBlockingCollectiveDispatcher::
68~ParallelNonBlockingCollectiveDispatcher()
72 delete m_unsigned_char;
74 delete m_unsigned_short;
76 delete m_unsigned_int;
78 delete m_unsigned_long;
80 delete m_unsigned_long_long;
81#ifdef ARCANE_REAL_NOT_BUILTIN
97void ParallelNonBlockingCollectiveDispatcher::
98_setDispatchers(IParallelNonBlockingCollectiveDispatchT<char>* c,
99 IParallelNonBlockingCollectiveDispatchT<signed char>* sc,
100 IParallelNonBlockingCollectiveDispatchT<unsigned char>* uc,
101 IParallelNonBlockingCollectiveDispatchT<short>* s,
102 IParallelNonBlockingCollectiveDispatchT<unsigned short>* us,
103 IParallelNonBlockingCollectiveDispatchT<int>* i,
104 IParallelNonBlockingCollectiveDispatchT<unsigned int>* ui,
105 IParallelNonBlockingCollectiveDispatchT<long>* l,
106 IParallelNonBlockingCollectiveDispatchT<unsigned long>* ul,
107 IParallelNonBlockingCollectiveDispatchT<long long>* ll,
108 IParallelNonBlockingCollectiveDispatchT<unsigned long long>* ull,
109#ifdef ARCANE_REAL_NOT_BUILTIN
110 IParallelNonBlockingCollectiveDispatchT<Real>* r,
112 IParallelNonBlockingCollectiveDispatchT<float>* f,
113 IParallelNonBlockingCollectiveDispatchT<double>* d,
114 IParallelNonBlockingCollectiveDispatchT<long double>* ld,
115 IParallelNonBlockingCollectiveDispatchT<Real2>* r2,
116 IParallelNonBlockingCollectiveDispatchT<Real3>* r3,
117 IParallelNonBlockingCollectiveDispatchT<Real2x2>* r22,
118 IParallelNonBlockingCollectiveDispatchT<Real3x3>* r33,
119 IParallelNonBlockingCollectiveDispatchT<HPReal>* hpr)
123 m_unsigned_char = uc;
125 m_unsigned_short = us;
129 m_unsigned_long = ul;
131 m_unsigned_long_long = ull;
132#ifdef ARCANE_REAL_NOT_BUILTIN
148ITimeStats* ParallelNonBlockingCollectiveDispatcher::
151 return m_parallel_mng->timeStats();
157#define ARCANE_PARALLEL_MANAGER_DISPATCH(field, type) \
158 Parallel::Request ParallelNonBlockingCollectiveDispatcher:: \
159 allGather(ConstArrayView<type> send_buf, ArrayView<type> recv_buf) \
161 Timer::Phase tphase(timeStats(), TP_Communication); \
162 return field->allGather(send_buf, recv_buf); \
164 Parallel::Request ParallelNonBlockingCollectiveDispatcher:: \
165 gather(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer rank) \
167 Timer::Phase tphase(timeStats(), TP_Communication); \
168 return field->gather(send_buf, recv_buf, rank); \
170 Parallel::Request ParallelNonBlockingCollectiveDispatcher:: \
171 allGatherVariable(ConstArrayView<type> send_buf, Array<type>& recv_buf) \
173 Timer::Phase tphase(timeStats(), TP_Communication); \
174 return field->allGatherVariable(send_buf, recv_buf); \
176 Parallel::Request ParallelNonBlockingCollectiveDispatcher:: \
177 gatherVariable(ConstArrayView<type> send_buf, Array<type>& recv_buf, Integer rank) \
179 Timer::Phase tphase(timeStats(), TP_Communication); \
180 return field->gatherVariable(send_buf, recv_buf, rank); \
182 Parallel::Request ParallelNonBlockingCollectiveDispatcher:: \
183 scatterVariable(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer root) \
185 Timer::Phase tphase(timeStats(), TP_Communication); \
186 return field->scatterVariable(send_buf, recv_buf, root); \
188 Parallel::Request ParallelNonBlockingCollectiveDispatcher:: \
189 allReduce(eReduceType rt, ConstArrayView<type> send_buf, ArrayView<type> v) \
191 Timer::Phase tphase(timeStats(), TP_Communication); \
192 return field->allReduce(rt, send_buf, v); \
194 Parallel::Request ParallelNonBlockingCollectiveDispatcher:: \
195 broadcast(ArrayView<type> send_buf, Integer id) \
197 Timer::Phase tphase(timeStats(), TP_Communication); \
198 return field->broadcast(send_buf, id); \
200 Parallel::Request ParallelNonBlockingCollectiveDispatcher:: \
201 allToAll(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer count) \
203 Timer::Phase tphase(timeStats(), TP_Communication); \
204 return field->allToAll(send_buf, recv_buf, count); \
206 Parallel::Request ParallelNonBlockingCollectiveDispatcher:: \
207 allToAllVariable(ConstArrayView<type> send_buf, Int32ConstArrayView send_count, \
208 Int32ConstArrayView send_index, ArrayView<type> recv_buf, \
209 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) \
211 Timer::Phase tphase(timeStats(), TP_Communication); \
212 return field->allToAllVariable(send_buf, send_count, send_index, recv_buf, recv_count, recv_index); \
214 IParallelNonBlockingCollectiveDispatchT<type>* ParallelNonBlockingCollectiveDispatcher:: \
220ARCANE_PARALLEL_MANAGER_DISPATCH(m_char,
char)
221ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_char,
unsigned char)
222ARCANE_PARALLEL_MANAGER_DISPATCH(m_signed_char,
signed char)
223ARCANE_PARALLEL_MANAGER_DISPATCH(m_short,
short)
224ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_short,
unsigned short)
225ARCANE_PARALLEL_MANAGER_DISPATCH(m_int,
int)
226ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_int,
unsigned int)
227ARCANE_PARALLEL_MANAGER_DISPATCH(m_long,
long)
228ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_long,
unsigned long)
229ARCANE_PARALLEL_MANAGER_DISPATCH(m_long_long,
long long)
230ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_long_long,
unsigned long long)
231ARCANE_PARALLEL_MANAGER_DISPATCH(m_float,
float)
232ARCANE_PARALLEL_MANAGER_DISPATCH(m_double,
double)
233ARCANE_PARALLEL_MANAGER_DISPATCH(m_long_double,
long double)
234#ifdef ARCANE_REAL_NOT_BUILTIN
235ARCANE_PARALLEL_MANAGER_DISPATCH(m_real, Real)
237ARCANE_PARALLEL_MANAGER_DISPATCH(m_real2, Real2)
238ARCANE_PARALLEL_MANAGER_DISPATCH(m_real3, Real3)
239ARCANE_PARALLEL_MANAGER_DISPATCH(m_real2x2, Real2x2)
240ARCANE_PARALLEL_MANAGER_DISPATCH(m_real3x3, Real3x3)
241ARCANE_PARALLEL_MANAGER_DISPATCH(m_hpreal, HPReal)
Interface of the parallelism manager for a subdomain.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --