Skip to content

Commit

Permalink
Merge pull request #164 from Argonne-National-Laboratory/dro
Browse files Browse the repository at this point in the history
Parallelizing the dual decomposition of DRO
  • Loading branch information
kibaekkim authored Dec 1, 2020
2 parents ba1d50d + f507f4c commit 941b165
Show file tree
Hide file tree
Showing 21 changed files with 920 additions and 328 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build test

on: [push, pull_request]

jobs:
test-github-cpuonly:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-18.04]
compiler: [gcc, clang]
fail-fast: false

steps:
- name: Install extra libraries
run: |
if [ ${{ matrix.os }} == ubuntu-18.04 ] && [ ${{ matrix.compiler }} == gcc ]
then
sudo apt-get update -y
sudo apt-get install -y lcov
fi
- name: Set my secrets
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Checkout DSP
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout DSPThirdPartyLibs
run: |
mkdir -p ~/.ssh
ssh-keyscan xgitlab.cels.anl.gov >> ~/.ssh/known_hosts
git clone [email protected]:kimk/DSPThirdPartyLibs.git
- name: Run cmake, build, and test
env:
MYOS: ${{ matrix.os }}
CC: ${{ matrix.compiler }}
FC: gfortran-9
run: |
cd DSPThirdPartyLibs
./github.sh
if [ ${{ matrix.os }} == ubuntu-18.04 ]
then
export LD_LIBRARY_PATH=$PWD/lib:$(dirname `$FC --print-file-name libgfortran.so`):$LD_LIBRARY_PATH
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
fi
if [ ${{ matrix.os }} == macos-latest ]
then
export DYLD_LIBRARY_PATH=$PWD/lib:$(dirname `$FC --print-file-name libgfortran.dylib`):$DYLD_LIBRARY_PATH
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
fi
cd ..
mkdir build
cd build
if [ ${{ matrix.compiler }} == gcc ]; then export CXX=g++; fi
if [ ${{ matrix.compiler }} == clang ]; then export CXX=clang++; fi
cmake .. -DUNIT_TESTING=ON -DCODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=DEBUG
make -j
make install
- name: Run test
run: |
if [ ${{ matrix.os }} == ubuntu-18.04 ]; then export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }}; fi
if [ ${{ matrix.os }} == macos-latest ]; then export DYLD_LIBRARY_PATH=${{ env.DYLD_LIBRARY_PATH }}; fi
cd build
./src/test/UnitTests
ctest
if [ ${{ matrix.os }} == ubuntu-18.04 ] && [ ${{ matrix.compiler }} == gcc ]
then
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
fi
- uses: codecov/codecov-action@v1
with:
file: ./build/coverage.info
88 changes: 0 additions & 88 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Release: ![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/Argon

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

Status: [![Build Status](https://travis-ci.org/Argonne-National-Laboratory/DSP.svg?branch=master)](https://travis-ci.org/Argonne-National-Laboratory/DSP)
Status: ![Build Status](https://github.com/Argonne-National-Laboratory/DSP/workflows/Build%20test/badge.svg)
[![codecov](https://codecov.io/gh/Argonne-National-Laboratory/DSP/branch/master/graph/badge.svg)](https://codecov.io/gh/Argonne-National-Laboratory/DSP)

--------
Expand Down
Binary file removed deploy_rsa.enc
Binary file not shown.
2 changes: 0 additions & 2 deletions llvm-gcov.sh

This file was deleted.

2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ set(DSP_SRC
Solver/DualDecomp/DdWorkerCG.cpp
Solver/DualDecomp/DdWorkerLB.cpp
Solver/DualDecomp/DdWorkerUB.cpp
Solver/DualDecomp/DdDroWorkerUB.cpp
Solver/DantzigWolfe/DwBranchInt.cpp
Solver/DantzigWolfe/DwBranchNonant.cpp
Solver/DantzigWolfe/DwBranchNonant2.cpp
Expand Down Expand Up @@ -160,6 +161,7 @@ if (MPI_CXX_FOUND)
Solver/DualDecomp/DdMWAsyncDyn.cpp
Solver/DualDecomp/DdMWPara.cpp
Solver/DualDecomp/DdMWSync.cpp
Solver/DualDecomp/DdDroWorkerUBMpi.cpp
Utility/DspMpi.cpp
)
if(SCIPLIB)
Expand Down
6 changes: 3 additions & 3 deletions src/DspConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
* So it is based on symantic versioning.
*/
#define DSP_VERSION_MAJOR 1
#define DSP_VERSION_MINOR 3
#define DSP_VERSION_MINOR 4
#define DSP_VERSION_PATCH 0

#include <stdio.h>

inline void show_copyright()
{
char msg[1024];
sprintf(msg, "\n=================================================================================\n\n"
sprintf(msg, "\n=================================================================================\n"
" DSP: Parallel decomposition methods for structured programming\n"
" - Version %d.%d.%d\n"
" - See https://github.com/Argonne-National-Laboratory/DSP\n\n"
" Under the terms of Contract No. DE-AC02-06CH11357 with UChicago Argonne, LLC,\n"
" the U.S. Government retains certain rights in this software.\n\n"
"=================================================================================\n\n",
"=================================================================================\n",
DSP_VERSION_MAJOR, DSP_VERSION_MINOR, DSP_VERSION_PATCH);
printf("%s", msg);
}
Expand Down
3 changes: 1 addition & 2 deletions src/Model/StoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ DSP_RTN_CODE StoModel::setWassersteinAmbiguitySet(double lp_norm, double eps)
* TODO: Can we do in parallel?
* The relevant issues need addressed first:
* - https://github.com/kibaekkim/DSPopt.jl/issues/14
* - https://github.com/Argonne-National-Laboratory/DSP/issues/50
*/
for (int ss = 0; ss < nscen_; ++ss)
{
Expand Down Expand Up @@ -542,7 +541,7 @@ DSP_RTN_CODE StoModel::setWassersteinAmbiguitySet(double lp_norm, double eps)
*/

printf("[DRO] Set %d reference scenarios.\n", nrefs_);
printf("[DRO] Computed the Wasserstein distances with %f-norm.\n", lp_norm);
printf("[DRO] Computed the Wasserstein distances of order %f.\n", lp_norm);

return DSP_RTN_OK;
}
Expand Down
Loading

0 comments on commit 941b165

Please sign in to comment.