Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MetisGraphDigest.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/* MetisGraphDigest.h (C) 2000-2024 */
9/* */
10/* Calculates a global checksum of Metis inputs/outputs. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_STD_INTERNAL_METISGRAPHDIGEST
13#define ARCANE_STD_INTERNAL_METISGRAPHDIGEST
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/String.h"
18#include "arcane/utils/TraceAccessor.h"
19
21
22#include "arcane/std/internal/MetisGraph.h"
23
24#include <string>
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Arcane
30{
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
38class MetisGraphDigest
39: public TraceAccessor
40{
41 public:
42
43 explicit MetisGraphDigest(IParallelMng* pm);
44
45 public:
46
53 String computeInputDigest(const bool need_part, const int nb_options,
54 const MetisGraphView& my_graph, const idx_t* vtxdist, const idx_t* wgtflag,
55 const idx_t* numflag, const idx_t* ncon, const idx_t* nparts,
56 const real_t* tpwgts, const real_t* ubvec, const real_t* ipc2redist,
57 const idx_t* options);
58
65 String computeOutputDigest(const MetisGraphView& my_graph, const idx_t* edgecut);
66
67 private:
68
69 IParallelMng* m_parallel_mng = nullptr;
70 Int32 m_my_rank = A_NULL_RANK;
71 Int32 m_nb_rank = 0;
72
73 private:
74
75 void _computeHash(Span<const idx_t> data, ByteArray& output, const char* name);
76 void _computeHash(Span<const real_t> data, ByteArray& output, const char* name);
78};
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83} // namespace Arcane
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88#endif
Declarations of Arcane's general types.
Constant view of an array of type T.
Interface of the parallelism manager for a subdomain.
String _digestString(ConstArrayView< Byte > my_digest)
From the local sum, calculates the global sum and returns a string representing this sum (only on pro...
String computeInputDigest(const bool need_part, const int nb_options, const MetisGraphView &my_graph, const idx_t *vtxdist, const idx_t *wgtflag, const idx_t *numflag, const idx_t *ncon, const idx_t *nparts, const real_t *tpwgts, const real_t *ubvec, const real_t *ipc2redist, const idx_t *options)
String computeOutputDigest(const MetisGraphView &my_graph, const idx_t *edgecut)
View of an array of elements of type T.
Definition Span.h:635
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Array< Byte > ByteArray
Dynamic one-dimensional array of characters.
Definition UtilsTypes.h:121
std::int32_t Int32
Signed integer type of 32 bits.