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
19#include "arccore/concurrency/ParallelLoopOptions.h"
20
21#include <optional>
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31/*!
32 * \brief Informations d'exécution d'une boucle.
33 *
34 * Cette classe permet de gérer les informations d'exécutions communes à toutes
35 * les boucles.
36 */
37class ARCCORE_CONCURRENCY_EXPORT ForLoopRunInfo
38{
39 public:
40
41 using ThatClass = ForLoopRunInfo;
42
43 public:
44
45 ForLoopRunInfo() = default;
46 explicit ForLoopRunInfo(const ParallelLoopOptions& options)
47 : m_options(options)
48 {}
49 ForLoopRunInfo(const ParallelLoopOptions& options, const ForLoopTraceInfo& trace_info)
50 : m_options(options)
51 , m_trace_info(trace_info)
52 {}
53 explicit ForLoopRunInfo(const ForLoopTraceInfo& trace_info)
54 : m_trace_info(trace_info)
55 {}
56
57 public:
58
59 std::optional<ParallelLoopOptions> options() const { return m_options; }
60 ThatClass& addOptions(const ParallelLoopOptions& v)
61 {
62 m_options = v;
63 return (*this);
64 }
65 const ForLoopTraceInfo& traceInfo() const { return m_trace_info; }
66 ThatClass& addTraceInfo(const ForLoopTraceInfo& v)
67 {
68 m_trace_info = v;
69 return (*this);
70 }
71
72 /*!
73 * \brief Positionne le pointeur conservant les statistiques d'exécution.
74 *
75 * Ce pointeur \a v doit rester valide durant toute l'exécution de la boucle.
76 */
77 void setExecStat(ForLoopOneExecStat* v) { m_exec_stat = v; }
78
79 //! Pointeur contenant les statistiques d'exécution.
80 ForLoopOneExecStat* execStat() const { return m_exec_stat; }
81
82 protected:
83
84 std::optional<ParallelLoopOptions> m_options;
85 ForLoopTraceInfo m_trace_info;
86 ForLoopOneExecStat* m_exec_stat = nullptr;
87};
88
89/*---------------------------------------------------------------------------*/
90/*---------------------------------------------------------------------------*/
91
92} // End namespace Arcane
93
94/*---------------------------------------------------------------------------*/
95/*---------------------------------------------------------------------------*/
96
97#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 -*-