TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
mon_main.h
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#ifndef mon_main_included
17#define mon_main_included
18
19
20#include <Process.h>
21#include <Interprete_bloc.h>
22#include <Comm_Group.h>
23#include <list>
24
25/*! @brief Classe creee et executee par main() et lors d'une execution TRUST a travers Python.
26 *
27 * Il faut
28 * - creer une instance mon_main
29 * - initialiser le parallele
30 * - appeler dowork(nom_du_cas) (lecture et interpretation du jdd)
31 * A cet instant on peut jouer avec les objets crees en python
32 * (voir Interprete_bloc::objet_global(nom))
33 * - detruire l'instance mon_main
34 * L'interprete principal conserve ses objets jusqu'a la destruction
35 * de l'instance mon_main
36 *
37 */
39{
40public:
41 mon_main(int verbose_level=9, bool journal_master=false, Nom log_directory = "", bool apply_verification=true, bool disable_stop=false);
42 ~mon_main();
43
44 void init_parallel(const int argc, char **argv, bool with_mpi, bool check_enabled=false, bool with_petsc=true);
45 void finalize();
46 void dowork(const Nom& nom_du_cas);
47
48private:
49 int verbose_level_;
50 bool journal_master_;
51
52 Nom log_directory_;
53 bool trio_began_mpi_;
54 bool disable_stop_;
55 OWN_PTR(Comm_Group) groupe_trio_;
56 OWN_PTR(Comm_Group) node_group_;
57 OWN_PTR(Comm_Group) node_master_;
58 Interprete_bloc interprete_principal_;
59};
60extern bool error_handlers;
61
62#endif
: Cette classe decrit un groupe de processeurs sur lesquels
Definition Comm_Group.h:40
Interprete un bloc d'instructions dans le jeu de donnees.
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
void finalize()
Definition mon_main.cpp:280
void dowork(const Nom &nom_du_cas)
Definition mon_main.cpp:343
mon_main(int verbose_level=9, bool journal_master=false, Nom log_directory="", bool apply_verification=true, bool disable_stop=false)
Definition mon_main.cpp:70
void init_parallel(const int argc, char **argv, bool with_mpi, bool check_enabled=false, bool with_petsc=true)
Definition mon_main.cpp:198