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

Batch execution of a code. More...

Inheritance diagram for Arcane::ArcaneMainBatch:
Collaboration diagram for Arcane::ArcaneMainBatch:

Classes

class  SessionExec
 Execution information for a session. More...
class  ExecFunctor

Public Member Functions

 ArcaneMainBatch (const ApplicationInfo &, IMainFactory *)
void build () override
 Constructs the class members. The instance is not usable until this method has been called. This method must be called before initialize().
void initialize () override
 Initializes the instance. The instance is not usable until this method has been called.
int execute () override
 Starts execution. This method only returns when the program exits.
void doAbort () override
 Performs an abort.
bool parseArgs (StringList args) override
 Parses arguments.
void finalize () override
 Performs the last operations before instance destruction.
Public Member Functions inherited from Arcane::ArcaneMain
 ArcaneMain (const ApplicationInfo &infos, IMainFactory *factory)
 ArcaneMain (const ApplicationInfo &app_info, IMainFactory *factory, const ApplicationBuildInfo &app_build_info, const DotNetRuntimeInitialisationInfo &dotnet_init_info, const AcceleratorRuntimeInitialisationInfo &accelerator_init_info)
void setErrorCode (int errcode) override
 Sets the return code.
int errorCode () const override
 Execution error code.
const ApplicationInfoapplicationInfo () const override
 Executable information.
const ApplicationBuildInfoapplicationBuildInfo () const override
 Information to build the IApplication instance.
const DotNetRuntimeInitialisationInfodotnetRuntimeInitialisationInfo () const override
 .Net runtime initialization information.
const AcceleratorRuntimeInitialisationInfoacceleratorRuntimeInitialisationInfo () const override
 Runtime initialization information for accelerators.
IMainFactorymainFactory () const override
 Main factory.
IApplicationapplication () const override
 Application.
ServiceFactoryInfoCollection registeredServiceFactoryInfos () override
 List of registered service factories.
ModuleFactoryInfoCollection registeredModuleFactoryInfos () override
 List of registered module factories.
bool hasGarbageCollector () const override
 Indicates that certain objects are managed via a garbage collector.
void setDirectExecuteFunctor (IDirectSubDomainExecuteFunctor *f) override
IDirectSubDomainExecuteFunctor_directExecuteFunctor () const
Public Member Functions inherited from Arcane::IArcaneMain
virtual ~IArcaneMain ()
 Releases resources.

Private Member Functions

bool _sequentialParseArgs (StringList args)

Private Attributes

ISessionm_session = nullptr
ArcaneMainBatchProperties m_properties
 Session.
bool m_init_only
 true if only initialization is performed.
bool m_check_case_only
 true if only dataset verification is performed.
bool m_has_sub_domain_threads
 indicates if threads are used to manage subdomains
String m_case_name
 Case name.
String m_direct_exec_name
String m_direct_test_name
Ref< ICodeServicem_code_service
 Code service.
SessionExecm_session_exec = nullptr

Additional Inherited Members

Static Public Member Functions inherited from Arcane::ArcaneMain
static int arcaneMain (const ApplicationInfo &app_info, IMainFactory *factory=nullptr)
 Entry point of the executable in Arcane.
static int run ()
 Entry point of the executable in Arcane.
static void arcaneInitialize ()
 Initializes Arcane.
static void arcaneFinalize ()
 Terminates Arcane usage.
static void setHasGarbageCollector ()
 Indicates that certain objects are managed by a garbage collector.
static void setHasDotNETRuntime ()
 Indicates that we are running in the .NET runtime.
static void setDefaultMainFactory (IMainFactory *mf)
 Sets the default factory.
static ApplicationInfodefaultApplicationInfo ()
 Default application info.
static DotNetRuntimeInitialisationInfodefaultDotNetRuntimeInitialisationInfo ()
 Information for .Net runtime initialization.
static AcceleratorRuntimeInitialisationInfodefaultAcceleratorRuntimeInitialisationInfo ()
 Information for accelerator initialization.
static ApplicationBuildInfodefaultApplicationBuildInfo ()
 Information for accelerator initialization.
static int callFunctorWithCatchedException (IFunctor *functor, IArcaneMain *amain, bool *clean_abort, bool is_print=true)
 Calls the functor functor while catching possible exceptions.
static void setExecuteOverrideFunctor (ArcaneMainExecutionOverrideFunctor *functor)
static bool hasDotNetWrapper ()
 Indicates if a '.Net' assembly is being executed from a C++ main.
static Real initializationTimeForAccelerator ()
 Returns the time (in seconds) for the initialization of accelerator runtimes for this process.
static void addServiceFactoryInfo (IServiceFactoryInfo *factory)
 Adds a service factory.
static void addModuleFactoryInfo (IModuleFactoryInfo *factory)
 Adds a module factory.
static void addApplicationBuildInfoVisitor (IApplicationBuildInfoVisitor *visitor)
 Adds a visitor to fill ApplicationBuildInfo.
static void redirectSignals ()
static bool isMasterIO ()
static void setUseTestLogger (bool v)
Static Public Member Functions inherited from Arcane::IArcaneMain
static IArcaneMainarcaneMain ()
static void setArcaneMain (IArcaneMain *arcane_main)
Protected Member Functions inherited from Arcane::ArcaneMain
IApplication_application ()
ApplicationBuildInfo_applicationBuildInfo ()
Static Protected Member Functions inherited from Arcane::ArcaneMain
static int _internalRun (IDirectSubDomainExecuteFunctor *func)

Detailed Description

Batch execution of a code.

Definition at line 104 of file ArcaneMainBatch.cc.

Constructor & Destructor Documentation

◆ ArcaneMainBatch()

Arcane::ArcaneMainBatch::ArcaneMainBatch ( const ApplicationInfo & exe_info,
IMainFactory * main_factory )

Definition at line 262 of file ArcaneMainBatch.cc.

◆ ~ArcaneMainBatch()

Arcane::ArcaneMainBatch::~ArcaneMainBatch ( )
override

Definition at line 292 of file ArcaneMainBatch.cc.

Member Function Documentation

◆ _sequentialParseArgs()

bool Arcane::ArcaneMainBatch::_sequentialParseArgs ( StringList args)
private

Definition at line 319 of file ArcaneMainBatch.cc.

◆ build()

void Arcane::ArcaneMainBatch::build ( )
overridevirtual

Constructs the class members. The instance is not usable until this method has been called. This method must be called before initialize().

Warning
This method must only be called once.

Reimplemented from Arcane::ArcaneMain.

Definition at line 274 of file ArcaneMainBatch.cc.

References Arcane::ArcaneMain::build().

Here is the call graph for this function:

◆ doAbort()

void Arcane::ArcaneMainBatch::doAbort ( )
overridevirtual

Performs an abort.

Reimplemented from Arcane::ArcaneMain.

Definition at line 1060 of file ArcaneMainBatch.cc.

References Arcane::ArcaneMain::application(), Arcane::IApplication::parallelSuperMng(), and Arcane::IParallelSuperMng::tryAbort().

Here is the call graph for this function:

◆ execute()

int Arcane::ArcaneMainBatch::execute ( )
overridevirtual

Starts execution. This method only returns when the program exits.

Returns
the Arcane return code, 0 if everything is okay.

Reimplemented from Arcane::ArcaneMain.

Definition at line 612 of file ArcaneMainBatch.cc.

References Arcane::ArcaneMain::applicationBuildInfo(), ARCANE_THROW, Arcane::IIOMng::collectiveRead(), Arcane::IParallelSuperMng::commSize(), Arcane::CaseDatasetSource::content(), Arcane::CaseDatasetSource::fileName(), Arcane::ITraceMng::info(), m_code_service, m_has_sub_domain_threads, Arcane::IParallelSuperMng::nbLocalSubDomain(), and Arcane::CaseDatasetSource::setContent().

Here is the call graph for this function:

◆ finalize()

void Arcane::ArcaneMainBatch::finalize ( )
overridevirtual

Performs the last operations before instance destruction.

Reimplemented from Arcane::ArcaneMain.

Definition at line 1040 of file ArcaneMainBatch.cc.

References Arcane::ArcaneMain::errorCode(), Arcane::Accelerator::RunnerInternal::finalize(), and m_code_service.

Here is the call graph for this function:

◆ initialize()

void Arcane::ArcaneMainBatch::initialize ( )
overridevirtual

Initializes the instance. The instance is not usable until this method has been called.

Warning
This method must only be called once.

Reimplemented from Arcane::ArcaneMain.

Definition at line 283 of file ArcaneMainBatch.cc.

References Arcane::ArcaneMain::initialize().

Here is the call graph for this function:

◆ parseArgs()

bool Arcane::ArcaneMainBatch::parseArgs ( StringList args)
overridevirtual

Parses arguments.

Recognized arguments must be removed from the list.

Return values
trueif execution must stop,
falseif it continues normally

Reimplemented from Arcane::ArcaneMain.

Definition at line 305 of file ArcaneMainBatch.cc.

References Arcane::ArcaneMain::parseArgs().

Here is the call graph for this function:

Member Data Documentation

◆ m_case_name

String Arcane::ArcaneMainBatch::m_case_name
private

Case name.

Definition at line 239 of file ArcaneMainBatch.cc.

◆ m_check_case_only

bool Arcane::ArcaneMainBatch::m_check_case_only
private

true if only dataset verification is performed.

Definition at line 237 of file ArcaneMainBatch.cc.

◆ m_code_service

Ref<ICodeService> Arcane::ArcaneMainBatch::m_code_service
private

Code service.

Definition at line 242 of file ArcaneMainBatch.cc.

Referenced by execute(), and finalize().

◆ m_direct_exec_name

String Arcane::ArcaneMainBatch::m_direct_exec_name
private

Definition at line 240 of file ArcaneMainBatch.cc.

◆ m_direct_test_name

String Arcane::ArcaneMainBatch::m_direct_test_name
private

Definition at line 241 of file ArcaneMainBatch.cc.

◆ m_has_sub_domain_threads

bool Arcane::ArcaneMainBatch::m_has_sub_domain_threads
private

indicates if threads are used to manage subdomains

Definition at line 238 of file ArcaneMainBatch.cc.

Referenced by execute().

◆ m_init_only

bool Arcane::ArcaneMainBatch::m_init_only
private

true if only initialization is performed.

Definition at line 236 of file ArcaneMainBatch.cc.

◆ m_properties

ArcaneMainBatchProperties Arcane::ArcaneMainBatch::m_properties
private

Session.

Definition at line 235 of file ArcaneMainBatch.cc.

◆ m_session

ISession* Arcane::ArcaneMainBatch::m_session = nullptr
private

Definition at line 234 of file ArcaneMainBatch.cc.

◆ m_session_exec

SessionExec* Arcane::ArcaneMainBatch::m_session_exec = nullptr
private

Definition at line 243 of file ArcaneMainBatch.cc.


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