16#include <communications.h>
20inline void erreur(
const Nom&
id)
23 Cerr <<
"The restarting has failed. The tag " <<
id <<
" has not been" << finl;
24 Cerr <<
"found in the restarting file. Check the restarting time in your data set." << finl;
28inline void erreur_syn(
const Nom&
id,
const Nom& syn_id)
31 Cerr <<
"The restarting has failed. The tag " <<
id <<
" or its synonym"<< syn_id <<
" has not been" << finl;
32 Cerr <<
"found in the restarting file. Check the restarting time in your data set." << finl;
36extern void convert_to(
const char *s,
double& ob);
37double extract_time_from_string(
const Nom& ident_lu,
const int digits)
41 convert_to(ident_lu.
substr_old(length-digits,digits),temps);
46double avancer_fichier(
Entree& fich,
const Nom&
id,
const int read_header)
67 Cerr <<
"Looking for the tag " <<
id <<
" in the file." << finl;
75 if (ident_lu!=
"format_sauvegarde:")
92 un_objet.
typer(type_lu);
93 Cerr <<
"-> Passing object " << ident_lu <<
" ... " << flush;
96 temps = extract_time_from_string(ident_lu, digits);
99 if (
id!=(
Nom)
"fin" && ident_lu == (
Nom)
"fin") erreur(
id);
102 Cerr <<
"-> Find object " <<
id <<
" and reading data in it ..." << finl;
104 envoyer_broadcast(temps, 0);
110double avancer_fichier_with_syno(
Entree& fich,
const Nom&
id,
const Nom& syn_id,
const int read_header)
131 Cerr <<
"Looking for the tag " <<
id <<
"or its synonym "<< syn_id<<
" in the file." << finl;
139 if (ident_lu!=
"format_sauvegarde:")
156 un_objet.
typer(type_lu);
157 Cerr <<
"-> Passing object " << ident_lu <<
" ... " << flush;
159 Cerr <<
"OK" << finl;
160 temps = extract_time_from_string(ident_lu, digits);
163 if (
id!=(
Nom)
"fin" && ident_lu == (
Nom)
"fin") erreur_syn(
id,syn_id);
166 Cerr <<
"-> Find object " <<
id <<
" or its synonym "<< syn_id<<
" and reading data in it ..." << finl;
168 envoyer_broadcast(temps, 0);
173double get_last_time(
Entree& fich)
175 return avancer_fichier(fich,
"fin", 1);
Class defining operators and methods for all reading operation in an input flow (file,...
virtual void set_diffuse(bool diffuse)
Sets the diffuse flag for this input stream.
virtual istream & get_istream()
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
Nom substr_old(const int, const int) const
Returns a name using the usual substr command. NOTE: deb = 1 means the first character of the string.
int longueur() const
Returns the number of characters in the Nom string, including the null terminator.
Objet_U * typer(const char *nom_type)
Tries to create an instance of type "type".
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
int reprendre(Entree &is) override
Restores an Objet_U from an input stream. Virtual method to override.