Ignore:
Timestamp:
Jan 28, 2010 5:53:15 PM (10 years ago)
Author:
wehart
Message:

Merged revisions 2112-2195 via svnmerge from
https://software.sandia.gov/svn/public/coopr/coopr.opt/trunk

........

r2137 | wehart | 2010-01-10 12:17:40 -0700 (Sun, 10 Jan 2010) | 2 lines


Misc documentation updates.

........

r2155 | wehart | 2010-01-12 15:25:13 -0700 (Tue, 12 Jan 2010) | 2 lines


Adding a utility routine: results_attributes.

........

r2167 | jwatson | 2010-01-24 14:06:15 -0700 (Sun, 24 Jan 2010) | 3 lines


Added a _report_timing attribute to the base solver class. If true, it will print out presolve/solve/postsolve timing statistics. The derived shell-based solver will additionally report log and solution file read times.

........

r2173 | wehart | 2010-01-27 10:23:31 -0700 (Wed, 27 Jan 2010) | 2 lines


Misc edits.

........

r2174 | wehart | 2010-01-27 10:31:26 -0700 (Wed, 27 Jan 2010) | 2 lines


Adding a hook for specifying the format for reading/writing IO formats.

........

r2182 | wehart | 2010-01-27 15:39:31 -0700 (Wed, 27 Jan 2010) | 2 lines


Removing colin stuff from coopr.opt.

........

r2186 | wehart | 2010-01-27 17:39:31 -0700 (Wed, 27 Jan 2010) | 2 lines


Renaming results_attributes to results_schema.

........

Location:
coopr.opt/stable/2.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coopr.opt/stable/2.2

  • coopr.opt/stable/2.2/coopr/opt/base/solver.py

    r2033 r2196  
    2424import pyutilib.common
    2525import pyutilib.misc
     26
     27import time
    2628
    2729
     
    126128        self.problem=None
    127129        self._assert_available=False
     130        self._report_timing = False # timing statistics are always collected, but optionally reported.
    128131
    129132        # a fairly universal solver feature, at least when dealing
     
    151154    def solve(self, *args, **kwds):
    152155        """ Solve the problem """
     156        initial_time = time.time()
    153157        self._presolve(*args, **kwds)
     158        presolve_completion_time = time.time()
    154159        self._apply_solver()
     160        solve_completion_time = time.time()
    155161        result = self._postsolve()
     162        postsolve_completion_time = time.time()
    156163        result.symbol_map = self._symbol_map
     164        if self._report_timing is True:
     165           print "Presolve time="+str(presolve_completion_time-initial_time)
     166           print "Solve time="+str(solve_completion_time - presolve_completion_time)
     167           print "Postsolve time="+str(postsolve_completion_time-solve_completion_time)
    157168        return result
    158169
Note: See TracChangeset for help on using the changeset viewer.