Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ParallelMngDispatcher.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ParallelMngDispatcher.cc (C) 2000-2025 */
9/* */
10/* Redirection of message handling based on argument type. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/Array.h"
15#include "arcane/utils/HPReal.h"
16#include "arcane/utils/NumericTypes.h"
17#include "arcane/utils/NotImplementedException.h"
18#include "arcane/utils/ScopedPtr.h"
19#include "arcane/utils/ITraceMng.h"
20#include "arcane/utils/ValueConvert.h"
21#include "arcane/utils/FatalErrorException.h"
22
23#include "arcane/core/ParallelMngDispatcher.h"
24#include "arcane/core/IParallelDispatch.h"
25#include "arcane/core/Timer.h"
26#include "arcane/core/ITimeStats.h"
27#include "arcane/core/IParallelNonBlockingCollective.h"
28#include "arcane/core/internal/ParallelMngInternal.h"
29
30#include "arcane/accelerator/core/Runner.h"
31#include "arcane/accelerator/core/RunQueueBuildInfo.h"
32
33#include "arccore/message_passing/Dispatchers.h"
35#include "arccore/message_passing/MessagePassingMng.h"
36#include "arccore/message_passing/IControlDispatcher.h"
37#include "arccore/message_passing/ISerializeDispatcher.h"
38#include "arccore/message_passing/PointToPointMessageInfo.h"
39#include "arccore/message_passing/IRequestList.h"
40#include "arccore/message_passing/ISerializeMessageList.h"
41#include "arccore/trace/internal/TimeMetric.h"
42
43/*---------------------------------------------------------------------------*/
44/*---------------------------------------------------------------------------*/
45
46namespace Arcane
47{
48using namespace Arccore::MessagePassing;
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
53ParallelMngDispatcherBuildInfo::
54ParallelMngDispatcherBuildInfo(MP::Dispatchers* dispatchers,
56: m_comm_rank(mpm->commRank())
57, m_comm_size(mpm->commSize())
58, m_dispatchers(dispatchers)
59, m_message_passing_mng(mpm)
60{
61 _init();
62}
63
64/*---------------------------------------------------------------------------*/
65/*---------------------------------------------------------------------------*/
66
67ParallelMngDispatcherBuildInfo::
68ParallelMngDispatcherBuildInfo(Ref<MP::Dispatchers> dispatchers,
70: m_comm_rank(mpm_ref->commRank())
71, m_comm_size(mpm_ref->commSize())
72, m_dispatchers(dispatchers.get())
73, m_dispatchers_ref(dispatchers)
74, m_message_passing_mng(mpm_ref.get())
75, m_message_passing_mng_ref(mpm_ref)
76{
77 _init();
78}
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83ParallelMngDispatcherBuildInfo::
84ParallelMngDispatcherBuildInfo(Int32 comm_rank, Int32 comm_size)
85: m_comm_rank(comm_rank)
86, m_comm_size(comm_size)
87, m_dispatchers(nullptr)
88, m_message_passing_mng(nullptr)
89{
90 _init();
91}
92
93/*---------------------------------------------------------------------------*/
94/*---------------------------------------------------------------------------*/
95
96void ParallelMngDispatcherBuildInfo::
97_init()
98{
99 if (!m_dispatchers) {
100 m_dispatchers_ref = createRef<MP::Dispatchers>();
101 m_dispatchers = m_dispatchers_ref.get();
102 }
103 if (!m_message_passing_mng) {
104 auto* x = new MP::MessagePassingMng(m_comm_rank, m_comm_size, m_dispatchers);
105 m_message_passing_mng = x;
106 m_message_passing_mng_ref = makeRef(x);
107 }
108 if (!m_message_passing_mng_ref.get())
109 m_message_passing_mng_ref = makeRef(m_message_passing_mng);
110}
111
112/*---------------------------------------------------------------------------*/
113/*---------------------------------------------------------------------------*/
114
115ParallelMngDispatcher::DefaultControlDispatcher::
116DefaultControlDispatcher(IParallelMng* pm)
117: m_parallel_mng(pm)
118{
119}
120
121void ParallelMngDispatcher::DefaultControlDispatcher::
122waitAllRequests(ArrayView<Request> requests)
123{
124 m_parallel_mng->waitAllRequests(requests);
125}
126
127void ParallelMngDispatcher::DefaultControlDispatcher::
128waitSomeRequests(ArrayView<Request> requests, ArrayView<bool> indexes,
129 bool is_non_blocking)
130{
131 UniqueArray<Integer> done_requests;
132 if (is_non_blocking)
133 done_requests = m_parallel_mng->testSomeRequests(requests);
134 else
135 done_requests = m_parallel_mng->waitSomeRequests(requests);
136 indexes.fill(false);
137 for (int x : done_requests)
138 indexes[x] = true;
139}
140
141IMessagePassingMng* ParallelMngDispatcher::DefaultControlDispatcher::
142commSplit(bool keep)
143{
144 ARCANE_UNUSED(keep);
145 ARCANE_THROW(NotImplementedException, "split from MessagePassing::IControlDispatcher");
146}
147
148void ParallelMngDispatcher::DefaultControlDispatcher::
149barrier()
150{
151 m_parallel_mng->barrier();
152}
153
154Request ParallelMngDispatcher::DefaultControlDispatcher::
155nonBlockingBarrier()
156{
157 return m_parallel_mng->nonBlockingCollective()->barrier();
158}
159
160MessageId ParallelMngDispatcher::DefaultControlDispatcher::
161probe(const PointToPointMessageInfo& message)
162{
163 return m_parallel_mng->probe(message);
164}
165
166MessageSourceInfo ParallelMngDispatcher::DefaultControlDispatcher::
167legacyProbe(const PointToPointMessageInfo& message)
168{
169 return m_parallel_mng->legacyProbe(message);
170}
171
172Ref<Parallel::IRequestList> ParallelMngDispatcher::DefaultControlDispatcher::
173createRequestListRef()
174{
175 return m_parallel_mng->createRequestListRef();
176}
177
178/*---------------------------------------------------------------------------*/
179/*---------------------------------------------------------------------------*/
180
181void ParallelMngDispatcher::DefaultControlDispatcher::
182setProfiler(MP::IProfiler* p)
183{
184 ARCANE_UNUSED(p);
185 ARCANE_THROW(NotImplementedException, "setProfiler() from MessagePassing::IControlDispatcher");
186}
187
188/*---------------------------------------------------------------------------*/
189/*---------------------------------------------------------------------------*/
190
192: public MP::ISerializeDispatcher
193{
194 public:
195
196 explicit SerializeDispatcher(IParallelMng* pm)
197 : m_parallel_mng(pm)
198 {}
199
200 public:
201
203 {
204 return m_parallel_mng->createSerializeMessageListRef();
205 }
206 Request sendSerializer(const ISerializer* s, const PointToPointMessageInfo& message) override
207 {
208 return m_parallel_mng->sendSerializer(s, message);
209 }
210 Request receiveSerializer(ISerializer* s, const PointToPointMessageInfo& message) override
211 {
212 return m_parallel_mng->receiveSerializer(s, message);
213 }
214
215 private:
216
217 IParallelMng* m_parallel_mng;
218};
219
220/*---------------------------------------------------------------------------*/
221/*---------------------------------------------------------------------------*/
222
223/*---------------------------------------------------------------------------*/
224/*---------------------------------------------------------------------------*/
225
226ParallelMngDispatcher::
227ParallelMngDispatcher(const ParallelMngDispatcherBuildInfo& bi)
228: m_char(nullptr)
229, m_unsigned_char(nullptr)
230, m_signed_char(nullptr)
231, m_short(nullptr)
232, m_unsigned_short(nullptr)
233, m_int(nullptr)
234, m_unsigned_int(nullptr)
235, m_long(nullptr)
236, m_unsigned_long(nullptr)
237, m_long_long(nullptr)
238, m_unsigned_long_long(nullptr)
239, m_float(nullptr)
240, m_double(nullptr)
241, m_long_double(nullptr)
242, m_apreal(nullptr)
243, m_real2(nullptr)
244, m_real3(nullptr)
245, m_real2x2(nullptr)
246, m_real3x3(nullptr)
247, m_hpreal(nullptr)
248, m_time_stats(nullptr)
249, m_mp_dispatchers_ref(bi.dispatchersRef())
250, m_message_passing_mng_ref(bi.messagePassingMngRef())
251, m_control_dispatcher(new DefaultControlDispatcher(this))
252, m_serialize_dispatcher(new SerializeDispatcher(this))
253, m_parallel_mng_internal(new ParallelMngInternal(this))
254{
255}
256
257/*---------------------------------------------------------------------------*/
258/*---------------------------------------------------------------------------*/
259
260ParallelMngDispatcher::
261~ParallelMngDispatcher()
262{
263 m_mp_dispatchers_ref.reset();
264
265 delete m_parallel_mng_internal;
266
267 delete m_serialize_dispatcher;
268 delete m_control_dispatcher;
269 delete m_char;
270 delete m_signed_char;
271 delete m_unsigned_char;
272 delete m_short;
273 delete m_unsigned_short;
274 delete m_int;
275 delete m_unsigned_int;
276 delete m_long;
277 delete m_unsigned_long;
278 delete m_long_long;
279 delete m_unsigned_long_long;
280 delete m_apreal;
281 delete m_float;
282 delete m_double;
283 delete m_long_double;
284 delete m_real2;
285 delete m_real3;
286 delete m_real2x2;
287 delete m_real3x3;
288 delete m_hpreal;
289}
290
291/*---------------------------------------------------------------------------*/
292/*---------------------------------------------------------------------------*/
293
294void ParallelMngDispatcher::
295_setControlDispatcher(MP::IControlDispatcher* d)
296{
297 delete m_control_dispatcher;
298 m_control_dispatcher = d;
299}
300
301/*---------------------------------------------------------------------------*/
302/*---------------------------------------------------------------------------*/
303
304void ParallelMngDispatcher::
305_setSerializeDispatcher(MP::ISerializeDispatcher* d)
306{
307 delete m_serialize_dispatcher;
308 m_serialize_dispatcher = d;
309}
310
311/*---------------------------------------------------------------------------*/
312/*---------------------------------------------------------------------------*/
313
314void ParallelMngDispatcher::
315_setArccoreDispatchers()
316{
317 m_mp_dispatchers_ref->setDispatcher(m_char->toArccoreDispatcher());
318 m_mp_dispatchers_ref->setDispatcher(m_signed_char->toArccoreDispatcher());
319 m_mp_dispatchers_ref->setDispatcher(m_unsigned_char->toArccoreDispatcher());
320 m_mp_dispatchers_ref->setDispatcher(m_short->toArccoreDispatcher());
321 m_mp_dispatchers_ref->setDispatcher(m_unsigned_short->toArccoreDispatcher());
322 m_mp_dispatchers_ref->setDispatcher(m_int->toArccoreDispatcher());
323 m_mp_dispatchers_ref->setDispatcher(m_unsigned_int->toArccoreDispatcher());
324 m_mp_dispatchers_ref->setDispatcher(m_long->toArccoreDispatcher());
325 m_mp_dispatchers_ref->setDispatcher(m_unsigned_long->toArccoreDispatcher());
326 m_mp_dispatchers_ref->setDispatcher(m_long_long->toArccoreDispatcher());
327 m_mp_dispatchers_ref->setDispatcher(m_unsigned_long_long->toArccoreDispatcher());
328 m_mp_dispatchers_ref->setDispatcher(m_float->toArccoreDispatcher());
329 m_mp_dispatchers_ref->setDispatcher(m_double->toArccoreDispatcher());
330 m_mp_dispatchers_ref->setDispatcher(m_long_double->toArccoreDispatcher());
331
332 ARCANE_CHECK_POINTER(m_control_dispatcher);
333 m_mp_dispatchers_ref->setDispatcher(m_control_dispatcher);
334 ARCANE_CHECK_POINTER(m_serialize_dispatcher);
335 m_mp_dispatchers_ref->setDispatcher(m_serialize_dispatcher);
336}
337
338/*---------------------------------------------------------------------------*/
339/*---------------------------------------------------------------------------*/
340
342messagePassingMng() const
343{
344 return m_message_passing_mng_ref.get();
345}
346
347/*---------------------------------------------------------------------------*/
348/*---------------------------------------------------------------------------*/
349
350ITimeMetricCollector* ParallelMngDispatcher::
352{
353 ITimeMetricCollector* c = nullptr;
354 ITimeStats* s = m_time_stats;
355 if (s)
356 c = s->metricCollector();
357 return c;
358}
359
360/*---------------------------------------------------------------------------*/
361/*---------------------------------------------------------------------------*/
362
365{
366 m_time_stats = ts;
367 if (ts) {
368 ITimeMetricCollector* c = ts->metricCollector();
369 _messagePassingMng()->setTimeMetricCollector(c);
370 }
371}
372
373/*---------------------------------------------------------------------------*/
374/*---------------------------------------------------------------------------*/
375
376TimeMetricAction ParallelMngDispatcher::
377_communicationTimeMetricAction() const
378{
379 return Timer::phaseAction(timeStats(), TP_Communication);
380}
381
382/*---------------------------------------------------------------------------*/
383/*---------------------------------------------------------------------------*/
384
385void ParallelMngDispatcher::
386broadcastString(String& str, Int32 rank)
387{
388 Int64 len_info[1];
389 Int32 my_rank = commRank();
390 Span<const Byte> bytes = str.bytes();
391 if (rank == my_rank) {
392 len_info[0] = bytes.size();
393 broadcast(Int64ArrayView(1, len_info), rank);
394 ByteUniqueArray utf8_array(bytes);
395 broadcast(utf8_array, rank);
396 }
397 else {
398 broadcast(Int64ArrayView(1, len_info), rank);
399 ByteUniqueArray utf8_array(len_info[0]);
400 broadcast(utf8_array, rank);
401 str = String::fromUtf8(utf8_array);
402 }
403}
404
405/*---------------------------------------------------------------------------*/
406/*---------------------------------------------------------------------------*/
407
410{
411 Int64 size = 0;
412 if (commRank() == rank) {
413 size = bytes.largeSize();
414 }
415 {
416 Int64ArrayView bs(1, &size);
417 broadcast(bs, rank);
418 }
419 if (commRank() != rank)
420 bytes.resize(size);
421 if (size != 0)
422 broadcast(bytes, rank);
423}
424
425/*---------------------------------------------------------------------------*/
426/*---------------------------------------------------------------------------*/
427
429allGather(ISerializer* send_serializer, ISerializer* recv_serializer)
430{
431 Timer::Phase tphase(timeStats(), TP_Communication);
432 mpAllGather(_messagePassingMng(), send_serializer, recv_serializer);
433}
434
435/*---------------------------------------------------------------------------*/
436/*---------------------------------------------------------------------------*/
437
440{
441 TimeMetricSentry tphase(Timer::phaseAction(timeStats(), TP_Communication));
443
444 for (ISerializeMessage* m : messages)
445 message_list->addMessage(m);
446
447 message_list->waitMessages(Parallel::WaitAll);
448}
449
450/*---------------------------------------------------------------------------*/
451/*---------------------------------------------------------------------------*/
452
455{
456 TimeMetricSentry tphase(Timer::phaseAction(timeStats(), TP_Communication));
458
459 for (const Ref<ISerializeMessage>& v : messages)
460 message_list->addMessage(v.get());
461
462 message_list->waitMessages(Parallel::WaitAll);
463}
464
465/*---------------------------------------------------------------------------*/
466/*---------------------------------------------------------------------------*/
467
470{
471 return makeRef(_createSerializeMessageList());
472}
473
474/*---------------------------------------------------------------------------*/
475/*---------------------------------------------------------------------------*/
476
479{
480 return _createSerializeMessageList();
481}
482
483/*---------------------------------------------------------------------------*/
484/*---------------------------------------------------------------------------*/
485
488{
489 return _createSubParallelMng(kept_ranks);
490}
491
492/*---------------------------------------------------------------------------*/
493/*---------------------------------------------------------------------------*/
494
497{
498 return makeRef(_createSubParallelMng(kept_ranks));
499}
500
501/*---------------------------------------------------------------------------*/
502/*---------------------------------------------------------------------------*/
503
504Ref<IParallelMng> ParallelMngDispatcher::
505_createSubParallelMngRef([[maybe_unused]] Int32 color, [[maybe_unused]] Int32 key)
506{
507 ARCANE_THROW(NotImplementedException, "Create sub-parallelmng with split semantic");
508}
509
510/*---------------------------------------------------------------------------*/
511/*---------------------------------------------------------------------------*/
512
513UniqueArray<Integer> ParallelMngDispatcher::
514_doWaitRequests(ArrayView<Request> requests, eWaitType wait_type)
515{
516 Timer::Phase tphase(timeStats(), TP_Communication);
518 Integer nb_request = requests.size();
519 request_list->add(requests);
520 request_list->wait(wait_type);
521 // Don't forget to copy the requests, as they might have been modified
522 for (Integer i = 0; i < nb_request; ++i)
523 requests[i] = request_list->request(i);
524 return request_list->doneRequestIndexes();
525}
526
527/*---------------------------------------------------------------------------*/
528/*---------------------------------------------------------------------------*/
529
532{
533 return _doWaitRequests(requests, Parallel::WaitSome);
534}
535
536/*---------------------------------------------------------------------------*/
537/*---------------------------------------------------------------------------*/
538
544
545/*---------------------------------------------------------------------------*/
546/*---------------------------------------------------------------------------*/
547
548#define ARCANE_PARALLEL_MANAGER_DISPATCH(field, type) \
549 void ParallelMngDispatcher:: \
550 allGather(ConstArrayView<type> send_buf, ArrayView<type> recv_buf) \
551 { \
552 Timer::Phase tphase(timeStats(), TP_Communication); \
553 (field)->allGather(send_buf, recv_buf); \
554 } \
555 void ParallelMngDispatcher:: \
556 gather(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer rank) \
557 { \
558 Timer::Phase tphase(timeStats(), TP_Communication); \
559 (field)->gather(send_buf, recv_buf, rank); \
560 } \
561 void ParallelMngDispatcher:: \
562 allGatherVariable(ConstArrayView<type> send_buf, Array<type>& recv_buf) \
563 { \
564 Timer::Phase tphase(timeStats(), TP_Communication); \
565 (field)->allGatherVariable(send_buf, recv_buf); \
566 } \
567 void ParallelMngDispatcher:: \
568 gatherVariable(ConstArrayView<type> send_buf, Array<type>& recv_buf, Integer rank) \
569 { \
570 Timer::Phase tphase(timeStats(), TP_Communication); \
571 (field)->gatherVariable(send_buf, recv_buf, rank); \
572 } \
573 void ParallelMngDispatcher:: \
574 scatterVariable(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer root) \
575 { \
576 Timer::Phase tphase(timeStats(), TP_Communication); \
577 (field)->scatterVariable(send_buf, recv_buf, root); \
578 } \
579 type ParallelMngDispatcher:: \
580 reduce(eReduceType rt, type v) \
581 { \
582 Timer::Phase tphase(timeStats(), TP_Communication); \
583 return (field)->allReduce(rt, v); \
584 } \
585 void ParallelMngDispatcher:: \
586 reduce(eReduceType rt, ArrayView<type> v) \
587 { \
588 Timer::Phase tphase(timeStats(), TP_Communication); \
589 (field)->allReduce(rt, v); \
590 } \
591 void ParallelMngDispatcher:: \
592 broadcast(ArrayView<type> send_buf, Integer id) \
593 { \
594 Timer::Phase tphase(timeStats(), TP_Communication); \
595 (field)->broadcast(send_buf, id); \
596 } \
597 void ParallelMngDispatcher:: \
598 send(ConstArrayView<type> values, Integer id) \
599 { \
600 Timer::Phase tphase(timeStats(), TP_Communication); \
601 (field)->send(values, id); \
602 } \
603 void ParallelMngDispatcher:: \
604 recv(ArrayView<type> values, Integer id) \
605 { \
606 Timer::Phase tphase(timeStats(), TP_Communication); \
607 (field)->recv(values, id); \
608 } \
609 Parallel::Request ParallelMngDispatcher:: \
610 send(ConstArrayView<type> values, Integer id, bool is_blocked) \
611 { \
612 Timer::Phase tphase(timeStats(), TP_Communication); \
613 return (field)->send(values, id, is_blocked); \
614 } \
615 Request ParallelMngDispatcher:: \
616 send(Span<const type> values, const PointToPointMessageInfo& message) \
617 { \
618 Timer::Phase tphase(timeStats(), TP_Communication); \
619 return (field)->send(values, message); \
620 } \
621 Parallel::Request ParallelMngDispatcher:: \
622 recv(ArrayView<type> values, Integer id, bool is_blocked) \
623 { \
624 Timer::Phase tphase(timeStats(), TP_Communication); \
625 return (field)->recv(values, id, is_blocked); \
626 } \
627 Request ParallelMngDispatcher:: \
628 receive(Span<type> values, const PointToPointMessageInfo& message) \
629 { \
630 Timer::Phase tphase(timeStats(), TP_Communication); \
631 return (field)->receive(values, message); \
632 } \
633 void ParallelMngDispatcher:: \
634 sendRecv(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer id) \
635 { \
636 Timer::Phase tphase(timeStats(), TP_Communication); \
637 (field)->sendRecv(send_buf, recv_buf, id); \
638 } \
639 void ParallelMngDispatcher:: \
640 allToAll(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer count) \
641 { \
642 Timer::Phase tphase(timeStats(), TP_Communication); \
643 (field)->allToAll(send_buf, recv_buf, count); \
644 } \
645 void ParallelMngDispatcher:: \
646 allToAllVariable(ConstArrayView<type> send_buf, Int32ConstArrayView send_count, \
647 Int32ConstArrayView send_index, ArrayView<type> recv_buf, \
648 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) \
649 { \
650 Timer::Phase tphase(timeStats(), TP_Communication); \
651 (field)->allToAllVariable(send_buf, send_count, send_index, recv_buf, recv_count, recv_index); \
652 } \
653 type ParallelMngDispatcher:: \
654 scan(eReduceType rt, type v) \
655 { \
656 Timer::Phase tphase(timeStats(), TP_Communication); \
657 return (field)->scan(rt, v); \
658 } \
659 void ParallelMngDispatcher:: \
660 computeMinMaxSum(type val, type& min_val, type& max_val, type& sum_val, Int32& min_proc, Int32& max_proc) \
661 { \
662 Timer::Phase tphase(timeStats(), TP_Communication); \
663 (field)->computeMinMaxSum(val, min_val, max_val, sum_val, min_proc, max_proc); \
664 } \
665 IParallelDispatchT<type>* ParallelMngDispatcher:: \
666 dispatcher(type*) \
667 { \
668 return (field); \
669 } \
670 void ParallelMngDispatcher:: \
671 computeMinMaxSum(ConstArrayView<type> values, \
672 ArrayView<type> min_values, \
673 ArrayView<type> max_values, \
674 ArrayView<type> sum_values, \
675 ArrayView<Int32> min_ranks, \
676 ArrayView<Int32> max_ranks) \
677 { \
678 Timer::Phase tphase(timeStats(), TP_Communication); \
679 (field)->computeMinMaxSum(values, min_values, max_values, sum_values, min_ranks, max_ranks); \
680 } \
681 void ParallelMngDispatcher:: \
682 scan(eReduceType rt, ArrayView<type> v) \
683 { \
684 Timer::Phase tphase(timeStats(), TP_Communication); \
685 (field)->scan(rt, v); \
686 }
687
688ARCANE_PARALLEL_MANAGER_DISPATCH(m_char, char)
689ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_char, unsigned char)
690ARCANE_PARALLEL_MANAGER_DISPATCH(m_signed_char, signed char)
691ARCANE_PARALLEL_MANAGER_DISPATCH(m_short, short)
692ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_short, unsigned short)
693ARCANE_PARALLEL_MANAGER_DISPATCH(m_int, int)
694ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_int, unsigned int)
695ARCANE_PARALLEL_MANAGER_DISPATCH(m_long, long)
696ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_long, unsigned long)
697ARCANE_PARALLEL_MANAGER_DISPATCH(m_long_long, long long)
698ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_long_long, unsigned long long)
699ARCANE_PARALLEL_MANAGER_DISPATCH(m_float, float)
700ARCANE_PARALLEL_MANAGER_DISPATCH(m_double, double)
701ARCANE_PARALLEL_MANAGER_DISPATCH(m_long_double, long double)
702ARCANE_PARALLEL_MANAGER_DISPATCH(m_apreal, APReal)
703ARCANE_PARALLEL_MANAGER_DISPATCH(m_real2, Real2)
704ARCANE_PARALLEL_MANAGER_DISPATCH(m_real3, Real3)
705ARCANE_PARALLEL_MANAGER_DISPATCH(m_real2x2, Real2x2)
706ARCANE_PARALLEL_MANAGER_DISPATCH(m_real3x3, Real3x3)
707ARCANE_PARALLEL_MANAGER_DISPATCH(m_hpreal, HPReal)
708
709/*---------------------------------------------------------------------------*/
710/*---------------------------------------------------------------------------*/
711
712} // End namespace Arcane
713
714/*---------------------------------------------------------------------------*/
715/*---------------------------------------------------------------------------*/
716
717namespace Arccore
718{
721} // namespace Arccore
722
723/*---------------------------------------------------------------------------*/
724/*---------------------------------------------------------------------------*/
#define ARCANE_CHECK_POINTER(ptr)
Macro returning the pointer ptr if it is not null or throwing an exception if it is null.
#define ARCANE_THROW(exception_class,...)
Macro for throwing an exception with formatting.
Brief list of message exchange functions.
#define ARCCORE_DEFINE_REFERENCE_COUNTED_CLASS(class_name)
Macro to define methods and types for a class that uses a reference counter.
Emulation of real number in arbitrary precision.
Int64 largeSize() const
Number of elements in the vector (in 64 bits).
Modifiable view of an array of type T.
void fill(const T &o) noexcept
Fills the array with the value o.
constexpr Integer size() const noexcept
Returns the size of the array.
void resize(Int64 s)
Changes the number of elements in the array to s.
Constant view of an array of type T.
Class implementing a High-Precision real number.
Definition HPReal.h:159
Interface of the parallelism manager for a subdomain.
virtual Int32 commRank() const =0
Rank of this instance in the communicator.
virtual Ref< Parallel::IRequestList > createRequestListRef()=0
Creates a request list for this manager.
virtual ITimeMetricCollector * metricCollector()=0
Associated collection interface.
Interface of the dispatcher container.
Definition Dispatchers.h:35
Interface of the message passing manager.
Information about the source of a message.
Information for sending/receiving a point-to-point message.
Request sendSerializer(const ISerializer *s, const PointToPointMessageInfo &message) override
Sending message.
Request receiveSerializer(ISerializer *s, const PointToPointMessageInfo &message) override
Receiving message.
Ref< ISerializeMessageList > createSerializeMessageListRef() override
Create a list of serialization messages.
ISerializeMessageList * createSerializeMessageList() final
Creates a list to manage 'ISerializeMessage'.
void setTimeStats(ITimeStats *ts) override
Sets the statistics manager.
void allGather(ISerializer *send_serializer, ISerializer *recv_serializer) override
Redefines allGather here to avoid hiding the symbol in derived classes.
Ref< IParallelMng > createSubParallelMngRef(Int32ConstArrayView kept_ranks) override
Creates a new parallelism manager for a subset of ranks.
void processMessages(ConstArrayView< ISerializeMessage * > messages) override
Executes the operations of messages messages.
IMessagePassingMng * messagePassingMng() const override
Associated Arccore message passing manager.
ITimeMetricCollector * timeMetricCollector() const override
Arccore temporal statistics collector (can be null).
IParallelMng * createSubParallelMng(Int32ConstArrayView kept_ranks) final
Creates a new parallelism manager for a subset of ranks.
UniqueArray< Integer > testSomeRequests(ArrayView< Request > requests) override
Tests if one of the rvalues requests is complete.
ITimeStats * timeStats() const override
Associated statistics manager (can be null).
Ref< ISerializeMessageList > createSerializeMessageListRef() final
Creates a list to manage 'ISerializeMessage'.
UniqueArray< Integer > waitSomeRequests(ArrayView< Request > requests) override
Blocks while waiting for one of the rvalues requests to complete.
void broadcastMemoryBuffer(ByteArray &bytes, Int32 rank) override
Performs a broadcast of a memory region.
Class managing a 2-dimensional real vector.
Definition Real2.h:122
Class managing a 2x2 matrix of reals.
Definition Real2x2.h:55
Class managing a 3-dimensional real vector.
Definition Real3.h:132
Class managing a 3x3 real matrix.
Definition Real3x3.h:67
void reset()
Positions the instance to the null pointer.
Reference to an instance.
constexpr __host__ __device__ SizeType size() const noexcept
Returns the size of the array.
Definition Span.h:327
View of an array of elements of type T.
Definition Span.h:635
Span< const Byte > bytes() const
Returns the conversion of the instance into UTF-8 encoding.
Definition String.cc:293
Positions the phase of the currently executing action.
Definition Timer.h:142
1D data vector with value semantics (STL style).
@ WaitSome
Wait until all messages in the list are processed.
void mpAllGather(IMessagePassingMng *pm, const ISerializer *send_serializer, ISerializer *receive_serialize)
allGather() message for serialization
Definition Messages.cc:309
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ArrayView< Int64 > Int64ArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:451
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
Array< Byte > ByteArray
Dynamic one-dimensional array of characters.
Definition UtilsTypes.h:121
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
UniqueArray< Byte > ByteUniqueArray
Dynamic 1D array of characters.
Definition UtilsTypes.h:335
auto makeRef(InstanceType *t) -> Ref< InstanceType >
Creates a reference on a pointer.
std::int32_t Int32
Signed integer type of 32 bits.
Namespace of Arccore.
Ref< TrueType > createRef(Args &&... args)
Creates an instance of type TrueType with arguments Args and returns a reference to it.
auto makeRef(InstanceType *t) -> Ref< InstanceType >
Creates a reference on a pointer.