Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::ModuleMaster Class Reference

Main module. More...

#include <arcane/core/ModuleMaster.h>

Inheritance diagram for Arcane::ModuleMaster:
Collaboration diagram for Arcane::ModuleMaster:

Public Member Functions

 ModuleMaster (const ModuleBuildInfo &)
 Constructor.
 ~ModuleMaster () override
 Destructor.
VersionInfo versionInfo () const override
 Module version.
CaseOptionsMaincaseoptions () override
 Access to module options.
IModuletoModule () override
 Conversion to IModule.
CommonVariablescommonVariables () override
 Access to 'common' variables shared between all services and modules.
void addTimeLoopService (ITimeLoopService *tls) override
 Adds the time loop service.
void dumpStandardCurves () override
 Dumps standard curves (CPUTime, ElapsedTime, ...).
void timeLoopBegin ()
 Auto-loaded entry point at the beginning of the calculation loop iteration.
void timeLoopEnd ()
 Auto-loaded entry point at the end of the calculation loop iteration.
void masterInit ()
 Auto-loaded entry point at the beginning of initialization.
void masterStartInit ()
 Auto-loaded entry point at the beginning of a new case initialization.
void masterContinueInit ()
 Auto-loaded entry point at the beginning of a new case restart.
Public Member Functions inherited from Arcane::AbstractModule
 AbstractModule (const ModuleBuildInfo &)
 Constructor from a ModuleBuildInfo.
virtual ~AbstractModule ()
 Destructor.
String name () const override
 Module name.
ISessionsession () const override
 Session associated with the module.
ISubDomainsubDomain () const override
 Sub-domain associated with the module.
IMeshdefaultMesh () const override
 Default mesh for this module.
MeshHandle defaultMeshHandle () const override
 Default mesh for this module.
IParallelMngparallelMng () const override
 Message passing parallelism manager.
IAcceleratorMngacceleratorMng () const override
 Accelerator manager.
ITraceMngtraceMng () const override
 Trace manager.
void setUsed (bool v) override
 Sets the module usage flag.
bool used () const override
 Returns the module usage status.
void setDisabled (bool v) override
 Sets the module activation flag.
bool disabled () const override
 Returns the module activation status.
bool isGarbageCollected () const override
 Indicates if the module uses a Garbage collection system.
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const
Public Member Functions inherited from Arcane::IModule
virtual ~IModule ()
 Destructor.
Public Member Functions inherited from Arcane::CommonVariables
 CommonVariables (IModule *c)
 Constructs the references of the common variables for the module c.
 CommonVariables (IVariableMng *variable_mng)
 Constructs the references of the common variables for the manager variable_mng.
 CommonVariables (ISubDomain *sd)
 Constructs the references of the common variables for the subdomain sd.
virtual ~CommonVariables ()
 Releases resources.
Int32 globalIteration () const
 Current iteration number.
Real globalTime () const
 Current time.
Real globalOldTime () const
 Previous current time.
Real globalFinalTime () const
 Final time of the simulation.
Real globalDeltaT () const
 Current Delta T.
Real globalCPUTime () const
 CPU time used (in seconds).
Real globalOldCPUTime () const
 Previous CPU time used (in seconds).
Real globalElapsedTime () const
 Clock time (elapsed) used (in seconds).
Real globalOldElapsedTime () const
 Previous clock time (elapsed) used (in seconds).
Public Member Functions inherited from Arcane::IModuleMaster
virtual ~IModuleMaster ()
 Destructor.

Protected Member Functions

virtual void timeIncrementation ()
 Overridable time step incrementation.
virtual void timeStepInformation ()
 Overridable display of time step information.
void _masterBeginLoop ()
void _masterEndLoop ()
void _masterStartInit ()
void _masterContinueInit ()
void _masterLoopExit ()
void _masterMeshChanged ()
void _masterRestore ()
Protected Member Functions inherited from Arcane::AbstractModule
void _setVersionInfo (const VersionInfo &vi)
Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Protected Attributes

CaseOptionsMainm_case_options_main = nullptr
 Instance of module options.
Integer m_nb_loop = 0
 Number of calculation loops performed.
Real m_old_cpu_time = 0.0
 CPU time value at the last iteration.
Real m_old_elapsed_time = 0.0
 Clock time value at the last iteration.
UniqueArray< ITimeLoopService * > m_timeloop_services
 List of time loop services.
bool m_is_first_loop = true
 Indicates if we are in the first execution loop.
Real m_thm_mem_used = 0.0
Real m_thm_diff_cpu = 0.0
Real m_thm_global_cpu_time = 0.0
Real m_thm_diff_elapsed = 0.0
Real m_thm_global_elapsed_time = 0.0
Real m_thm_global_time = 0.0
bool m_has_thm_dump_at_iteration = false

Private Member Functions

void _dumpTimeInfo ()

Additional Inherited Members

Static Public Member Functions inherited from Arcane::AbstractModule
static void staticInitialize (ISubDomain *sd)
 Initialization of the module for the sub-domain sd.
Static Public Member Functions inherited from Arcane::IModuleMaster
static IModuleMastercreateDefault (const ModuleBuildInfo &)
 Creation of an instance of IModuleMaster.
Public Attributes inherited from Arcane::CommonVariables
VariableScalarInt32 m_global_iteration
 Current iteration.
VariableScalarReal m_global_time
 Current time.
VariableScalarReal m_global_deltat
 Global Delta T.
VariableScalarReal m_global_old_time
 Time previous to the current time.
VariableScalarReal m_global_old_deltat
 Delta T at the time previous to the global time.
VariableScalarReal m_global_final_time
 Final time of the case.
VariableScalarReal m_global_old_cpu_time
 Previous CPU time used (in seconds).
VariableScalarReal m_global_cpu_time
 CPU time used (in seconds).
VariableScalarReal m_global_old_elapsed_time
 Previous clock time used (in seconds).
VariableScalarReal m_global_elapsed_time
 Clock time used (in seconds).

Detailed Description

Main module.

This module is always loaded first so that these entry points encompass all those of other modules. It contains the global case variables, such as the filename or the iteration number.

Definition at line 42 of file ModuleMaster.h.

Constructor & Destructor Documentation

◆ ModuleMaster()

◆ ~ModuleMaster()

Arcane::ModuleMaster::~ModuleMaster ( )
override

Destructor.

Definition at line 98 of file ModuleMaster.cc.

References m_case_options_main.

Member Function Documentation

◆ _masterBeginLoop()

void Arcane::ModuleMaster::_masterBeginLoop ( )
protected

Definition at line 379 of file ModuleMaster.cc.

◆ _masterContinueInit()

void Arcane::ModuleMaster::_masterContinueInit ( )
protected

Definition at line 415 of file ModuleMaster.cc.

◆ _masterEndLoop()

void Arcane::ModuleMaster::_masterEndLoop ( )
protected

Definition at line 391 of file ModuleMaster.cc.

◆ _masterLoopExit()

void Arcane::ModuleMaster::_masterLoopExit ( )
protected

Definition at line 427 of file ModuleMaster.cc.

◆ _masterMeshChanged()

void Arcane::ModuleMaster::_masterMeshChanged ( )
protected

Definition at line 439 of file ModuleMaster.cc.

◆ _masterRestore()

void Arcane::ModuleMaster::_masterRestore ( )
protected

Definition at line 451 of file ModuleMaster.cc.

◆ _masterStartInit()

void Arcane::ModuleMaster::_masterStartInit ( )
protected

Definition at line 403 of file ModuleMaster.cc.

◆ addTimeLoopService()

void Arcane::ModuleMaster::addTimeLoopService ( ITimeLoopService * tls)
overridevirtual

Adds the time loop service.

Implements Arcane::IModuleMaster.

Definition at line 370 of file ModuleMaster.cc.

References m_timeloop_services.

◆ caseoptions()

CaseOptionsMain * Arcane::ModuleMaster::caseoptions ( )
inlineoverridevirtual

Access to module options.

Implements Arcane::IModuleMaster.

Definition at line 61 of file ModuleMaster.h.

References m_case_options_main.

◆ commonVariables()

CommonVariables * Arcane::ModuleMaster::commonVariables ( )
inlineoverridevirtual

Access to 'common' variables shared between all services and modules.

Implements Arcane::IModuleMaster.

Definition at line 67 of file ModuleMaster.h.

References Arcane::CommonVariables::CommonVariables().

Here is the call graph for this function:

◆ dumpStandardCurves()

void Arcane::ModuleMaster::dumpStandardCurves ( )
overridevirtual

Dumps standard curves (CPUTime, ElapsedTime, ...).

Implements Arcane::IModuleMaster.

Definition at line 320 of file ModuleMaster.cc.

References Arcane::ITimeHistoryMng::addValue(), Arcane::platform::getCPUTime(), Arcane::platform::getCurrentDateTime(), Arcane::platform::getMemoryUsed(), Arcane::platform::getRealTime(), Arcane::TraceAccessor::info(), Arcane::CommonVariables::m_global_cpu_time, Arcane::CommonVariables::m_global_elapsed_time, Arcane::CommonVariables::m_global_time, m_old_cpu_time, m_old_elapsed_time, Arcane::AbstractModule::subDomain(), and Arcane::ISubDomain::timeHistoryMng().

Referenced by timeLoopEnd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ masterContinueInit()

void Arcane::ModuleMaster::masterContinueInit ( )

Auto-loaded entry point at the beginning of a new case restart.

Definition at line 137 of file ModuleMaster.cc.

References Arcane::ISubDomain::caseMng(), Arcane::TraceAccessor::info(), Arcane::CommonVariables::m_global_iteration, Arcane::CommonVariables::m_global_old_deltat, Arcane::CommonVariables::m_global_old_time, Arcane::AbstractModule::subDomain(), and Arcane::ICaseMng::updateOptions().

Referenced by ModuleMaster().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ masterInit()

void Arcane::ModuleMaster::masterInit ( )

Auto-loaded entry point at the beginning of initialization.

Definition at line 129 of file ModuleMaster.cc.

Referenced by ModuleMaster().

Here is the caller graph for this function:

◆ masterStartInit()

void Arcane::ModuleMaster::masterStartInit ( )

Auto-loaded entry point at the beginning of a new case initialization.

Is not called in case of initialization on a restart

Definition at line 107 of file ModuleMaster.cc.

References Arcane::ISubDomain::caseMng(), Arcane::CommonVariables::m_global_cpu_time, Arcane::CommonVariables::m_global_elapsed_time, Arcane::CommonVariables::m_global_iteration, Arcane::CommonVariables::m_global_old_cpu_time, Arcane::CommonVariables::m_global_old_deltat, Arcane::CommonVariables::m_global_old_elapsed_time, Arcane::CommonVariables::m_global_old_time, Arcane::CommonVariables::m_global_time, Arcane::AbstractModule::subDomain(), and Arcane::ICaseMng::updateOptions().

Referenced by ModuleMaster().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timeIncrementation()

void Arcane::ModuleMaster::timeIncrementation ( )
protectedvirtual

Overridable time step incrementation.

Definition at line 158 of file ModuleMaster.cc.

References Arcane::CommonVariables::m_global_deltat, and Arcane::CommonVariables::m_global_time.

Referenced by timeLoopBegin().

Here is the caller graph for this function:

◆ timeLoopBegin()

void Arcane::ModuleMaster::timeLoopBegin ( )

Auto-loaded entry point at the beginning of the calculation loop iteration.

  • If the current time is strictly greater than the limit time, requests the termination of the calculation
  • Adds the delta calculated in the previous time step to the current time

Definition at line 185 of file ModuleMaster.cc.

References Arcane::ISubDomain::allReplicaParallelMng(), Arcane::ISubDomain::caseMng(), Arcane::IParallelMng::commSize(), Arcane::IParallelMng::computeMinMaxSum(), Arcane::platform::getCPUTime(), Arcane::platform::getCurrentDateTime(), Arcane::platform::getMemoryUsed(), Arcane::platform::getOnlineDebuggerService(), Arcane::platform::getRealTime(), Arcane::TraceAccessor::info(), Arcane::CommonVariables::m_global_cpu_time, Arcane::CommonVariables::m_global_deltat, Arcane::CommonVariables::m_global_elapsed_time, Arcane::CommonVariables::m_global_iteration, Arcane::CommonVariables::m_global_old_cpu_time, Arcane::CommonVariables::m_global_old_elapsed_time, Arcane::CommonVariables::m_global_old_time, Arcane::CommonVariables::m_global_time, m_is_first_loop, m_nb_loop, m_old_cpu_time, m_old_elapsed_time, Arcane::AbstractModule::parallelMng(), Arcane::IParallelMng::reduce(), Arcane::MessagePassing::ReduceMax, Arcane::AbstractModule::subDomain(), timeIncrementation(), timeStepInformation(), and Arcane::ICaseMng::updateOptions().

Referenced by ModuleMaster().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timeLoopEnd()

void Arcane::ModuleMaster::timeLoopEnd ( )

Auto-loaded entry point at the end of the calculation loop iteration.

  • Increments the iteration counter

Definition at line 293 of file ModuleMaster.cc.

References dumpStandardCurves(), Arcane::TraceAccessor::info(), Arcane::CommonVariables::m_global_iteration, and Arcane::AbstractModule::subDomain().

Referenced by ModuleMaster().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timeStepInformation()

void Arcane::ModuleMaster::timeStepInformation ( )
protectedvirtual

Overridable display of time step information.

Definition at line 167 of file ModuleMaster.cc.

References Arcane::TraceAccessor::info(), Arcane::CommonVariables::m_global_deltat, Arcane::CommonVariables::m_global_iteration, Arcane::CommonVariables::m_global_time, and m_nb_loop.

Referenced by timeLoopBegin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toModule()

IModule * Arcane::ModuleMaster::toModule ( )
inlineoverridevirtual

Conversion to IModule.

Implements Arcane::IModuleMaster.

Definition at line 64 of file ModuleMaster.h.

◆ versionInfo()

VersionInfo Arcane::ModuleMaster::versionInfo ( ) const
inlineoverridevirtual

Module version.

Reimplemented from Arcane::AbstractModule.

Definition at line 58 of file ModuleMaster.h.

Member Data Documentation

◆ m_case_options_main

CaseOptionsMain* Arcane::ModuleMaster::m_case_options_main = nullptr
protected

Instance of module options.

Definition at line 126 of file ModuleMaster.h.

Referenced by caseoptions(), ModuleMaster(), and ~ModuleMaster().

◆ m_has_thm_dump_at_iteration

bool Arcane::ModuleMaster::m_has_thm_dump_at_iteration = false
protected

Definition at line 150 of file ModuleMaster.h.

◆ m_is_first_loop

bool Arcane::ModuleMaster::m_is_first_loop = true
protected

Indicates if we are in the first execution loop.

Definition at line 141 of file ModuleMaster.h.

Referenced by timeLoopBegin().

◆ m_nb_loop

Integer Arcane::ModuleMaster::m_nb_loop = 0
protected

Number of calculation loops performed.

Definition at line 129 of file ModuleMaster.h.

Referenced by timeLoopBegin(), and timeStepInformation().

◆ m_old_cpu_time

Real Arcane::ModuleMaster::m_old_cpu_time = 0.0
protected

CPU time value at the last iteration.

Definition at line 132 of file ModuleMaster.h.

Referenced by dumpStandardCurves(), and timeLoopBegin().

◆ m_old_elapsed_time

Real Arcane::ModuleMaster::m_old_elapsed_time = 0.0
protected

Clock time value at the last iteration.

Definition at line 135 of file ModuleMaster.h.

Referenced by dumpStandardCurves(), and timeLoopBegin().

◆ m_thm_diff_cpu

Real Arcane::ModuleMaster::m_thm_diff_cpu = 0.0
protected

Definition at line 144 of file ModuleMaster.h.

◆ m_thm_diff_elapsed

Real Arcane::ModuleMaster::m_thm_diff_elapsed = 0.0
protected

Definition at line 146 of file ModuleMaster.h.

◆ m_thm_global_cpu_time

Real Arcane::ModuleMaster::m_thm_global_cpu_time = 0.0
protected

Definition at line 145 of file ModuleMaster.h.

◆ m_thm_global_elapsed_time

Real Arcane::ModuleMaster::m_thm_global_elapsed_time = 0.0
protected

Definition at line 147 of file ModuleMaster.h.

◆ m_thm_global_time

Real Arcane::ModuleMaster::m_thm_global_time = 0.0
protected

Definition at line 148 of file ModuleMaster.h.

◆ m_thm_mem_used

Real Arcane::ModuleMaster::m_thm_mem_used = 0.0
protected

Definition at line 143 of file ModuleMaster.h.

◆ m_timeloop_services

UniqueArray<ITimeLoopService*> Arcane::ModuleMaster::m_timeloop_services
protected

List of time loop services.

Definition at line 138 of file ModuleMaster.h.

Referenced by addTimeLoopService().


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