14#include "arcane/core/CodeService.h"
16#include "arcane/utils/List.h"
17#include "arcane/utils/ScopedPtr.h"
18#include "arcane/utils/Exception.h"
19#include "arcane/utils/String.h"
20#include "arcane/utils/ITraceMng.h"
21#include "arcane/utils/IProfilingService.h"
22#include "arcane/utils/PlatformUtils.h"
23#include "arcane/utils/Array.h"
24#include "arcane/utils/ValueConvert.h"
25#include "arcane/utils/JSONWriter.h"
27#include "arcane/core/IApplication.h"
28#include "arcane/core/ISession.h"
29#include "arcane/core/IServiceLoader.h"
30#include "arcane/core/IMainFactory.h"
31#include "arcane/core/ISubDomain.h"
32#include "arcane/core/ServiceBuildInfo.h"
33#include "arcane/core/ICheckpointMng.h"
34#include "arcane/core/ICaseMng.h"
35#include "arcane/core/ITimeLoopMng.h"
36#include "arcane/core/IVariableMng.h"
37#include "arcane/core/CheckpointInfo.h"
38#include "arcane/core/internal/IVariableMngInternal.h"
49class CodeServicePrivate
68, m_application(application)
79CodeService(
const ServiceBuildInfo& sbi)
80: m_p(new CodeServicePrivate(sbi.application(), sbi.serviceInfo()))
108 return m_p->m_extensions;
122 _preInitializeSubDomain(sub_domain);
128 trace->
error() << ex;
132 trace->
error() <<
"Unknown exception thrown";
146 bool is_profile_init =
false;
148 is_profile_init = (v.value() != 0);
163 sub_domain->setIsContinue();
164 sub_domain->allocateMeshes();
168 ci.setIsRestart(
true);
176 sub_domain->readOrReloadMeshes();
181 sub_domain->initializeMeshVariablesFromCaseFile();
186 sub_domain->doInitMeshPartition();
188 sub_domain->setIsInitialized();
191 if (is_profile_init && ps) {
194 JSONWriter json_writer(JSONWriter::FormatFlags::None);
195 json_writer.beginObject();
197 json_writer.endObject();
199 std::ofstream ofile(file_name.
localstr());
200 ofile << json_writer.getBuffer();
210 return m_p->m_service_info;
219 return m_p->m_application;
226_addExtension(
const String& extension)
228 m_p->m_extensions.add(extension);
234IApplication* CodeService::
237 return m_p->m_application;
Information about a checkpoint.
IServiceInfo * serviceInfo() const override
Service information.
IBase * serviceParent() const override
Parent of this service.
void initCase(ISubDomain *sub_domain, bool is_continue) override
Initializes the session session.
StringCollection validExtensions() const override
Returns the list of file extensions processed by the instance. The extension does not include the '....
bool allowExecution() const override
Returns whether the code allows execution.
ISubDomain * createAndLoadCase(ISession *session, const SubDomainBuildInfo &sdbi) override
Creates and loads the case using the info sdbi for the session session.
Template class for converting a type.
Base class for an exception.
Interface of the base class for main arcane objects.
virtual ITraceMng * traceMng() const =0
Trace manager.
virtual void printOptions()=0
Prints the option values.
virtual void readOptions(bool is_phase1)=0
Reads the dataset options corresponding to the used modules.
Interface of the checkpoint information manager.
virtual ARCANE_DEPRECATED_122 void readCheckpoint()=0
Reads a checkpoint.
virtual CheckpointInfo readDefaultCheckpointInfo()=0
Reads default checkpoint information.
virtual void dumpJSON(JSONWriter &writer)=0
Writes the profiling information to the writer writer.
Interface for service or module information.
Interface for a case execution session.
virtual ISubDomain * createSubDomain(const SubDomainBuildInfo &sdbi)=0
Creates a sub-domain with the parameters contained in sdbi.
Interface of the subdomain manager.
virtual ICheckpointMng * checkpointMng() const =0
Protection manager.
virtual ITimeLoopMng * timeLoopMng()=0
Returns the time loop manager.
virtual IVariableMng * variableMng()=0
Returns the variable manager.
virtual void readCaseMeshes()=0
Reads the mesh information from the dataset.
virtual ICaseMng * caseMng()=0
Returns the dataset manager.
Interface for the time loop manager.
virtual void execBuildEntryPoints()=0
Executes the build entry points.
virtual void execInitEntryPoints(bool is_continue)=0
Executes the initialization entry points.
virtual TraceMessage error()=0
Stream for an error message.
Variable manager interface.
virtual IVariableMngInternal * _internalApi()=0
Internal Arcane API.
Class allowing automatic start and stop of a service.
void setPrintAtEnd(bool v)
Indicates if results are printed at the end of profiling.
Unicode character string.
const char * localstr() const
Returns the conversion of the instance into UTF-8 encoding.
Parameters necessary for building a subdomain.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Collection< String > StringCollection
Collection of strings.
List< String > StringList
Unicode string list.