TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
EcritureLectureSpecial.cpp
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#include <EcritureLectureSpecial.h>
17
18#include <Champ_Fonc_base.h>
19#include <Domaine_VF.h>
20#include <Domaine.h>
21#include <MD_Vector_tools.h>
22#include <Octree_Double.h>
23#include <MD_Vector_composite.h>
24#include <MD_Vector_seq.h>
25#include <TRUSTTab_parts.h>
26#include <TRUST_2_PDI.h>
27
31
32#ifdef MPI_
33Nom EcritureLectureSpecial::Input="LecFicDiffuseBin"; // "EFichierBin" was the past (<=1.6.9) and "LecFicPartageMPIIO" is may be the future
34Nom EcritureLectureSpecial::Output="EcrFicPartageMPIIO"; // "EcrFicPartageBin" was the past (<=1.6.9) and "EcrFicPartageMPIIO" is after 1.7.0
35#else
37Nom EcritureLectureSpecial::Output="EcrFicPartageBin";
38#endif
39
40Implemente_instanciable(EcritureLectureSpecial,"EcritureLectureSpecial",Interprete);
41
42const DoubleTab& get_ref_coordinates_items(const Domaine_VF& zvf, const MD_Vector& md)
43{
44 // j'aurais pris xv mais il n'a pas de structure parallele !!!
45 if (md == zvf.face_sommets().get_md_vector())
46 return zvf.xv(); // Descripteur des face
47 else if (md == zvf.md_vector_faces_bord())
48 return zvf.xv_bord();
49 // j'aurais pris xp mais il n'a pas de structure parallele !!!!!!$&
50 else if (md == zvf.domaine().les_elems().get_md_vector())
51 return zvf.xp(); // Descripteur des elements
52 else if (md == zvf.xa().get_md_vector())
53 return zvf.xa(); // Descripteur des aretes
54 else if (md == zvf.domaine().les_sommets().get_md_vector())
55 return zvf.domaine().les_sommets();
56 else
57 {
58 Cerr << "Error in get_ref_coordinates_items\n"
59 << " descriptor not found in this domaine" << finl;
61 }
62 return zvf.xv(); // for compiler
63}
65{
66 return os;
67}
68
70{
71 return is;
72}
73// XD ecriturelecturespecial interprete ecriturelecturespecial INHERITS_BRACE Class to write or not to write a .xyz file
74// XD_CONT on the disk at the end of the calculation.
75// XD attr type chaine type REQ If set to 0 (the default), no xyz file is created. If set to 1, the .xyz file is written
76// XD_CONT at the end of the computation.
78{
79 Nom option;
80 is >> option;
81 if (option=="EFichierBin" || option=="LecFicDiffuseBin" || option=="LecFicPartageMPIIO")
82 {
83 Cerr << "ERROR: EcritureLectureSpecial: - option '" << option << "' is obsolete! You may only specify 0 or 1." <<finl;
85 }
86 else if (option=="EcrFicPartageMPIIO" || option=="EcrFicPartageBin" || option=="EcrFicPartage")
87 {
88 Cerr << "ERROR: EcritureLectureSpecial: - option '" << option << "' is obsolete! You may only specify 0 or 1." <<finl;
90 }
91 else if (option=="0")
92 Active=0;
93 else if (option=="1")
94 Active=1;
95 else
96 {
97 Cerr << "ERROR: \"EcritureLectureSpecial " << option << "\" is not recognized." << finl;
99 }
100 Cerr << "EcritureLectureSpecial::Active set to " << Active << finl;
101 return is;
102}
103
104/*! @brief indique si le format special a ete demande en lecture active par reprise xyz .
105 *
106 * ...
107 *
108 */
113
114/*! @brief indique si le format special a ete demande en lecture active par sauvegarde xyz .
115 *
116 * ...
117 * si le mode ecriture est special c.a.d si format de sauvegarde xyz
118 * alors special =1 a_faire=je_suis_maitre
119 * sinon special=0 , a_faire=1
120 *
121 *
122 */
124{
125 // with PDI, no one is writing, the library handles the IO
127 {
128 a_faire = 0;
129 special = 0;
130 }
131 else
132 {
133 special=0;
134 a_faire=1;
135 assert(mode_ecr>=0); // mode_ecr n'est pas positionne
136 if (mode_ecr)
137 {
138 special=1;
139 a_faire=Process::je_suis_maitre();
140 }
141 }
142 return mode_ecr;
143}
144
145/*! @brief simple appel a EcritureLectureSpecial::ecriture_special (const Domaine_VF& zvf,Sortie& fich,int nbval,const DoubleTab& val)
146 *
147 * apres avoir recupere le tableau val
148 *
149 */
151{
152 const Domaine_VF& zvf = ref_cast(Domaine_VF, ch.domaine_dis_base());
153 const DoubleTab& val = ch.valeurs();
154 return ecriture_special(zvf, fich, val);
155}
156
157int ecrit(Sortie& fich, const ArrOfBit& items_to_write, const DoubleTab& pos, const DoubleTab& val)
158{
159 const int nb_dim = val.nb_dim();
160 const int nb_comp = (nb_dim == 2) ? val.dimension(1) : 1;
161 const int nb_val = items_to_write.size_array();
162 const int dim = pos.dimension(1);
163
164 if (EcritureLectureSpecial::get_Output().finit_par("MPIIO"))
165 {
166 // No bufferisation needed for Parallel IO
167 int jmax = (dim + nb_comp) * nb_val;
168 ArrOfDouble tmp(jmax);
169 int j=0;
170 for (int p = 0; p < nb_val; p++)
171 {
172 // On n'ecrit que les items reels non communs afin d'avoir un fichier .xyz
173 // de meme taille quelque soit le decoupage et surtout de pouvoir le relire
174 // quelque soit le decoupage et les supports
175 if (items_to_write[p])
176 {
177 for (int k = 0; k < dim; k++)
178 tmp[j++] = pos(p, k);
179 if (nb_dim == 1)
180 tmp[j++] = val(p);
181 else
182 for (int k = 0; k < nb_comp; k++)
183 tmp[j++] = val(p, k);
184 }
185 }
186 fich.put(tmp.addr(), j, dim + nb_comp /* nb colonnes en ascii */);
187 }
188 else
189 {
190 // Bufferisation needed for EcrFicPartage
191 int jmax = (dim + nb_comp) * 128;
192 ArrOfDouble tmp(jmax);
193 int j = 0;
194 for (int p = 0; p < nb_val; p++)
195 {
196 // On n'ecrit que les items reels non communs afin d'avoir un fichier .xyz
197 // de meme taille quelque soit le decoupage et surtout de pouvoir le relire
198 // quelque soit le decoupage et les supports
199 if (items_to_write[p])
200 {
201 for (int k = 0; k < dim; k++)
202 tmp[j++] = pos(p, k);
203 if (nb_dim == 1)
204 tmp[j++] = val(p);
205 else
206 for (int k = 0; k < nb_comp; k++)
207 tmp[j++] = val(p, k);
208 if (j == jmax)
209 {
210 fich.put(tmp.addr(), j, dim + nb_comp /* nb colonnes en ascii */);
211 // On flushe regulierement en sequentiel car sur certains tres gros maillages
212 // stack overflow possible...
213 if (Process::is_sequential()) fich.syncfile();
214 j = 0;
215 }
216 }
217 }
218 if (j)
219 fich.put(tmp.addr(), j, dim + nb_comp /* nb colonnes en ascii */);
220 }
221 return 8 * (dim + nb_comp) * nb_val; // Bytes
222}
223
224/*! @brief Partie "interieure" de l'ecriture, appellee par la methode en dessous.
225 *
226 * Methode recursive, si le tableau a ecrire a un descripteur MD_Vector_composite
227 *
228 */
229static int ecriture_special_part2(const Domaine_VF& zvf, Sortie& fich, const DoubleTab& val)
230{
231 const MD_Vector& md = val.get_md_vector();
232 int bytes = 0;
233 if (sub_type(MD_Vector_composite, md.valeur()))
234 {
235 // Champs p1bulles et autres: appel recursif pour les differents sous-tableaux:
236 ConstDoubleTab_parts parts(val);
237 int n = zvf.que_suis_je() == "Domaine_PolyMAC_MPFA" ? 1 : parts.size();//on saute les variables auxiliaires de Champ_{P0,Face}_PolyMAC_MPFA
238 for (int i = 0; i < n; i++)
239 bytes += ecriture_special_part2(zvf, fich, parts[i]);
240 }
241 else if (sub_type(MD_Vector_std, md.valeur()) || sub_type(MD_Vector_seq, md.valeur()))
242 {
243 ArrOfBit items_to_write;
244 md->get_sequential_items_flags(items_to_write);
245 const DoubleTab& coords = get_ref_coordinates_items(zvf, md);
246 bytes += ecrit(fich, items_to_write, coords, val);
247 fich.syncfile();
248 }
249 else
250 {
251 Cerr << "EcritureLectureSpecial::ecriture_special_part: Error, unknown Metadata vector type : "
252 << md->que_suis_je() << finl;
254 }
255 return bytes;
256}
257
258/*! @brief codage de l'ecriture des positions et des valeurs de val
259 *
260 */
261int EcritureLectureSpecial::ecriture_special(const Domaine_VF& zvf, Sortie& fich, const DoubleTab& val)
262{
263 const MD_Vector& md = val.get_md_vector();
264 if (!md)
265 {
266 Cerr << "EcritureLectureSpecial::ecriture_special: error, cannot save an array with no metadata" << finl;
268 }
269 const trustIdType nb_items_seq = md->nb_items_seq_tot();
270 if (nb_items_seq == 0)
271 return 0;
272
273 const int nb_dim = val.nb_dim();
274 const int nb_comp = (nb_dim == 2) ? val.dimension(1) : 1;
275 const int dim = Objet_U::dimension;
276 const trustIdType n = nb_items_seq * (nb_comp + dim);
277
278
280 {
281 fich << (int)1 << finl;
282 fich << n << finl ;
283 fich << (int)1 << finl;
284 fich << n << finl ;
285 fich << n <<finl;
286 }
287
288 int bytes = ecriture_special_part2(zvf, fich, val);
289
291 {
292 fich << n << finl;
293 fich << (int)0 << finl;
294 fich << (int)0 << finl;
295 fich << (int)0 << finl;
296 fich << (int)1 << finl;
297 fich << (int)0 << finl;
298 fich << n << finl;
299 fich << finl;
300 fich << (int)1 << finl;
301 fich << (int)0 << finl;
302 fich << (int)0 <<finl;
303 }
304 fich.syncfile();
305 return bytes;
306}
307
308/*! @brief simple appel a EcritureLectureSpecial::lecture_special (const Domaine_VF& zvf,Entree& fich,int nbval, DoubleTab& val )
309 *
310 */
312{
313 const Domaine_VF& zvf=ref_cast(Domaine_VF,ch.domaine_dis_base());
314 DoubleTab& val = ch.valeurs();
315 lecture_special(zvf, fich, val);
316}
317
318
319/*! @brief Reciproque de la methode ecrit(.
320 *
321 * ..), lit uniquement les items sequentiels (donc pas les items communs recus d'un autre processeur)
322 * On verifie a la fin qu'on a bien lu exactement le nombre d'items attendus, s'il en manque
323 * c'est que le epsilon n'est pas bon (ou qu'on a change le maillage...)
324 * Valeur de retour: nombre total d'items sequentiels lus (sur tous les procs)
325 *
326 */
327static trustIdType lire_special(Entree& fich, const DoubleTab& coords, DoubleTab& val, const double epsilon)
328{
329 const int dim = coords.dimension(1);
330 const int nb_dim = val.nb_dim();
331 const int nb_comp = (nb_dim == 1) ? 1 : val.dimension(1);
332
333 const MD_Vector& md_vect = val.get_md_vector();
334 // Dans un premier temps, 1 si l'item est a lire, 0 s'il est lu par un autre processeur.
335 // Une fois que l'item est lu, on met le flag a 2.
336 ArrOfInt items_to_read;
337 const int n_to_read = md_vect->get_sequential_items_flags(items_to_read);
338 Octree_Double octree;
339 // Build an octree with "thick" nodes (epsilon size)
340 octree.build_nodes(coords, 0 /* do not include virtual elements */, epsilon);
341 const ArrOfInt& floor_elements = octree.floor_elements();
342
343 // Le fichier contient ce nombre de lignes pour cette partie du tableau (nombre total d'items sequentiels)
344 const trustIdType ntot = Process::mp_sum(n_to_read);
345
346 // On lit dans le fichier par blocs de buflines_max parce qu'il y a
347 // un broadcast reseau a chaque comm:
348 const int buflines_max = 2048; // pas trop, histoire d'avoir plusieurs blocs dans les cas tests
349 DoubleTab buffer(buflines_max, dim + nb_comp);
350 int bufptr = buflines_max;
351 ArrOfInt items;
352
353
354 double max_epsilon_needed = epsilon;
355 // Combien de fois on a trouve plusieurs candidats a moins de epsilon ?
356 int error_too_many_matches = 0;
357 // Combien de fois on est tombe plusieurs fois sur le meme sommet a lire ?
358 int error_duplicate_read = 0;
359 // Combien d'items a-t-on lu ?
360 int count_items_read = 0;
361
362 // Boucle sur les items sequentiels du fichier:
363 trustIdType pourcent=0;
364 for (trustIdType i = 0; i < ntot; i++)
365 {
366 trustIdType tmp=(i*10)/(ntot-1);
367 if (tmp>pourcent || i==0)
368 {
369 pourcent=tmp;
370 Cerr<<"\r"<<pourcent*10<<"% of data has been found."<<flush;
371 }
372 if (bufptr == buflines_max)
373 {
374 bufptr = 0;
375 trustIdType n = std::min(static_cast<trustIdType>(buflines_max), ntot - i);
376 n *= (dim + nb_comp);
377 assert(n <= static_cast<trustIdType>(buffer.size_array()));
378 fich.get(buffer.addr(), static_cast<int>(n)); // n is small enough
379 }
380 const double x = buffer(bufptr, 0);
381 const double y = buffer(bufptr, 1);
382 const double z = (dim == 3) ? buffer(bufptr, 2) : 0.;
383 // Recherche des items correspondant potentiellement au point (x,y,z)
384 int index = -1;
385 int nb_items_proches = octree.search_elements(x, y, z, index);
386 if (nb_items_proches > 0)
387 {
388 items.resize_array(nb_items_proches, RESIZE_OPTIONS::NOCOPY_NOINIT);
389 // Voir doc de Octree_Double::search_elements: on copie les indices des items proches dans items:
390 for (int j = 0; j < nb_items_proches; j++)
391 items[j] = floor_elements[index++];
392 // On reduit la liste pour avoir uniquement les items a moins de epsilon
393 const int item_le_plus_proche = octree.search_nodes_close_to(x, y, z, coords, items, epsilon);
394 nb_items_proches = items.size_array();
395 if (nb_items_proches == 1)
396 {
397 const int flag = items_to_read[item_le_plus_proche];
398 if (flag == 1)
399 {
400 // Ok, il faut lire cette valeur
401 items_to_read[item_le_plus_proche] = 2;
402 count_items_read++;
403 if (nb_dim == 1)
404 {
405 val(item_le_plus_proche) = buffer(bufptr, dim);
406 }
407 else
408 {
409 for (int j = 0; j < nb_comp; j++)
410 val(item_le_plus_proche, j) = buffer(bufptr, dim + j);
411 }
412 }
413 else if (flag == 0)
414 {
415 // Cet item n'est pas a moi, ne pas le lire
416 }
417 else
418 {
419 // Erreur, on a deja lu cet item !!! epsilon est trop grand (ou erreur a la sauvegarde ???)
420 error_duplicate_read++;
421 }
422 }
423 else if (nb_items_proches == 0)
424 {
425 // ok, le sommet est sur un autre processeur (ou epsilon trop petit ??)
426 }
427 else
428 {
429 // Erreur: epsilon est trop grand, on a plusieurs candidats a moins de epsilon
430 // Calcul de la distance avec le deuxieme plus proche pour afficher un message d'erreur a la fin:
431 for (int ii = 0; ii < nb_items_proches; ii++)
432 {
433 const int i_coord = items[ii];
434 if (i_coord == item_le_plus_proche)
435 continue; // celui-la est sans doute le bon, il faut un epsilon superieur a cette valeur la...
436 double xx = 0;
437 for (int j = 0; j < dim; j++)
438 {
439 double yy = coords(i_coord, j) - buffer(bufptr, j);
440 xx += yy * yy;
441 }
442 // On propose de mettre un epsilon au maximum egal a 1/10 de la distance avec le deuxieme point le plus proche:
443 xx = sqrt(xx) * 0.1;
444 if (max_epsilon_needed > xx)
445 max_epsilon_needed = xx;
446 }
447 error_too_many_matches++;
448 }
449 }
450 bufptr++;
451 }
452 Cerr << finl;
453 // Erreurs ?
454 int err = (count_items_read != n_to_read) || (error_too_many_matches > 0) || (error_duplicate_read > 0);
455 err = static_cast<int>(Process::mp_sum(err)); // sum of 0 and 1, always 'int'
456 if (err)
457 {
458 error_too_many_matches = static_cast<int>(Process::mp_sum(error_too_many_matches));
459 error_duplicate_read = static_cast<int>(Process::mp_sum(error_duplicate_read));
460 max_epsilon_needed = Process::mp_min(max_epsilon_needed);
462 {
463 if (error_too_many_matches)
464 {
465 Cerr << "Error in EcritureLectureSpecial: error_too_many_matches = " << error_too_many_matches
466 << ", epsilon is too large. Suggested value: " << max_epsilon_needed << finl;
467 if (max_epsilon_needed==0)
468 {
469 Cerr << "It could be because your mesh has two boundaries which match exactly." << finl;
470 Cerr << "It is possible to do calculation with this property but xyz restart process" << finl;
471 Cerr << "is impossible because it can't detect the differences between faces of the two boundaries..." << finl;
472 Cerr << "Try to do a classic restart with .sauv files." << finl;
473 }
474 }
475 else if (error_duplicate_read)
476 {
477 Cerr << "Error in EcritureLectureSpecial: error_duplicate_read = " << error_duplicate_read
478 << ", probably epsilon too large. " << finl;
479 }
480 else
481 {
482 Cerr << "Error in EcritureLectureSpecial: Some items were not found: epsilon too small (or the mesh has changed?)" << finl;
483 }
484 }
487 }
488 return ntot;
489}
490
491// Valeur de retour: nombre total d'items sequentiels lus (sur tous les procs)
492static trustIdType lecture_special_part2(const Domaine_VF& zvf, Entree& fich, DoubleTab& val)
493{
494 const MD_Vector& md = val.get_md_vector();
495
496 trustIdType ntot = 0;
497 if (sub_type(MD_Vector_composite, md.valeur()))
498 {
499 // Champs p1bulles et autres: appel recursif pour les differents sous-tableaux:
500 DoubleTab_parts parts(val);
501 const int n = parts.size();
502 for (int i = 0; i < n; i++)
503 ntot += lecture_special_part2(zvf, fich, parts[i]);
504 }
505 else if (sub_type(MD_Vector_std, md.valeur()) || sub_type(MD_Vector_seq, md.valeur()))
506 {
507 const DoubleTab& coords = get_ref_coordinates_items(zvf, md);
508 const double epsilon = zvf.domaine().epsilon();
509 ntot += lire_special(fich, coords, val, epsilon);
510 }
511 else
512 {
513 Cerr << "EcritureLectureSpecial::lecture_special_part2: Error, unknown Metadata vector type : "
514 << md->que_suis_je() << finl;
516 }
517 return ntot;
518}
519
520/*! @brief codage de la relecture d'un champ a partir d'un fichier special positions,valeurs
521 *
522 */
523void EcritureLectureSpecial::lecture_special(const Domaine_VF& zvf, Entree& fich, DoubleTab& val)
524{
525
526 const MD_Vector& md_vect = val.get_md_vector();
527 if (!md_vect)
528 {
529 Cerr << "EcritureLectureSpecial::ecriture_special: error, cannot save an array with no metadata" << finl;
531 }
532 const trustIdType nb_items_seq = md_vect->nb_items_seq_tot();
533 if (nb_items_seq == 0)
534 return;
535
536 trustIdType bidon;
537 fich >> bidon >> bidon >> bidon >> bidon >> bidon;
538
539 trustIdType ntot = lecture_special_part2(zvf, fich, val);
540 if (ntot != nb_items_seq)
541 {
542 Cerr << "Internal error in EcritureLectureSpecial::lecture_special" << finl;
543 exit();
544 }
545
546 fich >> bidon >> bidon >> bidon >> bidon >> bidon >> bidon >> bidon >> bidon >> bidon >> bidon;
547
548 // On met a jour les parties virtuelles du tableau val
550}
551
552/*! @brief Renvoie le mode d'ecriture utilise (pour pouvoir le modifier).
553 *
554 * Cette methode est statique.
555 *
556 */
558{
559 static Nom option=Output;
560
561 // disable MPIIO in sequential mode
562 if (Output=="EcrFicPartageMPIIO" && Process::is_sequential()) option="EcrFicPartageBin";
563
564 // disable MPIIO if TRUST_DISABLE_MPIIO=1
565 char* theValue = getenv("TRUST_DISABLE_MPIIO");
566 if (theValue != nullptr)
567 {
568 if (option=="EcrFicPartageMPIIO" && strcmp(theValue,"1")==0) option="EcrFicPartageBin";
569 }
570
571 return option;
572}
int_t size_array() const
Renvoie la taille du tableau en bits.
Definition ArrOfBit.h:45
virtual DoubleTab & valeurs()=0
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
virtual const Domaine_dis_base & domaine_dis_base() const
DoubleTab_t & les_sommets()
Definition Domaine.h:113
IntTab_t & les_elems()
Definition Domaine.h:129
class Domaine_VF
Definition Domaine_VF.h:44
virtual const DoubleTab & xv_bord() const
double xa(int num_arete, int k) const
Definition Domaine_VF.h:78
double xv(int num_face, int k) const
Definition Domaine_VF.h:76
int face_sommets(int i, int j) const
renvoie le numero du ieme sommet de la face num_face.
Definition Domaine_VF.h:583
double xp(int num_elem, int k) const
Definition Domaine_VF.h:77
const MD_Vector & md_vector_faces_bord() const
Definition Domaine_VF.h:157
double epsilon() const
const Domaine & domaine() const
static Nom & get_Output()
Renvoie le mode d'ecriture utilise (pour pouvoir le modifier).
static int is_ecriture_special(int &special, int &a_faire)
indique si le format special a ete demande en lecture active par sauvegarde xyz .
static int is_lecture_special()
indique si le format special a ete demande en lecture active par reprise xyz .
Entree & interpreter(Entree &fich) override
static int ecriture_special(const Champ_base &ch, Sortie &fich)
simple appel a EcritureLectureSpecial::ecriture_special (const Domaine_VF& zvf,Sortie& fich,...
static void lecture_special(Champ_base &ch, Entree &fich)
simple appel a EcritureLectureSpecial::lecture_special (const Domaine_VF& zvf,Entree& fich,...
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual int get(int *ob, std::streamsize n)
Definition Entree.cpp:222
Classe de base des objets "interprete".
Definition Interprete.h:38
int get_sequential_items_flags(ArrOfBit &flags, int line_size=1) const
virtual trustIdType nb_items_seq_tot() const
Metadata for a distributed composite vector.
Dummy parallel descriptor used for sequential computations.
C'est le plus simple des descripteurs, utilise pour les tableaux de valeurs aux sommets,...
: Cette classe est un OWN_PTR mais l'objet pointe est partage entre plusieurs
Definition MD_Vector.h:48
const MD_Vector_base & valeur() const
Definition MD_Vector.h:77
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:76
static int dimension
Definition Objet_U.h:99
friend class Sortie
Definition Objet_U.h:75
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
const ArrOfInt_t & floor_elements() const
static int_t search_nodes_close_to(double x, double y, double z, const DoubleTab_t &coords, ArrOfInt_t &node_list, double epsilon)
Methode hors classe Cherche parmi les sommets de la liste node_list ceux qui sont a une.
void build_nodes(const DoubleTab_t &coords, const bool include_virtual, const double epsilon=0.)
construit un octree contenant les points de coordonnees coords.
int_t search_elements(double x, double y, double z, int_t &index) const
cherche les elements ou les points contenus dans l'octree_floor qui contient le point (x,...
static double mp_min(double)
Definition Process.cpp:386
static double mp_sum(double)
Calcule la somme de x sur tous les processeurs du groupe courant.
Definition Process.cpp:146
static void barrier()
Synchronise tous les processeurs du groupe courant (attend que tous les processeurs soient arrives a ...
Definition Process.cpp:136
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
static int je_suis_maitre()
renvoie 1 si on est sur le processeur maitre du groupe courant (c'est a dire me() == 0),...
Definition Process.cpp:86
static bool is_sequential()
Definition Process.cpp:115
Classe de base des flux de sortie.
Definition Sortie.h:52
virtual int put(const unsigned *ob, std::streamsize n, std::streamsize nb_colonnes=1)
Definition Sortie.cpp:101
virtual Sortie & syncfile()
Definition Sortie.cpp:187
_SIZE_ size_array() const
void resize_array(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
int nb_dim() const
Definition TRUSTTab.h:199
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
virtual const MD_Vector & get_md_vector() const
Definition TRUSTVect.h:123
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
static int is_PDI_checkpoint()