LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::Scheduler Class Reference

#include "Scheduler.h"

Classes

struct  Config
 

Public Types

using Parameters = fhicl::Table< Config >
 

Public Member Functions

 Scheduler (Parameters const &p)
 
ActionTable const & actionTable () const noexcept
 
unsigned num_threads () const noexcept
 
ScheduleID::size_type num_schedules () const noexcept
 
bool handleEmptyRuns () const noexcept
 
bool handleEmptySubRuns () const noexcept
 
bool errorOnMissingConsumes () const noexcept
 
bool wantSummary () const noexcept
 
std::string const & dataDependencyGraph () const noexcept
 
std::unique_ptr< GlobalTaskGroupglobal_task_group ()
 

Private Attributes

ActionTable actionTable_
 
unsigned const nThreads_
 
unsigned const nSchedules_
 
unsigned const stackSize_
 
bool const handleEmptyRuns_
 
bool const handleEmptySubRuns_
 
bool const errorOnMissingConsumes_
 
bool const wantSummary_
 
std::string const dataDependencyGraph_
 

Detailed Description

Definition at line 15 of file Scheduler.h.

Member Typedef Documentation

Definition at line 69 of file Scheduler.h.

Constructor & Destructor Documentation

art::Scheduler::Scheduler ( Parameters const &  p)
explicit

Definition at line 49 of file Scheduler.cc.

References dataDependencyGraph_, errorOnMissingConsumes_, handleEmptyRuns_, handleEmptySubRuns_, art::Globals::instance(), nSchedules_, nThreads_, num_threads(), stackSize_, and wantSummary_.

50  : actionTable_{ps().actionTable()}
51  , nThreads_{adjust_num_threads(ps().num_threads())}
52  , nSchedules_{ps().num_schedules()}
53  , stackSize_{ps().stack_size()}
54  , handleEmptyRuns_{ps().handleEmptyRuns()}
55  , handleEmptySubRuns_{ps().handleEmptySubRuns()}
56  , errorOnMissingConsumes_{ps().errorOnMissingConsumes()}
57  , wantSummary_{ps().wantSummary()}
58  , dataDependencyGraph_{ps().dataDependencyGraph()}
59  {
60  auto& globals = *Globals::instance();
61  globals.setNThreads(nThreads_);
62  globals.setNSchedules(nSchedules_);
63  }
ActionTable actionTable_
Definition: Scheduler.h:119
unsigned num_threads() const noexcept
Definition: Scheduler.h:79
std::string const dataDependencyGraph_
Definition: Scheduler.h:127
bool const wantSummary_
Definition: Scheduler.h:126
bool const errorOnMissingConsumes_
Definition: Scheduler.h:125
unsigned const stackSize_
Definition: Scheduler.h:122
unsigned const nSchedules_
Definition: Scheduler.h:121
bool const handleEmptySubRuns_
Definition: Scheduler.h:124
bool const handleEmptyRuns_
Definition: Scheduler.h:123
unsigned const nThreads_
Definition: Scheduler.h:120
static Globals * instance()
Definition: Globals.cc:17

Member Function Documentation

ActionTable const& art::Scheduler::actionTable ( ) const
inlinenoexcept

Definition at line 73 of file Scheduler.h.

References actionTable_.

74  {
75  return actionTable_;
76  }
ActionTable actionTable_
Definition: Scheduler.h:119
std::string const& art::Scheduler::dataDependencyGraph ( ) const
inlinenoexcept

Definition at line 109 of file Scheduler.h.

References dataDependencyGraph_, and global_task_group().

110  {
111  return dataDependencyGraph_;
112  }
std::string const dataDependencyGraph_
Definition: Scheduler.h:127
bool art::Scheduler::errorOnMissingConsumes ( ) const
inlinenoexcept

Definition at line 99 of file Scheduler.h.

References errorOnMissingConsumes_.

100  {
102  }
bool const errorOnMissingConsumes_
Definition: Scheduler.h:125
std::unique_ptr< GlobalTaskGroup > art::Scheduler::global_task_group ( )

Definition at line 66 of file Scheduler.cc.

References nThreads_, and stackSize_.

Referenced by dataDependencyGraph().

67  {
68  using tbb::global_control;
69  auto value_of = [](auto const field) {
70  return global_control::active_value(field);
71  };
72  auto group = std::make_unique<GlobalTaskGroup>(nThreads_, stackSize_);
73  mf::LogInfo("MTdiagnostics")
74  << "TBB has been configured to use:\n"
75  << " - a maximum of " << value_of(max_parallelism) << " threads\n"
76  << " - a stack size of " << value_of(thread_stack_size) << " bytes";
77  return group;
78  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
unsigned const stackSize_
Definition: Scheduler.h:122
unsigned const nThreads_
Definition: Scheduler.h:120
bool art::Scheduler::handleEmptyRuns ( ) const
inlinenoexcept

Definition at line 89 of file Scheduler.h.

References handleEmptyRuns_.

90  {
91  return handleEmptyRuns_;
92  }
bool const handleEmptyRuns_
Definition: Scheduler.h:123
bool art::Scheduler::handleEmptySubRuns ( ) const
inlinenoexcept

Definition at line 94 of file Scheduler.h.

References handleEmptySubRuns_.

95  {
96  return handleEmptySubRuns_;
97  }
bool const handleEmptySubRuns_
Definition: Scheduler.h:124
ScheduleID::size_type art::Scheduler::num_schedules ( ) const
inlinenoexcept

Definition at line 84 of file Scheduler.h.

References nSchedules_.

85  {
86  return nSchedules_;
87  }
unsigned const nSchedules_
Definition: Scheduler.h:121
unsigned art::Scheduler::num_threads ( ) const
inlinenoexcept

Definition at line 79 of file Scheduler.h.

References nThreads_.

Referenced by Scheduler().

80  {
81  return nThreads_;
82  }
unsigned const nThreads_
Definition: Scheduler.h:120
bool art::Scheduler::wantSummary ( ) const
inlinenoexcept

Definition at line 104 of file Scheduler.h.

References wantSummary_.

105  {
106  return wantSummary_;
107  }
bool const wantSummary_
Definition: Scheduler.h:126

Member Data Documentation

ActionTable art::Scheduler::actionTable_
private

Definition at line 119 of file Scheduler.h.

Referenced by actionTable().

std::string const art::Scheduler::dataDependencyGraph_
private

Definition at line 127 of file Scheduler.h.

Referenced by dataDependencyGraph(), and Scheduler().

bool const art::Scheduler::errorOnMissingConsumes_
private

Definition at line 125 of file Scheduler.h.

Referenced by errorOnMissingConsumes(), and Scheduler().

bool const art::Scheduler::handleEmptyRuns_
private

Definition at line 123 of file Scheduler.h.

Referenced by handleEmptyRuns(), and Scheduler().

bool const art::Scheduler::handleEmptySubRuns_
private

Definition at line 124 of file Scheduler.h.

Referenced by handleEmptySubRuns(), and Scheduler().

unsigned const art::Scheduler::nSchedules_
private

Definition at line 121 of file Scheduler.h.

Referenced by num_schedules(), and Scheduler().

unsigned const art::Scheduler::nThreads_
private

Definition at line 120 of file Scheduler.h.

Referenced by global_task_group(), num_threads(), and Scheduler().

unsigned const art::Scheduler::stackSize_
private

Definition at line 122 of file Scheduler.h.

Referenced by global_task_group(), and Scheduler().

bool const art::Scheduler::wantSummary_
private

Definition at line 126 of file Scheduler.h.

Referenced by Scheduler(), and wantSummary().


The documentation for this class was generated from the following files: