Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MetisGraphGather.h
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/* MetisGraphGather.h (C) 2000-2024 */
9/* */
10/* Gathering of 'Parmetis' graphs. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_STD_INTERNAL_METISGRAPHGATHER
13#define ARCANE_STD_INTERNAL_METISGRAPHGATHER
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/Array.h"
18#include "arcane/utils/String.h"
19#include "arcane/utils/TraceAccessor.h"
20
22
23#include "arcane/std/internal/MetisGraph.h"
24
25#include <parmetis.h>
26#include <mpi.h>
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace Arcane
32{
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37class MetisGraphGather
38: public TraceAccessor
39{
40 public:
41
42 explicit MetisGraphGather(IParallelMng* pm);
43
44 public:
45
50 void gatherGraph(const bool need_part, ConstArrayView<idx_t> vtxdist, const int ncon, MetisGraphView my_graph,
51 MetisGraph& graph);
52
59
60 private:
61
62 IParallelMng* m_parallel_mng = nullptr;
63 Int32 m_my_rank = A_NULL_RANK;
64 Int32 m_nb_rank = A_NULL_RANK;
65
66 private:
67
68 template <class SourceType, class TargetType>
69 void _convertVector(const int size, ConstArrayView<SourceType> src, ArrayView<TargetType> dest);
70};
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75} // End namespace Arcane
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
80#endif
Declarations of Arcane's general types.
Modifiable view of an array of type T.
Constant view of an array of type T.
Interface of the parallelism manager for a subdomain.
void scatterPart(ConstArrayView< idx_t > vtxdist, ConstArrayView< idx_t > part, ArrayView< idx_t > my_part)
Distributes the partitioning "part" from processor rank 0 in the communicator "comm" to all processor...
void gatherGraph(const bool need_part, ConstArrayView< idx_t > vtxdist, const int ncon, MetisGraphView my_graph, MetisGraph &graph)
Performs a gathering of the ParMetis graph "my_graph" on processor rank 0 in the communicator "comm"....
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int32_t Int32
Signed integer type of 32 bits.