Arcane  v4.1.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
Référence de la classe Arcane::TaskFactory

Fabrique pour les tâches. Plus de détails...

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/concurrency/arccore/concurrency/TaskFactory.h>

+ Graphe de collaboration de Arcane::TaskFactory:

Fonctions membres publiques statiques

template<typename InstanceType>
static ITaskcreateTask (InstanceType *instance, void(InstanceType::*function)(const TaskContext &tc))
 Créé une tâche. Lors de l'exécution, la tâche appellera la méthode function via l'instance instance.
 
template<typename InstanceType>
static ITaskcreateTask (InstanceType *instance, void(InstanceType::*function)())
 Créé une tâche. Lors de l'exécution, la tâche appellera la méthode function via l'instance instance.
 
template<typename InstanceType>
static ITaskcreateChildTask (ITask *parent_task, InstanceType *instance, void(InstanceType::*function)(const TaskContext &tc))
 Créé une tâche fille.
 
template<typename InstanceType>
static ITaskcreateChildTask (ITask *parent_task, InstanceType *instance, void(InstanceType::*function)())
 Créé une tâche fille.
 
static void executeParallelFor (Integer begin, Integer size, const ParallelLoopOptions &options, IRangeFunctor *f)
 Exécute le fonctor f en concurrence.
 
static void executeParallelFor (Integer begin, Integer size, Integer block_size, IRangeFunctor *f)
 Exécute le fonctor f en concurrence.
 
static void executeParallelFor (Integer begin, Integer size, IRangeFunctor *f)
 Exécute le fonctor f en concurrence.
 
static void executeParallelFor (const ParallelFor1DLoopInfo &loop_info)
 Exécute la boucle loop_info en concurrence.
 
static void executeParallelFor (const ComplexForLoopRanges< 1 > &loop_ranges, const ParallelLoopOptions &options, IMDRangeFunctor< 1 > *functor)
 Exécute une boucle simple.
 
static void executeParallelFor (const ComplexForLoopRanges< 1 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 1 > *functor)
 Exécute une boucle simple.
 
static void executeParallelFor (const ComplexForLoopRanges< 2 > &loop_ranges, const ParallelLoopOptions &options, IMDRangeFunctor< 2 > *functor)
 Exécute une boucle 2D.
 
static void executeParallelFor (const ComplexForLoopRanges< 2 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 2 > *functor)
 Exécute une boucle 2D.
 
static void executeParallelFor (const ComplexForLoopRanges< 3 > &loop_ranges, const ParallelLoopOptions &options, IMDRangeFunctor< 3 > *functor)
 Exécute une boucle 3D.
 
static void executeParallelFor (const ComplexForLoopRanges< 3 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 3 > *functor)
 Exécute une boucle 3D.
 
static void executeParallelFor (const ComplexForLoopRanges< 4 > &loop_ranges, const ParallelLoopOptions &options, IMDRangeFunctor< 4 > *functor)
 Exécute une boucle 4D.
 
static void executeParallelFor (const ComplexForLoopRanges< 4 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 4 > *functor)
 Exécute une boucle 4D.
 
static Int32 nbAllowedThread ()
 Nombre de threads utilisés au maximum pour gérer les tâches.
 
static Int32 currentTaskThreadIndex ()
 Indice (entre 0 et nbAllowedThread()-1) du thread exécutant la tâche actuelle.
 
static Int32 currentTaskIndex ()
 Indice (entre 0 et nbAllowedThread()-1) de la tâche actuelle.
 
static void setDefaultParallelLoopOptions (const ParallelLoopOptions &v)
 Positionne les valeurs par défaut d'exécution d'une boucle parallèle.
 
static const ParallelLoopOptionsdefaultParallelLoopOptions ()
 Valeurs par défaut d'exécution d'une boucle parallèle.
 
static bool isActive ()
 Indique si les tâches sont actives. Les tâches sont actives si une implémentation est disponible et si le nombre de threads demandé est strictement supérieur à 1.
 
static void printInfos (std::ostream &o)
 Affiche les informations sur l'implémentation.
 
static IObservablecreateThreadObservable ()
 Observable appelé lors de la création d'un thread pour une tâche.
 
static IObservabledestroyThreadObservable ()
 Observable appelé lors de la destruction d'un thread pour une tâche.
 
static void terminate ()
 Indique qu'on n'utilisera plus les threads. Cette méthode ne doit pas être appelée lorsque des tâches sont actives.
 
static void setVerboseLevel (Integer v)
 Positionne le niveau de verbosité (0 pour pas d'affichage qui est le défaut)
 
static Integer verboseLevel ()
 Niveau de verbosité
 
static void _internalSetImplementation (ITaskImplementation *task_impl)
 

Attributs privés

friend TaskFactoryInternal
 

Attributs privés statiques

static ITaskImplementationm_impl = &NullTaskImplementation::singleton
 
static Int32 m_verbose_level = 0
 

Description détaillée

Fabrique pour les tâches.

Définition à la ligne 33 du fichier TaskFactory.h.

Documentation des fonctions membres

◆ _internalSetImplementation()

void Arcane::TaskFactory::_internalSetImplementation ( ITaskImplementation * task_impl)
static

Définition à la ligne 235 du fichier ConcurrencyUtils.cc.

◆ createChildTask() [1/2]

template<typename InstanceType>
static ITask * Arcane::TaskFactory::createChildTask ( ITask * parent_task,
InstanceType * instance,
void(InstanceType::* function )() )
inlinestatic

Créé une tâche fille.

Lors de l'exécution, la tâche appellera la méthode function via l'instance instance.

Définition à la ligne 88 du fichier TaskFactory.h.

◆ createChildTask() [2/2]

template<typename InstanceType>
static ITask * Arcane::TaskFactory::createChildTask ( ITask * parent_task,
InstanceType * instance,
void(InstanceType::* function )(const TaskContext &tc) )
inlinestatic

Créé une tâche fille.

Lors de l'exécution, la tâche appellera la méthode function via l'instance instance.

Définition à la ligne 74 du fichier TaskFactory.h.

◆ createTask() [1/2]

template<typename InstanceType>
static ITask * Arcane::TaskFactory::createTask ( InstanceType * instance,
void(InstanceType::* function )() )
inlinestatic

Créé une tâche. Lors de l'exécution, la tâche appellera la méthode function via l'instance instance.

Définition à la ligne 61 du fichier TaskFactory.h.

◆ createTask() [2/2]

template<typename InstanceType>
static ITask * Arcane::TaskFactory::createTask ( InstanceType * instance,
void(InstanceType::* function )(const TaskContext &tc) )
inlinestatic

Créé une tâche. Lors de l'exécution, la tâche appellera la méthode function via l'instance instance.

Définition à la ligne 49 du fichier TaskFactory.h.

◆ createThreadObservable()

IObservable * Arcane::TaskFactory::createThreadObservable ( )
static

Observable appelé lors de la création d'un thread pour une tâche.

Avertissement
L'instance de l'observable est créée lors du premier appel à cette méthode. Elle n'est donc pas thread-safe. De même, la modification de l'observable (ajout/suppression d'observateur) n'est pas thread-safe.

Définition à la ligne 244 du fichier ConcurrencyUtils.cc.

◆ currentTaskIndex()

static Int32 Arcane::TaskFactory::currentTaskIndex ( )
inlinestatic

Indice (entre 0 et nbAllowedThread()-1) de la tâche actuelle.

Cet indice est le même que currentTaskThreadIndex() sauf dans le cas où on se trouve dans un executeParallelFor() avec un partitionnement déterministe (ParallelLoopOptions::Partitioner::Deterministic). Dans ce dernier cas, le numéro de la tâche est assigné de manière déterministe qui ne dépend que du nombre de threads alloués pour la tâche et de ParallelLoopOptions::grainSize().

Si le thread courant n'exécute pas une tâche associé à cette implémentation, retourne (-1).

Définition à la ligne 211 du fichier TaskFactory.h.

◆ currentTaskThreadIndex()

static Int32 Arcane::TaskFactory::currentTaskThreadIndex ( )
inlinestatic

Indice (entre 0 et nbAllowedThread()-1) du thread exécutant la tâche actuelle.

Pour des raisons de performance, il est préférable d'appeler cette méthode le moins possible. L'idéal est de ne le faire qu'au début de l'exécution de la tâche et ensuite d'utiliser la valeur retournée.

Définition à la ligne 193 du fichier TaskFactory.h.

◆ defaultParallelLoopOptions()

static const ParallelLoopOptions & Arcane::TaskFactory::defaultParallelLoopOptions ( )
inlinestatic

Valeurs par défaut d'exécution d'une boucle parallèle.

Définition à la ligne 228 du fichier TaskFactory.h.

Références Arcane::ConcurrencyBase::defaultParallelLoopOptions().

Référencé par Arcane::TBBTaskImplementation::_executeMDParallelFor(), Arcane::arcaneParallelForeach(), Arcane::arcaneParallelForeach(), Arcane::TBBTaskImplementation::executeParallelFor(), Arcane::TBBTaskImplementation::executeParallelFor(), et Arcane::TBBTaskImplementation::initialize().

+ Voici le graphe d'appel pour cette fonction :
+ Voici le graphe des appelants de cette fonction :

◆ destroyThreadObservable()

IObservable * Arcane::TaskFactory::destroyThreadObservable ( )
static

Observable appelé lors de la destruction d'un thread pour une tâche.

Avertissement
L'instance de l'observable est créée lors du premier appel à cette méthode. Elle n'est donc pas thread-safe. De même, la modification de l'observable (ajout/suppression d'observateur) n'est pas thread-safe.

Définition à la ligne 254 du fichier ConcurrencyUtils.cc.

◆ executeParallelFor() [1/12]

static void Arcane::TaskFactory::executeParallelFor ( const ComplexForLoopRanges< 1 > & loop_ranges,
const ForLoopRunInfo & run_info,
IMDRangeFunctor< 1 > * functor )
inlinestatic

Exécute une boucle simple.

Définition à la ligne 128 du fichier TaskFactory.h.

◆ executeParallelFor() [2/12]

static void Arcane::TaskFactory::executeParallelFor ( const ComplexForLoopRanges< 1 > & loop_ranges,
const ParallelLoopOptions & options,
IMDRangeFunctor< 1 > * functor )
inlinestatic

Exécute une boucle simple.

Définition à la ligne 120 du fichier TaskFactory.h.

◆ executeParallelFor() [3/12]

static void Arcane::TaskFactory::executeParallelFor ( const ComplexForLoopRanges< 2 > & loop_ranges,
const ForLoopRunInfo & run_info,
IMDRangeFunctor< 2 > * functor )
inlinestatic

Exécute une boucle 2D.

Définition à la ligne 144 du fichier TaskFactory.h.

◆ executeParallelFor() [4/12]

static void Arcane::TaskFactory::executeParallelFor ( const ComplexForLoopRanges< 2 > & loop_ranges,
const ParallelLoopOptions & options,
IMDRangeFunctor< 2 > * functor )
inlinestatic

Exécute une boucle 2D.

Définition à la ligne 136 du fichier TaskFactory.h.

◆ executeParallelFor() [5/12]

static void Arcane::TaskFactory::executeParallelFor ( const ComplexForLoopRanges< 3 > & loop_ranges,
const ForLoopRunInfo & run_info,
IMDRangeFunctor< 3 > * functor )
inlinestatic

Exécute une boucle 3D.

Définition à la ligne 160 du fichier TaskFactory.h.

◆ executeParallelFor() [6/12]

static void Arcane::TaskFactory::executeParallelFor ( const ComplexForLoopRanges< 3 > & loop_ranges,
const ParallelLoopOptions & options,
IMDRangeFunctor< 3 > * functor )
inlinestatic

Exécute une boucle 3D.

Définition à la ligne 152 du fichier TaskFactory.h.

◆ executeParallelFor() [7/12]

static void Arcane::TaskFactory::executeParallelFor ( const ComplexForLoopRanges< 4 > & loop_ranges,
const ForLoopRunInfo & run_info,
IMDRangeFunctor< 4 > * functor )
inlinestatic

Exécute une boucle 4D.

Définition à la ligne 176 du fichier TaskFactory.h.

◆ executeParallelFor() [8/12]

static void Arcane::TaskFactory::executeParallelFor ( const ComplexForLoopRanges< 4 > & loop_ranges,
const ParallelLoopOptions & options,
IMDRangeFunctor< 4 > * functor )
inlinestatic

Exécute une boucle 4D.

Définition à la ligne 168 du fichier TaskFactory.h.

◆ executeParallelFor() [9/12]

static void Arcane::TaskFactory::executeParallelFor ( const ParallelFor1DLoopInfo & loop_info)
inlinestatic

Exécute la boucle loop_info en concurrence.

Définition à la ligne 114 du fichier TaskFactory.h.

◆ executeParallelFor() [10/12]

◆ executeParallelFor() [11/12]

static void Arcane::TaskFactory::executeParallelFor ( Integer begin,
Integer size,
Integer block_size,
IRangeFunctor * f )
inlinestatic

Exécute le fonctor f en concurrence.

Définition à la ligne 102 du fichier TaskFactory.h.

◆ executeParallelFor() [12/12]

static void Arcane::TaskFactory::executeParallelFor ( Integer begin,
Integer size,
IRangeFunctor * f )
inlinestatic

Exécute le fonctor f en concurrence.

Définition à la ligne 108 du fichier TaskFactory.h.

◆ isActive()

static bool Arcane::TaskFactory::isActive ( )
inlinestatic

Indique si les tâches sont actives. Les tâches sont actives si une implémentation est disponible et si le nombre de threads demandé est strictement supérieur à 1.

Définition à la ligne 240 du fichier TaskFactory.h.

Référencé par Arcane::Accelerator::AcceleratorRuntimeInitialisationInfo::executionPolicy(), et Arcane::Application::initialize().

+ Voici le graphe des appelants de cette fonction :

◆ nbAllowedThread()

static Int32 Arcane::TaskFactory::nbAllowedThread ( )
inlinestatic

Nombre de threads utilisés au maximum pour gérer les tâches.

Définition à la ligne 184 du fichier TaskFactory.h.

Références Arcane::ConcurrencyBase::maxAllowedThread().

Référencé par Arcane::Application::initialize().

+ Voici le graphe d'appel pour cette fonction :
+ Voici le graphe des appelants de cette fonction :

◆ printInfos()

static void Arcane::TaskFactory::printInfos ( std::ostream & o)
inlinestatic

Affiche les informations sur l'implémentation.

Les informations sont par exemple le numéro de version ou le nom de l'implémentation.

Définition à la ligne 251 du fichier TaskFactory.h.

Référencé par Arcane::Application::initialize().

+ Voici le graphe des appelants de cette fonction :

◆ setDefaultParallelLoopOptions()

static void Arcane::TaskFactory::setDefaultParallelLoopOptions ( const ParallelLoopOptions & v)
inlinestatic

Positionne les valeurs par défaut d'exécution d'une boucle parallèle.

Définition à la ligne 222 du fichier TaskFactory.h.

Références Arcane::ConcurrencyBase::setDefaultParallelLoopOptions().

Référencé par Arcane::ArcaneLauncher::init(), et Arcane::TBBTaskImplementation::initialize().

+ Voici le graphe d'appel pour cette fonction :
+ Voici le graphe des appelants de cette fonction :

◆ setVerboseLevel()

static void Arcane::TaskFactory::setVerboseLevel ( Integer v)
inlinestatic

Positionne le niveau de verbosité (0 pour pas d'affichage qui est le défaut)

Définition à la ligne 288 du fichier TaskFactory.h.

Références setVerboseLevel().

Référencé par Arcane::Application::build(), et setVerboseLevel().

+ Voici le graphe d'appel pour cette fonction :
+ Voici le graphe des appelants de cette fonction :

◆ terminate()

void Arcane::TaskFactory::terminate ( )
static

Indique qu'on n'utilisera plus les threads. Cette méthode ne doit pas être appelée lorsque des tâches sont actives.

Définition à la ligne 265 du fichier ConcurrencyUtils.cc.

Référencé par Arcane::Application::~Application().

+ Voici le graphe des appelants de cette fonction :

◆ verboseLevel()

static Integer Arcane::TaskFactory::verboseLevel ( )
inlinestatic

Niveau de verbosité

Définition à la ligne 291 du fichier TaskFactory.h.

Référencé par Arcane::TBBTaskImplementation::_executeMDParallelFor().

+ Voici le graphe des appelants de cette fonction :

Documentation des données membres

◆ m_impl

ITaskImplementation * Arcane::TaskFactory::m_impl = &NullTaskImplementation::singleton
staticprivate

Définition à la ligne 302 du fichier TaskFactory.h.

◆ m_verbose_level

Int32 Arcane::TaskFactory::m_verbose_level = 0
staticprivate

Définition à la ligne 303 du fichier TaskFactory.h.

◆ TaskFactoryInternal

friend Arcane::TaskFactory::TaskFactoryInternal
private

Définition à la ligne 35 du fichier TaskFactory.h.


La documentation de cette classe a été générée à partir des fichiers suivants :