Changeset 2196


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:
3 deleted
7 edited
2 copied

Legend:

Unmodified
Added
Removed
  • coopr.opt/stable/2.2

  • coopr.opt/stable/2.2/coopr/opt/__init__.py

    r1900 r2196  
    1515from base import *
    1616from results import *
    17 from colin import *
    1817import solver
    1918import reader
  • 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
  • coopr.opt/stable/2.2/coopr/opt/solver/shellcmd.py

    r1987 r2196  
    2323import pyutilib.plugin.core
    2424import pyutilib.misc
     25
     26import time
    2527
    2628class SystemCallSolver(OptSolver):
     
    175177        Process the output files.
    176178        """
     179        start_time = time.time()
    177180        if self._results_format is None:
    178181           raise ValueError, "Results format is None"
    179182        results = self.process_logfile()
     183        log_file_completion_time = time.time()
     184        if self._report_timing is True:
     185           print "Log file read time="+str(log_file_completion_time - start_time)+" seconds"
    180186        if self.results_reader is None:
    181187           self.process_soln_file(results)
     188           soln_file_completion_time = time.time()
     189           if self._report_timing is True:           
     190              print "Solution file read time="+str(soln_file_completion_time - log_file_completion_time)+" seconds"           
    182191        else:
    183192           results = self.results_reader(self.results_file, res=results)
     193           results_reader_completion_time = time.time()
     194           print "Results reader time="+str(results_reader_completion_time - log_file_completion_time)+" seconds"                     
    184195        if rc != None:
    185196           results.solver.error_rc=rc
  • coopr.opt/stable/2.2/doc/opt/plugins-pca.tex

    r1828 r2196  
    1111Trac~\cite{Trac}, yapsy~\cite{yapsy} and SprinklesPy~\cite{SprinklesPy}.
    1212Although we discuss the design requirements for PCA later, PCA was
    13 initially motivated by the desire to use Trac's plugin framework within
    14 a self-contained packages.  The core of PCA is provided by PyUtilib's
     13initially motivated by the need to have a Trac-like plugin framework that was
     14self-contained.  The core of PCA is provided by PyUtilib's
    1515\code{pyutilib.plugin.core} module.
    1616
     
    2626A software application can declare \textit{extension points} that other
    2727components can \textit{plug in} to. This mechanisms supports a flexible,
    28 modular programming paradigm that enables software applications can
     28modular programming paradigm that enables software applications to
    2929be extended in a dynamic manner. Extension points and the extensions
    3030contributed to them are stored in a global registry, and execution of
     
    3434needing to know the details of how they are employed.
    3535
    36 Extension points are defined with respect to an \textit{interface} class
    37 that implicitly defines the registration type that is used for a
    38 plugin. Further, a plugin class includes a declaration that it implements
     36Extension points are defined with respect to an \textit{interface} class,
     37which defines the type that plugins use to register their capabilies.
     38A plugin class includes declarations that denote that it implements
    3939one-or-more interfaces. An interface is defined by the methods and data
    4040that are used. However, the PCA does not enforce
     
    7474API conformance for plugins, and hence any declaration in the \code{MyInterface}
    7575class would be ignored. Additionally, note that an instance of \code{MyInterface}
    76 is not created; declaring the plugin interface simply requires the
    77 specification of a subclass of \code{Interface}.
     76is not created; the \code{MyInterface} class is simply used to declare a type that is used to index related plugins.
    7877
    7978An instance of \code{ExtensionPoint} can be used to iterate through
     
    102101
    103102#
    104 # This loop iterates over all servicess, including the 'disabled'
     103# This loop iterates over all services, including the 'disabled'
    105104# services.
    106105#
  • coopr.opt/stable/2.2/doc/opt/plugins.tex

    r1808 r2196  
    4848\definecolor{light-gray}{gray}{0.9}
    4949\lstset{backgroundcolor=\color{light-gray}}
    50 \lstset{aboveskip=1em,belowskip=1em}
     50\lstset{aboveskip=1em,belowskip=1em,showspaces=false,showstringspaces=false}
    5151
    5252\tableofcontents
  • coopr.opt/stable/2.2/examples/opt/README.txt

    r1078 r2196  
    1 Examples for coopr.opt:
    2 
    3  - colin: Illustrations of the use of coopr.opt's optimizers and COLIN
    4         XML interface.
     1This directory will contain examples that illustrate the use of coopr.opt
     2optimizers.
Note: See TracChangeset for help on using the changeset viewer.