16#include <LecFicDiffuse_JDD.h>
17#include <Execute_parallel.h>
18#include <Interprete_bloc.h>
19#include <TRUST_Error.h>
20#include <TRUSTArray.h>
33 Cerr <<
"Execute_parallel::readOn() not coded" << finl;
40 Cerr <<
"Execute_parallel::printOn() not coded" << finl;
61 Cerr <<
"Execute_parallel::interpreter to run several cases:" << finl;
66 bool disable_journal =
false;
71 param.
ajouter(
"nb_procs", &nb_procs);
77 const int n_calculs = liste_cas.size();
80 Cerr <<
"Nb_procs not given, we assume that calculations are sequential."
88 Cerr <<
"Error : nb_procs array must have " << n_calculs
89 <<
" values." << finl;
97 if (min_array(nb_procs) < 1)
99 Cerr <<
"Error : processor numbers must be >= 1" << finl;
104 for (
int i = 0; i < n_calculs; i++)
105 count += nb_procs[i];
108 Cerr <<
"Error : computations require " << count <<
" processors." << finl;
109 Cerr <<
"but only " <<
nproc() <<
" processors has been asked." << finl;
119 for (
int i = 0; i < n_calculs; i++)
121 const int n = nb_procs[i];
126 snprintf(s, 20,
"%05d", (
int)count);
139 snprintf(s2, 20,
"%05d", (
int)(count+n-1));
142 log=
"log files from ";
147 Cerr <<
"Error and standard outputs are redirected into " << log <<
" for case " << liste_cas[i] << finl;
153 for (
int j = 0; j < n; j++)
160 Cerr << n_calculs <<
" cases are running..." << finl;
163 const int old_journal_level = get_journal_level();
164 for (
int i = 0; i < n_calculs; i++)
168 set_Cerr_to_journal(1);
170 change_journal_level(0);
171 Nom nom_fichier(liste_cas[i]);
173 Journal(1) <<
"Execute_parallel: Entering subgroup " << i
174 <<
" to run case " << nom_fichier << finl;
176 nom_fichier +=
".data";
197 Cerr << err.
get_pe() <<
" <> " <<
Process::me() <<
" in Execute_parallel::interpreter." << finl;
202 set_Cerr_to_journal(0);
204 Cerr <<
"Case " << liste_cas[i] <<
" has finished. See " << log_courant << finl;
206 Cerr <<
"!!! Case " << liste_cas[i] <<
" has failed. See " << log_courant <<
" !!!" << finl;
208 Journal(1) <<
"Execute_parallel: Exiting subgroup " << i << finl;
214 change_journal_level(old_journal_level);
218 Cerr << finl <<
"End of Execute_parallel::interpreter" << finl;
: This class describes a group of processors on which
Class defining operators and methods for all reading operation in an input flow (file,...
Interpreter allowing the simultaneous execution of several data files.
Entree & interpreter(Entree &) override
Creates a partition of the nproc processors for the computation in order to interpret N different dat...
Interprets a block of instructions in the data set.
Entree & interpreter_bloc(Entree &is, Bloc_Type bloc_type, int verifier_sans_interpreter)
Interprets a block of instructions read from input is.
Base class for "interpreter" objects.
This class implements the operators and virtual methods of the EFichier class as follows: The file to...
void set_check_types(bool flag) override
Calls get_entree_master().
class Nom: a character string for naming TRUST objects.
An array of character strings (VECT(Nom)).
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
static const Nom & nom_du_cas()
Returns a constant reference to the case name. This method is static.
static Nom & get_set_nom_du_cas()
Returns a non-constant reference to the case name (to allow modification). This method is static.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
static int enter_group(const Comm_Group &group)
If the local processor belongs to the group, the current group for this processor becomes "group" and...
static void create_group(const ArrOfInt &liste_pe, OWN_PTR(Comm_Group) &group, int force_Comm_Group_NoParallel=0)
Creates a new processor group (can be called anywhere in the code).
static void exit_group()
Returns to the group that was active before the last successful enter_group() call (which returned 1)...
Helper class to factorize the readOn method of Objet_U classes.
void ajouter_flag(const char *keyword, const bool *value)
Register a boolean flag whose mere presence switches it to true.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
int lire_avec_accolades_depuis(Entree &is)
Parse the parameter block { ... } from is.
static Sortie & Journal(int message_level=0)
Returns a static Sortie object used as an event journal.
static int nproc()
Returns the number of processors in the current group. See Comm_Group::nproc() and PE_Groups::current...
static void barrier()
Synchronizes all processors in the current group (waits until all processors have reached the barrier...
static int exception_sur_exit
static int me()
Returns the rank of the local processor in the current communication group. See Comm_Group::rank() an...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
_SIZE_ size_array() const
void resize_array(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
const int & get_pe() const