Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::ITimeLoopMng Class Referenceabstract

Interface for the time loop manager. More...

#include <arcane/core/ITimeLoopMng.h>

Inheritance diagram for Arcane::ITimeLoopMng:
Collaboration diagram for Arcane::ITimeLoopMng:

Public Member Functions

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

Detailed Description

Interface for the time loop manager.

The time loop consists of three parts, executed in the following order:

  • initialization (Init)
  • compute loop (ComputeLoop)
  • termination (Exit)

Initialization and termination are called only once. However, the compute loop is executed as long as no one requests an explicit stop via the stopComputeLoop() method.

Definition at line 72 of file ITimeLoopMng.h.

Constructor & Destructor Documentation

◆ ~ITimeLoopMng()

virtual Arcane::ITimeLoopMng::~ITimeLoopMng ( )
inlinevirtual

Frees resources.

Definition at line 76 of file ITimeLoopMng.h.

Member Function Documentation

◆ cpuTimeUsed()

virtual Real Arcane::ITimeLoopMng::cpuTimeUsed ( ) const
pure virtual

Returns the CPU time used in seconds.

Implemented in Arcane::TimeLoopMng.

◆ createTimeLoop()

virtual ITimeLoop * Arcane::ITimeLoopMng::createTimeLoop ( const String & name)
pure virtual

Creates a time loop named name.

Implemented in Arcane::TimeLoopMng.

◆ currentEntryPoint()

virtual IEntryPoint * Arcane::ITimeLoopMng::currentEntryPoint ( )
pure virtual

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

Implemented in Arcane::TimeLoopMng.

Referenced by Arcane::VariableMng::addVariable().

Here is the caller graph for this function:

◆ doComputeLoop()

virtual int Arcane::ITimeLoopMng::doComputeLoop ( Integer max_loop = 0)
pure virtual

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.

Implemented in Arcane::TimeLoopMng.

◆ doExecNextEntryPoint()

virtual void Arcane::ITimeLoopMng::doExecNextEntryPoint ( bool & is_last)
pure virtual

Executes the next entry point.

Returns in is_last true if the entry point that was just executed is the last one of the iteration.

Implemented in Arcane::TimeLoopMng.

◆ doOneIteration()

virtual int Arcane::ITimeLoopMng::doOneIteration ( )
pure virtual

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.

Implemented in Arcane::TimeLoopMng.

◆ doVerification()

virtual void Arcane::ITimeLoopMng::doVerification ( const String & name)
pure virtual

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.

Implemented in Arcane::TimeLoopMng.

◆ execBuildEntryPoints()

virtual void Arcane::ITimeLoopMng::execBuildEntryPoints ( )
pure virtual

Executes the build entry points.

Implemented in Arcane::TimeLoopMng.

Referenced by Arcane::CodeService::initCase().

Here is the caller graph for this function:

◆ execExitEntryPoints()

virtual void Arcane::ITimeLoopMng::execExitEntryPoints ( )
pure virtual

Executes the exit entry points.

Implemented in Arcane::TimeLoopMng.

◆ execInitEntryPoints()

virtual void Arcane::ITimeLoopMng::execInitEntryPoints ( bool is_continue)
pure virtual

Executes the initialization entry points.

Parameters
is_continueis true if resuming

Implemented in Arcane::TimeLoopMng.

Referenced by Arcane::CodeService::initCase().

Here is the caller graph for this function:

◆ execOnMeshChangedEntryPoints()

virtual void Arcane::ITimeLoopMng::execOnMeshChangedEntryPoints ( )
pure virtual

Executes the entry points after load balancing.

Executes the entry points after load balancing

Implemented in Arcane::TimeLoopMng.

◆ execOnMeshRefinementEntryPoints()

virtual void Arcane::ITimeLoopMng::execOnMeshRefinementEntryPoints ( )
pure virtual

Executes the entry points after refinement.

Implemented in Arcane::TimeLoopMng.

◆ finalTimeReached()

virtual bool Arcane::ITimeLoopMng::finalTimeReached ( ) const
pure virtual

Returns true if the final time has been reached.

Implemented in Arcane::TimeLoopMng.

◆ goBackward()

virtual void Arcane::ITimeLoopMng::goBackward ( )
pure virtual

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.

Implemented in Arcane::TimeLoopMng.

◆ isDoingBackward()

virtual bool Arcane::ITimeLoopMng::isDoingBackward ( )
pure virtual

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.

Implemented in Arcane::TimeLoopMng.

◆ loopEntryPoints()

virtual EntryPointCollection Arcane::ITimeLoopMng::loopEntryPoints ( )
pure virtual

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

Implemented in Arcane::TimeLoopMng.

◆ nbLoop()

virtual Integer Arcane::ITimeLoopMng::nbLoop ( ) const
pure virtual

Number of compute loops performed.

Implemented in Arcane::TimeLoopMng.

◆ nextEntryPoint()

virtual IEntryPoint * Arcane::ITimeLoopMng::nextEntryPoint ( )
pure virtual

Returns the next entry point to execute or 0 if there is none.

Implemented in Arcane::TimeLoopMng.

◆ observable()

virtual IObservable * Arcane::ITimeLoopMng::observable ( eTimeLoopEventType type)
pure virtual

Observable on the instance.

The type of the observable is given by type

Implemented in Arcane::TimeLoopMng.

◆ registerActionMeshPartition()

virtual void Arcane::ITimeLoopMng::registerActionMeshPartition ( IMeshPartitionerBase * mesh_partitioner)
pure virtual

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.

Implemented in Arcane::TimeLoopMng.

Referenced by Arcane::ArcaneLoadBalanceModule::checkLoadBalance().

Here is the caller graph for this function:

◆ registerTimeLoop()

virtual void Arcane::ITimeLoopMng::registerTimeLoop ( ITimeLoop * time_loop)
pure virtual

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.

Implemented in Arcane::TimeLoopMng.

Referenced by Arcane::InternalInfosDumper::dumpArcaneDatabase(), Arcane::InternalInfosDumper::dumpInternalAllInfos(), and Arcane::TimeLoopReader::registerTimeLoops().

Here is the caller graph for this function:

◆ setBackwardSavePeriod()

virtual void Arcane::ITimeLoopMng::setBackwardSavePeriod ( Integer n)
pure virtual

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

Implemented in Arcane::TimeLoopMng.

◆ setStopReason()

virtual void Arcane::ITimeLoopMng::setStopReason ( eTimeLoopStopReason reason)
pure virtual

Positions the reason for stopping the code.

Implemented in Arcane::TimeLoopMng.

◆ setUsedTimeLoop()

virtual void Arcane::ITimeLoopMng::setUsedTimeLoop ( const String & name)
pure virtual

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.

Implemented in Arcane::TimeLoopMng.

Referenced by Arcane::InternalInfosDumper::dumpArcaneDatabase(), Arcane::InternalInfosDumper::dumpInternalAllInfos(), and Arcane::TimeLoopReader::setUsedTimeLoop().

Here is the caller graph for this function:

◆ setVerificationActive()

virtual void Arcane::ITimeLoopMng::setVerificationActive ( bool is_active)
pure virtual

Positions the state of the verification mode.

Implemented in Arcane::TimeLoopMng.

◆ stopComputeLoop()

virtual void Arcane::ITimeLoopMng::stopComputeLoop ( bool is_final_time,
bool has_error = false )
pure virtual

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.

Implemented in Arcane::TimeLoopMng.

◆ stopReason()

virtual eTimeLoopStopReason Arcane::ITimeLoopMng::stopReason ( ) const
pure virtual

Reason for stopping the code.

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

Implemented in Arcane::TimeLoopMng.

◆ subDomain()

virtual ISubDomain * Arcane::ITimeLoopMng::subDomain ( ) const
pure virtual

< Returns the sub-domain manager

Implemented in Arcane::TimeLoopMng.

◆ timeLoops()

virtual void Arcane::ITimeLoopMng::timeLoops ( TimeLoopCollection & time_loops) const
pure virtual

Returns in time_loops the list of time loops.

Implemented in Arcane::TimeLoopMng.

◆ timeLoopsName()

virtual void Arcane::ITimeLoopMng::timeLoopsName ( StringCollection & names) const
pure virtual

Returns in names the list of time loop names.

Implemented in Arcane::TimeLoopMng.

◆ usedTimeLoop()

virtual ITimeLoop * Arcane::ITimeLoopMng::usedTimeLoop ( ) const
pure virtual

Returns the time loop used.

Implemented in Arcane::TimeLoopMng.

Referenced by Arcane::SubDomain::dumpInternalInfos().

Here is the caller graph for this function:

◆ usedTimeLoopEntryPoints()

virtual EntryPointCollection Arcane::ITimeLoopMng::usedTimeLoopEntryPoints ( )
pure virtual

List of all entry points for the current time loop.

Implemented in Arcane::TimeLoopMng.


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