Arcane  4.2.3.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-2026 */
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(Int32 comm_rank, Int32 comm_size)
55: m_comm_rank(comm_rank)
56, m_comm_size(comm_size)
57{
58 _init();
59}
60
61
62/*---------------------------------------------------------------------------*/
63/*---------------------------------------------------------------------------*/
64
65ParallelMngDispatcherBuildInfo::
66ParallelMngDispatcherBuildInfo(Int32 comm_rank, Int32 comm_size, MP::Communicator communicator)
67: m_comm_rank(comm_rank)
68, m_comm_size(comm_size)
69, m_communicator(communicator)
70{
71 _init();
72}
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76
77void ParallelMngDispatcherBuildInfo::
78_init()
79{
80 m_dispatchers_ref = createRef<MP::Dispatchers>();
81}
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86ParallelMngDispatcher::DefaultControlDispatcher::
87DefaultControlDispatcher(IParallelMng* pm)
88: m_parallel_mng(pm)
89{
90}
91
92void ParallelMngDispatcher::DefaultControlDispatcher::
93waitAllRequests(ArrayView<Request> requests)
94{
95 m_parallel_mng->waitAllRequests(requests);
96}
97
98void ParallelMngDispatcher::DefaultControlDispatcher::
99waitSomeRequests(ArrayView<Request> requests, ArrayView<bool> indexes,
100 bool is_non_blocking)
101{
102 UniqueArray<Integer> done_requests;
103 if (is_non_blocking)
104 done_requests = m_parallel_mng->testSomeRequests(requests);
105 else
106 done_requests = m_parallel_mng->waitSomeRequests(requests);
107 indexes.fill(false);
108 for (int x : done_requests)
109 indexes[x] = true;
110}
111
112IMessagePassingMng* ParallelMngDispatcher::DefaultControlDispatcher::
113commSplit(bool keep)
114{
115 ARCANE_UNUSED(keep);
116 ARCANE_THROW(NotImplementedException, "split from MessagePassing::IControlDispatcher");
117}
118
119Ref<IMessagePassingMng> ParallelMngDispatcher::DefaultControlDispatcher::
120splitCommunicator(bool keep)
121{
122 ARCANE_UNUSED(keep);
123 ARCANE_THROW(NotImplementedException, "split from MessagePassing::IControlDispatcher");
124}
125
126void ParallelMngDispatcher::DefaultControlDispatcher::
127barrier()
128{
129 m_parallel_mng->barrier();
130}
131
132Request ParallelMngDispatcher::DefaultControlDispatcher::
133nonBlockingBarrier()
134{
135 return m_parallel_mng->nonBlockingCollective()->barrier();
136}
137
138MessageId ParallelMngDispatcher::DefaultControlDispatcher::
139probe(const PointToPointMessageInfo& message)
140{
141 return m_parallel_mng->probe(message);
142}
143
144MessageSourceInfo ParallelMngDispatcher::DefaultControlDispatcher::
145legacyProbe(const PointToPointMessageInfo& message)
146{
147 return m_parallel_mng->legacyProbe(message);
148}
149
150Ref<Parallel::IRequestList> ParallelMngDispatcher::DefaultControlDispatcher::
151createRequestListRef()
152{
153 return m_parallel_mng->createRequestListRef();
154}
155
156/*---------------------------------------------------------------------------*/
157/*---------------------------------------------------------------------------*/
158
159void ParallelMngDispatcher::DefaultControlDispatcher::
160setProfiler(MP::IProfiler* p)
161{
162 ARCANE_UNUSED(p);
163 ARCANE_THROW(NotImplementedException, "setProfiler() from MessagePassing::IControlDispatcher");
164}
165
166/*---------------------------------------------------------------------------*/
167/*---------------------------------------------------------------------------*/
168
170: public MP::ISerializeDispatcher
171{
172 public:
173
174 explicit SerializeDispatcher(IParallelMng* pm)
175 : m_parallel_mng(pm)
176 {}
177
178 public:
179
181 {
182 return m_parallel_mng->createSerializeMessageListRef();
183 }
184 Request sendSerializer(const ISerializer* s, const PointToPointMessageInfo& message) override
185 {
186 return m_parallel_mng->sendSerializer(s, message);
187 }
188 Request receiveSerializer(ISerializer* s, const PointToPointMessageInfo& message) override
189 {
190 return m_parallel_mng->receiveSerializer(s, message);
191 }
192
193 private:
194
195 IParallelMng* m_parallel_mng = nullptr;
196};
197
198/*---------------------------------------------------------------------------*/
199/*---------------------------------------------------------------------------*/
200
201/*---------------------------------------------------------------------------*/
202/*---------------------------------------------------------------------------*/
203
204ParallelMngDispatcher::
205ParallelMngDispatcher(const ParallelMngDispatcherBuildInfo& bi)
206: m_comm_rank(bi.commRank())
207, m_comm_size(bi.commSize())
208, m_communicator(bi.communicator())
209, m_char(nullptr)
210, m_unsigned_char(nullptr)
211, m_signed_char(nullptr)
212, m_short(nullptr)
213, m_unsigned_short(nullptr)
214, m_int(nullptr)
215, m_unsigned_int(nullptr)
216, m_long(nullptr)
217, m_unsigned_long(nullptr)
218, m_long_long(nullptr)
219, m_unsigned_long_long(nullptr)
220, m_float(nullptr)
221, m_double(nullptr)
222, m_long_double(nullptr)
223, m_apreal(nullptr)
224, m_real2(nullptr)
225, m_real3(nullptr)
226, m_real2x2(nullptr)
227, m_real3x3(nullptr)
228, m_hpreal(nullptr)
229, m_time_stats(nullptr)
230, m_mp_dispatchers_ref(bi.dispatchersRef())
231, m_control_dispatcher(new DefaultControlDispatcher(this))
232, m_serialize_dispatcher(new SerializeDispatcher(this))
233, m_parallel_mng_internal(new ParallelMngInternal(this))
234{
235 m_message_passing_mng = this;
236}
237
238/*---------------------------------------------------------------------------*/
239/*---------------------------------------------------------------------------*/
240
241ParallelMngDispatcher::
242~ParallelMngDispatcher()
243{
244 m_mp_dispatchers_ref.reset();
245
246 delete m_parallel_mng_internal;
247
248 delete m_serialize_dispatcher;
249 delete m_control_dispatcher;
250 delete m_char;
251 delete m_signed_char;
252 delete m_unsigned_char;
253 delete m_short;
254 delete m_unsigned_short;
255 delete m_int;
256 delete m_unsigned_int;
257 delete m_long;
258 delete m_unsigned_long;
259 delete m_long_long;
260 delete m_unsigned_long_long;
261 delete m_apreal;
262 delete m_float;
263 delete m_double;
264 delete m_long_double;
265 delete m_real2;
266 delete m_real3;
267 delete m_real2x2;
268 delete m_real3x3;
269 delete m_hpreal;
270}
271
272/*---------------------------------------------------------------------------*/
273/*---------------------------------------------------------------------------*/
274
275void ParallelMngDispatcher::
276_setControlDispatcher(MP::IControlDispatcher* d)
277{
278 delete m_control_dispatcher;
279 m_control_dispatcher = d;
280}
281
282/*---------------------------------------------------------------------------*/
283/*---------------------------------------------------------------------------*/
284
285void ParallelMngDispatcher::
286_setSerializeDispatcher(MP::ISerializeDispatcher* d)
287{
288 delete m_serialize_dispatcher;
289 m_serialize_dispatcher = d;
290}
291
292/*---------------------------------------------------------------------------*/
293/*---------------------------------------------------------------------------*/
294
295void ParallelMngDispatcher::
296_setArccoreDispatchers()
297{
298 m_mp_dispatchers_ref->setDispatcher(m_char->toArccoreDispatcher());
299 m_mp_dispatchers_ref->setDispatcher(m_signed_char->toArccoreDispatcher());
300 m_mp_dispatchers_ref->setDispatcher(m_unsigned_char->toArccoreDispatcher());
301 m_mp_dispatchers_ref->setDispatcher(m_short->toArccoreDispatcher());
302 m_mp_dispatchers_ref->setDispatcher(m_unsigned_short->toArccoreDispatcher());
303 m_mp_dispatchers_ref->setDispatcher(m_int->toArccoreDispatcher());
304 m_mp_dispatchers_ref->setDispatcher(m_unsigned_int->toArccoreDispatcher());
305 m_mp_dispatchers_ref->setDispatcher(m_long->toArccoreDispatcher());
306 m_mp_dispatchers_ref->setDispatcher(m_unsigned_long->toArccoreDispatcher());
307 m_mp_dispatchers_ref->setDispatcher(m_long_long->toArccoreDispatcher());
308 m_mp_dispatchers_ref->setDispatcher(m_unsigned_long_long->toArccoreDispatcher());
309 m_mp_dispatchers_ref->setDispatcher(m_float->toArccoreDispatcher());
310 m_mp_dispatchers_ref->setDispatcher(m_double->toArccoreDispatcher());
311 m_mp_dispatchers_ref->setDispatcher(m_long_double->toArccoreDispatcher());
312
313 ARCANE_CHECK_POINTER(m_control_dispatcher);
314 m_mp_dispatchers_ref->setDispatcher(m_control_dispatcher);
315 ARCANE_CHECK_POINTER(m_serialize_dispatcher);
316 m_mp_dispatchers_ref->setDispatcher(m_serialize_dispatcher);
317}
318
319/*---------------------------------------------------------------------------*/
320/*---------------------------------------------------------------------------*/
321
323messagePassingMng() const
324{
325 return m_message_passing_mng;
326}
327
328/*---------------------------------------------------------------------------*/
329/*---------------------------------------------------------------------------*/
330
331MP::IDispatchers* ParallelMngDispatcher::
332dispatchers()
333{
334 return m_mp_dispatchers_ref.get();
335}
336
337/*---------------------------------------------------------------------------*/
338/*---------------------------------------------------------------------------*/
339
340ITimeMetricCollector* ParallelMngDispatcher::
342{
343 ITimeMetricCollector* c = nullptr;
344 ITimeStats* s = m_time_stats;
345 if (s)
346 c = s->metricCollector();
347 return c;
348}
349
350/*---------------------------------------------------------------------------*/
351/*---------------------------------------------------------------------------*/
352
355{
356 m_time_stats = ts;
357 if (ts) {
358 ITimeMetricCollector* c = ts->metricCollector();
359 m_time_metric_collector = c;
360 }
361}
362
363/*---------------------------------------------------------------------------*/
364/*---------------------------------------------------------------------------*/
365
366TimeMetricAction ParallelMngDispatcher::
367_communicationTimeMetricAction() const
368{
369 return Timer::phaseAction(timeStats(), TP_Communication);
370}
371
372/*---------------------------------------------------------------------------*/
373/*---------------------------------------------------------------------------*/
374
375void ParallelMngDispatcher::
376broadcastString(String& str, Int32 rank)
377{
378 Int64 len_info[1];
379 Int32 my_rank = commRank();
380 Span<const Byte> bytes = str.bytes();
381 if (rank == my_rank) {
382 len_info[0] = bytes.size();
383 broadcast(Int64ArrayView(1, len_info), rank);
384 ByteUniqueArray utf8_array(bytes);
385 broadcast(utf8_array, rank);
386 }
387 else {
388 broadcast(Int64ArrayView(1, len_info), rank);
389 ByteUniqueArray utf8_array(len_info[0]);
390 broadcast(utf8_array, rank);
391 str = String::fromUtf8(utf8_array);
392 }
393}
394
395/*---------------------------------------------------------------------------*/
396/*---------------------------------------------------------------------------*/
397
400{
401 Int64 size = 0;
402 if (commRank() == rank) {
403 size = bytes.largeSize();
404 }
405 {
406 Int64ArrayView bs(1, &size);
407 broadcast(bs, rank);
408 }
409 if (commRank() != rank)
410 bytes.resize(size);
411 if (size != 0)
412 broadcast(bytes, rank);
413}
414
415/*---------------------------------------------------------------------------*/
416/*---------------------------------------------------------------------------*/
417
419allGather(ISerializer* send_serializer, ISerializer* recv_serializer)
420{
421 Timer::Phase tphase(timeStats(), TP_Communication);
422 mpAllGather(_messagePassingMng(), send_serializer, recv_serializer);
423}
424
425/*---------------------------------------------------------------------------*/
426/*---------------------------------------------------------------------------*/
427
430{
431 TimeMetricSentry tphase(Timer::phaseAction(timeStats(), TP_Communication));
433
434 for (ISerializeMessage* m : messages)
435 message_list->addMessage(m);
436
437 message_list->waitMessages(Parallel::WaitAll);
438}
439
440/*---------------------------------------------------------------------------*/
441/*---------------------------------------------------------------------------*/
442
445{
446 TimeMetricSentry tphase(Timer::phaseAction(timeStats(), TP_Communication));
448
449 for (const Ref<ISerializeMessage>& v : messages)
450 message_list->addMessage(v.get());
451
452 message_list->waitMessages(Parallel::WaitAll);
453}
454
455/*---------------------------------------------------------------------------*/
456/*---------------------------------------------------------------------------*/
457
460{
461 return makeRef(_createSerializeMessageList());
462}
463
464/*---------------------------------------------------------------------------*/
465/*---------------------------------------------------------------------------*/
466
469{
470 return _createSerializeMessageList();
471}
472
473/*---------------------------------------------------------------------------*/
474/*---------------------------------------------------------------------------*/
475
478{
479 return _createSubParallelMng(kept_ranks);
480}
481
482/*---------------------------------------------------------------------------*/
483/*---------------------------------------------------------------------------*/
484
487{
488 return makeRef(_createSubParallelMng(kept_ranks));
489}
490
491/*---------------------------------------------------------------------------*/
492/*---------------------------------------------------------------------------*/
493
494Ref<IParallelMng> ParallelMngDispatcher::
495_createSubParallelMngRef([[maybe_unused]] Int32 color, [[maybe_unused]] Int32 key)
496{
497 ARCANE_THROW(NotImplementedException, "Create sub-parallelmng with split semantic");
498}
499
500/*---------------------------------------------------------------------------*/
501/*---------------------------------------------------------------------------*/
502
503UniqueArray<Integer> ParallelMngDispatcher::
504_doWaitRequests(ArrayView<Request> requests, eWaitType wait_type)
505{
506 Timer::Phase tphase(timeStats(), TP_Communication);
508 Integer nb_request = requests.size();
509 request_list->add(requests);
510 request_list->wait(wait_type);
511 // Don't forget to copy the requests, as they might have been modified
512 for (Integer i = 0; i < nb_request; ++i)
513 requests[i] = request_list->request(i);
514 return request_list->doneRequestIndexes();
515}
516
517/*---------------------------------------------------------------------------*/
518/*---------------------------------------------------------------------------*/
519
522{
523 return _doWaitRequests(requests, Parallel::WaitSome);
524}
525
526/*---------------------------------------------------------------------------*/
527/*---------------------------------------------------------------------------*/
528
534
535/*---------------------------------------------------------------------------*/
536/*---------------------------------------------------------------------------*/
537
538#define ARCANE_PARALLEL_MANAGER_DISPATCH(field, type) \
539 void ParallelMngDispatcher:: \
540 allGather(ConstArrayView<type> send_buf, ArrayView<type> recv_buf) \
541 { \
542 Timer::Phase tphase(timeStats(), TP_Communication); \
543 (field)->allGather(send_buf, recv_buf); \
544 } \
545 void ParallelMngDispatcher:: \
546 gather(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer rank) \
547 { \
548 Timer::Phase tphase(timeStats(), TP_Communication); \
549 (field)->gather(send_buf, recv_buf, rank); \
550 } \
551 void ParallelMngDispatcher:: \
552 allGatherVariable(ConstArrayView<type> send_buf, Array<type>& recv_buf) \
553 { \
554 Timer::Phase tphase(timeStats(), TP_Communication); \
555 (field)->allGatherVariable(send_buf, recv_buf); \
556 } \
557 void ParallelMngDispatcher:: \
558 gatherVariable(ConstArrayView<type> send_buf, Array<type>& recv_buf, Integer rank) \
559 { \
560 Timer::Phase tphase(timeStats(), TP_Communication); \
561 (field)->gatherVariable(send_buf, recv_buf, rank); \
562 } \
563 void ParallelMngDispatcher:: \
564 scatterVariable(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer root) \
565 { \
566 Timer::Phase tphase(timeStats(), TP_Communication); \
567 (field)->scatterVariable(send_buf, recv_buf, root); \
568 } \
569 type ParallelMngDispatcher:: \
570 reduce(eReduceType rt, type v) \
571 { \
572 Timer::Phase tphase(timeStats(), TP_Communication); \
573 return (field)->allReduce(rt, v); \
574 } \
575 void ParallelMngDispatcher:: \
576 reduce(eReduceType rt, ArrayView<type> v) \
577 { \
578 Timer::Phase tphase(timeStats(), TP_Communication); \
579 (field)->allReduce(rt, v); \
580 } \
581 void ParallelMngDispatcher:: \
582 broadcast(ArrayView<type> send_buf, Integer id) \
583 { \
584 Timer::Phase tphase(timeStats(), TP_Communication); \
585 (field)->broadcast(send_buf, id); \
586 } \
587 void ParallelMngDispatcher:: \
588 send(ConstArrayView<type> values, Integer id) \
589 { \
590 Timer::Phase tphase(timeStats(), TP_Communication); \
591 (field)->send(values, id); \
592 } \
593 void ParallelMngDispatcher:: \
594 recv(ArrayView<type> values, Integer id) \
595 { \
596 Timer::Phase tphase(timeStats(), TP_Communication); \
597 (field)->recv(values, id); \
598 } \
599 Parallel::Request ParallelMngDispatcher:: \
600 send(ConstArrayView<type> values, Integer id, bool is_blocked) \
601 { \
602 Timer::Phase tphase(timeStats(), TP_Communication); \
603 return (field)->send(values, id, is_blocked); \
604 } \
605 Request ParallelMngDispatcher:: \
606 send(Span<const type> values, const PointToPointMessageInfo& message) \
607 { \
608 Timer::Phase tphase(timeStats(), TP_Communication); \
609 return (field)->send(values, message); \
610 } \
611 Parallel::Request ParallelMngDispatcher:: \
612 recv(ArrayView<type> values, Integer id, bool is_blocked) \
613 { \
614 Timer::Phase tphase(timeStats(), TP_Communication); \
615 return (field)->recv(values, id, is_blocked); \
616 } \
617 Request ParallelMngDispatcher:: \
618 receive(Span<type> values, const PointToPointMessageInfo& message) \
619 { \
620 Timer::Phase tphase(timeStats(), TP_Communication); \
621 return (field)->receive(values, message); \
622 } \
623 void ParallelMngDispatcher:: \
624 sendRecv(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer id) \
625 { \
626 Timer::Phase tphase(timeStats(), TP_Communication); \
627 (field)->sendRecv(send_buf, recv_buf, id); \
628 } \
629 void ParallelMngDispatcher:: \
630 allToAll(ConstArrayView<type> send_buf, ArrayView<type> recv_buf, Integer count) \
631 { \
632 Timer::Phase tphase(timeStats(), TP_Communication); \
633 (field)->allToAll(send_buf, recv_buf, count); \
634 } \
635 void ParallelMngDispatcher:: \
636 allToAllVariable(ConstArrayView<type> send_buf, Int32ConstArrayView send_count, \
637 Int32ConstArrayView send_index, ArrayView<type> recv_buf, \
638 Int32ConstArrayView recv_count, Int32ConstArrayView recv_index) \
639 { \
640 Timer::Phase tphase(timeStats(), TP_Communication); \
641 (field)->allToAllVariable(send_buf, send_count, send_index, recv_buf, recv_count, recv_index); \
642 } \
643 type ParallelMngDispatcher:: \
644 scan(eReduceType rt, type v) \
645 { \
646 Timer::Phase tphase(timeStats(), TP_Communication); \
647 return (field)->scan(rt, v); \
648 } \
649 void ParallelMngDispatcher:: \
650 computeMinMaxSum(type val, type& min_val, type& max_val, type& sum_val, Int32& min_proc, Int32& max_proc) \
651 { \
652 Timer::Phase tphase(timeStats(), TP_Communication); \
653 (field)->computeMinMaxSum(val, min_val, max_val, sum_val, min_proc, max_proc); \
654 } \
655 IParallelDispatchT<type>* ParallelMngDispatcher:: \
656 dispatcher(type*) \
657 { \
658 return (field); \
659 } \
660 void ParallelMngDispatcher:: \
661 computeMinMaxSum(ConstArrayView<type> values, \
662 ArrayView<type> min_values, \
663 ArrayView<type> max_values, \
664 ArrayView<type> sum_values, \
665 ArrayView<Int32> min_ranks, \
666 ArrayView<Int32> max_ranks) \
667 { \
668 Timer::Phase tphase(timeStats(), TP_Communication); \
669 (field)->computeMinMaxSum(values, min_values, max_values, sum_values, min_ranks, max_ranks); \
670 } \
671 void ParallelMngDispatcher:: \
672 scan(eReduceType rt, ArrayView<type> v) \
673 { \
674 Timer::Phase tphase(timeStats(), TP_Communication); \
675 (field)->scan(rt, v); \
676 }
677
678ARCANE_PARALLEL_MANAGER_DISPATCH(m_char, char)
679ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_char, unsigned char)
680ARCANE_PARALLEL_MANAGER_DISPATCH(m_signed_char, signed char)
681ARCANE_PARALLEL_MANAGER_DISPATCH(m_short, short)
682ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_short, unsigned short)
683ARCANE_PARALLEL_MANAGER_DISPATCH(m_int, int)
684ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_int, unsigned int)
685ARCANE_PARALLEL_MANAGER_DISPATCH(m_long, long)
686ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_long, unsigned long)
687ARCANE_PARALLEL_MANAGER_DISPATCH(m_long_long, long long)
688ARCANE_PARALLEL_MANAGER_DISPATCH(m_unsigned_long_long, unsigned long long)
689ARCANE_PARALLEL_MANAGER_DISPATCH(m_float, float)
690ARCANE_PARALLEL_MANAGER_DISPATCH(m_double, double)
691ARCANE_PARALLEL_MANAGER_DISPATCH(m_long_double, long double)
692ARCANE_PARALLEL_MANAGER_DISPATCH(m_apreal, APReal)
693ARCANE_PARALLEL_MANAGER_DISPATCH(m_real2, Real2)
694ARCANE_PARALLEL_MANAGER_DISPATCH(m_real3, Real3)
695ARCANE_PARALLEL_MANAGER_DISPATCH(m_real2x2, Real2x2)
696ARCANE_PARALLEL_MANAGER_DISPATCH(m_real3x3, Real3x3)
697ARCANE_PARALLEL_MANAGER_DISPATCH(m_hpreal, HPReal)
698
699/*---------------------------------------------------------------------------*/
700/*---------------------------------------------------------------------------*/
701
702} // End namespace Arcane
703
704/*---------------------------------------------------------------------------*/
705/*---------------------------------------------------------------------------*/
706
707namespace Arccore
708{
711} // namespace Arccore
712
713/*---------------------------------------------------------------------------*/
714/*---------------------------------------------------------------------------*/
#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.
Interface of the parallelism manager for a subdomain.
virtual Ref< Parallel::IRequestList > createRequestListRef()=0
Creates a request list for this manager.
virtual ITimeMetricCollector * metricCollector()=0
Associated collection interface.
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.
Int32 commRank() const override
Rank of this instance in the communicator.
ITimeMetricCollector * timeMetricCollector() const override
Interface for collecting execution times (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.
Class managing a 2x2 matrix of reals.
Class managing a 3-dimensional real vector.
Class managing a 3x3 real matrix.
void reset()
Positions the instance to the null pointer.
InstanceType * get() const
Associated instance or nullptr if none.
Reference to an instance.
constexpr __host__ __device__ SizeType size() const noexcept
Returns the size of the array.
Definition Span.h:325
View of an array of elements of type T.
Definition Span.h:633
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:319
-- 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:445
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:115
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:476
UniqueArray< Byte > ByteUniqueArray
Dynamic 1D array of characters.
Definition UtilsTypes.h:329
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.