source: coopr.pysp/stable/2.3/scripts/runph @ 2317

Last change on this file since 2317 was 2317, checked in by wehart, 10 years ago

Merged revisions 2246-2316 via svnmerge from
https://software.sandia.gov/svn/public/coopr/coopr.pysp/trunk

........

r2246 | wehart | 2010-02-01 21:10:48 -0700 (Mon, 01 Feb 2010) | 2 lines


Tagging coopr.pysp release 2.2

........

r2247 | wehart | 2010-02-01 21:46:08 -0700 (Mon, 01 Feb 2010) | 2 lines


Documentation fix.

........

r2248 | jwatson | 2010-02-03 08:44:59 -0700 (Wed, 03 Feb 2010) | 3 lines


Adding os.path.expanduser wrappers around all directory/filenames, to facilitate correct processing of ~ characters.

........

r2249 | jwatson | 2010-02-03 09:28:25 -0700 (Wed, 03 Feb 2010) | 3 lines


Misc fixes.

........

r2254 | jwatson | 2010-02-03 21:09:38 -0700 (Wed, 03 Feb 2010) | 3 lines


Changed PyomoModelData? call from add_data_mumble() to add().

........

r2255 | jwatson | 2010-02-03 21:38:35 -0700 (Wed, 03 Feb 2010) | 3 lines


Re-factoring of PH options parser code to accomodate MRP work being done by DLW.

........

r2256 | jwatson | 2010-02-03 22:18:11 -0700 (Wed, 03 Feb 2010) | 3 lines


Major speed improvements in the EF writer by avoiding Python deep-copes - saves a few orders of magnitude of run-time.

........

r2260 | jwatson | 2010-02-04 21:44:29 -0700 (Thu, 04 Feb 2010) | 3 lines


Refactoring of ph initialization routines to support sampling and bundling.

........

r2261 | jwatson | 2010-02-04 21:46:37 -0700 (Thu, 04 Feb 2010) | 3 lines


Renaming ph_script module to phinit, which is more accurate with the newly factored, library-like functionality.

........

r2262 | jwatson | 2010-02-04 21:54:50 -0700 (Thu, 04 Feb 2010) | 3 lines


Minor improvement to phinit functionality.

........

r2267 | jwatson | 2010-02-05 15:09:02 -0700 (Fri, 05 Feb 2010) | 3 lines


Initial PySP unit tests!!!

........

r2268 | wehart | 2010-02-05 15:25:52 -0700 (Fri, 05 Feb 2010) | 2 lines


A fix to the tests.

........

r2269 | jwatson | 2010-02-05 15:46:35 -0700 (Fri, 05 Feb 2010) | 3 lines


Added SIZES3 PySP test and added absolute paths to "runph" script.

........

r2270 | jwatson | 2010-02-05 16:01:08 -0700 (Fri, 05 Feb 2010) | 3 lines


PySP tests need absolute output paths!

........

r2271 | jwatson | 2010-02-05 16:20:01 -0700 (Fri, 05 Feb 2010) | 3 lines


Making unit tests for PySP compatible with coverage utilities. Farmer examples work, SIZES3 doesn't for some reason.

........

r2272 | jwatson | 2010-02-05 16:59:46 -0700 (Fri, 05 Feb 2010) | 3 lines


Various fixes to PySP unit tests. Changing name of testphextension to examplephextension - with the test prefix, coverage tests import the module, which causes all kinds of issues.

........

r2275 | jwatson | 2010-02-06 13:45:11 -0700 (Sat, 06 Feb 2010) | 3 lines


Testing improvements. From lpython, the tests run individually just fine. In aggregate, only the first run passes - independent of what test that might be! Something to stare at later....

........

r2277 | jwatson | 2010-02-06 23:30:13 -0700 (Sat, 06 Feb 2010) | 3 lines


Fixed problem with runph --profile option, broken by my recent factoring of phinit.py.

........

r2288 | jwatson | 2010-02-08 13:32:41 -0700 (Mon, 08 Feb 2010) | 3 lines


Significant initialization speed reductions in the WW PH extension for PySP.

........

r2290 | jwatson | 2010-02-08 19:22:32 -0700 (Mon, 08 Feb 2010) | 1 line


Initial commit of multi-stage capacity expansion problem in PySP

........

r2291 | jwatson | 2010-02-08 19:23:24 -0700 (Mon, 08 Feb 2010) | 1 line


Miscellaneous fix to ef writer involving indexed cost variables

........

r2296 | jwatson | 2010-02-09 18:56:48 -0700 (Tue, 09 Feb 2010) | 3 lines


Removing monster-sized LP file from the PySP forestry examples directory.

........

r2297 | jwatson | 2010-02-09 18:59:05 -0700 (Tue, 09 Feb 2010) | 3 lines


The extensive forms in the PySP forestry example were massive - and are now gone.

........

r2298 | jwatson | 2010-02-09 19:03:09 -0700 (Tue, 09 Feb 2010) | 1 line


Removing output logs for PySP network flow example

........

r2299 | jwatson | 2010-02-09 19:04:12 -0700 (Tue, 09 Feb 2010) | 1 line


Removing a big network flow EF

........

r2300 | jwatson | 2010-02-09 19:05:08 -0700 (Tue, 09 Feb 2010) | 3 lines


Removing PySP cap example EF to free up space.

........

r2301 | jwatson | 2010-02-09 19:14:26 -0700 (Tue, 09 Feb 2010) | 1 line


Performance improvements to PH obtained by processing scenario sub-problem results as they come in, instead of waiting for them after a solver barrier sync

........

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#! /usr/bin/env python
2#
3# A script that controls execution of PH on a problem instance, optionally solving the extensive form upon termination.
4#  _________________________________________________________________________
5#
6#  Coopr: A COmmon Optimization Python Repository
7#  Copyright (c) 2009 Sandia Corporation.
8#  This software is distributed under the BSD License.
9#  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
10#  the U.S. Government retains certain rights in this software.
11#  For more information, see the FAST README.txt file.
12#  _________________________________________________________________________
13
14import traceback
15import sys
16if sys.version_info[0:2] < (2,4):
17   print ""
18   print "ERROR: Pyomo requires Python 2.4 or newer"
19   sys.exit(1)
20from os.path import abspath, dirname
21import os
22import pyutilib.common 
23sys.path.insert(0, dirname(dirname(abspath(__file__))))
24sys.path.append(".")
25currdir = dirname(abspath(__file__))
26coopr_path = dirname(currdir)
27pyutilib_path = dirname(coopr_path)+os.sep+"pyutilib"
28sys.path.append(coopr_path)
29sys.path.append(pyutilib_path)
30sys.path.append(abspath(os.getcwd()))
31
32#
33# Adjust the user path if it looks like this script is being used
34# from an Acro build (adds the Acro bin directory, if it exists).
35#
36# Recurse up the current path, looking for a subdirectory that
37# contains 'python' and 'bin'
38#
39curr = os.path.abspath(os.getcwd())
40while os.sep in curr:
41    if os.path.exists(curr+os.sep+"python") and os.path.exists(curr+os.sep+"bin"):
42        os.environ["PATH"] = curr+os.sep+"bin:"+os.environ["PATH"]
43        break
44    if os.path.basename(curr) == "":
45        break
46    curr = os.path.dirname(curr)
47
48import coopr.pysp.phinit
49
50try:
51    coopr.pysp.phinit.run()
52except ValueError, str:
53    print "VALUE ERROR:"
54    print str
55except IOError, str:
56    print "IO ERROR:"
57    print str
58except pyutilib.common.ApplicationError, str:
59    print "APPLICATION ERROR:"
60    print str
61except RuntimeError, str:
62    print "RUN-TIME ERROR:"   
63    print str       
64except:
65   print "Encountered unhandled exception"
66   traceback.print_exc()
Note: See TracBrowser for help on using the repository browser.