Skip to content

Commit

Permalink
Merge pull request #43 from Argonne-National-Laboratory/merge-bb
Browse files Browse the repository at this point in the history
PR from merge-bb to master
  • Loading branch information
kibaekkim committed Jan 4, 2020
2 parents 627975c + 9b542b4 commit 0752153
Show file tree
Hide file tree
Showing 330 changed files with 401,704 additions and 6,905 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ Build
.idea
ma27-1.0.0.tar.gz
scipoptsuite-3.1.1.tgz
build_master
build/*
build_merge/*
19 changes: 12 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
[submodule "extra/CoinUtils"]
path = extra/CoinUtils
url = https://github.com/coin-or/CoinUtils.git
url=https://github.com/coin-or/CoinUtils.git
branch = stable/2.11
[submodule "extra/Osi"]
path = extra/Osi
url=https://github.com/kibaekkim/Osi.new.git
branch = stable/dsp
[submodule "extra/Smi"]
path = extra/Smi
url = https://github.com/kibaekkim/Smi.git
url=https://github.com/kibaekkim/Smi.git
[submodule "extra/OOQP"]
path = extra/OOQP
url = https://github.com/emgertz/OOQP.git
url=https://github.com/emgertz/OOQP.git
[submodule "extra/Alps"]
path = extra/Alps
url=https://github.com/kibaekkim/CHiPPS-ALPS.git
[submodule "extra/Clp"]
path = extra/Clp
url = https://github.com/coin-or/Clp.git
[submodule "extra/Osi"]
path = extra/Osi
url = https://github.com/coin-or/Osi.git
branch = master
branch = stable/1.17
97 changes: 39 additions & 58 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,75 +1,56 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.5)

# Should use GNU compilers for unix-type OS, including Mac and CygWin
if(UNIX)
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_Fortran_COMPILER "gfortran")
endif()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(color_scheme.cmake)
include(UserConfig.cmake)
set(DEPEND_DIR $ENV{PWD})

##################################################
# Project name
##################################################
project(DSP)
message(STATUS "The system information: ${CMAKE_SYSTEM}.${CMAKE_SYSTEM_PROCESSOR}")

##################################################
# REQUIRED PACKAGES
##################################################
enable_language(CXX)
enable_language(Fortran)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif(NOT CMAKE_BUILD_TYPE)
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
find_package(MPI)
find_package(OpenMP)

string(REPLACE ";" "\ " BLAS_LIBRARIES "${BLAS_LIBRARIES}")

##################################################
# My include files
##################################################
include(UserConfig.cmake)
include(color_scheme.cmake)

##################################################
# Compiler settings
##################################################

# if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# message(FATAL_ERROR "We currently do not support Clang compiler")
# elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# message(FATAL_ERROR "We currently do not support Intel compiler")
# elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# message(FATAL_ERROR "We currently do not support MSVC compiler")
# endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++0x -DNDEBUG")
if(MPI_CXX_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS} -DDSP_HAS_MPI")
endif()
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
if(APPLE)
set(CMAKE_MACOSX_RPATH OFF)
endif()

##################################################
# add include directories
##################################################
include_directories(
src
${SCIP_DIR}/src
${SCIP_DIR}/src/scip
${SPX_DIR}/src)
if (MPI_CXX_FOUND)
include_directories(${MPI_CXX_INCLUDE_PATH})
set(CMAKE_C_COMPILER "mpicc")
set(CMAKE_CXX_COMPILER "mpicxx")
set(CMAKE_Fortran_COMPILER "mpif90")
endif()

##################################################
# SUBDIRECTORY
##################################################
if(APPLE)
set(LIBRARY_PATH_VAR_NAME "DYLD_LIBRARY_PATH")
else(APPLE)
set(LIBRARY_PATH_VAR_NAME "LD_LIBRARY_PATH")
endif(APPLE)

find_library(GFORTRANLIB NAMES gfortran libgfortran PATHS ENV ${LIBRARY_PATH_VAR_NAME})
if(NOT GFORTRANLIB)
message(FATAL_ERROR "gfortran library is required, but cannot be found. Please either locate the library to a searchable path or set a proper environment variable for the path.")
endif(NOT GFORTRANLIB)

find_library(SCIPLIB scip PATHS ${SCIPOPT_LIB_DIR})
find_library(MA27LIB ma27 PATHS ${MA27LIB_DIR})
find_library(CPLEXLIB cplex PATHS ${CPLEX_LIB_DIR})

# if(APPLE)
# set(CMAKE_MACOSX_RPATH OFF)
# endif()

add_subdirectory(extra)
add_subdirectory(src)

enable_testing()
add_subdirectory(test)
10 changes: 7 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Please set `UserConfig.cmake` as follows.
* `MA27LIB_DIR` is optional to use OOQP (interior point solver). If you are not using CPLEX, it is recommended to use OOQP for better performance. You can request the library here: http://www.hsl.rl.ac.uk/download/MA27/1.0.0/a/
* It is required to set paths for either CPLEX or SCIP.
* `CPLEX_LIB_DIR` is the path to the directory that contains `libcplex.a`. `CPLEX_INC_DIR` is the path to the directory that contains `cplex.h`.
* If you use SCIP, you need to compile it as a shared library. `SCIP_DIR` is the path to the SCIP directory. `SCIP_LIB_DIR` is the path to the shared library (usually `${SCIP_DIR}/lib`). `SPX_DIR` is the path to the SOPLEX directory.
* If you use SCIP, you need to compile it as a shared library. `SCIPOPT_INC_DIR` is the path to the SCIP directory. `SCIPOPT_LIB_DIR` is the path to the shared library (usually `${SCIPOPT_INC_DIR}/lib`). `SPX_DIR` is the path to the SOPLEX directory.
* Once you are set the variables above, please set `USER_SETTINGS` to `ON`.

If you have all the prerequisite packages installed on your system, then you need to go to the root directory of DSP and type
Expand All @@ -14,11 +14,15 @@ mkdir build
cd build
cmake ..
```
to configure OOQP. If you wish to install the package in a more permanent location, you may then type
to configure OOQP. Then,
```bash
make
```
If you wish to install the package in a more permanent location, you may then type
```bash
make install
```
External packages (MA27, OOQP, SCIP Optimization Suite, Smi) used in DSP are built automatically.
External packages (MA27, OOQP, Smi) used in DSP are built automatically.

## Binary file

Expand Down
15 changes: 14 additions & 1 deletion PREREQUISITES.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,23 @@ sudo ./get.essentials.archlinux
* **bzip2 library** -- This is available in http://www.bzip.org/downloads.html.
* **zlib library** -- This is available in http://www.zlib.net.

## External software packages

The following packages are also *required* to build and run DSP and need to be located on ./extra directory before DSP may be built. *DSP will automatically configure and build the external packages once they are located in the right place.*

* **MA27** (./extra/ma27-1.0.0) -- MA27 is a library for solving sparse symmetric indefinite linear systems. To build OOQP solver, you must have this installed. This is part of HSL (formerly the Harwell Subroutine Library), a collection of ISO Fortran codes for large scale scientific computation.
1. Download: http://www.hsl.rl.ac.uk/download/MA27/1.0.0/a/
2. Unpack the downloaded file.
3. Move and rename the downloaded directory to ./extras/ma27-1.0.0/

* **SCIP Optimization Suite** (./extra/scipoptsuite-3.1.1) -- SCIP contains non-commercial solvers for mixed integer programming (MIP) and mixed-integer nonlinear programming (MINLP).
1. Download: http://scip.zib.de/download.php?fname=scipoptsuite-3.1.1.tgz
2. Unpack the downloaded file.
3. Move and rename the downloaded directory to ./extras/scipoptsuite-3.1.1

## MPI Library ##

MPI library is optional to build and run DSP, but required to run DSP in parallel. To run in parallel, you need to install one of the following libraries.

* **MPICH** -- This is available from http://www.mpich.org.
* **OpenMPI** -- This is available from https://www.open-mpi.org.

83 changes: 21 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,48 @@
# DSP

[![DOI](https://zenodo.org/badge/26612881.svg)](https://zenodo.org/badge/latestdoi/26612881)
[![Documentation Status](https://readthedocs.org/projects/dsp/badge/?version=master)](https://dsp.readthedocs.io/?badge=master)

DSP is an open-source and parallel package that implements decomposition methods for **stochastic mixed-integer programming (SMIP)** problems. These are structured optimization problems considering uncertain scenario realizations s with probabilities p_s in the following form:
DSP is an open-source and parallel package that implements decomposition methods for **structured mixed-integer programming** problems. These are structured optimization problems in the following form:

minimize c^T x + \sum_{s=1}^S p_s q_s^T y_s
minimize c^T x + \sum_{s=1}^S q_s^T y_s
subject to A x = b
T_s x + W_s y_s = h_s for s = 1, .., S
some x, y_s are integers

where x and y_s are decision variable vectors with dimensions n_1 and n_2, respectively, A, T_s and W_s are matrices of dimensions m_1 by n_1, m_2 by n_1 and m_2 by n_2, respectively, and c, q_s, b, and h_s are vectors of appropriate dimensions.

DSP provides **parallel** implementations for the following decomposition methods:
* Dual decomposition (with subgradient method and several bundle methods)
* Benders decomposition

The methods can be run on computing clusters and multi-core processors.

## Download

You can clone this repository in your preferred directory by typing:
```bash
git clone --recursive https://github.com/Argonne-National-Laboratory/DSP.git
```
or
```bash
git clone https://github.com/Argonne-National-Laboratory/DSP.git
cd DSP
git submodule update --init --recursive
```

## Installation

* See [PREREQUISITES.md](PREREQUISITES.md)
* See [INSTALL.md](INSTALL.md)

## Interfaces

### Stand-alone binary
**DSP Solution Methods:**
* Extensive form solver (global solver)
* Serial/parallel dual decomposition (dual bounding solver)
* Serial/parallel Dantzig-Wolfe decomposition (global solver)
* Serial/parallel Benders decomposition

DSP will be compiled as a binary file ``runDsp`` that can read ``SMPS`` files and solve the problems.
**Problem Input Formats:**
* SMPS file format for stochastic programs
* MPS and DEC files for generic block-structured optimization problems
* Julia modeling package [Dsp.jl](https://github.com/kibaekkim/Dsp.jl)

### Julia Interface

DSP can use Julia as a modeling interface for the computational experiments. Julia is a high level dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments such as MATLAB and Python. Julia can be downloaded from http://julialang.org/downloads/ If Julia is successfully installed on your machine, then you can start the Julia command-line tool by typing
```bash
julia
```
Now we need to install four Julia packages required to run DSP in the Julia environment. The packages should be installed in the Julia command-line tool. Please update the package list of Julia by typing
```julia
Pkg.update();
```
* [JuMP.jl](https://github.com/JuliaOpt/JuMP.jl) is a algebraic modeling package in Julia for mathematical programming, which can be installed by the following Julia command:
```julia
Pkg.add("JuMP");
```
* The [Dsp.jl](https://github.com/kibaekkim/Dsp.jl) package provides an interface to ``JuMP.jl``. DSPsolver.jl can be installed by the Julia command
```julia
Pkg.clone("https://github.com/kibaekkim/Dsp.jl.git");
```
* [MPI.jl](https://github.com/JuliaParallel/MPI.jl) is an **optional** package to run DSP in parallel on high-performance computing machines using MPI library. This is an MPI interface package, which can be installed by the following Julia command. MPICH is required for this package.
```julia
Pkg.add("MPI");
```

## Example

You can find examples in subdirectory examples.
## Documentation

The package documentation is available in [Readthedocs](https://dsp.readthedocs.io/?badge=master).

## Credits

DSP has been developed and is maintained by:
* [Kibaek Kim](http://mcs.anl.gov/~kibaekkim/), Mathematics and Computer Science Division, Argonne National Laboratory.
* [Victor M. Zavala](http://zavalab.engr.wisc.edu/), Department of Chemical and Biological Engineering, University of Wisconsin-Madison.

## Publications
* Kibaek Kim and Victor M. Zavala. "[Algorithmic innovations and software for the dual decomposition method applied to stochastic mixed-integer programs](http://www.optimization-online.org/DB_FILE/2015/06/4960.pdf)" Mathematical Programming Computation (accepted), 2017
* Kibaek Kim and Victor M. Zavala. "[Large-Scale Stochastic Mixed-Integer Programming Algorithms for Power Generation Scheduling](http://dx.doi.org/10.1007/978-3-319-28752-2_18)" Alternative Energy Sources and Technologies, 2016
* Kibaek Kim, Fan Yang, Victor M. Zavala, and Andrew A. Chien. "[Data Centers as Dispatchable Loads to Harness Stranded Power](http://dx.doi.org/10.1109/TSTE.2016.2593607)" IEEE Transactions on Sustainable Energy, 2016

## Key Publications

* Kibaek Kim and Briand Dandurand. "[Scalable Branching on Dual Decomposition of Stochastic Mixed-Integer Programming Problems](http://www.optimization-online.org/DB_HTML/2018/10/6867.html)" Optimization Online, 2018
* Kibaek Kim, Cosmin Petra, and Victor Zavala. "[An Asynchronous Bundle-Trust-Region Method for Dual Decomposition of Stochastic Mixed-Integer Programming](https://epubs.siam.org/doi/abs/10.1137/17M1148189)" SIAM Journal on Optimization 29(1), 2019
* Kibaek Kim and Victor M. Zavala. "[Algorithmic innovations and software for the dual decomposition method applied to stochastic mixed-integer programs](https://link.springer.com/article/10.1007/s12532-017-0128-z)" Mathematical Programming Computation 10(2), 2017


## Acknowledgements

This material is based upon work supported by the U.S. Department of Energy, Office of Science, under contract number DE-AC02-06CH11357. We gratefully acknowledge the computing resources provided on *Blues*, a high-performance computing cluster operated by the Laboratory Computing Resource Center at Argonne National Laboratory. We thank E. Michael Gertz and Stephen Wright for providing the [OOQP](http://pages.cs.wisc.edu/~swright/ooqp/) software package.


[![Analytics](https://ga-beacon.appspot.com/UA-64449559-2/DSP/README.md)](https://github.com/igrigorik/ga-beacon)

4 changes: 3 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ April 10, 2018
April 2, 2018
-------------

* Fixed the linking issue with CPLEX 12.8
* Fixed the early termination issue (before finding a feasible primal master solution)
* Fixed the compile issue with CPLEX 12.8
* Implemented a stand-alone binary file that can read SMPS, MPS+DEC files

February 22, 2018
-----------------
Expand Down
16 changes: 5 additions & 11 deletions UserConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
# This file defines the user-specific settings.

# Setting CPLEX paths is required.
# The others (ma27 and scip) are optional. For example, OOQP will be
# disabled if MA27LIB_DIR is not set.

set(MA27LIB_DIR "")
set(CPLEX_LIB_DIR "")
set(CPLEX_INC_DIR "")
set(SCIP_DIR "")
set(SCIP_LIB_DIR "")
set(SPX_DIR "")
set(MA27LIB_DIR "")
set(CPLEX_LIB_DIR "")
set(CPLEX_INC_DIR "")
set(SCIPOPT_INC_DIR "")
set(SCIPOPT_LIB_DIR "")

# Please change OFF to ON once the settings are provided.
set(USER_SETTINGS OFF)

if(NOT ${USER_SETTINGS})
message(FATAL_ERROR "Please complete the user-specific settings in UserConfig.cmake")
endif()
set(DEPEND_DIR $ENV{PWD})
9 changes: 0 additions & 9 deletions config_path.cmake

This file was deleted.

23 changes: 23 additions & 0 deletions docs/acknowledgement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Acknowledgements
----------------

This material is based upon work supported by the U.S. Department of Energy, Office of Science, under contract number DE-AC02-06CH11357.
We thank E. Michael Gertz and Stephen Wright for providing the `OOQP <http://pages.cs.wisc.edu/~swright/ooqp/>`_ software package.

Credits
^^^^^^^

DSP has been developed and is maintained by:

* `Kibaek Kim <http://mcs.anl.gov/~kibaekkim/>`_, Mathematics and Computer Science Division, Argonne National Laboratory.
* `Victor M. Zavala <http://zavalab.engr.wisc.edu/>`_, Department of Chemical and Biological Engineering, University of Wisconsin-Madison.

Publication
^^^^^^^^^^^

* Kibaek Kim and Brian Dandurand. Scalable Branching on Dual Decomposition of Stochastic Mixed-Integer Programming Problems. Optimization Online, 2018
* Kibaek Kim, Audun Botterud, and Feng Qiu. Temporal Decomposition for Improved Unit Commitment in Power System Production Cost Modeling. IEEE Transactions on Power Systems 33(5), 5276-5287, 2018
* Kibaek Kim and Victor M. Zavala. Algorithmic innovations and software for the dual decomposition method applied to stochastic mixed-integer programs. Mathematical Programming Computation 10(2), 225-266, 2018
* Kibaek Kim, Fan Yang, Victor M. Zavala, and Andrew A. Chien. Data Centers as Dispatchable Loads to Harness Stranded Power. IEEE Transactions on Sustainable Energy 8(1), 208-218, 2017
* Kibaek Kim and Victor M. Zavala. Large-Scale Stochastic Mixed-Integer Programming Algorithms for Power Generation Scheduling. In Alternative Energy Sources and Technologies, 493-512, 2016

0 comments on commit 0752153

Please sign in to comment.