Arcane
v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
StandaloneSubDomain.cc
1
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2
//-----------------------------------------------------------------------------
3
// Copyright 2000-2023 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
/* StandaloneSubDomain.cc (C) 2000-2023 */
9
/* */
10
/* Implémentation autonome d'un sous-domaine. */
11
/*---------------------------------------------------------------------------*/
12
/*---------------------------------------------------------------------------*/
13
14
#include "arcane/launcher/StandaloneSubDomain.h"
15
16
#include "arcane/utils/Ref.h"
17
#include "arcane/utils/ITraceMng.h"
18
#include "arcane/utils/FatalErrorException.h"
19
20
#include "arcane/impl/ArcaneSimpleExecutor.h"
21
22
#include "arcane/core/ISubDomain.h"
23
24
#include "arcane/launcher/ArcaneLauncher.h"
25
26
/*---------------------------------------------------------------------------*/
27
/*---------------------------------------------------------------------------*/
28
29
namespace
Arcane
30
{
31
32
class
StandaloneSubDomain::Impl
33
{
34
public
:
35
36
Impl
() =
default
;
37
~Impl
()
38
{
39
StandaloneSubDomain::_notifyRemoveStandaloneSubDomain();
40
}
41
42
void
init(
const
String
&
case_file_name
)
43
{
44
int
r
= m_simple_exec.initialize();
45
if
(
r
!= 0)
46
ARCANE_FATAL
(
"Error during initialization r={0}"
,
r
);
47
m_sub_domain = m_simple_exec.createSubDomain(
case_file_name
);
48
m_trace_mng = makeRef(m_sub_domain->
traceMng
());
49
}
50
51
public
:
52
53
ArcaneSimpleExecutor
m_simple_exec;
54
ISubDomain
* m_sub_domain =
nullptr
;
55
Ref<ITraceMng>
m_trace_mng;
56
};
57
58
/*---------------------------------------------------------------------------*/
59
/*---------------------------------------------------------------------------*/
60
61
StandaloneSubDomain::
62
StandaloneSubDomain
()
63
{
64
}
65
66
/*---------------------------------------------------------------------------*/
67
/*---------------------------------------------------------------------------*/
68
69
void
StandaloneSubDomain::
70
_checkIsInitialized()
71
{
72
if
(m_p.get())
73
return
;
74
ARCANE_FATAL
(
"Instance of 'StandaloneSubDomain' is not initialized.\n"
75
"You have to call ArcaneLauncher::createStandaloneSubDomain()\n"
76
"to get a valid instance"
);
77
}
78
79
/*---------------------------------------------------------------------------*/
80
/*---------------------------------------------------------------------------*/
81
82
ITraceMng
*
StandaloneSubDomain::
83
traceMng
()
84
{
85
_checkIsInitialized();
86
return
m_p->m_trace_mng.get();
87
}
88
89
/*---------------------------------------------------------------------------*/
90
/*---------------------------------------------------------------------------*/
91
92
ISubDomain
*
StandaloneSubDomain::
93
subDomain
()
94
{
95
_checkIsInitialized();
96
return
m_p->m_sub_domain;
97
}
98
99
/*---------------------------------------------------------------------------*/
100
/*---------------------------------------------------------------------------*/
101
102
void
StandaloneSubDomain::
103
_initUniqueInstance(
const
String
&
case_file_name
)
104
{
105
m_p = makeRef(
new
Impl());
106
m_p->init(
case_file_name
);
107
}
108
109
/*---------------------------------------------------------------------------*/
110
/*---------------------------------------------------------------------------*/
111
112
bool
StandaloneSubDomain::
113
_isValid()
114
{
115
return
m_p.get();
116
}
117
118
/*---------------------------------------------------------------------------*/
119
/*---------------------------------------------------------------------------*/
120
121
void
StandaloneSubDomain::
122
_notifyRemoveStandaloneSubDomain()
123
{
124
ArcaneLauncher::_notifyRemoveStandaloneSubDomain();
125
}
126
127
/*---------------------------------------------------------------------------*/
128
/*---------------------------------------------------------------------------*/
129
130
}
// End namespace Arcane
131
132
/*---------------------------------------------------------------------------*/
133
/*---------------------------------------------------------------------------*/
ARCANE_FATAL
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Definition
ArcaneGlobal.h:809
Arcane::ArcaneSimpleExecutor
Classe permettant d'exécuter directement du code sans passer par la boucle en temps.
Definition
ArcaneSimpleExecutor.h:51
Arcane::IBase::traceMng
virtual ITraceMng * traceMng() const =0
Gestionnaire de traces.
Arcane::ISubDomain
Interface du gestionnaire d'un sous-domaine.
Definition
ISubDomain.h:74
Arcane::LimaWrapper
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition
Lima.cc:120
Arcane::StandaloneSubDomain::Impl
Definition
StandaloneSubDomain.cc:33
Arcane::StandaloneSubDomain::traceMng
ITraceMng * traceMng()
Gestionnaire de trace associé.
Definition
StandaloneSubDomain.cc:83
Arcane::StandaloneSubDomain::StandaloneSubDomain
StandaloneSubDomain()
Constructeur non initialisé.
Definition
StandaloneSubDomain.cc:62
Arcane::StandaloneSubDomain::subDomain
ISubDomain * subDomain()
Sous-domaine.
Definition
StandaloneSubDomain.cc:93
Arccore::ITraceMng
Interface du gestionnaire de traces.
Definition
arccore/src/trace/arccore/trace/ITraceMng.h:156
Arccore::String
Chaîne de caractères unicode.
Definition
arccore/src/base/arccore/base/String.h:70
Arcane
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Definition
AcceleratorGlobal.h:36
arcane
launcher
StandaloneSubDomain.cc
Généré le Lundi 18 Novembre 2024 03:01:36 pour Arcane par
1.9.8