English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / ReLauncher: TMpiRun.h Source File
Uranie / ReLauncher  v4.10.0
/* @license-end */
TMpiRun.h
Go to the documentation of this file.
1 /* --- Ansi C --- */
3 // Copyright (C) 2013-2024 CEA/DES
4 //
5 // This program is free software: you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public License
7 // as published by the Free Software Foundation, either version 3 of
8 // the License, or any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this program.
17 // if not, see <http://www.gnu.org/licenses/>.
19 
27 #ifndef __TMPIRUN__
28 #define __TMPIRUN__
29 
30 #include "TSeparateRun.h"
31 
32 //#include <queue>
33 //#include <vector>
34 
35 #define MPICH_IGNORE_CXX_SEEK
36 #define OMPI_SKIP_MPICXX
37 #include <mpi.h>
38 
39 
40 namespace URANIE
41 {
42 namespace MpiRelauncher
43 {
44 
46 {
47 protected:
48  static int _count;
49  int _id;
50 
51  MPI_Comm _comm;
52 
53  virtual int wait_service();
54  virtual int send_header(int canal, int *head, int size);
55  virtual int send_value(int canal, double *mesg, int size);
56  virtual int receive_header(int canal, int *head, int size);
57  virtual int receive_value(int canal, double *mesg, int size);
58 
59 public:
60 
61  TMpiRun(URANIE::Relauncher::TEval *r, int *argc, char ***argv);
62  TMpiRun(URANIE::Relauncher::TEval *r, Bool_t init=kTRUE);
63  TMpiRun(URANIE::Relauncher::TEval *r, MPI_Comm comm);
64  virtual ~TMpiRun();
65 
66  virtual void startSlave();
67  virtual Bool_t onMaster();
68  virtual Bool_t readyToGet();
69 
70  ClassDef(URANIE::MpiRelauncher::TMpiRun, ID_RELAUNCHER)
71 };
72 
73 
74 }} //namespace
75 #endif
Definition: TBaseEval.cxx:44
TMpiRun(URANIE::Relauncher::TEval *r, int *argc, char ***argv)
Definition: TMpiRun.cxx:53
virtual ~TMpiRun()
Definition: TMpiRun.cxx:135
int _id
Definition: TMpiRun.h:49
Definition: TSeparateRun.h:44
static int _count
Definition: TMpiRun.h:48
virtual void startSlave()
Definition: TMpiRun.cxx:184
virtual int send_value(int canal, double *mesg, int size)
Definition: TMpiRun.cxx:176
MPI_Comm _comm
Definition: TMpiRun.h:51
virtual int send_header(int canal, int *head, int size)
Definition: TMpiRun.cxx:170
virtual Bool_t onMaster()
Definition: TMpiRun.cxx:201
virtual Bool_t readyToGet()
Definition: TMpiRun.cxx:206
separate process communicating by stream
virtual int receive_header(int canal, int *head, int size)
Definition: TMpiRun.cxx:157
Definition: TEval.h:49
virtual int wait_service()
Definition: TMpiRun.cxx:147
virtual int receive_value(int canal, double *mesg, int size)
Definition: TMpiRun.cxx:163
Definition: TMpiRun.h:45