Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Parallel.h
Go to the documentation of this file.
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/* Parallel.h (C) 2000-2025 */
9/* */
10/* Namespace for types managing parallelism. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_PARALLEL_H
13#define ARCANE_CORE_PARALLEL_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/utils/ArrayView.h"
19
21#include "arccore/message_passing/Request.h"
22#include "arccore/message_passing/Communicator.h"
23#include "arccore/message_passing/PointToPointMessageInfo.h"
24#include "arccore/message_passing/IControlDispatcher.h"
25
27
28#define ARCANE_BEGIN_NAMESPACE_PARALLEL \
29 namespace Parallel \
30 {
31#define ARCANE_END_NAMESPACE_PARALLEL }
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36/*!
37 * \brief Types of parallelism classes.
38 */
39namespace Arcane::Parallel
40{
41class IStat;
42}
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
47/*!
48 * \brief Declarations of types and methods used by message exchange mechanisms.
49 */
51{
52
53/*!
54 * \brief Performs a named barrier with name \a name
55 *
56 * Performs a named barrier \a name using the manager \a pm.
57 *
58 * All ranks of \a pm block in this barrier and verify that all ranks use the
59 * same barrier name. If one of the ranks uses a different name, an exception
60 * is raised.
61 *
62 * This operation allows checking that all ranks use the same barrier, unlike
63 * the IParallelMng::barrier() operation.
64 *
65 * \note Only the first 1024 characters of \a name are used.
66 */
67extern "C++" ARCANE_CORE_EXPORT void
68namedBarrier(IParallelMng* pm, const String& name);
69
70/*---------------------------------------------------------------------------*/
71/*---------------------------------------------------------------------------*/
72/*!
73 * \brief Filters strings common to all ranks of \a pm.
74 *
75 * Takes an input list \a input_string of strings and returns in
76 * \a common_strings those that are common to all ranks of \a pm.
77 * The strings returned in \a common_strings are sorted alphabetically.
78 */
79extern "C++" ARCANE_CORE_EXPORT void
80filterCommonStrings(IParallelMng* pm, ConstArrayView<String> input_strings,
81 Array<String>& common_strings);
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85/*!
86 * \brief Writes the date and memory consumed into \a tm.
87 *
88 * The operation is collective on \a pm and displays the minimum, average,
89 * and maximum memory consumed, as well as the ranks of those that consume
90 * the least and the most memory.
91 */
92extern "C++" ARCANE_CORE_EXPORT void
93dumpDateAndMemoryUsage(IParallelMng* pm, ITraceMng* tm);
94
95/*---------------------------------------------------------------------------*/
96/*---------------------------------------------------------------------------*/
97
98} // namespace Arcane::MessagePassing
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
103namespace Arcane
104{
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
109inline std::ostream&
110operator<<(std::ostream& o, const Parallel::Request prequest)
111{
112 prequest.print(o);
113 return o;
114}
115
116/*---------------------------------------------------------------------------*/
117/*---------------------------------------------------------------------------*/
118
119} // End namespace Arcane
120
121/*---------------------------------------------------------------------------*/
122/*---------------------------------------------------------------------------*/
123
124#endif
Arcane configuration file.
Declarations of Arcane's general types.
Declarations of types and methods used by message exchange mechanisms.
void namedBarrier(IParallelMng *pm, const String &name)
Performs a named barrier with name name.
Definition Parallel.cc:61
void dumpDateAndMemoryUsage(IParallelMng *pm, ITraceMng *tm)
Writes the date and memory consumed into tm.
Definition Parallel.cc:164
void filterCommonStrings(IParallelMng *pm, ConstArrayView< String > input_strings, Array< String > &common_strings)
Filters strings common to all ranks of pm.
Definition Parallel.cc:95
Concurrency implementation.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::ostream & operator<<(std::ostream &ostr, eItemKind item_kind)
Output operator for a stream.