14#include "arcane/lima/LimaCutInfosReader.h"
16#include "arcane/utils/ArcanePrecomp.h"
18#include "arcane/utils/ScopedPtr.h"
19#include "arcane/utils/StringBuilder.h"
20#include "arcane/utils/FatalErrorException.h"
22#include "arcane/core/ItemGroup.h"
23#include "arcane/core/Item.h"
24#include "arcane/core/IXmlDocumentHolder.h"
25#include "arcane/core/XmlNode.h"
26#include "arcane/core/XmlNodeList.h"
27#include "arcane/core/IParallelMng.h"
28#include "arcane/core/IIOMng.h"
29#include "arcane/core/Timer.h"
30#include "arcane/core/IMesh.h"
52, m_parallel_mng(parallel_mng)
67 std::istringstream istr(buf);
120 if ((!is_parallel) || (is_parallel && nb_rank == 1)) {
121 for (
Integer i = 0, n = nodes_id.
size(); i < n; ++i)
123 for (
Integer i = 0, n = cells_id.
size(); i < n; ++i)
130 if (!dir_name.
empty()) {
131 correspondance_filename += dir_name;
132 correspondance_filename +=
"/";
134 correspondance_filename +=
"Correspondances";
136 if (comm_rank == 0) {
142 if (!doc_holder.
get())
143 ARCANE_FATAL(
"Invalid correspondance file '{0}'", correspondance_filename);
145 info() <<
"Time to read (unit: second) 'Correspondances' file: "
148 XmlNode root_element = doc_holder->documentNode().documentElement();
159 for (
Int32 i = 1; i < nb_rank; ++i) {
160 pm->
recv(other_sizes, i);
161 other_nodes_id.
resize(other_sizes[0]);
162 other_cells_id.
resize(other_sizes[1]);
164 pm->send(other_nodes_id, i);
165 pm->send(other_cells_id, i);
168 info() <<
"Time to transfert values: "
175 mesh_element_size[0] = nodes_id.
size();
176 mesh_element_size[1] = cells_id.
size();
177 pm->send(mesh_element_size, 0);
178 pm->
recv(nodes_id, 0);
179 pm->
recv(cells_id, 0);
202 String ustr_buf(String::fromNumber(comm_rank));
205 for (
Integer i = 0, s = cpu_list.size(); i < s; ++i) {
206 String id_str = cpu_list[i].attrValue(us_id);
209 if (id_str == ustr_buf) {
210 cpu_elem = cpu_list[i];
215 ARCANE_FATAL(
"No element <cpu[@id=\"{0}\"]>", comm_rank);
217 if (node_elem.
null())
220 if (cell_elem.
null())
228 if (nb_read != expected_size)
229 ARCANE_FATAL(
"Bad number of nodes rank={0} nb_read={1} expected={2}",
230 comm_rank, nb_read, expected_size);
238 if (nb_read != expected_size)
239 ARCANE_FATAL(
"Bad number of cells rank={0} nb_read={1} expected={2}",
240 comm_rank, nb_read, expected_size);
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
constexpr Integer size() const noexcept
Returns the size of the array.
void resize(Int64 s)
Changes the number of elements in the array to s.
virtual IXmlDocumentHolder * parseXmlFile(const String &filename, const String &schemaname=String{})=0
Reads and parses the XML file filename.
Interface of the parallelism manager for a subdomain.
virtual Int32 commRank() const =0
Rank of this instance in the communicator.
virtual void recv(ArrayView< char > values, Int32 rank)=0
virtual Int32 commSize() const =0
Number of instances in the communicator.
virtual IIOMng * ioMng() const =0
I/O manager.
virtual bool isParallel() const =0
Returns true if the execution is parallel.
virtual void barrier()=0
Performs a barrier.
Manager of a DOM document.
void _readUniqueIndex(Int64ArrayView nodes_id, Int64ArrayView cells_id, const String &dir_name)
Retrieval of unique entity indices.
void readItemsUniqueId(Int64ArrayView nodes_id, Int64ArrayView cells_id, const String &dir_name)
Constructs the internal mesh structures.
void _readUniqueIndexFromXml(Int64ArrayView nodes_id, Int64ArrayView cells_id, XmlNode root_element, Int32 rank)
Reading unique indices from an XML correspondence file.
T * get() const
Returns the object referenced by the instance.
Encapsulation of an automatically destructing pointer.
Unicode character string constructor.
Unicode character string.
bool null() const
Returns true if the string is null.
const char * localstr() const
Returns the conversion of the instance into UTF-8 encoding.
bool empty() const
True if the string is empty (null or "").
Sentinel for the timer. The sentinel associated with a timer allows it to be triggered upon its const...
@ TimerReal
Timer using real time.
Real lastActivationTime() const
Returns the time (in seconds) spent during the last activation of the timer.
TraceMessage info() const
Flow for an information message.
1D data vector with value semantics (STL style).
List of nodes of a DOM tree.
XmlNode child(const String &name) const
Child node of this node with name name.
String value() const
Node value.
XmlNodeList children(const String &name) const
Set of child nodes of this node having the name name.
bool null() const
True if the node is null.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ArrayView< Int64 > Int64ArrayView
C equivalent of a 1D array of 64-bit integers.
UniqueArray< Int64 > Int64UniqueArray
Dynamic 1D array of 64-bit integers.
Int32 Integer
Type representing an integer.
ArrayView< Integer > IntegerArrayView
C equivalent of a 1D array of integers.
std::int32_t Int32
Signed integer type of 32 bits.