Arcane  v4.1.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ITaskImplementation.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/* ITaskImplementation.h (C) 2000-2025 */
9/* */
10/* Interface de gestion des tâches. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_BASE_ITASKIMPLEMENTATION_H
13#define ARCCORE_BASE_ITASKIMPLEMENTATION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/concurrency/ConcurrencyGlobal.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
36class ARCCORE_CONCURRENCY_EXPORT ITaskImplementation
37{
38 public:
39
40 virtual ~ITaskImplementation() = default;
41
42 public:
43
52 virtual void initialize(Int32 nb_thread) = 0;
58 virtual void terminate() = 0;
65
67 virtual void executeParallelFor(Integer begin, Integer size, const ParallelLoopOptions& options, IRangeFunctor* f) = 0;
68
70 virtual void executeParallelFor(Integer begin, Integer size, Integer block_size, IRangeFunctor* f) = 0;
71
73 virtual void executeParallelFor(Integer begin, Integer size, IRangeFunctor* f) = 0;
74
76 virtual void executeParallelFor(const ParallelFor1DLoopInfo& loop_info) = 0;
77
79 virtual void executeParallelFor(const ComplexForLoopRanges<1>& loop_ranges,
80 const ForLoopRunInfo& run_info,
81 IMDRangeFunctor<1>* functor) = 0;
83 virtual void executeParallelFor(const ComplexForLoopRanges<2>& loop_ranges,
84 const ForLoopRunInfo& run_info,
85 IMDRangeFunctor<2>* functor) = 0;
87 virtual void executeParallelFor(const ComplexForLoopRanges<3>& loop_ranges,
88 const ForLoopRunInfo& run_info,
89 IMDRangeFunctor<3>* functor) = 0;
91 virtual void executeParallelFor(const ComplexForLoopRanges<4>& loop_ranges,
92 const ForLoopRunInfo& run_info,
93 IMDRangeFunctor<4>* functor) = 0;
94
96 virtual bool isActive() const = 0;
97
99 virtual Int32 nbAllowedThread() const = 0;
100
102 virtual Int32 currentTaskThreadIndex() const = 0;
103
105 virtual Int32 currentTaskIndex() const = 0;
106
108 virtual void printInfos(std::ostream& o) const = 0;
109};
110
111/*---------------------------------------------------------------------------*/
112/*---------------------------------------------------------------------------*/
113
114} // End namespace Arcane
115
116/*---------------------------------------------------------------------------*/
117/*---------------------------------------------------------------------------*/
118
119#endif
Informations d'exécution d'une boucle.
Interface d'un fonctor sur un interval d'itération multi-dimensionnel de dimension RankValue.
Interface d'un fonctor sur un interval d'itération.
Interface d'un fonctor pour une tâche.
Definition Task.h:72
Implémentation d'une fabrique de tâches.
virtual void executeParallelFor(Integer begin, Integer size, const ParallelLoopOptions &options, IRangeFunctor *f)=0
Exécute le fonctor f en concurrence.
virtual void executeParallelFor(Integer begin, Integer size, IRangeFunctor *f)=0
Exécute le fonctor f en concurrence.
virtual void executeParallelFor(const ParallelFor1DLoopInfo &loop_info)=0
Exécute la boucle loop_info en concurrence.
virtual Int32 nbAllowedThread() const =0
Nombre de threads utilisés au maximum pour gérer les tâches.
virtual void executeParallelFor(const ComplexForLoopRanges< 2 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 2 > *functor)=0
Exécute une boucle 2D en concurrence.
virtual void executeParallelFor(Integer begin, Integer size, Integer block_size, IRangeFunctor *f)=0
Exécute le fonctor f en concurrence.
virtual void executeParallelFor(const ComplexForLoopRanges< 3 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 3 > *functor)=0
Exécute une boucle 3D en concurrence.
virtual ITask * createRootTask(ITaskFunctor *f)=0
Créé une tâche racine. L'implémentation doit recopier la valeur de f qui est soit un TaskFunctor,...
virtual Int32 currentTaskIndex() const =0
Implémentation de TaskFactory::currentTaskIndex()
virtual bool isActive() const =0
Indique si l'implémentation est active.
virtual void executeParallelFor(const ComplexForLoopRanges< 4 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 4 > *functor)=0
Exécute une boucle 4D en concurrence.
virtual void executeParallelFor(const ComplexForLoopRanges< 1 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 1 > *functor)=0
Exécute une boucle 1D en concurrence.
virtual void printInfos(std::ostream &o) const =0
Affiche les informations sur le runtime utilisé
virtual void terminate()=0
virtual Int32 currentTaskThreadIndex() const =0
Implémentation de TaskFactory::currentTaskThreadIndex()
virtual void initialize(Int32 nb_thread)=0
Interface d'une tâche concourante.
Definition Task.h:187
Caractéristiques d'un boucle 1D multi-thread.
Definition ParallelFor.h:34
Options d'exécution d'une boucle parallèle en multi-thread.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
std::int32_t Int32
Type entier signé sur 32 bits.