Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ddb1933
Add MPI layer CMake setup
pratikvn Oct 22, 2021
7e1a4b9
Add basic classes and hooks
pratikvn Oct 22, 2021
a56a6ff
Update with MPI version
pratikvn Oct 22, 2021
426e48b
Add a EnableSharedCreate interface
pratikvn Oct 22, 2021
a76b727
Add new macros for instantiations
pratikvn Oct 22, 2021
0e8a031
Add exception handling and helpers
pratikvn Oct 22, 2021
bdb5f87
Add MPI bindings and binding helpers
pratikvn Oct 22, 2021
4f5db6b
Add MPI tests and CUDA Aware check helper
pratikvn Oct 22, 2021
7ba1c81
Add a few MPI jobs for CI
pratikvn Oct 22, 2021
4e869f6
Add docs, and some tests.
pratikvn Oct 22, 2021
da8f2c4
Review update, more tests
pratikvn Oct 25, 2021
13d1c53
Add an example as an integration test
pratikvn Oct 25, 2021
91aadba
Disable MPI compilation when not being used.
pratikvn Oct 28, 2021
518be63
Fix test_install and MPI run as root
pratikvn Oct 29, 2021
64bd141
Make init_finalize a singleton
pratikvn Nov 2, 2021
320ab30
Review WIP
pratikvn Nov 3, 2021
09ff8f5
Review update 2: comm, req, and win
pratikvn Nov 4, 2021
ff15e67
WIP: Moving funcs to public header
pratikvn Nov 4, 2021
3a6d2df
Move all wrappers to headers
pratikvn Nov 5, 2021
25d5e62
Update init_finalize
pratikvn Nov 5, 2021
8544262
Remove ginkgo_mpi library, move to core
pratikvn Nov 5, 2021
fb95689
Format files
ginkgo-bot Nov 5, 2021
fcdcb79
Rem unnecessary ex and code in gtest-mpi-listener
pratikvn Nov 8, 2021
06a4f36
Format files
ginkgo-bot Nov 9, 2021
4f5ae1d
Library fixes and gtes-mpi-listener updates
pratikvn Nov 10, 2021
c0a82cb
Some more fixes for cmake and MPI types
pratikvn Nov 10, 2021
1b148ec
Remove init finalize exception handling.
pratikvn Nov 12, 2021
7f2cd88
Make nb functions return requests
pratikvn Nov 16, 2021
cf965ad
Some test updates
pratikvn Nov 16, 2021
1c681bb
Update tests to TYPED_TESTS
pratikvn Nov 16, 2021
f4b89ef
Review update.
pratikvn Nov 17, 2021
fa1d910
Remove info struct and use MPI_Info
pratikvn Nov 17, 2021
b377bec
Make MPI calls inline
pratikvn Nov 17, 2021
0b9a510
Overhaul communicator
pratikvn Nov 18, 2021
7d11a47
Fix MPI_Win, MPI_Put consistency issues
pratikvn Nov 19, 2021
df080b6
Fix GPU Aware functionality
pratikvn Nov 20, 2021
b1c264d
Update docs and fix types
pratikvn Nov 21, 2021
ced2a61
Make sync a comm member function
pratikvn Nov 22, 2021
4ecb5a1
Review update.
pratikvn Nov 25, 2021
c2d9679
Store MPI_Comm in a shared_ptr
pratikvn Nov 25, 2021
509ca6c
Move everything to member funcs of comm and window
pratikvn Nov 26, 2021
e913f55
Add request and status wrappers
pratikvn Nov 27, 2021
37b8a44
Review updates.
pratikvn Nov 27, 2021
a5f5e93
Merge: Add a MPI layer, CMake setup and test framework
pratikvn Nov 27, 2021
96ba143
adds partition class
MarcelKoch Oct 22, 2021
83b9071
add sorting tests to partition
MarcelKoch Aug 24, 2021
a193c90
Format files
ginkgo-bot Sep 7, 2021
06404d2
add partition kernels
upsj Oct 23, 2021
8b09820
use kernel stubs
MarcelKoch Oct 25, 2021
94624ce
rename range_ranks to range_starting_indices
MarcelKoch Oct 26, 2021
382eeb0
add partition builder from global size
MarcelKoch Oct 26, 2021
7219260
move distributed typedefs to a centralized place
MarcelKoch Oct 27, 2021
fa194fa
review updates
MarcelKoch Oct 27, 2021
eb9f52f
allow only const access to partition data
MarcelKoch Oct 28, 2021
b55e267
review update
MarcelKoch Oct 28, 2021
1720ca3
add template for global_index_type
MarcelKoch Oct 28, 2021
8d550fb
review updates
MarcelKoch Nov 24, 2021
42b25bc
disables dpcpp for partition common test
MarcelKoch Nov 25, 2021
810d86c
fix kernel launch issues for certain cuda versions
MarcelKoch Nov 25, 2021
5bb5436
review updates
MarcelKoch Nov 29, 2021
ed77851
Merge: Add a class for partitions of intervals
MarcelKoch Nov 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ include:
BUILD_CUDA: "OFF"
BUILD_HIP: "OFF"
BUILD_HWLOC: "ON"
BUILD_MPI: "OFF"
MPI_AS_ROOT: "OFF"
FAST_TESTS: "OFF"
DPCPP_SINGLE_MODE: "OFF"
MIXED_PRECISION: "ON"
Expand Down Expand Up @@ -74,6 +76,8 @@ include:
-DGINKGO_DEVEL_TOOLS=OFF -DGINKGO_BUILD_REFERENCE=${BUILD_REFERENCE}
-DGINKGO_BUILD_OMP=${BUILD_OMP} -DGINKGO_BUILD_CUDA=${BUILD_CUDA}
-DGINKGO_BUILD_HIP=${BUILD_HIP}
-DGINKGO_BUILD_MPI=${BUILD_MPI} -DGINKGO_MPI_EXEC_SUFFIX=${MPI_SUFFIX}
-DMPI_RUN_AS_ROOT=${MPI_AS_ROOT}
-DGINKGO_BUILD_HWLOC=${BUILD_HWLOC}
-DGINKGO_BUILD_TESTS=ON -DGINKGO_BUILD_EXAMPLES=ON
-DGINKGO_FAST_TESTS=${FAST_TESTS}
Expand Down Expand Up @@ -109,6 +113,8 @@ include:
-DGINKGO_DEVEL_TOOLS=OFF -DGINKGO_BUILD_REFERENCE=${BUILD_REFERENCE}
-DGINKGO_BUILD_OMP=${BUILD_OMP} -DGINKGO_BUILD_CUDA=${BUILD_CUDA}
-DGINKGO_BUILD_HIP=${BUILD_HIP}
-DGINKGO_BUILD_MPI=${BUILD_MPI} -DGINKGO_MPI_EXEC_SUFFIX=${MPI_SUFFIX}
-DMPI_RUN_AS_ROOT=${MPI_RUN_AS_ROOT}
-DGINKGO_BUILD_HWLOC=${BUILD_HWLOC}
-DGINKGO_BUILD_TESTS=ON -DGINKGO_BUILD_EXAMPLES=ON
-DGINKGO_FAST_TESTS=${FAST_TESTS}
Expand Down Expand Up @@ -553,6 +559,49 @@ build/amd/clang/hip_wo_omp/release/shared:
BUILD_HIP: "ON"
BUILD_TYPE: "Release"

# mpi job test debug shared
build/nocuda/gcc/mpi/debug/shared:
<<: *default_build_with_test
extends:
- .quick_test_condition
- .use_gko-nocuda-gnu9-llvm8-intel
variables:
<<: *default_variables
BUILD_MPI: "ON"
MPI_AS_ROOT: "ON"
BUILD_TYPE: "Debug"
BUILD_SHARED_LIBS: "ON"

# mpi job test release static
build/nocuda/gcc/mpi/release/static:
<<: *default_build_with_test
extends:
- .full_test_condition
- .use_gko-nocuda-gnu9-llvm8-intel
variables:
<<: *default_variables
BUILD_MPI: "ON"
MPI_AS_ROOT: "ON"
BUILD_TYPE: "Release"
BUILD_SHARED_LIBS: "OFF"

# mpi job with cuda 10.0
build/cuda100/mpi/gcc/all/debug/shared:
<<: *default_build
extends:
- .quick_test_condition
- .use_gko-cuda100-gnu7-llvm60-intel2018
variables:
<<: *default_variables
BUILD_OMP: "ON"
BUILD_CUDA: "ON"
BUILD_MPI: "ON"
MPI_AS_ROOT: "ON"
BUILD_HIP: "ON"
BUILD_TYPE: "Debug"
FAST_TESTS: "ON"
CUDA_ARCH: 61

# no cuda but latest gcc and clang
build/nocuda/gcc/core/debug/static:
<<: *default_build_with_test
Expand Down
32 changes: 32 additions & 0 deletions ABOUT-LICENSING.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,35 @@ __NOTE:__ Some of the options that pull additional software when compiling
Ginkgo are ON by default, and have to be disabled manually to prevent
third-party licensing. Refer to the [Installation section in
INSTALL.md](INSTALL.md#Building) for more details.


When using testing with MPI switched on, the gtest-mpi-listener header only library is used for testing MPI functionality. The repository is licensed triple licensed under BSD-3, MIT and Apache 2.0. The License duplicated below. More details on the License and the library are [available on github](https://github.com/LLNL/gtest-mpi-listener)


> # Copyright 2005, Google Inc. All rights reserved.
> #
> # Redistribution and use in source and binary forms, with or without
> # modification, are permitted provided that the following conditions are
> # met:
> #
> # * Redistributions of source code must retain the above copyright
> # notice, this list of conditions and the following disclaimer.
> # * Redistributions in binary form must reproduce the above
> # copyright notice, this list of conditions and the following disclaimer
> # in the documentation and/or other materials provided with the
> # distribution.
> # * Neither the name of Google Inc. nor the names of its
> # contributors may be used to endorse or promote products derived from
> # this software without specific prior written permission.
> #
> # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ option(GINKGO_BUILD_EXAMPLES "Build Ginkgo's examples" ON)
option(GINKGO_BUILD_BENCHMARKS "Build Ginkgo's benchmarks" ON)
option(GINKGO_BUILD_REFERENCE "Compile reference CPU kernels" ON)
option(GINKGO_BUILD_OMP "Compile OpenMP kernels for CPU" ${GINKGO_HAS_OMP})
option(GINKGO_BUILD_MPI "Compile the MPI module" ${GINKGO_HAS_MPI})
option(GINKGO_BUILD_DPCPP
"Compile DPC++ kernels for Intel GPUs or other DPC++ enabled hardware" ${GINKGO_HAS_DPCPP})
option(GINKGO_BUILD_CUDA "Compile kernels for NVIDIA GPUs" ${GINKGO_HAS_CUDA})
Expand Down Expand Up @@ -189,6 +190,10 @@ else()
message(STATUS "HWLOC is being forcibly switched off")
endif()

if(GINKGO_BUILD_MPI)
find_package(MPI REQUIRED)
endif()

# We keep using NVCC/HCC for consistency with previous releases even if AMD
# updated everything to use NVIDIA/AMD in ROCM 4.1
set(GINKGO_HIP_PLATFORM_NVCC 0)
Expand Down
9 changes: 8 additions & 1 deletion cmake/GinkgoConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ set(GINKGO_BUILD_REFERENCE @GINKGO_BUILD_REFERENCE@)
set(GINKGO_BUILD_OMP @GINKGO_BUILD_OMP@)
set(GINKGO_BUILD_CUDA @GINKGO_BUILD_CUDA@)
set(GINKGO_BUILD_HIP @GINKGO_BUILD_HIP@)
set(GINKGO_BUILD_MPI @GINKGO_BUILD_MPI@)
set(GINKGO_BUILD_DPCPP @GINKGO_BUILD_DPCPP@)

set(GINKGO_DEVEL_TOOLS @GINKGO_DEVEL_TOOLS@)
Expand Down Expand Up @@ -81,10 +82,11 @@ set(GINKGO_DPCPP_FLAGS @GINKGO_DPCPP_FLAGS@)
set(GINKGO_MKL_ROOT @GINKGO_MKL_ROOT@)
set(GINKGO_DPL_ROOT @GINKGO_DPL_ROOT@)

set(GINKGO_BUILD_MPI @GINKGO_BUILD_MPI@)

set(GINKGO_HAVE_PAPI_SDE @GINKGO_HAVE_PAPI_SDE@)

set(GINKGO_HAVE_HWLOC @GINKGO_HAVE_HWLOC@)
set(GINKGO_BUILD_HWLOC @GINKGO_BUILD_HWLOC@)

# Ginkgo installation configuration
set(GINKGO_CONFIG_FILE_PATH "${CMAKE_CURRENT_LIST_DIR}")
Expand Down Expand Up @@ -151,6 +153,11 @@ if(GINKGO_HAVE_HWLOC)
find_package(HWLOC REQUIRED)
endif()

# Check for MPI if it is enabled
if(GINKGO_BUILD_MPI)
find_package(MPI REQUIRED)
endif()

# HIP and OpenMP depend on Threads::Threads in some circumstances, but don't find it
if (GINKGO_BUILD_HIP OR GINKGO_BUILD_OMP)
find_package(Threads REQUIRED)
Expand Down
9 changes: 9 additions & 0 deletions cmake/autodetect_executors.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
set(GINKGO_HAS_OMP OFF)
set(GINKGO_HAS_MPI OFF)
set(GINKGO_HAS_CUDA OFF)
set(GINKGO_HAS_DPCPP OFF)
set(GINKGO_HAS_HIP OFF)
find_package(OpenMP 3.0)
find_package(MPI)
include(CheckLanguage)
check_language(CUDA)
try_compile(GKO_CAN_COMPILE_DPCPP ${PROJECT_BINARY_DIR}/dpcpp
Expand All @@ -16,6 +18,13 @@ if(OpenMP_CXX_FOUND)
set(GINKGO_HAS_OMP ON)
endif()

if(MPI_FOUND)
if(NOT DEFINED GINKGO_BUILD_MPI)
message(STATUS "Enabling MPI support")
endif()
set(GINKGO_HAS_MPI ON)
endif()

if(CMAKE_CUDA_COMPILER)
if(NOT DEFINED GINKGO_BUILD_CUDA)
message(STATUS "Enabling CUDA executor")
Expand Down
30 changes: 28 additions & 2 deletions cmake/create_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,28 @@ function(ginkgo_create_thread_test test_name)
ginkgo_set_test_target_properties(${test_name} ${test_target_name})
endfunction(ginkgo_create_thread_test)

function(ginkgo_create_mpi_test test_name num_mpi_procs)
file(RELATIVE_PATH REL_BINARY_DIR
${PROJECT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
string(REPLACE "/" "_" TEST_TARGET_NAME "${REL_BINARY_DIR}/${test_name}")
add_executable(${TEST_TARGET_NAME} ${test_name}.cpp)
set_target_properties(${TEST_TARGET_NAME} PROPERTIES
OUTPUT_NAME ${test_name})
if (GINKGO_CHECK_CIRCULAR_DEPS)
target_link_libraries(${TEST_TARGET_NAME} PRIVATE "${GINKGO_CIRCULAR_DEPS_FLAGS}")
endif()
if("${GINKGO_MPI_EXEC_SUFFIX}" MATCHES ".openmpi" AND MPI_RUN_AS_ROOT)
set(OPENMPI_RUN_AS_ROOT_FLAG "--allow-run-as-root")
else()
set(OPENMPI_RUN_AS_ROOT_FLAG "")
endif()
target_link_libraries(${TEST_TARGET_NAME} PRIVATE ginkgo GTest::MPI_main GTest::GTest ${ARGN})
target_link_libraries(${TEST_TARGET_NAME} PRIVATE MPI::MPI_CXX)
set(test_param ${MPIEXEC_NUMPROC_FLAG} ${num_mpi_procs} ${OPENMPI_RUN_AS_ROOT_FLAG} ${CMAKE_BINARY_DIR}/${REL_BINARY_DIR}/${test_name})
add_test(NAME ${REL_BINARY_DIR}/${test_name}
COMMAND ${MPIEXEC_EXECUTABLE} ${test_param})
endfunction(ginkgo_create_mpi_test)

function(ginkgo_create_test_cpp_cuda_header test_name)
ginkgo_build_test_name(${test_name} test_target_name)
add_executable(${test_target_name} ${test_name}.cpp)
Expand Down Expand Up @@ -141,6 +163,7 @@ ginkgo_build_test_name(${test_name} test_target_name)
endfunction(ginkgo_create_hip_test)

function(ginkgo_create_common_test test_name)
cmake_parse_arguments(PARSE_ARGV 1 common_test "" "" "DISABLE_EXECUTORS;ADDITIONAL_LIBRARIES")
set(executors)
if(GINKGO_BUILD_OMP)
list(APPEND executors omp)
Expand All @@ -154,6 +177,9 @@ function(ginkgo_create_common_test test_name)
if(GINKGO_BUILD_DPCPP)
list(APPEND executors dpcpp)
endif()
foreach(disabled_exec ${common_test_DISABLE_EXECUTORS})
list(REMOVE_ITEM executors ${disabled_exec})
endforeach()
foreach(exec ${executors})
ginkgo_build_test_name(${test_name} test_target_name)
# build executor typename out of shorthand
Expand All @@ -167,7 +193,7 @@ function(ginkgo_create_common_test test_name)
target_compile_features(${test_target_name} PUBLIC cxx_std_14)
target_compile_options(${test_target_name} PRIVATE ${GINKGO_COMPILER_FLAGS})
target_compile_definitions(${test_target_name} PRIVATE EXEC_TYPE=${exec_type} EXEC_NAMESPACE=${exec})
target_link_libraries(${test_target_name} PRIVATE ${ARGN})
target_link_libraries(${test_target_name} PRIVATE ${common_test_ADDITIONAL_LIBRARIES})
# use float for DPC++ if necessary
if((exec STREQUAL "dpcpp") AND GINKGO_DPCPP_SINGLE_MODE)
target_compile_definitions(${test_target_name} PRIVATE GINKGO_COMMON_SINGLE_MODE=1)
Expand All @@ -187,4 +213,4 @@ function(ginkgo_create_common_and_reference_test test_name)
target_compile_definitions(${test_target_name} PRIVATE EXEC_TYPE=ReferenceExecutor EXEC_NAMESPACE=reference)
target_link_libraries(${test_target_name} PRIVATE ${ARGN})
ginkgo_set_test_target_properties(${test_name}_reference ${test_target_name})
endfunction()
endfunction()
6 changes: 5 additions & 1 deletion cmake/get_info.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ foreach(log_type ${log_types})
ginkgo_print_module_footer(${${log_type}} "User configuration:")
ginkgo_print_module_footer(${${log_type}} " Enabled modules:")
ginkgo_print_foreach_variable(${${log_type}}
"GINKGO_BUILD_OMP;GINKGO_BUILD_REFERENCE;GINKGO_BUILD_CUDA;GINKGO_BUILD_HIP;GINKGO_BUILD_DPCPP")
"GINKGO_BUILD_OMP;GINKGO_BUILD_MPI;GINKGO_BUILD_REFERENCE;GINKGO_BUILD_CUDA;GINKGO_BUILD_HIP;GINKGO_BUILD_DPCPP")
ginkgo_print_module_footer(${${log_type}} " Enabled features:")
ginkgo_print_foreach_variable(${${log_type}}
"GINKGO_MIXED_PRECISION")
Expand Down Expand Up @@ -155,6 +155,10 @@ IF(GINKGO_BUILD_OMP)
include(omp/get_info.cmake)
ENDIF()

IF(GINKGO_BUILD_MPI)
include(core/mpi/get_info.cmake)
ENDIF()

IF(GINKGO_BUILD_CUDA)
include(cuda/get_info.cmake)
ENDIF()
Expand Down
1 change: 1 addition & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set(UNIFIED_SOURCES
components/fill_array_kernels.cpp
components/precision_conversion_kernels.cpp
components/reduce_array_kernels.cpp
distributed/partition_kernels.cpp
matrix/coo_kernels.cpp
matrix/csr_kernels.cpp
matrix/dense_kernels.cpp
Expand Down
Loading