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

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

#include <arccore/concurrency/TaskFactory.h>

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 ()
 
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)
 

Description détaillée

Fabrique pour les tâches.

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

Documentation des fonctions membres

◆ _internalSetImplementation()

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

Définition à la ligne 240 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 87 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 73 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 60 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 48 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 249 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 213 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 195 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 227 du fichier TaskFactory.h.

Référencé par Arcane::arcaneParallelForeach(), et Arcane::arcaneParallelForeach().

◆ 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 259 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 127 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 119 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 143 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 135 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 159 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 151 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 175 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 167 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 113 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 101 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 107 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 239 du fichier TaskFactory.h.

Référencé par Arcane::Accelerator::AcceleratorRuntimeInitialisationInfo::executionPolicy().

◆ nbAllowedThread()

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

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

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

Référencé par Arcane::Accelerator::impl::RunCommandLaunchInfo::computeParallelLoopOptions().

◆ 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 250 du fichier TaskFactory.h.

◆ 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 221 du fichier TaskFactory.h.

Référencé par Arcane::ArcaneLauncher::init().

◆ 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 287 du fichier TaskFactory.h.

Références setVerboseLevel().

Référencé par setVerboseLevel().

◆ terminate()

void Arcane::TaskFactory::terminate ( )
static

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

◆ verboseLevel()

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

Niveau de verbosité

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


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