English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / ReLauncher: TThreadedRun.h Source File
Uranie / ReLauncher v4.9.0
/* @license-end */
TThreadedRun.h
Go to the documentation of this file.
1
2// Copyright (C) 2013-2024 CEA/DES
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Lesser General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or any
7// later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
18// $Id$
19// $Author$
20// $Date$
21// $Revision 1.4 $
22// $State$
24
32#ifndef __TTHREADEDRUN__
33#define __TTHREADEDRUN__
34
35#include <pthread.h>
36#include <queue>
37
38#include "TShareRun.h"
39
40namespace URANIE
41{
42namespace Relauncher
43{
44
45class TThreadedRun;
46
47struct job
48{
49 int id;
51 pthread_t thr;
52};
53
55{
56protected:
57 long _nbnode;
59
60 pthread_mutex_t _mutex_in, _mutex_out;
61 pthread_cond_t _invide, _outvide;
62 std::queue<struct element> _qin;
63 std::queue<struct relement> _qout;
64 std::vector<struct job> _job;
65
66 struct element serviceGet();
67 void servicePut(long, int);
68
69public:
70 TThreadedRun(TEval *, long);
71 virtual ~TThreadedRun(void);
72
73 virtual void startSlave(void);
74 virtual Bool_t onMaster(void);
75 virtual void stopSlave(void);
76
77 void calcul_loop(int);
78 virtual void put(long int, std::vector<URANIE::DataServer::UEntry*>*, std::vector<URANIE::DataServer::UEntry*>*, int =0 );
79 virtual Bool_t readyToGet();
80 virtual int get(long &);
81
82 ClassDef(URANIE::Relauncher::TThreadedRun, ID_RELAUNCHER)
83};
84
85}
86}
87
88#endif
TRun base class.
Definition TEval.h:50
Definition TShareRun.h:66
Definition TThreadedRun.h:55
virtual ~TThreadedRun(void)
Definition TThreadedRun.cxx:62
pthread_cond_t _outvide
Definition TThreadedRun.h:61
virtual void put(long int, std::vector< URANIE::DataServer::UEntry * > *, std::vector< URANIE::DataServer::UEntry * > *, int=0)
Definition TThreadedRun.cxx:147
std::vector< struct job > _job
Definition TThreadedRun.h:64
virtual Bool_t readyToGet()
Definition TThreadedRun.cxx:197
long _nbnode
Definition TThreadedRun.h:57
virtual Bool_t onMaster(void)
Definition TThreadedRun.cxx:122
std::queue< struct element > _qin
Definition TThreadedRun.h:62
virtual void startSlave(void)
Definition TThreadedRun.cxx:109
pthread_cond_t _invide
Definition TThreadedRun.h:61
int _runcore
Definition TThreadedRun.h:58
pthread_mutex_t _mutex_in
Definition TThreadedRun.h:60
pthread_mutex_t _mutex_out
Definition TThreadedRun.h:60
virtual int get(long &)
Definition TThreadedRun.cxx:202
void servicePut(long, int)
Definition TThreadedRun.cxx:180
virtual void stopSlave(void)
Definition TThreadedRun.cxx:127
void calcul_loop(int)
Definition TThreadedRun.cxx:74
struct element serviceGet()
Definition TThreadedRun.cxx:164
std::queue< struct relement > _qout
Definition TThreadedRun.h:63
Definition TBaseEval.cxx:44
Definition TShareRun.h:55
Definition TThreadedRun.h:48
pthread_t thr
Definition TThreadedRun.h:51
TThreadedRun * run
Definition TThreadedRun.h:50
int id
Definition TThreadedRun.h:49