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

Time loop manager. More...

Inheritance diagram for Arcane::TimeLoopMng:
Collaboration diagram for Arcane::TimeLoopMng:

Classes

struct  ModuleState

Public Types

enum  eVerifType {
  VerifNone , VerifWrite , VerifRead , VerifSync ,
  VerifSameReplica
}
typedef std::map< String, ModuleStateModuleStateMap
 List of module states.
typedef std::map< String, ITimeLoop * > TimeLoopMap
 List of time loops.
typedef std::map< String, IModuleFactoryInfo * > ModuleFactoryMap
 List of module factories indexed by their name.

Public Member Functions

 TimeLoopMng (ISubDomain *sd)
void build () override
ISubDomainsubDomain () const override
 < Returns the sub-domain manager
void execExitEntryPoints () override
 Executes the exit entry points.
void execBuildEntryPoints () override
 Executes the build entry points.
void execInitEntryPoints (bool is_continue) override
 Executes the initialization entry points.
void stopComputeLoop (bool is_final_time, bool has_error) override
 Indicates that the compute loop must stop.
bool finalTimeReached () const override
 Returns true if the final time has been reached.
Real cpuTimeUsed () const override
 Returns the CPU time used in seconds.
EntryPointCollection loopEntryPoints () override
 Returns the list of 'ComputeLoop' type entry points in the time loop.
EntryPointCollection usedTimeLoopEntryPoints () override
 List of all entry points for the current time loop.
void registerTimeLoop (ITimeLoop *timeloop) override
 Registration and selection of the time loop.
void setUsedTimeLoop (const String &name) override
 Positions the time loop to be executed. Selects the time loop named name as the one to be executed. This method performs the following operations:
ITimeLoopusedTimeLoop () const override
 Returns the time loop used.
void doExecNextEntryPoint (bool &is_last) override
IEntryPointnextEntryPoint () override
 Returns the next function to call.
IEntryPointcurrentEntryPoint () override
 Returns the entry point currently being executed or 0 if there is none.
int doOneIteration () override
 Starts the execution of a compute loop iteration.
void setBackwardMng (IBackwardMng *backward_mng) override
IBackwardMnggetBackwardMng () const override
void goBackward () override
 Performs a backward step.
bool isDoingBackward () override
 True if currently in a backward step.
void setBackwardSavePeriod (Integer n) override
 Positions the period between two saves for backward step. If this value is null, backward step is disabled.
void setVerificationActive (bool is_active) override
 Positions the state of the verification mode.
void doVerification (const String &name) override
 Performs a verification.
void registerActionMeshPartition (IMeshPartitionerBase *mesh_partitioner) override
 Schedules a mesh partitioning using the partition tool mesh_partitioner.
void timeLoopsName (StringCollection &names) const override
 Returns in names the list of time loop names.
void timeLoops (TimeLoopCollection &time_loops) const override
 Returns in time_loops the list of time loops.
ITimeLoopcreateTimeLoop (const String &name) override
 Creates a time loop named name.
int doComputeLoop (Integer max_loop) override
 Executes the compute loop.
Integer nbLoop () const override
 Number of compute loops performed.
void setStopReason (eTimeLoopStopReason reason) override
 Positions the reason for stopping the code.
eTimeLoopStopReason stopReason () const override
 Reason for stopping the code.
void execRestoreEntryPoints ()
void execOnMeshChangedEntryPoints () override
 Executes the entry points after load balancing.
void execOnMeshRefinementEntryPoints () override
 Executes the entry points after refinement.
ITraceMngtraceMng ()
IObservableobservable (eTimeLoopEventType type) override
 Observable on the instance.
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::ITimeLoopMng
virtual ~ITimeLoopMng ()
 Frees resources.

Protected Member Functions

void _addExecuteEntryPoint (IEntryPoint *)
 Adds an entry point to execute.
bool _createModule (const String &module_name)
 Creates a module from its name.
void _processEntryPoints (EntryPointList &entry_points, const TimeLoopEntryPointInfoCollection &entry_points_info, const char *where)
 Adds the entry points proposed in entry_points_info to the list entry_points.
void _fillModuleStateMap (ITimeLoop *time_loop)
Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Static Protected Member Functions

static void _extractModuleAndEntryPointName (const String &timeloop_call_name, String &module_name, String &entry_point_name)

Private Member Functions

void _execOneEntryPoint (IEntryPoint *ic, Integer index_value=0, bool do_verif=false)
void _dumpTimeInfos (JSONWriter &json_writer)
void _resetTimer () const
void _checkVerif (const String &entry_point_name, Integer index, bool do_verif)
void _checkVerifSameOnAllReplica (const String &entry_point_name)
void _createOwnDefaultBackwardMng ()
void _doMeshPartition ()
 Performs a mesh partitioning.
void _fillModuleFactoryMap ()
 Fills m_module_factory_map with the list of available factories.
void _createSingletonServices (IServiceLoader *service_loader)
void _callSpecificEntryPoint ()

Private Attributes

ISubDomainm_sub_domain
 Sub-domain manager.
IEntryPointMngm_entry_point_mng
 Entry point manager.
ModuleList m_list_execute_module
 List of modules to execute.
EntryPointList m_build_entry_points
 List of entry points to execute during build.
EntryPointList m_loop_entry_points
 List of entry points to execute.
EntryPointList m_init_entry_points
 List of entry points to execute during initialization.
EntryPointList m_exit_entry_points
 List of entry points to execute upon termination.
EntryPointList m_restore_entry_points
 List of entry points to execute during a backward step.
EntryPointList m_on_mesh_changed_entry_points
 List of entry points to execute after a mesh change.
EntryPointList m_on_mesh_refinement_entry_points
 List of entry points to execute after a refinement.
EntryPointList m_used_time_loop_entry_points
 List of all entry points of the used time loop.
TimeLoopMap m_time_loop_list
 List of time loops.
ITimeLoopm_default_time_loop
 Default time loop.
ITimeLoopm_used_time_loop
 Used time loop.
IEntryPointm_current_entry_point_ptr
 Currently executing entry point.
bool m_stop_time_loop
bool m_stop_has_error
bool m_final_time_reached
Integer m_current_entry_point
 Next entry point to execute.
eVerifType m_verif_type
 Verification type.
bool m_verif_same_parallel
String m_verif_path
 Save/read directory for verifications.
bool m_verification_active
bool m_verification_at_entry_point
 If true, performs checks at every entry point, otherwise only at the end of the iteration.
bool m_verification_only_at_exit = false
eVariableComparerComputeDifferenceMethod m_compute_diff_method = eVariableComparerComputeDifferenceMethod::Relative
IBackwardMngm_backward_mng
 Backward manager;.
bool m_my_own_backward_mng
ModuleStateMap m_module_state_list
ModuleFactoryMap m_module_factory_map
 State of all referenced modules.
ModuleFactoryMap m_lang_module_factory_map
 List of module factories.
Ref< IVerifierServicem_verifier_service
 List of module factories in the data file language.
UniqueArray< IMeshPartitionerBase * > m_mesh_partitioner
String m_message_class_name
Integer m_alarm_timer_value
Integer m_nb_loop
ObservablePool< eTimeLoopEventType > m_observables
eTimeLoopStopReason m_stop_reason
Ref< IMessagePassingProfilingServicem_msg_pass_prof_srv
String m_specific_entry_point_name
 For testing, specific entry point to call.

Detailed Description

Time loop manager.

Definition at line 98 of file TimeLoopMng.cc.

Member Typedef Documentation

◆ ModuleFactoryMap

List of module factories indexed by their name.

Definition at line 130 of file TimeLoopMng.cc.

◆ ModuleStateMap

List of module states.

Definition at line 126 of file TimeLoopMng.cc.

◆ TimeLoopMap

List of time loops.

Definition at line 128 of file TimeLoopMng.cc.

Member Enumeration Documentation

◆ eVerifType

Enumerator
VerifNone 

Indicates that no checks are performed.

VerifWrite 

Indicates that values are generated for checking.

VerifRead 

Indicates that values are reread and checked.

VerifSameReplica 

Checks that variables are synchronized.

Checks that variables have the same values on all replicas.

Definition at line 116 of file TimeLoopMng.cc.

Constructor & Destructor Documentation

◆ TimeLoopMng()

Arcane::TimeLoopMng::TimeLoopMng ( ISubDomain * sd)
explicit

Definition at line 340 of file TimeLoopMng.cc.

◆ ~TimeLoopMng()

Arcane::TimeLoopMng::~TimeLoopMng ( )
override

Definition at line 388 of file TimeLoopMng.cc.

Member Function Documentation

◆ _addExecuteEntryPoint()

void Arcane::TimeLoopMng::_addExecuteEntryPoint ( IEntryPoint * entry_point)
protected

Adds an entry point to execute.

Adds the entry point s to the list of entry points.

Definition at line 1477 of file TimeLoopMng.cc.

References Arcane::TraceAccessor::debug(), Arcane::TraceAccessor::log(), m_build_entry_points, m_current_entry_point, m_exit_entry_points, m_init_entry_points, m_list_execute_module, m_loop_entry_points, m_on_mesh_changed_entry_points, m_on_mesh_refinement_entry_points, m_restore_entry_points, m_used_time_loop_entry_points, Arcane::IEntryPoint::module(), Arcane::IEntryPoint::name(), Arcane::IModule::name(), Arcane::IModule::setUsed(), Arcane::IEntryPoint::WBuild, Arcane::IEntryPoint::WComputeLoop, Arcane::IEntryPoint::WContinueInit, Arcane::IEntryPoint::where(), Arcane::IEntryPoint::WInit, Arcane::IEntryPoint::WOnMeshChanged, Arcane::IEntryPoint::WOnMeshRefinement, Arcane::IEntryPoint::WRestore, and Arcane::IEntryPoint::WStartInit.

Referenced by setUsedTimeLoop().

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

◆ _callSpecificEntryPoint()

void Arcane::TimeLoopMng::_callSpecificEntryPoint ( )
private

Definition at line 1067 of file TimeLoopMng.cc.

◆ _checkVerif()

void Arcane::TimeLoopMng::_checkVerif ( const String & entry_point_name,
Integer index,
bool do_verif )
private

Definition at line 676 of file TimeLoopMng.cc.

◆ _checkVerifSameOnAllReplica()

void Arcane::TimeLoopMng::_checkVerifSameOnAllReplica ( const String & entry_point_name)
private

Definition at line 784 of file TimeLoopMng.cc.

◆ _createModule()

bool Arcane::TimeLoopMng::_createModule ( const String & module_name)
protected

Creates a module from its name.

Definition at line 1455 of file TimeLoopMng.cc.

References Arcane::IModuleFactoryInfo::createModule(), Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::get(), Arcane::TraceAccessor::info(), m_module_factory_map, and m_sub_domain.

Referenced by setUsedTimeLoop().

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

◆ _createOwnDefaultBackwardMng()

void Arcane::TimeLoopMng::_createOwnDefaultBackwardMng ( )
private

Definition at line 509 of file TimeLoopMng.cc.

◆ _createSingletonServices()

void Arcane::TimeLoopMng::_createSingletonServices ( IServiceLoader * service_loader)
private

Definition at line 1216 of file TimeLoopMng.cc.

◆ _doMeshPartition()

void Arcane::TimeLoopMng::_doMeshPartition ( )
private

Performs a mesh partitioning.

Definition at line 1012 of file TimeLoopMng.cc.

References Arcane::IItemFamily::allItemsSynchronizer(), Arcane::ISubDomain::commonVariables(), Arcane::IVariableSynchronizer::communicatingRanks(), Arcane::ITimeStats::dumpCurrentStats(), execOnMeshChangedEntryPoints(), Arcane::CommonVariables::globalIteration(), Arcane::TraceAccessor::info(), Arcane::Timer::lastActivationTime(), m_backward_mng, Arcane::TraceAccessor::plog(), subDomain(), Arcane::Timer::TimerReal, and Arcane::ISubDomain::timeStats().

Referenced by doOneIteration().

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

◆ _dumpTimeInfos()

void Arcane::TimeLoopMng::_dumpTimeInfos ( JSONWriter & json_writer)
private

Definition at line 1521 of file TimeLoopMng.cc.

◆ _execOneEntryPoint()

void Arcane::TimeLoopMng::_execOneEntryPoint ( IEntryPoint * ic,
Integer index_value = 0,
bool do_verif = false )
private

Definition at line 652 of file TimeLoopMng.cc.

◆ _extractModuleAndEntryPointName()

void Arcane::TimeLoopMng::_extractModuleAndEntryPointName ( const String & timeloop_call_name,
String & module_name,
String & entry_point_name )
staticprotected

Returns the module name and the entry point name from the name referenced in the time loop, of type ModuleName.EntryPointName.

Definition at line 1393 of file TimeLoopMng.cc.

References ARCANE_FATAL, and Arcane::String::localstr().

Referenced by _processEntryPoints().

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

◆ _fillModuleFactoryMap()

void Arcane::TimeLoopMng::_fillModuleFactoryMap ( )
private

Fills m_module_factory_map with the list of available factories.

Definition at line 1417 of file TimeLoopMng.cc.

References ARCANE_FATAL, Arcane::TraceAccessor::info(), Arcane::ICaseDocumentFragment::language(), m_lang_module_factory_map, m_module_factory_map, m_sub_domain, Arcane::IModuleFactoryInfo::moduleName(), Arcane::String::null(), Arcane::IModuleFactoryInfo::serviceInfo(), subDomain(), Arcane::IServiceInfo::tagName(), and Arcane::TraceAccessor::warning().

Referenced by setUsedTimeLoop().

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

◆ _fillModuleStateMap()

void Arcane::TimeLoopMng::_fillModuleStateMap ( ITimeLoop * time_loop)
protected

Populates the module state map based on the information contained in the <modules> elements of the time loop and the data file.

Definition at line 1314 of file TimeLoopMng.cc.

References ARCANE_FATAL, Arcane::XmlNode::attr(), Arcane::XmlNode::attrValue(), Arcane::ICaseMng::caseDocument(), m_lang_module_factory_map, m_sub_domain, Arcane::ICaseDocument::modulesElement(), Arcane::String::null(), Arcane::XmlNode::null(), Arcane::ITimeLoop::optionalModulesName(), Arcane::TraceAccessor::pwarning(), Arcane::ITimeLoop::requiredModulesName(), and Arcane::XmlNode::valueAsBoolean().

Referenced by setUsedTimeLoop().

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

◆ _processEntryPoints()

void Arcane::TimeLoopMng::_processEntryPoints ( EntryPointList & entry_points,
const TimeLoopEntryPointInfoCollection & entry_points_info,
const char * where )
protected

Adds the entry points proposed in entry_points_info to the list entry_points.

Ensures they are correctly associated with where

Definition at line 1255 of file TimeLoopMng.cc.

References _extractModuleAndEntryPointName(), ARCANE_FATAL, Arcane::TraceAccessor::log(), m_entry_point_mng, Arcane::String::null(), Arcane::IEntryPoint::WComputeLoop, Arcane::ITimeLoop::WComputeLoop, Arcane::IEntryPoint::WContinueInit, Arcane::ITimeLoop::WExit, Arcane::IEntryPoint::where(), Arcane::IEntryPoint::WInit, Arcane::ITimeLoop::WInit, Arcane::IEntryPoint::WRestore, Arcane::ITimeLoop::WRestore, and Arcane::IEntryPoint::WStartInit.

Referenced by setUsedTimeLoop().

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

◆ _resetTimer()

void Arcane::TimeLoopMng::_resetTimer ( ) const
private

Definition at line 1945 of file TimeLoopMng.cc.

◆ build()

void Arcane::TimeLoopMng::build ( )
overridevirtual

Implements Arcane::ITimeLoopMng.

Definition at line 403 of file TimeLoopMng.cc.

◆ cpuTimeUsed()

Real Arcane::TimeLoopMng::cpuTimeUsed ( ) const
overridevirtual

Returns the CPU time used in seconds.

Implements Arcane::ITimeLoopMng.

Definition at line 1692 of file TimeLoopMng.cc.

References m_entry_point_mng.

◆ createTimeLoop()

ITimeLoop * Arcane::TimeLoopMng::createTimeLoop ( const String & name)
overridevirtual

Creates a time loop named name.

Implements Arcane::ITimeLoopMng.

Definition at line 1753 of file TimeLoopMng.cc.

References Arcane::IMainFactory::createTimeLoop(), m_sub_domain, and Arcane::IApplication::mainFactory().

Here is the call graph for this function:

◆ currentEntryPoint()

IEntryPoint * Arcane::TimeLoopMng::currentEntryPoint ( )
inlineoverridevirtual

Returns the entry point currently being executed or 0 if there is none.

Implements Arcane::ITimeLoopMng.

Definition at line 161 of file TimeLoopMng.cc.

References m_current_entry_point_ptr.

◆ doComputeLoop()

int Arcane::TimeLoopMng::doComputeLoop ( Integer max_loop)
overridevirtual

Executes the compute loop.

The compute loop is executed until the stopComputeLoop() method is called or the number of loops performed equals max_loop if max_loop is not 0.

Return values
1if the code stops normally due to final time reached
2if the code stops normally due to max_loop reached
<0if the calculation stops due to an error.

Implements Arcane::ITimeLoopMng.

Definition at line 1808 of file TimeLoopMng.cc.

References Arcane::Exception::additionalInfo(), Arcane::ISubDomain::commonVariables(), Arcane::IParallelMng::commRank(), doOneIteration(), doVerification(), Arcane::ITraceMng::flush(), Arcane::IVariableSynchronizerMng::flushPendingStats(), Arcane::platform::getEnvironmentVariable(), Arcane::platform::getProfilingService(), Arcane::CommonVariables::globalIteration(), Arcane::TraceAccessor::info(), Arcane::IProfilingService::initialize(), Arcane::IProfilingService::isInitialized(), m_backward_mng, m_specific_entry_point_name, Arcane::MaxIterationReached, Arcane::String::null(), Arcane::ISubDomain::parallelMng(), Arcane::TraceAccessor::pinfo(), Arcane::IProfilingService::printInfos(), Arcane::IProfilingService::reset(), Arcane::IMemoryInfo::setIteration(), Arcane::IMemoryInfo::setStackTraceMinAllocSize(), Arcane::platform::sleep(), stopComputeLoop(), subDomain(), Arcane::IVariableMng::synchronizerMng(), Arcane::TraceAccessor::traceMng(), and Arcane::ISubDomain::variableMng().

Here is the call graph for this function:

◆ doExecNextEntryPoint()

void Arcane::TimeLoopMng::doExecNextEntryPoint ( bool & is_last)
overridevirtual

Execute the next entry point in the list.

Implements Arcane::ITimeLoopMng.

Definition at line 832 of file TimeLoopMng.cc.

References ARCANE_FATAL, Arcane::CollectionBase::count(), Arcane::CollectionBase::empty(), m_current_entry_point, m_loop_entry_points, and m_used_time_loop.

Here is the call graph for this function:

◆ doOneIteration()

int Arcane::TimeLoopMng::doOneIteration ( )
overridevirtual

Starts the execution of a compute loop iteration.

Return values
0if the code should continue.
>0if the calculation stops normally.
<0if the calculation stops due to an error.

Implements Arcane::ITimeLoopMng.

Definition at line 874 of file TimeLoopMng.cc.

References _doMeshPartition(), Arcane::ICaseOptions::activateFunction(), ARCANE_FATAL, Arcane::ICaseMng::blocks(), Arcane::ISubDomain::caseMng(), Arcane::ICaseOptions::caseModule(), Arcane::ISubDomain::commonVariables(), Arcane::ISubDomain::defaultMesh(), Arcane::IModule::disabled(), Arcane::platform::getEnvironmentVariable(), Arcane::CommonVariables::globalIteration(), Arcane::CommonVariables::globalTime(), Arcane::TraceAccessor::info(), m_backward_mng, Arcane::CommonVariables::m_global_iteration, m_loop_entry_points, m_used_time_loop, m_verif_type, m_verification_at_entry_point, Arcane::IEntryPoint::module(), Arcane::IModule::name(), Arcane::ITimeStats::notifyNewIterationLoop(), Arcane::IMesh::prepareForDump(), Arcane::IModule::setDisabled(), subDomain(), Arcane::ISubDomain::timeStats(), Arcane::TraceAccessor::traceMng(), Arcane::ICaseFunction::value(), and VerifWrite.

Referenced by doComputeLoop().

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

◆ doVerification()

void Arcane::TimeLoopMng::doVerification ( const String & name)
overridevirtual

Performs a verification.

This operation is collective.

This operation allows manually performing a verification operation, whose name is name. This name name must be unique for given iteration.

Implements Arcane::ITimeLoopMng.

Definition at line 667 of file TimeLoopMng.cc.

Referenced by doComputeLoop().

Here is the caller graph for this function:

◆ execBuildEntryPoints()

void Arcane::TimeLoopMng::execBuildEntryPoints ( )
overridevirtual

Executes the build entry points.

Implements Arcane::ITimeLoopMng.

Definition at line 557 of file TimeLoopMng.cc.

References Arcane::TraceAccessor::info(), m_build_entry_points, m_sub_domain, Arcane::IEntryPoint::WBuild, and Arcane::IEntryPoint::where().

Here is the call graph for this function:

◆ execExitEntryPoints()

void Arcane::TimeLoopMng::execExitEntryPoints ( )
overridevirtual

Executes the exit entry points.

Implements Arcane::ITimeLoopMng.

Definition at line 620 of file TimeLoopMng.cc.

References Arcane::ITraceMng::flush(), Arcane::TraceAccessor::info(), Arcane::String::localstr(), m_exit_entry_points, m_sub_domain, Arcane::ITraceMng::plog(), subDomain(), and Arcane::TraceAccessor::traceMng().

Here is the call graph for this function:

◆ execInitEntryPoints()

void Arcane::TimeLoopMng::execInitEntryPoints ( bool is_continue)
overridevirtual

Executes the initialization entry points.

Parameters
is_continueis true if resuming

Implements Arcane::ITimeLoopMng.

Definition at line 539 of file TimeLoopMng.cc.

References Arcane::TraceAccessor::info(), m_init_entry_points, m_sub_domain, Arcane::IEntryPoint::WContinueInit, Arcane::IEntryPoint::where(), Arcane::IEntryPoint::WInit, and Arcane::IEntryPoint::WStartInit.

Here is the call graph for this function:

◆ execOnMeshChangedEntryPoints()

void Arcane::TimeLoopMng::execOnMeshChangedEntryPoints ( )
overridevirtual

Executes the entry points after load balancing.

Executes the entry points after load balancing

Implements Arcane::ITimeLoopMng.

Definition at line 588 of file TimeLoopMng.cc.

References Arcane::TraceAccessor::info(), m_on_mesh_changed_entry_points, m_sub_domain, and Arcane::IEntryPoint::name().

Referenced by _doMeshPartition().

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

◆ execOnMeshRefinementEntryPoints()

void Arcane::TimeLoopMng::execOnMeshRefinementEntryPoints ( )
overridevirtual

Executes the entry points after refinement.

Implements Arcane::ITimeLoopMng.

Definition at line 604 of file TimeLoopMng.cc.

References Arcane::TraceAccessor::info(), m_on_mesh_refinement_entry_points, m_sub_domain, and Arcane::IEntryPoint::name().

Here is the call graph for this function:

◆ execRestoreEntryPoints()

void Arcane::TimeLoopMng::execRestoreEntryPoints ( )

Definition at line 573 of file TimeLoopMng.cc.

◆ finalTimeReached()

bool Arcane::TimeLoopMng::finalTimeReached ( ) const
inlineoverridevirtual

Returns true if the final time has been reached.

Implements Arcane::ITimeLoopMng.

Definition at line 147 of file TimeLoopMng.cc.

◆ getBackwardMng()

IBackwardMng * Arcane::TimeLoopMng::getBackwardMng ( ) const
inlineoverridevirtual

Implements Arcane::ITimeLoopMng.

Definition at line 167 of file TimeLoopMng.cc.

◆ goBackward()

void Arcane::TimeLoopMng::goBackward ( )
overridevirtual

Performs a backward step.

This method just positions a marker. The backward step actually takes place when the currently executing entry point finishes.

After backward step, the backward entry points are called.

Warning
During parallel execution, this method must be called by all sub-domains.

Implements Arcane::ITimeLoopMng.

Definition at line 1718 of file TimeLoopMng.cc.

References m_backward_mng, and Arcane::TraceAccessor::traceMng().

Here is the call graph for this function:

◆ isDoingBackward()

bool Arcane::TimeLoopMng::isDoingBackward ( )
overridevirtual

True if currently in a backward step.

A backward step is active as long as the physical time is less than the physical time reached before the backward step trigger.

Implements Arcane::ITimeLoopMng.

Definition at line 1707 of file TimeLoopMng.cc.

References m_backward_mng.

◆ loopEntryPoints()

EntryPointCollection Arcane::TimeLoopMng::loopEntryPoints ( )
inlineoverridevirtual

Returns the list of 'ComputeLoop' type entry points in the time loop.

Implements Arcane::ITimeLoopMng.

Definition at line 150 of file TimeLoopMng.cc.

References m_loop_entry_points.

◆ nbLoop()

Integer Arcane::TimeLoopMng::nbLoop ( ) const
inlineoverridevirtual

Number of compute loops performed.

Implements Arcane::ITimeLoopMng.

Definition at line 188 of file TimeLoopMng.cc.

◆ nextEntryPoint()

IEntryPoint * Arcane::TimeLoopMng::nextEntryPoint ( )
overridevirtual

Returns the next function to call.

Implements Arcane::ITimeLoopMng.

Definition at line 861 of file TimeLoopMng.cc.

References Arcane::CollectionBase::count(), m_current_entry_point, and m_loop_entry_points.

Here is the call graph for this function:

◆ observable()

IObservable * Arcane::TimeLoopMng::observable ( eTimeLoopEventType type)
inlineoverridevirtual

Observable on the instance.

The type of the observable is given by type

Implements Arcane::ITimeLoopMng.

Definition at line 201 of file TimeLoopMng.cc.

◆ registerActionMeshPartition()

void Arcane::TimeLoopMng::registerActionMeshPartition ( IMeshPartitionerBase * mesh_partitioner)
overridevirtual

Schedules a mesh partitioning using the partition tool mesh_partitioner.

This method just positions a marker. The partitioning actually takes place when the last entry point of the compute loop is finished (end of an iteration).

After partitioning, the mesh change entry points are called.

Warning
During parallel execution, this method must be called by all sub-domains.

Implements Arcane::ITimeLoopMng.

Definition at line 1792 of file TimeLoopMng.cc.

References Arcane::TraceAccessor::info(), and m_backward_mng.

Here is the call graph for this function:

◆ registerTimeLoop()

void Arcane::TimeLoopMng::registerTimeLoop ( ITimeLoop * time_loop)
overridevirtual

Registration and selection of the time loop.

Registers a time loop. Registers the time loop time_loop.

If a time loop with the same name as time_loop is already referenced, the new one replaces the old one.

Implements Arcane::ITimeLoopMng.

Definition at line 1080 of file TimeLoopMng.cc.

References ARCANE_FATAL, Arcane::TraceAccessor::log(), m_time_loop_list, Arcane::ITimeLoop::name(), and Arcane::TraceAccessor::traceMng().

Here is the call graph for this function:

◆ setBackwardMng()

void Arcane::TimeLoopMng::setBackwardMng ( IBackwardMng * backward_mng)
overridevirtual

Implements Arcane::ITimeLoopMng.

Definition at line 520 of file TimeLoopMng.cc.

◆ setBackwardSavePeriod()

void Arcane::TimeLoopMng::setBackwardSavePeriod ( Integer n)
inlineoverridevirtual

Positions the period between two saves for backward step. If this value is null, backward step is disabled.

Implements Arcane::ITimeLoopMng.

Definition at line 171 of file TimeLoopMng.cc.

References m_backward_mng.

◆ setStopReason()

void Arcane::TimeLoopMng::setStopReason ( eTimeLoopStopReason reason)
overridevirtual

Positions the reason for stopping the code.

Implements Arcane::ITimeLoopMng.

Definition at line 1763 of file TimeLoopMng.cc.

◆ setUsedTimeLoop()

void Arcane::TimeLoopMng::setUsedTimeLoop ( const String & name)
overridevirtual

Positions the time loop to be executed. Selects the time loop named name as the one to be executed. This method performs the following operations:

  • Starting from the name name, it searches for the time loop to use. This time loop must have been referenced by the call to registerTimeLoop()
  • For each entry point name of the time loop, it searches for the corresponding entry point (IEntryPoint) registered in the architecture
  • It constructs the list of entry points to be called during initialization, in the compute loop, and during termination, taking into account the entry points that are automatically loaded.
  • It determines the list of modules used by considering that a module is used if and only if one of its entry points is used

The operation fails and causes a fatal error in one of the following cases:

  • this method has already been called,
  • no time loop named name is registered,
  • one of the entry point names in the list does not correspond to any referenced entry point.

If name is null, the time loop used is the default loop which contains no explicit entry points. It only contains the automatically registered entry points.

Return values
truein case of error,
falseotherwise.

Implements Arcane::ITimeLoopMng.

Definition at line 1100 of file TimeLoopMng.cc.

References _addExecuteEntryPoint(), _createModule(), _fillModuleFactoryMap(), _fillModuleStateMap(), _processEntryPoints(), ARCANE_FATAL, Arcane::ISubDomain::configuration(), Arcane::CollectionBase::count(), Arcane::IMainFactory::createServiceLoader(), Arcane::PtrT< T >::get(), Arcane::TraceAccessor::info(), Arcane::TraceAccessor::logdate(), m_default_time_loop, m_entry_point_mng, m_sub_domain, m_time_loop_list, m_used_time_loop, m_used_time_loop_entry_points, Arcane::ISubDomain::mainFactory(), Arcane::IConfiguration::merge(), Arcane::String::null(), Arcane::IEntryPoint::PAutoLoadBegin, Arcane::IEntryPoint::PAutoLoadEnd, Arcane::IEntryPoint::property(), Arcane::TraceAccessor::traceMng(), Arcane::ITimeLoop::WBuild, Arcane::ITimeLoop::WComputeLoop, Arcane::ITimeLoop::WExit, Arcane::ITimeLoop::WInit, Arcane::ITimeLoop::WOnMeshChanged, Arcane::ITimeLoop::WOnMeshRefinement, and Arcane::ITimeLoop::WRestore.

Here is the call graph for this function:

◆ setVerificationActive()

void Arcane::TimeLoopMng::setVerificationActive ( bool is_active)
inlineoverridevirtual

Positions the state of the verification mode.

Implements Arcane::ITimeLoopMng.

Definition at line 178 of file TimeLoopMng.cc.

◆ stopComputeLoop()

void Arcane::TimeLoopMng::stopComputeLoop ( bool is_final_time,
bool has_error )
overridevirtual

Indicates that the compute loop must stop.

If is_final_time is true, it indicates that the final time has been reached. If has_error is true, it indicates that the calculation stopped due to an error. In this case, the application return code will be different from 0.

Implements Arcane::ITimeLoopMng.

Definition at line 1772 of file TimeLoopMng.cc.

References Arcane::Error, Arcane::FinalTimeReached, Arcane::NoReason, and Arcane::NoStop.

Referenced by doComputeLoop().

Here is the caller graph for this function:

◆ stopReason()

eTimeLoopStopReason Arcane::TimeLoopMng::stopReason ( ) const
inlineoverridevirtual

Reason for stopping the code.

If the value is eTimeLoopStopReason::NoStop, then the code is not stopping.

Implements Arcane::ITimeLoopMng.

Definition at line 191 of file TimeLoopMng.cc.

◆ subDomain()

ISubDomain * Arcane::TimeLoopMng::subDomain ( ) const
inlineoverridevirtual

< Returns the sub-domain manager

Implements Arcane::ITimeLoopMng.

Definition at line 141 of file TimeLoopMng.cc.

References m_sub_domain.

Referenced by _doMeshPartition(), _fillModuleFactoryMap(), doComputeLoop(), doOneIteration(), and execExitEntryPoints().

Here is the caller graph for this function:

◆ timeLoops()

void Arcane::TimeLoopMng::timeLoops ( TimeLoopCollection & time_loops) const
overridevirtual

Returns in time_loops the list of time loops.

Implements Arcane::ITimeLoopMng.

Definition at line 1743 of file TimeLoopMng.cc.

References m_time_loop_list.

◆ timeLoopsName()

void Arcane::TimeLoopMng::timeLoopsName ( StringCollection & names) const
overridevirtual

Returns in names the list of time loop names.

Implements Arcane::ITimeLoopMng.

Definition at line 1733 of file TimeLoopMng.cc.

References m_time_loop_list.

◆ traceMng()

ITraceMng * Arcane::TimeLoopMng::traceMng ( )
inline

Definition at line 199 of file TimeLoopMng.cc.

◆ usedTimeLoop()

ITimeLoop * Arcane::TimeLoopMng::usedTimeLoop ( ) const
inlineoverridevirtual

Returns the time loop used.

Implements Arcane::ITimeLoopMng.

Definition at line 156 of file TimeLoopMng.cc.

References m_used_time_loop.

◆ usedTimeLoopEntryPoints()

EntryPointCollection Arcane::TimeLoopMng::usedTimeLoopEntryPoints ( )
inlineoverridevirtual

List of all entry points for the current time loop.

Implements Arcane::ITimeLoopMng.

Definition at line 151 of file TimeLoopMng.cc.

References m_used_time_loop_entry_points.

Member Data Documentation

◆ m_alarm_timer_value

Integer Arcane::TimeLoopMng::m_alarm_timer_value
private

Definition at line 300 of file TimeLoopMng.cc.

◆ m_backward_mng

IBackwardMng* Arcane::TimeLoopMng::m_backward_mng
private

◆ m_build_entry_points

EntryPointList Arcane::TimeLoopMng::m_build_entry_points
private

List of entry points to execute during build.

Definition at line 242 of file TimeLoopMng.cc.

Referenced by _addExecuteEntryPoint(), and execBuildEntryPoints().

◆ m_compute_diff_method

Definition at line 287 of file TimeLoopMng.cc.

◆ m_current_entry_point

Integer Arcane::TimeLoopMng::m_current_entry_point
private

Next entry point to execute.

Definition at line 278 of file TimeLoopMng.cc.

Referenced by _addExecuteEntryPoint(), doExecNextEntryPoint(), and nextEntryPoint().

◆ m_current_entry_point_ptr

IEntryPoint* Arcane::TimeLoopMng::m_current_entry_point_ptr
private

Currently executing entry point.

Definition at line 272 of file TimeLoopMng.cc.

Referenced by currentEntryPoint().

◆ m_default_time_loop

ITimeLoop* Arcane::TimeLoopMng::m_default_time_loop
private

Default time loop.

Definition at line 268 of file TimeLoopMng.cc.

Referenced by setUsedTimeLoop().

◆ m_entry_point_mng

IEntryPointMng* Arcane::TimeLoopMng::m_entry_point_mng
private

Entry point manager.

Definition at line 236 of file TimeLoopMng.cc.

Referenced by _processEntryPoints(), cpuTimeUsed(), and setUsedTimeLoop().

◆ m_exit_entry_points

EntryPointList Arcane::TimeLoopMng::m_exit_entry_points
private

List of entry points to execute upon termination.

Definition at line 251 of file TimeLoopMng.cc.

Referenced by _addExecuteEntryPoint(), and execExitEntryPoints().

◆ m_final_time_reached

bool Arcane::TimeLoopMng::m_final_time_reached
private

Definition at line 276 of file TimeLoopMng.cc.

◆ m_init_entry_points

EntryPointList Arcane::TimeLoopMng::m_init_entry_points
private

List of entry points to execute during initialization.

Definition at line 248 of file TimeLoopMng.cc.

Referenced by _addExecuteEntryPoint(), and execInitEntryPoints().

◆ m_lang_module_factory_map

ModuleFactoryMap Arcane::TimeLoopMng::m_lang_module_factory_map
private

List of module factories.

Definition at line 295 of file TimeLoopMng.cc.

Referenced by _fillModuleFactoryMap(), and _fillModuleStateMap().

◆ m_list_execute_module

ModuleList Arcane::TimeLoopMng::m_list_execute_module
private

List of modules to execute.

Definition at line 239 of file TimeLoopMng.cc.

Referenced by _addExecuteEntryPoint().

◆ m_loop_entry_points

EntryPointList Arcane::TimeLoopMng::m_loop_entry_points
private

List of entry points to execute.

Definition at line 245 of file TimeLoopMng.cc.

Referenced by _addExecuteEntryPoint(), doExecNextEntryPoint(), doOneIteration(), loopEntryPoints(), and nextEntryPoint().

◆ m_mesh_partitioner

UniqueArray<IMeshPartitionerBase*> Arcane::TimeLoopMng::m_mesh_partitioner
private

Definition at line 298 of file TimeLoopMng.cc.

◆ m_message_class_name

String Arcane::TimeLoopMng::m_message_class_name
private

Definition at line 299 of file TimeLoopMng.cc.

◆ m_module_factory_map

ModuleFactoryMap Arcane::TimeLoopMng::m_module_factory_map
private

State of all referenced modules.

Definition at line 294 of file TimeLoopMng.cc.

Referenced by _createModule(), and _fillModuleFactoryMap().

◆ m_module_state_list

ModuleStateMap Arcane::TimeLoopMng::m_module_state_list
private

Definition at line 292 of file TimeLoopMng.cc.

◆ m_msg_pass_prof_srv

Ref<IMessagePassingProfilingService> Arcane::TimeLoopMng::m_msg_pass_prof_srv
private

Definition at line 308 of file TimeLoopMng.cc.

◆ m_my_own_backward_mng

bool Arcane::TimeLoopMng::m_my_own_backward_mng
private

Definition at line 290 of file TimeLoopMng.cc.

◆ m_nb_loop

Integer Arcane::TimeLoopMng::m_nb_loop
private

Definition at line 301 of file TimeLoopMng.cc.

◆ m_observables

ObservablePool<eTimeLoopEventType> Arcane::TimeLoopMng::m_observables
private

Definition at line 303 of file TimeLoopMng.cc.

◆ m_on_mesh_changed_entry_points

EntryPointList Arcane::TimeLoopMng::m_on_mesh_changed_entry_points
private

List of entry points to execute after a mesh change.

Definition at line 257 of file TimeLoopMng.cc.

Referenced by _addExecuteEntryPoint(), and execOnMeshChangedEntryPoints().

◆ m_on_mesh_refinement_entry_points

EntryPointList Arcane::TimeLoopMng::m_on_mesh_refinement_entry_points
private

List of entry points to execute after a refinement.

Definition at line 260 of file TimeLoopMng.cc.

Referenced by _addExecuteEntryPoint(), and execOnMeshRefinementEntryPoints().

◆ m_restore_entry_points

EntryPointList Arcane::TimeLoopMng::m_restore_entry_points
private

List of entry points to execute during a backward step.

Definition at line 254 of file TimeLoopMng.cc.

Referenced by _addExecuteEntryPoint().

◆ m_specific_entry_point_name

String Arcane::TimeLoopMng::m_specific_entry_point_name
private

For testing, specific entry point to call.

Definition at line 311 of file TimeLoopMng.cc.

Referenced by doComputeLoop().

◆ m_stop_has_error

bool Arcane::TimeLoopMng::m_stop_has_error
private

Definition at line 275 of file TimeLoopMng.cc.

◆ m_stop_reason

eTimeLoopStopReason Arcane::TimeLoopMng::m_stop_reason
private

Definition at line 305 of file TimeLoopMng.cc.

◆ m_stop_time_loop

bool Arcane::TimeLoopMng::m_stop_time_loop
private

Definition at line 274 of file TimeLoopMng.cc.

◆ m_sub_domain

◆ m_time_loop_list

TimeLoopMap Arcane::TimeLoopMng::m_time_loop_list
private

List of time loops.

Definition at line 266 of file TimeLoopMng.cc.

Referenced by registerTimeLoop(), setUsedTimeLoop(), timeLoops(), and timeLoopsName().

◆ m_used_time_loop

ITimeLoop* Arcane::TimeLoopMng::m_used_time_loop
private

Used time loop.

Definition at line 270 of file TimeLoopMng.cc.

Referenced by doExecNextEntryPoint(), doOneIteration(), setUsedTimeLoop(), and usedTimeLoop().

◆ m_used_time_loop_entry_points

EntryPointList Arcane::TimeLoopMng::m_used_time_loop_entry_points
private

List of all entry points of the used time loop.

Definition at line 263 of file TimeLoopMng.cc.

Referenced by _addExecuteEntryPoint(), setUsedTimeLoop(), and usedTimeLoopEntryPoints().

◆ m_verif_path

String Arcane::TimeLoopMng::m_verif_path
private

Save/read directory for verifications.

Definition at line 282 of file TimeLoopMng.cc.

◆ m_verif_same_parallel

bool Arcane::TimeLoopMng::m_verif_same_parallel
private

Definition at line 281 of file TimeLoopMng.cc.

◆ m_verif_type

eVerifType Arcane::TimeLoopMng::m_verif_type
private

Verification type.

Definition at line 280 of file TimeLoopMng.cc.

Referenced by doOneIteration().

◆ m_verification_active

bool Arcane::TimeLoopMng::m_verification_active
private

Definition at line 283 of file TimeLoopMng.cc.

◆ m_verification_at_entry_point

bool Arcane::TimeLoopMng::m_verification_at_entry_point
private

If true, performs checks at every entry point, otherwise only at the end of the iteration.

Definition at line 285 of file TimeLoopMng.cc.

Referenced by doOneIteration().

◆ m_verification_only_at_exit

bool Arcane::TimeLoopMng::m_verification_only_at_exit = false
private

Definition at line 286 of file TimeLoopMng.cc.

◆ m_verifier_service

Ref<IVerifierService> Arcane::TimeLoopMng::m_verifier_service
private

List of module factories in the data file language.

Definition at line 297 of file TimeLoopMng.cc.


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