Sandia Home Sandia Home
Main Page | Publications | Downloads | Configuration | Running the Code | Solver Parameters | FAQ | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

APPSPACK_Evaluator_SystemCall.hpp

Go to the documentation of this file.
00001 // $Id: APPSPACK_Evaluator_SystemCall.hpp,v 1.12 2006/06/30 01:42:08 tgkolda Exp $ 
00002 // $Source: /space/CVS-Acro/acro/packages/appspack/appspack/src/APPSPACK_Evaluator_SystemCall.hpp,v $ 
00003 
00004 //@HEADER
00005 // ************************************************************************
00006 // 
00007 //          APPSPACK: Asynchronous Parallel Pattern Search
00008 //                 Copyright (2003) Sandia Corporation
00009 // 
00010 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00011 // license for use of this work by or on behalf of the U.S. Government.
00012 // 
00013 // This library is free software; you can redistribute it and/or modify
00014 // it under the terms of the GNU Lesser General Public License as
00015 // published by the Free Software Foundation; either version 2.1 of the
00016 // License, or (at your option) any later version.
00017 //  
00018 // This library is distributed in the hope that it will be useful, but
00019 // WITHOUT ANY WARRANTY; without even the implied warranty of
00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021 // Lesser General Public License for more details.
00022 //                                                                                 
00023 // You should have received a copy of the GNU Lesser General Public
00024 // License along with this library; if not, write to the Free Software
00025 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00026 // USA.                                                                           .
00027 // 
00028 // Questions? Contact Tammy Kolda (tgkolda@sandia.gov) 
00029 // 
00030 // ************************************************************************
00031 //@HEADER
00032 
00038 #ifndef APPSPACK_EVALUATOR_SYSTEMCALL
00039 #define APPSPACK_EVALUATOR_SYSTEMCALL
00040 
00041 #include "APPSPACK_Common.hpp"
00042 #include "APPSPACK_Vector.hpp"
00043 #include "APPSPACK_Evaluator_Interface.hpp"
00044 #include "APPSPACK_Parameter_List.hpp"
00045 
00046 namespace APPSPACK
00047 {
00048 
00049 namespace Evaluator 
00050 {
00051 
00053 
00066 class SystemCall : public Interface
00067 {
00068 public:
00069   
00071   SystemCall(const string& executableName_in, 
00072              const string& inputPrefix_in, 
00073              const string& outputPrefix_in);
00074 
00083   SystemCall(const Parameter::List& params);
00084 
00086   virtual ~SystemCall() {};
00087   
00088   // derived
00089   virtual void operator()(int tag_in, const Vector& x_in, Vector& f_out, string& msg_out);
00090 
00092   virtual void print() const;
00093 
00094 private:
00095 
00097   void createStrings(int tag_in);
00098 
00100 
00113   void writeInputFile(const Vector& x);
00114 
00115 
00117   void runProgram();
00118 
00120 
00137   void readOutputFile();
00138 
00139 
00141   void deleteFiles();
00142 
00143 private:
00144 
00146   const string executableName;
00147 
00149   const string inputPrefix;
00150 
00152   const string outputPrefix;
00153 
00155   string tag;
00156 
00158   string inputFileName;
00159 
00161   string outputFileName;
00162 
00164   bool isInputFile;
00165 
00167   bool isOutputFile;
00168 
00170   string execString;
00171 
00173   Vector f;
00174 
00176   string msg;
00177 
00178 };
00179 
00180 }
00181 
00182 }
00183 
00184 #endif

 

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Fri Feb 16 10:33:35 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002