Changeset 2169


Ignore:
Timestamp:
Jan 24, 2010 4:17:41 PM (10 years ago)
Author:
jwatson
Message:

Propagating PH output-times option to solver report_timing attribute.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/ph.py

    r2164 r2169  
    744744            print "Initializing scenario sub-problem solver with options="+str(scenario_solver_options)
    745745         self._solver.set_options("".join(scenario_solver_options))
     746      if self._output_times is True:
     747         self._solver._report_timing = True
    746748
    747749      # construct the solver manager.
     
    10521054            results.write(num=1)           
    10531055
     1056         start_time = time.time()
    10541057         instance.load(results)
     1058         end_time = time.time()
     1059         if self._output_times is True:
     1060            print "Time loading results="+str(end_time-start_time)+" seconds"
    10551061
    10561062         if self._verbose is True:                 
     
    14061412
    14071413        if len(results.solution) == 0:
     1414           results.write()
    14081415           raise RuntimeError, "Solve failed for scenario="+scenario_name+"; no solutions generated"
    14091416
     
    14121419           results.write(num=1)           
    14131420
     1421        start_time = time.time()
    14141422        instance.load(results)
     1423        end_time = time.time()
     1424
     1425        if self._output_times is True:
     1426           print "Time loading results="+str(end_time-start_time)+" seconds"       
    14151427
    14161428        if self._verbose is True:                 
Note: See TracChangeset for help on using the changeset viewer.