14#include "arcane/utils/StdHeader.h"
15#include "arcane/utils/PlatformUtils.h"
16#include "arcane/utils/Iostream.h"
17#include "arcane/utils/ScopedPtr.h"
18#include "arcane/utils/VersionInfo.h"
19#include "arcane/utils/StringBuilder.h"
20#include "arcane/utils/ITraceMng.h"
21#include "arcane/utils/TraceAccessor.h"
22#include "arcane/utils/MemoryInfo.h"
23#include "arcane/utils/List.h"
24#include "arcane/utils/TraceAccessor2.h"
25#include "arcane/utils/ValueConvert.h"
26#include "arcane/utils/IProcessorAffinityService.h"
27#include "arcane/utils/IProfilingService.h"
28#include "arccore/common/internal/Property.h"
30#include "arcane/core/ISubDomain.h"
31#include "arcane/core/IVariableMng.h"
32#include "arcane/core/IModuleMng.h"
33#include "arcane/core/IServiceMng.h"
34#include "arcane/core/IModule.h"
35#include "arcane/core/IModuleMaster.h"
36#include "arcane/core/IEntryPointMng.h"
37#include "arcane/core/IEntryPoint.h"
38#include "arcane/core/IMeshReader.h"
39#include "arcane/core/ITimerMng.h"
40#include "arcane/core/IApplication.h"
41#include "arcane/core/IGhostLayerMng.h"
42#include "arcane/core/ArcaneException.h"
43#include "arcane/core/CaseOptionsMain.h"
44#include "arcane/core/IMesh.h"
45#include "arcane/core/IMeshModifier.h"
46#include "arcane/core/IMeshSubMeshTransition.h"
47#include "arcane/core/Properties.h"
48#include "arcane/core/IParallelMng.h"
49#include "arcane/core/Directory.h"
50#include "arcane/core/ITimeHistoryMng.h"
51#include "arcane/core/ICaseMng.h"
52#include "arcane/core/ICheckpointMng.h"
53#include "arcane/core/IPropertyMng.h"
54#include "arcane/core/ITimeStats.h"
55#include "arcane/core/ITimeLoop.h"
56#include "arcane/core/ITimeLoopMng.h"
57#include "arcane/core/IIOMng.h"
58#include "arcane/core/IMainFactory.h"
59#include "arcane/core/Timer.h"
60#include "arcane/core/XmlNode.h"
61#include "arcane/core/ICaseDocument.h"
62#include "arcane/core/IPhysicalUnitSystem.h"
63#include "arcane/core/IPhysicalUnitSystemService.h"
64#include "arcane/core/ISession.h"
65#include "arcane/core/IMeshStats.h"
66#include "arcane/core/IParallelReplication.h"
67#include "arcane/core/IServiceLoader.h"
68#include "arcane/core/IMeshPartitioner.h"
69#include "arcane/core/ICaseMeshMasterService.h"
70#include "arcane/core/ILoadBalanceMng.h"
71#include "arcane/core/CaseNodeNames.h"
72#include "arcane/core/Observable.h"
73#include "arcane/core/VariableCollection.h"
74#include "arcane/core/SubDomainBuildInfo.h"
75#include "arcane/core/ServiceBuilder.h"
76#include "arcane/core/IMeshUtilities.h"
77#include "arcane/core/IMeshMng.h"
78#include "arcane/core/MeshHandle.h"
79#include "arcane/core/ObserverPool.h"
80#include "arcane/core/parallel/IStat.h"
82#include "arcane/core/internal/ConfigurationPropertyReader.h"
83#include "arcane/core/internal/IDataInternal.h"
84#include "arcane/core/internal/ICaseMngInternal.h"
85#include "arcane/core/internal/IParallelMngInternal.h"
86#include "arcane/core/internal/IVariableMngInternal.h"
88#include "arcane/impl/ConfigurationReader.h"
89#include "arcane/impl/internal/MeshMng.h"
90#include "arcane/impl/internal/LegacyMeshBuilder.h"
92#include "arcane/core/CaseOptionService.h"
93#include "arcane/core/CaseOptionBuildInfo.h"
95#include "arcane/accelerator/core/IAcceleratorMng.h"
96#include "arcane/accelerator/core/DeviceInfo.h"
97#include "arcane/accelerator/core/Runner.h"
98#include "arcane/accelerator/core/AcceleratorRuntimeInitialisationInfo.h"
99#include "arcane/accelerator/core/IDeviceInfoList.h"
110class MeshBuilderMaster
118 m_mesh_service.addAlternativeNodeName(
"fr",
"maillages");
125 return m_case_options->configList();
130 ICaseOptions* options()
const {
return m_case_options.get(); }
136 m_mesh_service.instance()->createMeshes();
157 ARCANE_DECLARE_PROPERTY_CLASS(SubDomain);
162 class PropertyMngCheckpoint
167 explicit PropertyMngCheckpoint(
ISubDomain* sd)
179 m_observers.addObserver(
this,
180 &PropertyMngCheckpoint::_notifyWrite,
181 m_property_values.variable()->writeObservable());
182 m_observers.addObserver(
this,
183 &PropertyMngCheckpoint::_notifyRead,
184 m_property_values.variable()->readObservable());
191 info(4) <<
"PropertyMngCheckpoint: READ";
192 m_sub_domain->propertyMng()->readFrom(m_property_values);
196 info(4) <<
"PropertyMngCheckpoint: WRITE";
197 m_sub_domain->propertyMng()->writeTo(m_property_values._internalTrueData()->_internalDeprecatedValue());
198 m_property_values.variable()->syncReferences();
214 void build()
override;
216 void destroy()
override;
255 void dumpInfo(std::ostream&)
override;
260 IMesh*
mesh()
override {
return m_default_mesh_handle.
mesh(); }
261 IMesh*
findMesh(
const String& name,
bool throw_exception)
override;
275 m_legacy_mesh_builder->m_initial_partitioner = partitioner;
305 void _setLegacyMeshCreation(
bool v) { m_is_create_default_mesh_v2 = !v; }
306 bool isLegacyMeshCreation()
const {
return !m_is_create_default_mesh_v2; }
311 const char* _msgClassName()
const {
return "Init"; }
351 bool m_is_create_default_mesh_v2;
362 void _doInitialPartition();
363 void _doInitialPartitionForMesh(
IMesh* mesh,
const String& service_name);
364 void _notifyWriteCheckpoint();
372static ISubDomain* global_sub_domain =
nullptr;
376extern "C" ARCANE_IMPL_EXPORT
ISubDomain* _arcaneGetDefaultSubDomain()
378 return global_sub_domain;
384extern "C++" ISubDomain*
385arcaneCreateSubDomain(ISession* session,
const SubDomainBuildInfo& sdbi)
388 Ref<IParallelMng> all_replica_pm = sdbi.allReplicaParallelMng();
389 String case_file_name = sdbi.caseFileName();
392 ITraceMng* tm = pm->traceMng();
393 StringBuilder trace_id;
394 trace_id += String::fromNumber(pm->commRank());
395 if (all_replica_pm != pm) {
397 trace_id += pm->replication()->replicationRank();
401 tm->setTraceId(trace_id.toString());
403 auto* sd =
new SubDomain(session, pm, all_replica_pm, case_file_name, bytes);
407 global_sub_domain = sd;
417: TraceAccessor2(pm->traceMng())
419, m_application(session->application())
421, m_all_replica_parallel_mng(all_replica_pm)
422, m_timer_mng(nullptr)
423, m_time_stats(nullptr)
424, m_namespace_uri(arcaneNamespaceURI())
425, m_module_master(nullptr)
426, m_time_history_mng(nullptr)
427, m_is_initialized(false)
428, m_case_full_file_name(case_file_name)
429, m_case_name(
"unknown")
431, m_case_config(nullptr)
432, m_storage_directory(
".")
433, m_is_continue(false)
434, m_direct_execution(nullptr)
435, m_is_create_default_mesh_v2(false)
437 m_local_name =
"SubDomain";
457 m_default_mesh_handle = m_mesh_mng->createDefaultMeshHandle(
"Mesh0");
485 _setDefaultAcceleratorDevice(config);
487 m_accelerator_mng->initialize(config);
488 Runner runner = m_accelerator_mng->runner();
489 const auto& device_info = runner.
deviceInfo();
490 info() <<
"DeviceInfo: name=" << device_info.name();
491 info() <<
"DeviceInfo: description=" << device_info.description();
497 m_variable_mng->_internalApi()->setAcceleratorMng(m_accelerator_mng);
531 if (!meshes_elem.
null()) {
532 info() <<
"Using mesh service to create and allocate meshes";
540 if (!m_is_create_default_mesh_v2)
541 m_legacy_mesh_builder->createDefaultMesh();
544 service_loader->loadSubDomainServices(
this);
551 service_loader->initializeModuleFactories(
this);
556 m_observers.addObserver(
this,
557 &SubDomain::_notifyWriteCheckpoint,
581 Int32 modulo_device = 0;
583 Int32 nb_device = device_list->nbDevice();
584 info() <<
"DeviceInfo: nb_device=" << nb_device;
585 modulo_device = nb_device;
590 Int32 modulo = v.value();
593 modulo_device = modulo;
594 info() <<
"Use commRank() to choose accelerator device with modulo=" << modulo;
596 if (modulo_device != 0) {
598 info() <<
"Using device number=" << device_rank;
599 config.
setDeviceId(Accelerator::DeviceId(device_rank));
609 m_case_mesh_master_service.reset();
611 m_property_mng_checkpoint =
nullptr;
628 bool do_return =
true;
643 m_mesh_mng->destroyMeshes();
686 info() <<
"SubDomain: Allocating meshes";
693 info() <<
"** Reading mesh from mesh service";
695 String default_service_name =
"ArcaneCaseMeshMasterService";
701 m_case_mesh_master_service = mbm;
702 m_case_mng->_internalImpl()->internalReadOneOption(mbm->_options(),
true);
706 if (m_is_create_default_mesh_v2)
707 m_legacy_mesh_builder->createDefaultMesh();
709 m_legacy_mesh_builder->allocateMeshes();
719 info() <<
"SubDomain: read or reload meshes";
721 logdate() <<
"Initialisation du code.";
723 Integer nb_mesh = m_mesh_mng->meshes().size();
724 info() <<
" nb_mesh_created=" << nb_mesh
725 <<
" is_continue?=" << m_is_continue;
727 A_INFO(
"Test: {1}", A_TR2(
"nb_mesh_created", nb_mesh), A_TR(m_is_continue));
743 for (
Integer z = 0; z < nb_mesh; ++z) {
750 m_case_mesh_master_service->allocateMeshes();
753 m_legacy_mesh_builder->readMeshes();
763 for (
Integer z = 0; z < nb_mesh; ++z) {
764 IMesh* mesh = m_mesh_mng->getMesh(z);
766 mesh->nodesCoordinates().setUpToDate();
776 m_mesh_mng->addMesh(mesh);
785 return m_mesh_mng->meshes();
795 m_legacy_mesh_builder->initializeMeshVariablesFromCaseFile();
804 if (!m_is_continue) {
807 info() <<
"Using custom initial partitioner";
811 if (m_case_mesh_master_service.get()) {
812 m_case_mesh_master_service->partitionMeshes();
813 m_case_mesh_master_service->applyAdditionalOperationsOnMeshes();
815 else if (m_legacy_mesh_builder->m_use_internal_mesh_partitioner)
816 _doInitialPartition();
821 for (
IMesh* mesh : m_mesh_mng->meshes()) {
847 String test_service =
"MeshPartitionerTester";
849 for (
IMesh*
mesh : m_mesh_mng->meshes()) {
850 bool is_mesh_allocated =
mesh->isAllocated();
851 info() <<
"InitialPartitioning mesh=" <<
mesh->name() <<
" is_allocated?=" << is_mesh_allocated;
852 if (!is_mesh_allocated)
858 if (m_legacy_mesh_builder->m_use_partitioner_tester) {
861 info() <<
"Min nb cell=" << min_nb_cell;
862 if (min_nb_cell == 0)
863 _doInitialPartitionForMesh(
mesh, test_service);
865 info() <<
"Mesh name=" <<
mesh->name() <<
" have cells. Do not use " << test_service;
868 info() <<
"No basic partition first needed";
869 _doInitialPartitionForMesh(mesh, m_legacy_mesh_builder->m_internal_partitioner_name);
879 info() <<
"DoInitialPartition. mesh=" << mesh->name() <<
" service=" << service_name;
881 String lib_name = service_name;
882 IMeshPartitionerBase* mesh_partitioner_base =
nullptr;
883 Ref<IMeshPartitionerBase> mesh_partitioner_base_ref;
884 Ref<IMeshPartitioner> mesh_partitioner_ref;
886 ServiceBuilder<IMeshPartitionerBase> sbuilder(
this);
887 mesh_partitioner_base_ref = sbuilder.createReference(service_name, mesh,
SB_AllowNull);
888 mesh_partitioner_base = mesh_partitioner_base_ref.get();
890 if (!mesh_partitioner_base) {
893 pwarning() <<
"No implementation for 'IMeshPartitionerBase' interface found. "
894 <<
"Searching implementation for legacy 'IMeshPartitioner' interface";
895 ServiceBuilder<IMeshPartitioner> sbuilder_legacy(
this);
896 mesh_partitioner_ref = sbuilder_legacy.createReference(service_name, mesh,
SB_AllowNull);
897 if (mesh_partitioner_ref.get())
898 mesh_partitioner_base = mesh_partitioner_ref.get();
901 if (!mesh_partitioner_base) {
904 sbuilder.getServicesNames(valid_names);
905 String valid_values = String::join(
", ", valid_names);
906 String msg = String::format(
"The specified service for the initial mesh partitionment ({0}) "
907 "is not available (valid_values={1}). This service has to implement "
908 "interface Arcane::IMeshPartitionerBase",
909 lib_name, valid_values);
913 bool is_dynamic = mesh->isDynamic();
914 mesh->modifier()->setDynamic(
true);
915 mesh->utilities()->partitionAndExchangeMeshWithReplication(mesh_partitioner_base,
true);
916 mesh->modifier()->setDynamic(is_dynamic);
928 logdate() <<
"Execution of the end of compute entry points";
947 Int64 len =
id.length();
948 const char* str =
id.localstr();
949 if (len == 0 || !str)
952 if (!isalpha(str[0]))
954 for (
Int64 i = 1; i < len; ++i)
955 if (!isalpha(str[i]) && !isdigit(str[i]) && str[i] !=
'_' && str[i] !=
'.' && str[i] !=
'-')
973 m_legacy_mesh_builder->readCaseMeshes();
998 XmlElement time_loop_elem(root,
"timeloopinfo");
1002 String ustr_userclass(
"userclass");
1004 XmlElement elem(time_loop_elem, ustr_userclass, *j);
1010 String ustr_module(
"module");
1011 String ustr_name(
"name");
1012 String ustr_activated(
"activated");
1013 String ustr_true(
"true");
1014 String ustr_false(
"false");
1015 String ustr_variable(
"variable");
1016 String ustr_variable_ref(
"variable-ref");
1018 String ustr_datatype(
"datatype");
1019 String ustr_dimension(
"dimension");
1020 String ustr_kind(
"kind");
1021 String ustr_caseblock(
"caseblock");
1022 String ustr_tagname(
"tagname");
1026 XmlElement module_element(modules, ustr_module);
1028 bool is_activated = (*i)->used();
1029 module_element.
setAttrValue(ustr_activated, is_activated ? ustr_true : ustr_false);
1030 var_ref_list.
clear();
1033 XmlElement variable_element(module_element, ustr_variable_ref);
1041 for (VariableCollection::Enumerator j(var_prv_list); ++j;) {
1057 XmlElement block_elem(blocks_elem, ustr_caseblock);
1071 return m_default_mesh_handle.mesh()->dimension();
1080 return m_mesh_mng->findMesh(name, throw_exception);
1087_notifyWriteCheckpoint()
1089 info(4) <<
"SubDomain::_notifyWriteCheckpoint()";
1092 timeStats()->saveTimeValues(&time_stats_properties);
1095 Properties p(
propertyMng(),
"MessagePassingStats");
1107 info(4) <<
"SubDomain::setIsInitialized()";
1110 timeStats()->mergeTimeValues(&time_stats_properties);
1129 bool do_print_affinity =
false;
1131 do_print_affinity = (v.value() > 0);
1132 if (!do_print_affinity)
1134 info() <<
"PrintCPUAffinity";
1141 const Int32 nb_byte = 48;
1144 cpuset_bytes = cpuset.
bytes();
1147 cpuset_bytes[nb_byte - 1] =
Byte{ 0 };
1155 all_cpuset_bytes.
resize(nb_rank, nb_byte);
1158 for (
Int32 i = 0; i < nb_rank; ++i) {
1159 info() <<
"CPUAffinity " <<
Trace::Width(5) << i <<
" = " << all_cpuset_bytes[i].data();
1169template <
typename V>
void SubDomain::
1170_applyPropertyVisitor(V& p)
1172 auto b = p.builder();
1174 p << b.addBool(
"LegacyMeshCreation")
1175 .addDescription(
"Using legacy mesh creation")
1176 .addGetter([](
auto a) {
return a.x.isLegacyMeshCreation(); })
1177 .addSetter([](
auto a) { a.x._setLegacyMeshCreation(a.v); });
1183ARCANE_REGISTER_PROPERTY_CLASS(
SubDomain, ());
#define ARCANE_THROW(exception_class,...)
Macro for throwing an exception with formatting.
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Information for accelerator initialization.
eExecutionPolicy executionPolicy() const
Execution policy associated with acceleratorRuntime().
void setDeviceId(DeviceId name)
Positions the device associated with the Runner.
Accelerator manager interface.
Execution manager for accelerator.
const DeviceInfo & deviceInfo() const
Information about the device associated with this instance.
eExecutionPolicy executionPolicy() const
Associated execution policy.
ArrayView< DataType > viewAsArray()
View of the array as a 1D array.
void resize(Int64 new_size)
Resizes only the first dimension, leaving the second dimension unchanged.
void resize(Int64 s)
Changes the number of elements in the array to s.
Exception for an invalid identifier.
Exception when trying to dereference a null pointer.
XML node names of an Arcane dataset.
Information for building a dataset option.
Base class for a data set options list.
void clear()
Removes all elements from the collection.
EnumeratorT< String > Enumerator
Common variables of a case.
Configuration file readers.
void addValuesFromXmlNode(const XmlNode &element, Integer priority)
Adds values to the configuration.
Constant view of an array of type T.
static std::optional< Int32 > tryParseFromEnvironment(StringView s, bool throw_if_invalid)
Template class for converting a type.
Class managing a directory.
virtual const AcceleratorRuntimeInitialisationInfo & acceleratorRuntimeInitialisationInfo() const =0
Runtime initialization information for accelerators.
Interface of the base class for main arcane objects.
virtual ITraceMng * traceMng() const =0
Trace manager.
Interface of a class managing an XML document of the dataset.
virtual XmlNode configurationElement()=0
Returns the configuration information element.
virtual XmlNode meshesElement()=0
Element containing the list of meshes (new mechanism) (can be null).
virtual CaseNodeNames * caseNodeNames()=0
Returns the instance containing the names of XML nodes by language.
virtual CaseOptionsCollection blocks() const =0
Collection of option blocks.
virtual ICaseDocument * caseDocument()=0
XML document of the dataset (can be null if no dataset).
Interface for a data set options list.
Interface for a list of data set options.
virtual IModule * caseModule() const =0
Returns the associated module or nullptr if none exists.
virtual String rootTagName() const =0
Name of the element in the data set language.
Interface of the checkpoint information manager.
Interface for a configuration.
Interface of a direct execution service.
Interface of a class managing a directory.
Interface for the entry point manager.
Interface of the input/output manager.
Interface of an initial partitioner.
virtual void partitionAndDistributeMeshes(ConstArrayView< IMesh * > meshes)=0
Partitions the meshes.
Interface for registering variables for load balancing.
Factory for Arcane classes.
virtual Ref< IPropertyMng > createPropertyMngReference(ISubDomain *)=0
Creates an instance of the property manager.
virtual IServiceMng * createServiceMng(IBase *)=0
Creates an instance of the service manager.
virtual IEntryPointMng * createEntryPointMng(ISubDomain *)=0
Creates an instance of the entry point manager.
virtual ICheckpointMng * createCheckpointMng(ISubDomain *)=0
Creates an instance of the checkpoint manager.
virtual ITimeLoopMng * createTimeLoopMng(ISubDomain *)=0
Creates an instance of the time loop manager.
virtual ITimeHistoryMng * createTimeHistoryMng(ISubDomain *)=0
Creates an instance of the time history manager.
virtual IServiceLoader * createServiceLoader()=0
Creates an instance of the service loader.
virtual ILoadBalanceMng * createLoadBalanceMng(ISubDomain *sd)=0
Creates a description manager for load balancing.
virtual ICaseMng * createCaseMng(ISubDomain *)=0
Creates an instance of the case manager.
virtual IModuleMng * createModuleMng(ISubDomain *)=0
Creates an instance of the module manager.
virtual IVariableMng * createVariableMng(ISubDomain *)=0
Creates an instance of the variable manager.
virtual IModuleMaster * createModuleMaster(ISubDomain *sd)=0
Creates the master module for the sub-domain sd.
virtual Ref< IAcceleratorMng > createAcceleratorMngRef(ITraceMng *tm)=0
Creates a manager for accelerators.
virtual IIOMng * createIOMng(IApplication *)=0
Creates an instance of the I/O manager.
Interface for a memory usage information collector.
static IMeshStats * create(ITraceMng *trace, IMesh *mesh, IParallelMng *pm)
Creation of a default instance.
virtual void checkValidMesh()=0
Check for the validity of internal mesh structures (internal).
Interface of the main module.
Module manager interface.
virtual String name() const =0
Module name.
Interface of an observable.
Interface of the parallelism manager for a subdomain.
virtual IStat * stat()=0
Statistics manager.
virtual bool isMasterIO() const =0
true if the instance is a master I/O manager.
virtual Int32 commSize() const =0
Number of instances in the communicator.
virtual void gather(ConstArrayView< char > send_buf, ArrayView< char > recv_buf, Int32 rank)=0
Performs a gather operation onto a processor. This is a collective operation. The array send_buf must...
virtual Integer masterIORank() const =0
Rank of the instance managing I/O (for which isMasterIO() is true).
virtual char reduce(eReduceType rt, char v)=0
Performs a reduction of type rt on the real v and returns the value.
Interface of a unit system.
virtual void reloadMesh()=0
Reloads the mesh from protected variables.
Interface of a CPU core affinity management service.
virtual String cpuSetString()=0
Returns the cpuset for the current thread.
Interface of a profiling service.
Interface of the property manager.
Interface of a resource manager.
Service manager interface.
Interface for a case execution session.
Interface of the subdomain manager.
virtual IParallelMng * parallelMng()=0
Returns the parallelism manager.
Interface of a thread manager.
Class managing a history of values.
Interface for the time loop manager.
virtual ITimeLoop * usedTimeLoop() const =0
Returns the time loop used.
Interface of a time loop.
virtual String title() const =0
Title of the time loop.
virtual String description() const =0
Description of the time loop.
virtual StringCollection userClasses() const =0
List of user classes associated with the time loop.
Interface managing execution time statistics.
Interface of a timer manager.
virtual void flush()=0
Flushes all streams.
Variable manager interface.
virtual void variables(VariableRefCollection v, IModule *i)=0
Gets all variables of module i.
virtual eDataType dataType() const =0
Data type managed by the variable (Real, Integer, ...).
@ PPrivate
Indicates that the variable is private.
virtual eItemKind itemKind() const =0
Kind of mesh entities on which the variable is based.
virtual Integer dimension() const =0
Dimension of the variable.
virtual String name() const =0
Variable name.
Mesh construction via the "historical" method.
ListEnumeratorT< VariableRef * > Enumerator
IMesh * mesh() const
Associated mesh.
Base class of an observable.
virtual void saveValues(ITraceMng *tm, Properties *p)=0
Saves the current values into p.
virtual void mergeValues(ITraceMng *tm, Properties *p)=0
Merges the current values with those saved in p.
Class allowing automatic start and stop of a service.
void setPrintAtEnd(bool v)
Indicates if results are printed at the end of profiling.
Reference to an instance.
Encapsulation of a pointer with a reference counter.
static const IDeviceInfoList * deviceInfoList(eExecutionPolicy policy)
List of devices for the execution policy policy.
Encapsulation of an automatically destructing pointer.
Utility class for instantiating a service of a given interface.
Ref< InterfaceType > createReference(const String &name, eServiceBuilderProperties properties=SB_None)
Creates an instance implementing the InterfaceType interface.
Unicode character string.
Span< const Byte > bytes() const
Returns the conversion of the instance into UTF-8 encoding.
Class to manage the reading/writing of properties in checkpoints/rollbacks.
Implementation of a subdomain manager.
void readOrReloadMeshes() override
Reads or re-reads the meshes.
IParallelMng * allReplicaParallelMng() const override
Returns the parallelism manager for all replicas.
String objectLocalName() const override
Local name of the object.
IPhysicalUnitSystem * physicalUnitSystem() override
Subdomain unit system.
String m_case_name
Case name.
IModuleMng * moduleMng() override
Returns the module manager.
IThreadMng * threadMng() override
Returns the thread manager.
IParallelMng * parallelMng() override
Returns the parallelism manager.
Observable m_on_destroy_observable
Observable upon destruction.
const String & caseName() const override
Case name.
void setListingDirectory(const IDirectory &dir) override
Sets the output path for listing info.
Ref< ICaseMng > m_case_mng
Case data manager.
IEntryPointMng * entryPointMng() override
Returns the entry point manager.
ILoadBalanceMng * loadBalanceMng() override
Returns the load balancing manager.
ISession * m_session
Session.
IBase * objectParent() const override
Parent of this object.
void setIsContinue() override
Sets a flag indicating that a restart is being performed.
const String & caseFullFileName() const override
Full file path of the dataset.
void doInitModules() override
Calls the module initialization entry points.
IConfiguration * configuration() override
Associated configuration.
ICaseDocument * caseDocument() override
Case XML document.
IServiceMng * serviceMng() const override
Service manager.
Ref< IParallelMng > m_all_replica_parallel_mng
Parallelism manager for all replicas.
IIOMng * ioMng() override
Returns the I/O manager.
void setInitialPartitioner(IInitialPartitioner *partitioner) override
Sets the initial partitioner.
const CommonVariables & commonVariables() const override
Information on standard variables.
void setStorageDirectory(const IDirectory &dir) override
Sets the output path for exports requiring archiving.
void build() override
Constructs the instance members. The instance is not usable until this method has been called....
bool m_has_mesh_service
Indicates whether the service mechanism is used to read the mesh.
ITimeHistoryMng * timeHistoryMng() override
Returns the history manager.
IMemoryInfo * memoryInfo() const override
Memory information manager.
bool m_is_initialized
true if initialized
String m_case_full_file_name
Case path.
const IDirectory & exportDirectory() const override
Base directory for exports.
void dumpInfo(std::ostream &) override
Displays information about the instance.
void fillCaseBytes(ByteArray &bytes) const override
Fills bytes with the dataset content.
IModuleMaster * moduleMaster() const override
Module master interface.
ScopedPtrT< ILoadBalanceMng > m_lb_mng
Load balancing characteristics manager.
IVariableMng * variableMng() override
Returns the variable manager.
ScopedPtrT< IModuleMng > m_module_mng
Module manager.
const IDirectory & storageDirectory() const override
Base directory for exports requiring archiving.
Int32 subDomainId() const override
Subdomain ID associated with this manager.
Ref< IPropertyMng > m_property_mng
Property manager.
IMeshMng * meshMng() const override
Returns the mesh manager.
void addMesh(IMesh *mesh) override
Adds a mesh to the subdomain.
void _printCPUAffinity()
Displays the CPU affinity of all ranks.
CaseOptionsMain * m_case_config
Case config.
void dumpInternalInfos(XmlNode &root) override
Dumps internal architecture information. The information is stored in an XML tree with root as the ro...
IApplication * m_application
Main manager.
void allocateMeshes() override
Mesh allocation.
IObservable * onDestroyObservable() override
Notification before subdomain destruction.
ByteUniqueArray m_case_bytes
Case data.
void doInitMeshPartition() override
Applies the initialization mesh partitioning.
ITimerMng * timerMng() const override
Returns the timer manager.
VersionInfo objectVersion() const override
Service version number.
ICaseMng * caseMng() override
Returns the dataset manager.
Ref< IParallelMng > m_parallel_mng
Parallelism manager.
ConstArrayView< IMesh * > meshes() const override
List of meshes in the subdomain.
ScopedPtrT< IPhysicalUnitSystem > m_physical_unit_system
Physical unit system.
const IDirectory & listingDirectory() const override
Base directory for listings (logs, execution info).
void setExportDirectory(const IDirectory &dir) override
Sets the output path for exports (protections and restarts).
void setIsInitialized() override
Indicates that the subdomain is initialized.
ScopedPtrT< IEntryPointMng > m_entry_point_mng
Entry point manager.
const IConfiguration * configuration() const override
Associated configuration.
ScopedPtrT< IServiceMng > m_service_mng
Service manager.
IModuleMaster * m_module_master
Master module.
ScopedPtrT< ITimeHistoryMng > m_time_history_mng
History manager.
IDirectExecution * directExecution() const override
Direct execution service (or null).
const MeshHandle & defaultMeshHandle() override
Handle for the default mesh.
ScopedPtrT< IVariableMng > m_variable_mng
Variable manager.
void readCaseMeshes() override
Reads the mesh information from the dataset.
ScopedPtrT< ICheckpointMng > m_checkpoint_mng
Checkpoint manager.
Integer meshDimension() const override
Mesh dimension (1D, 2D, or 3D).
void initialize() override
Initializes the instance. The instance is not usable until this method has been called.
void doExitModules() override
Executes exit modules.
Directory m_export_directory
Export directory.
const CaseOptionsMain * caseOptionsMain() const override
General dataset options.
ITimeStats * m_time_stats
Execution time statistics.
ISession * session() const override
Session.
String objectNamespaceURI() const override
Namespace of the object.
ScopedPtrT< IMemoryInfo > m_memory_info
Memory usage information.
void setCaseName(const String &case_name) override
Sets the case name.
bool isContinue() const override
True if a restart is being performed, false otherwise.
IMainFactory * mainFactory() override
Main factory.
ICheckpointMng * checkpointMng() const override
Protection manager.
IRessourceMng * ressourceMng() const override
Resource manager.
IPropertyMng * propertyMng() const override
Property manager.
ScopedPtrT< IConfiguration > m_configuration
Configuration.
ITimeLoopMng * timeLoopMng() override
Returns the time loop manager.
void checkId(const String &where, const String &id) override
Checks if an identifier is valid.
Directory m_listing_directory
Listing directory.
IApplication * application() override
Application.
ScopedPtrT< ITimeLoopMng > m_time_loop_mng
Time loop manager.
Directory m_storage_directory
Archive directory.
ITimerMng * m_timer_mng
Timer manager.
ITraceMng * traceMng() const override
Trace manager.
ITimeStats * timeStats() const override
Execution time statistics.
IMesh * defaultMesh() override
Default mesh.
void initializeMeshVariablesFromCaseFile() override
Initializes variables whose values are specified in the dataset.
void setDirectExecution(IDirectExecution *v) override
Sets the direct execution service.
bool isInitialized() const override
Indicates if the session has been initialized.
Int32 nbSubDomain() const override
Total number of subdomains.
IAcceleratorMng * acceleratorMng() override
Associated accelerator manager.
IMesh * findMesh(const String &name, bool throw_exception) override
Searches for the mesh named name.
const ApplicationInfo & applicationInfo() const override
Executable information.
ScopedPtrT< IIOMng > m_io_mng
Input/output manager.
Positions the name of the currently executing action.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
TraceMessage logdate() const
Flow for a log message preceded by the date.
TraceMessage info() const
Flow for an information message.
ITraceMng * traceMng() const
Trace manager.
TraceMessage pwarning() const
Formatting the stream by length.
2D data vector with value semantics (STL style).
1D data vector with value semantics (STL style).
Parameters necessary for building a variable.
Information about a version.
bool null() const
True if the node is null.
void setAttrValue(const String &name, const String &value)
Sets the attribute name to the value value.
API UNDER DEVELOPMENT. DO NOT USE.
VariableRefArrayT< Byte > VariableArrayByte
Array variable of byte type.
Namespace for accelerator usage.
bool isAcceleratorPolicy(eExecutionPolicy exec_policy)
Indicates if exec_policy corresponds to an accelerator.
void dumpDateAndMemoryUsage(IParallelMng *pm, ITraceMng *tm)
Writes the date and memory consumed into tm.
@ ReduceMin
Minimum of values.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
@ SB_AllowNull
Allows the service to be absent.
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
Array< Byte > ByteArray
Dynamic one-dimensional array of characters.
UniqueArray< Byte > ByteUniqueArray
Dynamic 1D array of characters.
Collection< ICaseOptions * > CaseOptionsCollection
Collection of dataset options.
const char * itemKindName(eItemKind kind)
Entity kind name.
ConstArrayView< Byte > ByteConstArrayView
C equivalent of a 1D array of characters.
unsigned char Byte
Type of a byte.
UniqueArray< String > StringUniqueArray
Dynamic 1D array of strings.
List< VariableRef * > VariableRefList
Array of variable references.
const char * dataTypeName(eDataType type)
Data type name.
std::int32_t Int32
Signed integer type of 32 bits.