1 #ifndef __OPALSIMULATION_H__
2 #define __OPALSIMULATION_H__
14 #include "boost/smart_ptr.hpp"
55 std::map<std::string, std::vector<double> >
getData(
const std::vector<std::string> &statVariables);
65 void cleanUp(
const std::vector<std::string>& keep);
103 boost::scoped_ptr<GenerateOpalSimulation>
gs_;
128 const std::string& filename,
std::map< std::string, reqVarInfo_t > reqVarContainer_t
Expressions::Named_t constraints_
Concrete implementation of an Opal simulation wrapper.
void setupFSStructure()
create directories, input files, symlinks...
reqVarContainer_t requestedVars_
holds solutions returned to the optimizer
virtual ~OpalSimulation()
boost::shared_ptr< CmdArguments > CmdArguments_t
std::string pwd_
holds current directory (for restoring)
Expression to be evaluated in the framework.
std::string simTmpDir_
temporary directory for simulation data (environment var SIMTMPDIR)
Expressions::Named_t objectives_
std::string simulationDirName_
full path of simulation directory (where simulation will be run)
void restoreOut()
restore stdout and stderr to default
std::streambuf * strm_err_
stream buffer to redirect stderr
void copyH5_m()
copy H5 file
Abstract class every simulation has to implement to be able to work with the optimization pilot...
namedVariableCollection_t Param_t
bool hasResultsAvailable()
check if we already have simulated the current set of design vars
void invalidBunch()
mark a solution as invalid
OpalSimulation(Expressions::Named_t objectives, Expressions::Named_t constraints, Param_t params, std::string name, MPI_Comm comm, CmdArguments_t args)
reqVarContainer_t getResults()
returns container containing all requested variables with results
void setupSimulation()
create directories, input files, fieldmaps...
std::map< std::string, Expressions::Expr_t * > Named_t
type of an expressions with a name
std::map< std::string, std::vector< double > > getData(const std::vector< std::string > &statVariables)
void createSymlink_m(const std::string &path)
create symbolic links
std::streambuf * strm_buffer_
stream buffer to redirect output
int id_m
job id (SAMPLE command)
boost::scoped_ptr< GenerateOpalSimulation > gs_
object to generate simulation input files
std::set< std::string > dvarNames_
void getVariableDictionary(variableDictionary_t &dictionary, const std::string &filename, const Expressions::Expr_t *const expression)
get variables for expression evaluation from SDDS file. Can throw SDDSParserException ...
void redirectOutToFile()
redirect stdout and stderr to file
std::map< std::string, double > variableDictionary_t
std::map< std::string, std::string > userVariables_
variable dictionary holding requested optimizer values
std::string simulationName_
identification of the simulation (corresponding to output filename)
void collectResults()
Parse SDDS stat file and build up requested variable dictionary.
void setFilename(int id)
set job id (SAMPLE command)