#include <APPSPACK_Evaluator_SystemCall.hpp>
Inheritance diagram for APPSPACK::Evaluator::SystemCall:


Default method for handling evaluations. The user provides an executable that takes an input file with the point to be evaluated and creates an output file with the result.
See Using the APPSPACK Executables for more information on using APPSPACK with this object.
Basic system call mode of evaluation
Definition at line 66 of file APPSPACK_Evaluator_SystemCall.hpp.
Public Member Functions | |
| SystemCall (const string &executableName_in, const string &inputPrefix_in, const string &outputPrefix_in) | |
| Constructor. | |
| SystemCall (const Parameter::List ¶ms) | |
| Constructor (via parameter list). | |
| virtual | ~SystemCall () |
| Destructor. | |
| virtual void | operator() (int tag_in, const Vector &x_in, Vector &f_out, string &msg_out) |
| Do the function evaluation for the point x_in, and fill int he results. | |
| virtual void | print () const |
| Prints out the name of the executable, and the input and output file prefixes. | |
Private Member Functions | |
| void | createStrings (int tag_in) |
| Create the strings tag, inputFileName, outputFileName, and execString. | |
| void | writeInputFile (const Vector &x) |
| Write the parameter file. | |
| void | runProgram () |
| Run the function evaluation using a system command. | |
| void | readOutputFile () |
| Read the result file containing the function value. | |
| void | deleteFiles () |
| Delete the input and output files. | |
Private Attributes | |
| const string | executableName |
| Executable name. | |
| const string | inputPrefix |
| Prefix for name of parameters file. | |
| const string | outputPrefix |
| Prefix for name of output file. | |
| string | tag |
| Tag for this function evaluation. | |
| string | inputFileName |
| Name of parameters file for this function evaluation. | |
| string | outputFileName |
| Name of output file for this function evaluation. | |
| bool | isInputFile |
| Is there currently an input file (that will need to be deleted)? | |
| bool | isOutputFile |
| Is there currently an output file (that will need to be deleted)? | |
| string | execString |
| Executable string for this function evaluation. | |
| Vector | f |
| The function value. | |
| string | msg |
| Any message about the function value. | |
|
||||||||||||||||
|
Constructor.
Definition at line 43 of file APPSPACK_Evaluator_SystemCall.cpp. |
|
|
Constructor (via parameter list). Reads "Executable Name", "Input Prefix", and "Output Prefix" from the give parameter list. See Using the APPSPACK Executables for more information. Definition at line 54 of file APPSPACK_Evaluator_SystemCall.cpp. |
|
|
Destructor.
Definition at line 86 of file APPSPACK_Evaluator_SystemCall.hpp. |
|
||||||||||||||||||||
|
Do the function evaluation for the point x_in, and fill int he results.
Implements APPSPACK::Evaluator::Interface. Definition at line 63 of file APPSPACK_Evaluator_SystemCall.cpp. References createStrings(), deleteFiles(), readOutputFile(), runProgram(), and writeInputFile(). |
|
|
Prints out the name of the executable, and the input and output file prefixes.
Reimplemented from APPSPACK::Evaluator::Interface. Definition at line 187 of file APPSPACK_Evaluator_SystemCall.cpp. References executableName, inputPrefix, and outputPrefix. |
|
|
Create the strings tag, inputFileName, outputFileName, and execString.
Definition at line 81 of file APPSPACK_Evaluator_SystemCall.cpp. References execString, executableName, inputFileName, inputPrefix, outputFileName, outputPrefix, and tag. Referenced by operator()(). |
|
|
Write the parameter file.
Create the file named inputFileName containing the input vector
3 1.23547e-5 2.00000e-3 4.55000e+10 Definition at line 92 of file APPSPACK_Evaluator_SystemCall.cpp. References inputFileName, isInputFile, and APPSPACK::Vector::size(). Referenced by operator()(). |
|
|
Run the function evaluation using a system command.
Definition at line 115 of file APPSPACK_Evaluator_SystemCall.cpp. References execString. Referenced by operator()(). |
|
|
Read the result file containing the function value. Read the file of the name specified by outputFileName. The file is expected to contain one of the following types of outputs:
An empty function vector will be returned if we cannot read the result file or encounter any other problems. Otherwise f will contain the function value for this task. Definition at line 120 of file APPSPACK_Evaluator_SystemCall.cpp. References APPSPACK::dne(), f, APPSPACK::getNextString(), isOutputFile, msg, outputFileName, APPSPACK::Vector::push_back(), APPSPACK::Vector::resize(), APPSPACK::Vector::size(), and tag. Referenced by operator()(). |
|
|
Delete the input and output files.
Definition at line 174 of file APPSPACK_Evaluator_SystemCall.cpp. References inputFileName, isInputFile, isOutputFile, and outputFileName. Referenced by operator()(). |
|
|
Executable name.
Definition at line 146 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), and print(). |
|
|
Prefix for name of parameters file.
Definition at line 149 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), and print(). |
|
|
Prefix for name of output file.
Definition at line 152 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), and print(). |
|
|
Tag for this function evaluation.
Definition at line 155 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), and readOutputFile(). |
|
|
Name of parameters file for this function evaluation.
Definition at line 158 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), deleteFiles(), and writeInputFile(). |
|
|
Name of output file for this function evaluation.
Definition at line 161 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), deleteFiles(), and readOutputFile(). |
|
|
Is there currently an input file (that will need to be deleted)?
Definition at line 164 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by deleteFiles(), and writeInputFile(). |
|
|
Is there currently an output file (that will need to be deleted)?
Definition at line 167 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by deleteFiles(), and readOutputFile(). |
|
|
Executable string for this function evaluation.
Definition at line 170 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by createStrings(), and runProgram(). |
|
|
The function value.
Definition at line 173 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by readOutputFile(). |
|
|
Any message about the function value.
Definition at line 176 of file APPSPACK_Evaluator_SystemCall.hpp. Referenced by readOutputFile(). |
![]()
© Sandia Corporation | Site Contact | Privacy and Security
![]()
Generated on Fri Feb 16 10:33:36 2007 for APPSPACK 5.0.1 by
1.3.9.1 written by Dimitri van Heesch,
© 1997-2002