Changeset 5819


Ignore:
Timestamp:
11/16/08 13:19:04 (5 years ago)
Author:
wehart
Message:

Misc supression of output in Makefile.am.

Adding hooks to save the *.nl file for debugging purposes.

Fix to test_simple.py.

Location:
colin/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • colin/trunk/colin/AmplApplication.h

    r5786 r5819  
    2121#include <colin/OptApplication.h> 
    2222 
    23 namespace colin { 
     23namespace colin 
     24{ 
    2425 
    2526/** This defines the core relaxed application that directly interfaces 
     
    3031{ 
    3132public: 
     33 
    3234   struct ProblemInfo; 
    3335 
     
    4446 
    4547protected: 
     48 
    4649   /// Convert the domain supplied by the solver to the application domain 
    47    virtual bool 
    48    map_domain(const utilib::Any &src, utilib::Any &native, bool forward) const; 
     50   virtual bool map_domain(const utilib::Any &src, utilib::Any &native, bool forward) const; 
    4951 
    50    ///  
    51    virtual utilib::Any 
    52    spawn_evaluation( const utilib::Any &domain, 
    53                      const AppRequest::request_map_t &requests, 
    54                      utilib::seed_t &seed ); 
     52   /// 
     53   virtual utilib::Any spawn_evaluation( 
     54     const utilib::Any &domain, 
     55      const AppRequest::request_map_t &requests, 
     56      utilib::seed_t &seed); 
    5557 
    5658   /// Actually perform the calculation(s) requested by the solver 
    57    virtual utilib::Any 
    58    collect_evaluation( AppResponse::response_map_t &responses, 
    59                        utilib::seed_t &seed, 
    60                        AppResponse &masked_response, 
    61                        const utilib::Any evalid = utilib::Any() ); 
     59   virtual utilib::Any collect_evaluation( 
     60     AppResponse::response_map_t &responses, 
     61      utilib::seed_t &seed, 
     62      AppResponse &masked_response, 
     63      const utilib::Any evalid = utilib::Any()); 
    6264 
    6365private: 
     66 
    6467   /// 
    6568   struct Data; 
     69 
    6670   /// 
    6771   Data * data; 
     
    9094   utilib::Any set_nl_file(std::string fname); 
    9195 
     96   /// 
    9297   virtual ApplicationHandle relaxed_application() const 
    93    { return remote_app; } 
     98      { return remote_app; } 
     99 
     100   /// 
     101   void keep_nl_file(); 
    94102 
    95103protected: 
     104 
    96105   /// Convert the domain supplied by the solver to the application domain 
    97    virtual bool 
    98    map_domain(const utilib::Any &src, utilib::Any &native, bool forward) const; 
     106   virtual bool map_domain(const utilib::Any &src, utilib::Any &native, bool forward) const; 
    99107 
    100108   /// Default to using the evaluation manager from the wrapped application 
     
    102110   { return remote_app->eval_mngr().operator->(); } 
    103111 
     112   /// 
    104113   virtual OptApplication_Base* get_wrapped_application() const 
    105    { return remote_app.object(); } 
     114      { return remote_app.object(); } 
    106115 
    107116private: 
     117 
    108118   DEFINE_RESOLVERS(AmplApplication); 
    109119 
    110120   /// 
    111121   static bool 
    112    cb_map_response( const OptApplication_Base* ref, 
    113                     const utilib::Any &domain, 
    114                     const AppRequest::request_map_t &requests, 
    115                     const AppResponse::response_map_t &sub_response, 
    116                     AppResponse::response_map_t &response ); 
     122   cb_map_response(const OptApplication_Base* ref, 
     123                   const utilib::Any &domain, 
     124                   const AppRequest::request_map_t &requests, 
     125                   const AppResponse::response_map_t &sub_response, 
     126                   AppResponse::response_map_t &response); 
    117127 
    118128   /// 
     
    120130 
    121131private: 
     132 
    122133   /// 
    123134   struct Data; 
     135 
    124136   /// 
    125137   Data * data; 
     
    127139   /// 
    128140   ApplicationHandle remote_app; 
     141 
    129142   /// 
    130143   double EPS; 
  • colin/trunk/src/AmplApplication.cpp

    r5786 r5819  
    5757/// AmplApplication disabled because COLIN compiled without AMPL support 
    5858AmplApplication::AmplApplication() 
     59    : keep_nl_file(false) 
    5960{ 
    6061   EXCEPTION_MNGR(std::logic_error, "Attempting to create AmplApplication" 
     
    125126 
    126127struct AmplApplication_Core::ProblemInfo { 
     128   bool keep_nl_file; 
    127129   size_t NumVars; 
    128130   size_t NumReal; 
     
    337339set_nl_file(std::string fname, ProblemInfo* info) 
    338340{ 
     341   // 
     342   if (info->keep_nl_file) 
     343      rename(fname.c_str(), "dummy.nl"); 
     344 
    339345   /// Data 
    340346   ProblemInfo* ans = ( info ? info : new ProblemInfo ); 
     
    630636   /// 
    631637   AmplApplication_Core::ProblemInfo info; 
    632    /// 
    633     
    634638}; 
    635639 
     
    641645   register_initialize(cb_xml_nl, "NL"); 
    642646   register_response_xform_task(cb_map_response, ObjectType::get(this)); 
     647} 
     648 
     649 
     650void AmplApplication::keep_nl_file() 
     651{ 
     652data->info.keep_nl_file=true; 
    643653} 
    644654 
  • colin/trunk/src/AmplDriver.cpp

    r5786 r5819  
    3131 
    3232 
    33 //#include <utilib/MixedIntVars.h> 
    34 //#include <utilib/CharString.h> 
    35 //#include <utilib/ParameterList.h> 
    36 //#include <utilib/SparseMatrix.h> 
    37 ////#include <colin/OptSolverUtil.h> 
    38 //#include <colin/OptApplications.h> 
    39 ////#include <colin/ConcreteOptSolverHandle.h> 
    40 //#include <colin/RelaxableMixedIntDomainApplication.h> 
    41 //#include <colin/SolverMngr.h> 
    42 //#include <colin/OptSolver_Base.h> 
    43  
    44 //using namespace utilib; 
    45 //using namespace std; 
     33#include <colin/SolverMngr.h> 
     34#include <colin/OptSolver_Base.h> 
     35#include <colin/AmplApplication.h> 
    4636 
    4737#include <utilib/string_ops.h> 
    4838#include <utilib/BasicArray.h> 
    4939#include <utilib/CharString.h> 
    50  
    51 #include <colin/SolverMngr.h> 
    52 #include <colin/OptSolver_Base.h> 
    53 #include <colin/AmplApplication.h> 
    5440 
    5541using colin::SolverHandle; 
     
    195181   // 
    196182   ASL* ASL_ptr = ASL_alloc(ASL_read_fgh); 
     183   std::string fname; 
     184   fname=argv[1]; 
    197185   getstub(&argv, &ASL_options_info); 
    198186 
     
    255243   std::pair<ApplicationHandle, AmplApplication*> problem 
    256244      = ApplicationHandle::create<AmplApplication>(); 
    257    Any initial_point = problem.second->set_nl_file(argv[0]); 
     245   problem.second->keep_nl_file(); 
     246   Any initial_point = problem.second->set_nl_file(fname); 
    258247 
    259248   // 
  • colin/trunk/test/Makefile.am

    r5812 r5819  
    2929            -I$(TOPINC)/tinyxml -DMPICH_IGNORE_CXX_SEEK -DIGNORE_BROKEN 
    3030 
    31 check_PROGRAMS = colintest  
     31check_PROGRAMS=colintest  
    3232 
    3333colintest_SOURCES=colintest.cpp TestOptSolver.cpp 
    3434 
    3535all-local: 
    36         ${top_srcdir}/bin/cp_u colintest$(EXT) driver 
     36        @if test -e colintest$(EXE); then \ 
     37           ${top_srcdir}/bin/cp_u colintest$(EXT) driver; \ 
     38        fi 
     39 
  • colin/trunk/test/driver/test_simple.py

    r5816 r5819  
    1111SimpleDriver.add_test(cmd="./colintest --help", baseline="qa/exec2.qa", name="exec2") 
    1212SimpleDriver.add_test(cmd="./colintest --help-solvers", baseline="qa/exec3.qa", name="exec3") 
    13 SimpleDriver.add_test(cmd="ample colintest.mod", baseline="qa/exec4.qa", name="exec4") 
     13SimpleDriver.add_test(cmd="ampl colintest.mod", baseline="qa/exec4.qa", name="exec4") 
    1414 
    1515 
Note: See TracChangeset for help on using the changeset viewer.