Skip to content

Commit

Permalink
Merge develop into master
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
pratikvn authored Mar 20, 2020
2 parents a347632 + ac94b4a commit 8baee6a
Show file tree
Hide file tree
Showing 63 changed files with 3,980 additions and 886 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build-doc

on: [push]

jobs:
build:

name: Doxygen build
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: install-doxygen
run: |
sudo apt-get update
sudo apt-get -y install mpich texlive texlive-generic-recommended texlive-latex-extra doxygen graphviz ghostscript
- name: info
run: |
doxygen -v
cmake --version
- name: install-ginkgo
run: |
pushd .
cd ${HOME}
mkdir install
git clone https://github.com/ginkgo-project/ginkgo.git
cd ginkgo
git checkout expt-develop
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/install -DGINKGO_BUILD_BENCHMARKS=off -DGINKGO_BUILD_EXAMPLES=off -DGINKGO_BUILD_TESTS=off -DGINKGO_BUILD_OMP=off -DGINKGO_BUILD_REFERENCE=off -DGINKGO_BUILD_CUDA=off ..
make -j10
make install
export Ginkgo_DIR=${HOME}/install
echo $Ginkgo_DIR
popd
- name: build-doc
run: |
mkdir -p build-doc && pushd build-doc
export CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
cmake -DCMAKE_PREFIX_PATH=${HOME}/install -DSCHWARZ_BUILD_CHOLMOD=off -DSCHWARZ_BUILD_METIS=off -DSCHWARZ_WITH_HWLOC=off -DSCHWARZ_BUILD_CUDA=off -DSCHWARZ_BUILD_BENCHMARKING=off -DSCHWARZ_DEVEL_TOOLS=off -DSCHWARZ_BUILD_DOC=on -DSCHWARZ_DOC_GENERATE_PDF=on ..
make usr
make pdf
popd
# publish it
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
mkdir action-docs && cd action-docs
git init
git remote add github "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git"
git pull github gh-pages --ff-only
git checkout gh-pages
rm -rf doc/${CURRENT_BRANCH}
mkdir -p doc
mkdir -p doc/pdf
cp -r ../build-doc/doc/usr doc/${CURRENT_BRANCH}
cp ../build-doc/doc/pdf.pdf doc/pdf/${CURRENT_BRANCH}.pdf
export CURRENT_SHA="$(git rev-parse --short HEAD)"
echo $CURRENT_SHA
git add -A
git commit -m "Update documentation from ${CURRENT_SHA}"
git status
git branch --set-upstream-to=github/gh-pages gh-pages
- uses: pratikvn/github-push-action@master
with:
directory: action-docs
branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected]
with:
name: pdf-doc
path: build-doc/doc/pdf.pdf
104 changes: 104 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Build-status

on: [push]

jobs:
build:

name: No CUDA build
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: install-mpi
run: |
sudo apt-get update
sudo apt-get -y install mpich
- name: info
run: |
g++ -v
export MPI_DIR=$(which mpicxx)
echo $MPI_DIR
mpiexec --version
cmake --version
- name: install-ginkgo
run: |
pushd .
cd ${HOME}
mkdir install
git clone https://github.com/ginkgo-project/ginkgo.git
cd ginkgo
git checkout expt-develop
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/install -DGINKGO_BUILD_BENCHMARKS=off -DGINKGO_BUILD_EXAMPLES=off -DGINKGO_BUILD_TESTS=off ..
make -j10
make install
export Ginkgo_DIR=${HOME}/install
echo $Ginkgo_DIR
popd
- name: configure-run-schwarz-lib
run: |
mkdir build
cd build/
cmake -DCMAKE_PREFIX_PATH=${HOME}/install -DSCHWARZ_BUILD_CHOLMOD=off -DSCHWARZ_BUILD_METIS=off -DSCHWARZ_WITH_HWLOC=off -DSCHWARZ_BUILD_CUDA=off ..
make -j10
cuda-build:

name: Build with CUDA
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: install-mpi
run: |
sudo apt-get update
sudo apt-get -y install mpich
- name: install-cuda
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda
- name: info
run: |
g++ -v
/usr/local/cuda-10.2/bin/nvcc --version
mpiexec --version
cmake --version
MPI_DIR=$(which mpicxx)
echo $MPI_DIR
- name: install-metis
run: |
sudo apt-get -y install metis
- name: install-ginkgo
run: |
export PATH=/usr/local/cuda-10.2/bin:/usr/local/cuda-10.2/NsightCompute-2019.1${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
pushd .
cd ${HOME}
mkdir install
git clone https://github.com/ginkgo-project/ginkgo.git
cd ginkgo
git checkout expt-develop
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=/usr/local/cuda-10.2 -DCMAKE_INSTALL_PREFIX=${HOME}/install -DGINKGO_BUILD_BENCHMARKS=off -DGINKGO_BUILD_EXAMPLES=off -DGINKGO_BUILD_TESTS=off -DGINKGO_BUILD_CUDA=on ..
make -j10
make install
popd
- name: configure-run-schwarz-lib
run: |
export Ginkgo_DIR=${HOME}/install
echo $Ginkgo_DIR
export PATH=/usr/local/cuda-10.2/bin:/usr/local/cuda-10.2/NsightCompute-2019.1${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
mkdir build
cd build/
cmake -DCMAKE_PREFIX_PATH="${HOME}/install;/usr/local/cuda-10.2" -DSCHWARZ_BUILD_CHOLMOD=off -DSCHWARZ_BUILD_METIS=off -DSCHWARZ_WITH_HWLOC=off -DSCHWARZ_BUILD_CUDA=on ..
make -j10
36 changes: 27 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SET(TARGET "schwarz")
SET(TARGET "schwarz-lib")
CMAKE_MINIMUM_REQUIRED(VERSION 3.8)

PROJECT(${TARGET} LANGUAGES C CXX)
Expand All @@ -13,16 +13,19 @@ option(SCHWARZ_WITH_HWLOC "Build with hwloc support" ON)
option(SCHWARZ_BUILD_DEALII "Build with deal.ii support" OFF)
option(SCHWARZ_BUILD_CLANG_TIDY "Use clang-tidy for static checks of code." OFF)
option(SCHWARZ_DEVEL_TOOLS "Switch on some developer tools" ON)
option(SCHWARZ_BUILD_DOC "Build the doxygen documentation" OFF)

# Optional packages
include(cmake/package_helpers.cmake)
ginkgo_find_package(gflags gflags FALSE 2.2.2)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")

set(Schwarz_SOURCE_DIR "${CMAKE_SOURCE_DIR}")

set(SCHWARZ_HAVE_CHOLMOD 0)
if(SCHWARZ_BUILD_CHOLMOD)
if(NOT DEFINED ENV{CHOLMOD_DIR})
message(SEND_ERROR "Please specify where CHOLMOD has been installed.")
message(FATAL_ERROR "Please specify where CHOLMOD has been installed in CHOLMOD_DIR.")
endif()
set(CHOLMOD_INCLUDE_DIR $ENV{CHOLMOD_DIR}/include)
set(CHOLMOD_LIBRARY_DIR $ENV{CHOLMOD_DIR}/lib)
Expand All @@ -33,11 +36,14 @@ endif()

set(SCHWARZ_HAVE_METIS 0)
if(SCHWARZ_BUILD_METIS)
if(NOT DEFINED ENV{METIS_DIR})
message(SEND_ERROR "Please specify where METIS has been installed.")
find_package(METIS)
if(NOT METIS_FOUND AND NOT DEFINED ENV{METIS_DIR})
message(FATAL_ERROR "Please specify where METIS has been installed in METIS_DIR.")
endif()
if(NOT METIS_FOUND)
set(METIS_INCLUDE_DIR $ENV{METIS_DIR}/include)
set(METIS_LIBRARY_DIR $ENV{METIS_DIR}/lib)
endif()
set(METIS_INCLUDE_DIR $ENV{METIS_DIR}/include)
set(METIS_LIBRARY_DIR $ENV{METIS_DIR}/lib)
include_directories(${METIS_INCLUDE_DIR})
link_directories(${METIS_LIBRARY_DIR})
set(SCHWARZ_HAVE_METIS 1)
Expand Down Expand Up @@ -76,7 +82,8 @@ endif()

# Required packages

find_package(Ginkgo REQUIRED)
find_package(Ginkgo REQUIRED
HINTS ${Ginkgo_DIR} $ENV{Ginkgo_DIR})

find_package(MPI REQUIRED)
include_directories(SYSTEM ${MPI_C_INCLUDE_PATH} ${MPI_CXX_INCLUDE_PATH})
Expand All @@ -96,10 +103,12 @@ TARGET_SOURCES(${TARGET} PRIVATE
source/communicate.cpp
source/utils.cpp
source/solve.cpp
source/schwarz_solver.cpp
source/schwarz_base.cpp
source/restricted_schwarz.cpp
source/exception.cpp
)


configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/config.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/include/schwarz/config.hpp @ONLY)

Expand All @@ -111,6 +120,14 @@ else()
source/cuda_dummy_gather.cpp)
endif()

include(cmake/information_helpers.cmake)
schwarz_git_information()

if(SCHWARZ_BUILD_DOC)
add_subdirectory(doc)
endif()


if(SCHWARZ_BUILD_CLANG_TIDY)
find_program(
CLANG_TIDY_EXE
Expand Down Expand Up @@ -164,10 +181,11 @@ endif()

if(SCHWARZ_BUILD_CUDA)
TARGET_INCLUDE_DIRECTORIES(${TARGET}
SYSTEM PRIVATE ${CUDA_INCLUDE_DIRS})
SYSTEM PUBLIC ${CUDA_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${TARGET} ${CUDA_RUNTIME_LIBS} ${CUBLAS} ${CUSPARSE})
endif()


# Link the required packages
TARGET_LINK_LIBRARIES(${TARGET} Ginkgo::ginkgo)

Expand Down
3 changes: 2 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### Installation process.
# Installation Instructions {#install_schwarz}
-------------------------------------

## Building

Expand Down
46 changes: 30 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
### Schwarz testbed
Schwarz Library
-------------------

## Repository for testing schwarz methods.
--------------------------------------
[![Build status](https://github.com/pratikvn/schwarz-lib/workflows/Build/badge.svg)](https://github.com/pratikvn/schwarz-lib/actions?query=workflow%3ABuild-status)
[![Documentation](https://github.com/pratikvn/schwarz-lib/workflows/Build-doc/badge.svg?branch=develop)](https://pratikvn.github.io/schwarz-lib/doc/doc-setup/index.html)

Required components
-------------------
## Required components

The required components include:
1. Ginkgo: The Ginkgo library is needed. It needs to be installed and preferably the installation path
provided as an environment variable in `Ginkgo_DIR` variable.
2. MPI: As multiple nodes and a domain decomposition is used, an MPI implementation is necessary.
3. Boost: A Boost library is also required as one of its header files `mpi_datatype.hpp` is used to
detect the `MPI_type` needed at run-time. It may also be possible to get this specific file provide
its include path (NOT TESTED) if the complete Boost library is not easily available.

detect the `MPI_type` needed at run-time.

Quick Install
------------
## Quick Install

### Building Schwarz-Lib

Expand All @@ -33,8 +30,7 @@ For more CMake options please refer to the [Installation page](./INSTALL.md)



Currently implemented features
-------------------------------
## Currently implemented features

1. Executor paradigm:
+ [x] GPU.
Expand All @@ -51,28 +47,46 @@ Currently implemented features

3. Partitioning paradigm:
+ [x] METIS.
+ [x] Naive, 1D.
+ [x] Regular, 1D.
+ [x] Regular, 2D.
+ [ ] Zoltan.


4. Convergence check:
+ [x] Tree convergence.
+ [ ] Bahi decentralized.
+ [x] Centralized, tree based convergence (Yamazaki 2019).
+ [x] Decentralized, leader election based (Bahi 2005).

5. Communication paradigm.
+ [x] Onesided.
+ [x] Twosided.
+ [ ] Event based.

5. Communication strategies.
+ [x] Remote comm strategies:
+ [x] MPI_Put , gathered.
+ [x] MPI_Put , one by one.
+ [x] MPI_Get , gathered .
+ [x] MPI_Get , one by one.
+ [x] Lock strategies: MPI_Win_lock / MPI_Win_lock_all .
+ [x] Lock all and unlock all.
+ [x] Lock local and unlock local.
+ [x] Flush strategies: MPI_Win_flush / MPI_Win_flush_local .
+ [x] Flush all.
+ [x] Flush local.

6. Schwarz problem type.
+ [x] RAS.
+ [ ] O-RAS.


Any of the implemented features can be permuted and tested.

## Known Issues

1. On Summit, the Spectrum MPI seems to have a bug with using `MPI_Put` with GPU buffers. `MPI_Get` works as expected. This bug has also been confirmed with an external micro-benchmarking library, [OSU Micro-Benchmarks](https://github.com/pratikvn/osu-bench-personal-fork).


For installing and building, please check the [Installation page](./INSTALL.md)


Credits: This code is a refactoring(rewritten in C++, with additions) of the code from Ichitaro Yamazaki, ICL, UTK.
Credits: This code was inspired by (written in C++, with additions and improvements) the code from Ichitaro Yamazaki, ICL, UTK.
2 changes: 2 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Testing Instructions {#testing_schwarz}
-------------------------------------
Loading

0 comments on commit 8baee6a

Please sign in to comment.