Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
AnalysisCode Class Reference

Base class providing common functionality for derived classes (SysCallAnalysisCode and ForkAnalysisCode) which spawn separate processes for managing simulations. More...

Inheritance diagram for AnalysisCode:
ForkAnalysisCode SysCallAnalysisCode

List of all members.

Public Member Functions

void define_filenames (const int id)
 define modified filenames from user input by handling Unix temp file and tagging options
void write_parameters_files (const Variables &vars, const ActiveSet &set, const Response &response, const int id)
 write the parameters data and response request data to one or more parameters files (using one or more invocations of write_parameters_file()) in either standard or aprepro format
void read_results_files (Response &response, const int id)
 read the response object from one or more results files
const std::vector< String > & program_names () const
 return programNames
const std::string & input_filter_name () const
 return iFilterName
const std::string & output_filter_name () const
 return oFilterName
const std::string & parameters_filename () const
 return paramsFileName
const std::string & results_filename () const
 return resultsFileName
const std::string & results_filename (const int id)
 return the results filename entry in fileNameMap corresponding to id
void suppress_output_flag (const bool flag)
 set suppressOutputFlag
bool suppress_output_flag () const
 return suppressOutputFlag
bool command_line_arguments () const
 return commandLineArgs
bool multiple_parameters_filenames () const
 return multipleParamsFiles
void file_cleanup () const
 remove temporary files if not fileSaveFlag

Protected Member Functions

 AnalysisCode (const ProblemDescDB &problem_db)
 constructor
 ~AnalysisCode ()
 destructor
const char * work_dir () const
 return Workdir if useWorkdir is true (only called by derived classes)

Protected Attributes

bool suppressOutputFlag
 flag set by master processor to suppress output from slave processors
short outputLevel
 output verbosity level: {SILENT,QUIET,NORMAL,VERBOSE,DEBUG}_OUTPUT
bool fileTagFlag
 flags tagging of parameter/results files
bool fileSaveFlag
 flags retention of parameter/results files
bool commandLineArgs
 flag indicating use of passing of filenames as command line arguments to the analysis drivers and input/output filters
bool apreproFlag
 flag indicating use of the APREPRO (the Sandia "A PRE PROcessor" utility) format for parameter files
bool multipleParamsFiles
 flag indicating the need for separate parameters files for multiple analysis drivers
std::string iFilterName
 the name of the input filter (input_filter user specification)
std::string oFilterName
 the name of the output filter (output_filter user specification)
std::vector< StringprogramNames
 the names of the analysis code programs (analysis_drivers user specification)
size_t numPrograms
 the number of analysis code programs (length of programNames)
std::string specifiedParamsFileName
 the name of the parameters file from user specification
std::string paramsFileName
 the parameters file name actually used (modified with tagging or temp files)
std::string specifiedResultsFileName
 the name of the results file from user specification
std::string resultsFileName
 the results file name actually used (modified with tagging or temp files)
bool allowExistingResults
 by default analysis code interfaces delete results files if they exist; user may override with this flag and we'll try to gather and only fork if needed
std::string curWorkdir
 working directory when useWorkdir is true
std::map< int, std::pair
< std::string, std::string > > 
fileNameMap
 stores parameters and results file names used in spawning function evaluations. Map key is the function evaluation identifier.
bool useWorkdir
 whether to use a new or specified work_directory
std::string workDir
 its name, if specified...
bool dirTag
 whether to tag the working directory
bool dirSave
 whether dir_save was specified
bool dirDel
 whether to delete the directory when Dakota terminates
std::string templateDir
 template directory (if specified)
StringArray templateFiles
 template files (if specified)
bool templateCopy
 whether to force a copy (versus link) every time
bool templateReplace
 whether to replace existing files
bool haveTemplateDir
 state variable for template directory
bool haveWorkdir
 for dirTag, whether we have workDir
std::string dakDir
 Dakota directory (if needed)

Private Member Functions

void write_parameters_file (const Variables &vars, const ActiveSet &set, const Response &response, const std::string &prog, const std::vector< String > &an_comps, const std::string &params_fname)
 write the variables, active set vector, derivative variables vector, and analysis components to the specified parameters file in either standard or aprepro format

Private Attributes

ParallelLibraryparallelLib
 reference to the ParallelLibrary object. Used in define_filenames().
String2DArray analysisComponents
 the set of optional analysis components used by the analysis drivers (from the analysis_components interface specification)

Detailed Description

Base class providing common functionality for derived classes (SysCallAnalysisCode and ForkAnalysisCode) which spawn separate processes for managing simulations.

The AnalysisCode class hierarchy provides simulation spawning services for ApplicationInterface derived classes and alleviates these classes of some of the specifics of simulation code management. The hierarchy does not employ the letter-envelope technique since the ApplicationInterface derived classes instantiate the appropriate derived AnalysisCode class directly.


The documentation for this class was generated from the following files: