English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / ReLauncher: TCodeEval.h Source File
Uranie / ReLauncher v4.9.0
/* @license-end */
TCodeEval.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 __TCODEEVAL__
33#define __TCODEEVAL__
34
35#include <sstream>
36
37//ROOT
38#include "Rtypes.h"
39#include "TString.h"
40#include "TList.h"
41
42// Uranie
43#include "Relauncher.h"
44#include "TShareEval.h"
45
46#include "TDataServer.h"
47
48namespace URANIE
49{
50namespace Relauncher
51{
52
53class TCodeScript: public TObject
54{
55public:
56 virtual void build(TString &dir, TObjArray *in) = 0;
57 virtual void put(TString &ref, TString &tmp, Double_t *in) = 0;
58 virtual void put(TString &ref, TString &tmp, vector<URANIE::DataServer::UEntry*> *in) = 0;
59
60// std::stringstream buffer;
61
62 ClassDef(URANIE::Relauncher::TCodeScript, ID_RELAUNCHER)
63};
64
65class TCodeResult: public TObject
66{
67public:
68 virtual void build(TObjArray *) = 0;
69 virtual int get(TString &, Double_t*) = 0;
70 // virtual int get(TString &, Double_t**) = 0;
71 virtual int get(TString &work, vector<URANIE::DataServer::UEntry*> *sout) = 0;
72
73 virtual void clearFile(TString tmpdir) = 0;
74
75// std::stringstream buffer;
76
77 ClassDef(URANIE::Relauncher::TCodeResult, ID_RELAUNCHER)
78};
79
81{
82protected:
83 TString _cmd;
84 TString _origcmd;
86 Bool_t _isnumered;
88 TString _workdir, _tmpdir;
89 TList *_scripts;
91
92 void buildDir(void);
93 int putAndRun(Double_t *, int ncalc=-1);
94 int putAndRun(vector<URANIE::DataServer::UEntry*>*, int ncalc=-1);
95
96public:
97 //TCodeEval();
98 //TCodeEval(const TString &, const TString &);
99 TCodeBase(const char *scmd);
100 virtual ~TCodeBase(void);
101
102 void addInputFile(TCodeScript *fil);
103 void addOutputFile(TCodeResult *fil);
104 void setReference(TString dir);
105 void setWorkingDir(TString dir);
106 void setOldTmpDir();
107 void keepAllFolders();
108
109 virtual void setTmpDir(int id);
110
111 ClassDef(URANIE::Relauncher::TCodeBase, ID_RELAUNCHER)
112};
113
114class TCodeEval: public TShareEval, public TCodeBase
115{
116public:
117 //TCodeEval();
118 //TCodeEval(const TString &, const TString &);
119 TCodeEval(const char *scmd);
120 virtual ~TCodeEval(void);
121
122 virtual void freeze(void);
123 virtual TEval *rebuild(int rank, Bool_t chef = kTRUE);
124 virtual Bool_t unbuild();
125 virtual int eval(vector<URANIE::DataServer::UEntry*>*, vector<URANIE::DataServer::UEntry*>*, int =0 );
126
127 ClassDef(URANIE::Relauncher::TCodeEval, ID_RELAUNCHER)
128};
129
130}
131}
132
133#endif
134
implementation partage au TEval
Definition TCodeEval.h:81
Bool_t _isnumered
Definition TCodeEval.h:86
void setReference(TString dir)
Definition TCodeEval.cxx:93
TString _localdir
Definition TCodeEval.h:85
void addInputFile(TCodeScript *fil)
Definition TCodeEval.cxx:77
void keepAllFolders()
Definition TCodeEval.cxx:110
void setOldTmpDir()
Definition TCodeEval.cxx:105
TString _workdir
Definition TCodeEval.h:88
void addOutputFile(TCodeResult *fil)
Definition TCodeEval.cxx:83
virtual void setTmpDir(int id)
Definition TCodeEval.cxx:147
int putAndRun(Double_t *, int ncalc=-1)
Definition TCodeEval.cxx:215
TString _origcmd
Definition TCodeEval.h:84
TString _tmpdir
Definition TCodeEval.h:88
TString _initialdir
Definition TCodeEval.h:85
TList * _scripts
Definition TCodeEval.h:89
void buildDir(void)
Definition TCodeEval.cxx:116
virtual ~TCodeBase(void)
Definition TCodeEval.cxx:70
TCodeResult * _result
Definition TCodeEval.h:90
TString _cmd
Definition TCodeEval.h:83
void setWorkingDir(TString dir)
Definition TCodeEval.cxx:99
Bool_t _keepAllFolders
Definition TCodeEval.h:87
Definition TCodeEval.h:115
virtual Bool_t unbuild()
Definition TCodeEval.cxx:323
virtual TEval * rebuild(int rank, Bool_t chef=kTRUE)
Definition TCodeEval.cxx:310
virtual int eval(vector< URANIE::DataServer::UEntry * > *, vector< URANIE::DataServer::UEntry * > *, int=0)
Definition TCodeEval.cxx:331
virtual ~TCodeEval(void)
Definition TCodeEval.cxx:279
virtual void freeze(void)
Definition TCodeEval.cxx:283
Definition TCodeEval.h:66
virtual void clearFile(TString tmpdir)=0
virtual int get(TString &, Double_t *)=0
virtual int get(TString &work, vector< URANIE::DataServer::UEntry * > *sout)=0
virtual void build(TObjArray *)=0
Definition TCodeEval.h:54
virtual void build(TString &dir, TObjArray *in)=0
virtual void put(TString &ref, TString &tmp, Double_t *in)=0
virtual void put(TString &ref, TString &tmp, vector< URANIE::DataServer::UEntry * > *in)=0
Definition TEval.h:50
Definition TShareEval.h:52
Definition TBaseEval.cxx:44