Arcane  4.2.1.0
Developer documentation
Loading...
Searching...
No Matches
ArcaneLauncher.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ArcaneLauncher.h (C) 2000-2026 */
9/* */
10/* Class managing execution. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_LAUNCHER_ARCANELAUNCHER_H
13#define ARCANE_LAUNCHER_ARCANELAUNCHER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/launcher/LauncherGlobal.h"
18
19// The following files are not directly used in this '.h'
20// but are added so that user code only needs to include
21// 'ArcaneLauncher.h'.
22#include "arcane/utils/ApplicationInfo.h"
23#include "arcane/utils/CommandLineArguments.h"
24
25#include "arcane/core/ApplicationBuildInfo.h"
26#include "arcane/core/DotNetRuntimeInitialisationInfo.h"
27#include "arcane/core/AcceleratorRuntimeInitialisationInfo.h"
28
29#include "arcane/launcher/DirectExecutionContext.h"
30#include "arcane/launcher/DirectSubDomainExecutionContext.h"
31#include "arcane/launcher/IDirectExecutionContext.h"
32#include "arcane/launcher/StandaloneAcceleratorMng.h"
33#include "arcane/launcher/StandaloneSubDomain.h"
34
35#include <functional>
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40namespace Arcane
41{
42class IMainFactory;
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
81class ARCANE_LAUNCHER_EXPORT ArcaneLauncher
82{
83 friend StandaloneSubDomain;
84
85 public:
86
97 static void init(const CommandLineArguments& args);
98
102 static bool isInitialized();
103
113 static int run();
114
122 static int run(std::function<int(DirectExecutionContext&)> func);
123
134 static int run(std::function<int(DirectSubDomainExecutionContext&)> func);
135
143 static void setDefaultMainFactory(IMainFactory* mf);
144
155
166
174
182
184 static String getExeDirectory();
185
196
216 static StandaloneSubDomain createStandaloneSubDomain(const String& case_file_name,
217 Span<const std::byte> file_content = {});
218
226 static bool needHelp();
227
236 static bool printHelp();
237
238 public:
239
243 ARCCORE_DEPRECATED_2020("Use run(func) instead")
244 static int runDirect(std::function<int(IDirectExecutionContext*)> func);
245
249 ARCCORE_DEPRECATED_2020("Use init(args) instead")
251 {
252 init(args);
253 }
254
255 private:
256
257 static void _initStandalone();
258 static void _notifyRemoveStandaloneSubDomain();
259};
260
261/*---------------------------------------------------------------------------*/
262/*---------------------------------------------------------------------------*/
263
264} // End namespace Arcane
265
266/*---------------------------------------------------------------------------*/
267/*---------------------------------------------------------------------------*/
268
269#endif
Information for constructing an instance of IApplication.
Application information.
Execution management class.
static StandaloneAcceleratorMng createStandaloneAcceleratorMng()
Creates a standalone implementation to manage accelerators.
static int run()
Entry point of the executable in Arcane.
static String getExeDirectory()
Full name of the directory where the executable is located.
static DotNetRuntimeInitialisationInfo & dotNetRuntimeInitialisationInfo()
Information for '.Net' runtime initialization.
static bool needHelp()
Requests help with the "--help" or "-h" option.
static void init(const CommandLineArguments &args)
Positions information from command-line arguments and initializes the launcher.
static ApplicationBuildInfo & applicationBuildInfo()
Application execution parameter information.
static StandaloneSubDomain createStandaloneSubDomain(const String &case_file_name, Span< const std::byte > file_content={})
Creates a standalone implementation to manage a subdomain.
static bool isInitialized()
Indicates if init() has already been called.
static bool printHelp()
Display of generic Arcane help.
static ApplicationInfo & applicationInfo()
Application information.
static AcceleratorRuntimeInitialisationInfo & acceleratorRuntimeInitialisationInfo()
Information for accelerator initialization.
static int runDirect(std::function< int(IDirectExecutionContext *)> func)
static void setDefaultMainFactory(IMainFactory *mf)
Positions the default factory for creating the different managers.
static void setCommandLineArguments(const CommandLineArguments &args)
Direct execution context with subdomain creation.
Information for the initialization of the '.Net' runtime.
Implementation of the execution management class.
Factory for Arcane classes.
View of an array of elements of type T.
Definition Span.h:633
Standalone implementation of 'IAcceleratorMng.h'.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --