Execution management class. More...
#include <arcane/launcher/ArcaneLauncher.h>
Static Public Member Functions | |
| static void | init (const CommandLineArguments &args) |
| Positions information from command-line arguments and initializes the launcher. | |
| static bool | isInitialized () |
| Indicates if init() has already been called. | |
| static int | run () |
| Entry point of the executable in Arcane. | |
| static int | run (std::function< int(DirectExecutionContext &)> func) |
| Direct execution. | |
| static int | run (std::function< int(DirectSubDomainExecutionContext &)> func) |
| Direct execution with subdomain creation. | |
| static void | setDefaultMainFactory (IMainFactory *mf) |
| Positions the default factory for creating the different managers. | |
| static ApplicationInfo & | applicationInfo () |
| Application information. | |
| static ApplicationBuildInfo & | applicationBuildInfo () |
| Application execution parameter information. | |
| static DotNetRuntimeInitialisationInfo & | dotNetRuntimeInitialisationInfo () |
| Information for '.Net' runtime initialization. | |
| static AcceleratorRuntimeInitialisationInfo & | acceleratorRuntimeInitialisationInfo () |
| Information for accelerator initialization. | |
| static String | getExeDirectory () |
| Full name of the directory where the executable is located. | |
| static StandaloneAcceleratorMng | createStandaloneAcceleratorMng () |
| Creates a standalone implementation to manage accelerators. | |
| static StandaloneSubDomain | createStandaloneSubDomain (const String &case_file_name) |
| Creates a standalone implementation to manage a subdomain. | |
| static bool | needHelp () |
| Requests help with the "--help" or "-h" option. | |
| static bool | printHelp () |
| Display of generic Arcane help. | |
| static int | runDirect (std::function< int(IDirectExecutionContext *)> func) |
| static void | setCommandLineArguments (const CommandLineArguments &args) |
Execution management class.
There are two modes of using Arcane: classic mode and standalone mode.
Regardless of the mode chosen, the first thing to do is initialize Arcane by setting the arguments via the init() method, because certain command-line parameters are used to populate the properties of applicationInfo() and dotNetRuntimeInitialisationInfo().
The page Launching a Calculation provides usage examples.
The two execution modes are:
The classic usage is as follows:
Definition at line 81 of file ArcaneLauncher.h.
|
static |
Information for accelerator initialization.
To be taken into account, this information must be modified before calling run() or rundDirect().
Definition at line 151 of file ArcaneLauncher.cc.
Referenced by init().
|
static |
Application execution parameter information.
This method allows retrieving the ApplicationBuildInfo instance that will be used when calling run().
To be taken into account, this information must be modified before calling run() or runDirect().
Definition at line 160 of file ArcaneLauncher.cc.
Referenced by run().
|
static |
Application information.
This method allows retrieving the ApplicationInfo instance that will be used when calling run().
To be taken into account, this information must be modified before calling run() or runDirect().
Definition at line 133 of file ArcaneLauncher.cc.
Referenced by init(), needHelp(), and printHelp().
|
static |
Creates a standalone implementation to manage accelerators.
You must call init() before calling this method. The choice of runtime (Arcane::Accelerator::eExecutionPolicy) is determined by the arguments used when calling init() or specified via acceleratorRuntimeInitialisationInfo() (see Execution for more information)
Definition at line 415 of file ArcaneLauncher.cc.
|
static |
Creates a standalone implementation to manage a subdomain.
Only one instance of StandaloneSubDomain is allowed. Calling this method more than once generates an exception.
You must call init() before calling this method.
If this method is called, you must not call other ArcaneLauncher execution methods (for example ArcaneLauncher::run()).
case_file_name is the name of the file containing the dataset. If null, there is no dataset.
Definition at line 425 of file ArcaneLauncher.cc.
|
static |
Information for '.Net' runtime initialization.
To be taken into account, this information must be modified before calling run() or rundDirect().
Definition at line 142 of file ArcaneLauncher.cc.
Referenced by init().
|
static |
Full name of the directory where the executable is located.
Definition at line 169 of file ArcaneLauncher.cc.
References Arcane::platform::getExeFullPath(), and Arcane::platform::getFileDirName().
|
static |
Positions information from command-line arguments and initializes the launcher.
This method fills the uninitialized values of applicationInfo() and dotNetRuntimeInitialisationInfo() with the parameters specified in args.
This method must only be called once. Additional calls generate a FatalErrorException.
Definition at line 349 of file ArcaneLauncher.cc.
References acceleratorRuntimeInitialisationInfo(), applicationInfo(), ARCANE_FATAL, Arcane::ApplicationInfo::commandLineArguments(), dotNetRuntimeInitialisationInfo(), Arcane::String::empty(), Arcane::CommandLineArguments::getParameter(), Arcane::CommandLineArguments::parameters(), and Arcane::TaskFactory::setDefaultParallelLoopOptions().
Referenced by setCommandLineArguments().
|
static |
Indicates if init() has already been called.
Definition at line 384 of file ArcaneLauncher.cc.
|
static |
Requests help with the "--help" or "-h" option.
Method allowing to know if the user requested help with the "--help" or "-h" option.
Definition at line 445 of file ArcaneLauncher.cc.
References applicationInfo(), Arcane::ApplicationInfo::commandLineArguments(), and Arcane::CommandLineArguments::needHelp().
Referenced by printHelp().
|
static |
Display of generic Arcane help.
Method allowing to display generic Arcane help if the user requested it with the "--help" or "-h" option.
Definition at line 454 of file ArcaneLauncher.cc.
References applicationInfo(), and needHelp().
|
static |
Entry point of the executable in Arcane.
This method initializes the application, reads the dataset, and executes the code according to the time loop specified in the dataset.
| 0 | upon success |
Definition at line 124 of file ArcaneLauncher.cc.
|
static |
Direct execution.
Initializes the application and calls the function func after initialization. This method must only be called in sequential execution.
Definition at line 245 of file ArcaneLauncher.cc.
|
static |
Direct execution with subdomain creation.
Initializes the application and creates the subdomain(s) and calls the function func afterward. This method allows executing code without going through the time loop mechanisms. This method automatically manages the creation of subdomains based on launch parameters (MPI parallel execution, multithreading, ...).
Definition at line 302 of file ArcaneLauncher.cc.
References applicationBuildInfo(), Arcane::ApplicationBuildInfo::configFileName(), Arcane::String::empty(), and Arcane::ApplicationBuildInfo::setConfigFileName().
|
static |
Definition at line 221 of file ArcaneLauncher.cc.
|
inlinestatic |
Definition at line 244 of file ArcaneLauncher.h.
References init(), and setCommandLineArguments().
Referenced by setCommandLineArguments().
|
static |
Positions the default factory for creating the different managers.
This method must be called before run(). The instance passed as an argument must remain valid during the execution of run(). The caller remains the owner of the instance.
Definition at line 393 of file ArcaneLauncher.cc.