Arcane  v4.1.0.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
ForLoopRunInfo.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* ForLoopRunInfo.h (C) 2000-2025 */
9/* */
10/* Informations d'exécution d'une boucle. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_BASE_FORLOOPRUNINFO_H
13#define ARCCORE_BASE_FORLOOPRUNINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/base/ForLoopTraceInfo.h"
18#include "arccore/base/ParallelLoopOptions.h"
19
20#include <optional>
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30/*!
31 * \brief Informations d'exécution d'une boucle.
32 *
33 * Cette classe permet de gérer les informations d'exécutions communes à toutes
34 * les boucles.
35 */
36class ARCCORE_BASE_EXPORT ForLoopRunInfo
37{
38 public:
39
40 using ThatClass = ForLoopRunInfo;
41
42 public:
43
44 ForLoopRunInfo() = default;
45 explicit ForLoopRunInfo(const ParallelLoopOptions& options)
46 : m_options(options)
47 {}
48 ForLoopRunInfo(const ParallelLoopOptions& options, const ForLoopTraceInfo& trace_info)
49 : m_options(options)
50 , m_trace_info(trace_info)
51 {}
52 explicit ForLoopRunInfo(const ForLoopTraceInfo& trace_info)
53 : m_trace_info(trace_info)
54 {}
55
56 public:
57
58 std::optional<ParallelLoopOptions> options() const { return m_options; }
59 ThatClass& addOptions(const ParallelLoopOptions& v)
60 {
61 m_options = v;
62 return (*this);
63 }
64 const ForLoopTraceInfo& traceInfo() const { return m_trace_info; }
65 ThatClass& addTraceInfo(const ForLoopTraceInfo& v)
66 {
67 m_trace_info = v;
68 return (*this);
69 }
70
71 /*!
72 * \brief Positionne le pointeur conservant les statistiques d'exécution.
73 *
74 * Ce pointeur \a v doit rester valide durant toute l'exécution de la boucle.
75 */
76 void setExecStat(ForLoopOneExecStat* v) { m_exec_stat = v; }
77
78 //! Pointeur contenant les statistiques d'exécution.
79 ForLoopOneExecStat* execStat() const { return m_exec_stat; }
80
81 protected:
82
83 std::optional<ParallelLoopOptions> m_options;
84 ForLoopTraceInfo m_trace_info;
85 ForLoopOneExecStat* m_exec_stat = nullptr;
86};
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
90
91} // End namespace Arcane
92
93/*---------------------------------------------------------------------------*/
94/*---------------------------------------------------------------------------*/
95
96#endif
Classe pour gérer le profiling d'une seule exécution d'une boucle.
ForLoopOneExecStat * execStat() const
Pointeur contenant les statistiques d'exécution.
void setExecStat(ForLoopOneExecStat *v)
Positionne le pointeur conservant les statistiques d'exécution.
Informations de trace pour une boucle 'for'.
Options d'exécution d'une boucle parallèle en multi-thread.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-