Skip to content

Commit

Permalink
Merge branch 'develop' into warn-on-legacy-git-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelKoch authored Dec 14, 2023
2 parents f2343ef + 1e268ff commit 63a6f55
Show file tree
Hide file tree
Showing 111 changed files with 3,378 additions and 286 deletions.
147 changes: 77 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
![Ginkgo](/assets/logo.png)

[![Build status](https://gitlab.com/ginkgo-project/ginkgo-public-ci/badges/develop/pipeline.svg)](https://github.com/ginkgo-project/ginkgo/commits/develop)
[![OSX-build](https://github.com/ginkgo-project/ginkgo/actions/workflows/osx.yml/badge.svg)](https://github.com/ginkgo-project/ginkgo/actions/workflows/osx.yml)
[![Windows-build](https://github.com/ginkgo-project/ginkgo/actions/workflows/windows-msvc-ref.yml/badge.svg)](https://github.com/ginkgo-project/ginkgo/actions/workflows/windows-msvc-ref.yml)
[![codecov](https://codecov.io/gh/ginkgo-project/ginkgo/branch/develop/graph/badge.svg)](https://codecov.io/gh/ginkgo-project/ginkgo)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ginkgo-project_ginkgo&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=ginkgo-project_ginkgo)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=ginkgo-project_ginkgo&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=ginkgo-project_ginkgo)

[![CDash dashboard](https://img.shields.io/badge/CDash-Access-blue.svg)](https://my.cdash.org/index.php?project=Ginkgo+Project)
[![Documentation](https://img.shields.io/badge/Documentation-latest-blue.svg)](https://ginkgo-project.github.io/ginkgo-generated-documentation/doc/develop/)
[![License](https://img.shields.io/github/license/ginkgo-project/ginkgo.svg)](./LICENSE)
[![c++ standard](https://img.shields.io/badge/c%2B%2B-14-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.02260/status.svg)](https://doi.org/10.21105/joss.02260)

Ginkgo is a high-performance linear algebra library for manycore systems, with a
focus on the solution of sparse linear systems. It is implemented using modern C++
<p align="center"><img src="/assets/logo.png" alt="Ginkgo" width="60%" height="60%"></p>

<div align="center">

[![License](https://img.shields.io/github/license/ginkgo-project/ginkgo.svg)](./LICENSE)|[![c++ standard](https://img.shields.io/badge/c%2B%2B-14-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization)|[![Documentation](https://img.shields.io/badge/Documentation-latest-blue.svg)](https://ginkgo-project.github.io/ginkgo-generated-documentation/doc/develop/)|[![DOI](https://joss.theoj.org/papers/10.21105/joss.02260/status.svg)](https://doi.org/10.21105/joss.02260)
|:-:|:-:|:-:|:-:|


[![Build status](https://gitlab.com/ginkgo-project/ginkgo-public-ci/badges/develop/pipeline.svg)](https://gitlab.com/ginkgo-project/ginkgo-public-ci/-/pipelines?page=1&scope=branches&ref=develop)|[![OSX-build](https://github.com/ginkgo-project/ginkgo/actions/workflows/osx.yml/badge.svg)](https://github.com/ginkgo-project/ginkgo/actions/workflows/osx.yml)|[![Windows-build](https://github.com/ginkgo-project/ginkgo/actions/workflows/windows-msvc-ref.yml/badge.svg)](https://github.com/ginkgo-project/ginkgo/actions/workflows/windows-msvc-ref.yml)
|:-:|:-:|:-:|


[![codecov](https://codecov.io/gh/ginkgo-project/ginkgo/branch/develop/graph/badge.svg)](https://codecov.io/gh/ginkgo-project/ginkgo)|[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ginkgo-project_ginkgo&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=ginkgo-project_ginkgo)|[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=ginkgo-project_ginkgo&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=ginkgo-project_ginkgo)|[![CDash dashboard](https://img.shields.io/badge/CDash-Access-blue.svg)](https://my.cdash.org/index.php?project=Ginkgo+Project)
|:-:|:-:|:-:|:-:|

</div>


Ginkgo is a high-performance numerical linear algebra library for many-core systems, with a
focus on solution of sparse linear systems. It is implemented using modern C++
(you will need an at least C++14 compliant compiler to build it), with GPU kernels
implemented in CUDA, HIP, and DPC++(SYCL).
implemented for NVIDIA, AMD and Intel GPUs.

---

Performance
-----------
**[Prerequisites](#prerequisites)** |
**[Building Ginkgo](#building-and-installing-ginkgo)** |
**[Tests, Examples, Benchmarks](#tests-examples-and-benchmarks)** |
**[Bug reports](#bug-reports-and-support)** |
**[Licensing](#licensing)** |
**[Contributing](#contributing-to-ginkgo)** |
**[Citing](#citing-ginkgo)**

An extensive database of up-to-date benchmark results is available in the
[performance data repository](https://github.com/ginkgo-project/ginkgo-data).
Visualizations of the database can be interactively generated using the
[Ginkgo Performance Explorer web application](https://ginkgo-project.github.io/gpe).
The benchmark results are automatically updated using the CI system to always
reflect the current state of the library.

Prerequisites
-------------
# Prerequisites

### Linux and Mac OS

Expand Down Expand Up @@ -73,7 +75,7 @@ The Ginkgo DPC++(SYCL) module has the following __additional__ requirements:

The Ginkgo MPI module has the following __additional__ requirements:

* MPI 3.1+, ideally with GPUDirect support for best performance
* MPI 3.1+, ideally GPU-Aware, for best performance

In addition, if you want to contribute code to Ginkgo, you will also need the
following:
Expand Down Expand Up @@ -108,73 +110,53 @@ In these environments, two problems can be encountered, the solution for which i
__NOTE:__ Some restrictions will also apply on the version of C and C++ standard
libraries installed on the system. This needs further investigation.

Quick Install
------------

### Building Ginkgo
# Building and Installing Ginkgo

To build Ginkgo, you can use the standard CMake procedure.

```sh
mkdir build; cd build
cmake -G "Unix Makefiles" .. && make
cmake -G "Unix Makefiles" .. && cmake --build .
cmake --install .
```

By default, `GINKGO_BUILD_REFERENCE` is enabled. You should be able to run
examples with this executor. By default, Ginkgo tries to enable the relevant
modules depending on your machine environment (present of CUDA, ...). You can
also explicitly compile with the OpenMP, CUDA, HIP or DPC++(SYCL) modules enabled to
run the examples with these executors. Please refer to the [Installation
page](./INSTALL.md) for more details.
run the examples with these executors.

After the installation, CMake can find ginkgo with `find_package(Ginkgo)`.
An example can be found in the [`test_install`](test/test_install/CMakeLists.txt).
Please refer to the [Installation page](./INSTALL.md) for more details.

### Ginkgo Examples
Tip: After installation, in your CMake project, Ginkgo can be added with `find_package(Ginkgo)` and the the target that is exported is `Ginkgo::ginkgo`.
An example can be found in the [`test_install`](test/test_install/CMakeLists.txt).

Various examples are available for you to understand and play with Ginkgo within the `examples/` directory. They can be compiled by passing the `-DGINKGO_BUILD_EXAMPLES=ON` to the cmake command. Documentation for the examples is available within the `doc/` folder in each of the example directory and a commented code with explanations can found in the [online documentation](https://ginkgo-project.github.io/ginkgo-generated-documentation/doc/develop/Examples.html).
# Tests, Examples and Benchmarks

### Ginkgo Testing
### Testing

Ginkgo does comprehensive unit tests using Google Tests. These tests are enabled by default and can be disabled if necessary by passing the `-DGINKGO_BUILD_TESTS=NO` to the cmake command. More details about running tests can be found in the [TESTING.md page](./TESTING.md).

### Running the benchmarks
### Running examples

Various examples are available for you to understand and play with Ginkgo within the `examples/` directory. They can be compiled by passing the `-DGINKGO_BUILD_EXAMPLES=ON` to the cmake command. Each of the examples have commented code with explanations and this can be found within the [online documentation](https://ginkgo-project.github.io/ginkgo-generated-documentation/doc/develop/Examples.html).

### Benchmarking

A unique feature of Ginkgo is the ability to run benchmarks and view your results
with the help of the [Ginkgo Performance Explorer (GPE)](https://ginkgo-project.github.io/gpe/).

More details about this can be found in the [BENCHMARKING.md page](./BENCHMARKING.md)

Contributing to Ginkgo
---------------------------

### Contributing

When contributing for the first time, please add yourself to the list of
external contributors like in the example below.

#### Contributors
I hereby place all my contributions in this codebase under a BSD-3-Clause
license, as specified in the repository's [LICENSE](./LICENSE) file.

Name Surname <email@domain> Institution(s)

#### Contributing guidelines
# Bug reports and Support

Contributing guidelines can be accessed in the [CONTRIBUTING.md
page](./CONTRIBUTING.md). This page also contains other information useful to
developers, such as writing proper commit messages, understanding Ginkgo's
library design, relevant C++ information, and more.
If you have any questions about using Ginkgo, please use [Github discussions](https://github.com/ginkgo-project/ginkgo/discussions).

### Support
If you have any question, bug to report or would like to propose a new feature,
feel free to [create an
issue on GitHub](https://github.com/ginkgo-project/ginkgo/issues/new). Another possibility
is to send an email to [Ginkgo's main email address](mailto:[email protected])
or to contact any of the main [contributors](contributors.txt).
If you would like to request a feature, or have encountered a bug, please [create an issue](https://github.com/ginkgo-project/ginkgo/issues/new). Please be sure to describe your problem and provide as much information as possible.

You can also send an email to [Ginkgo's main email address](mailto:[email protected]).

### Licensing
# Licensing

Ginkgo is available under the [3-clause BSD license](LICENSE). All contributions
to the project are added under this license.
Expand All @@ -184,8 +166,33 @@ software may be pulled as additional dependencies, which have their own
licensing conditions. Refer to [ABOUT-LICENSING.md](ABOUT-LICENSING.md) for
details.

Citing Ginkgo
-------------
# Contributing to Ginkgo

We are glad that that you would like to contribute to Ginkgo and we are happy to help you with any questions you may have.

If you are contributing for the first time, please add yourself to the list of external contributors with the following info

``` text
Name Surname <email@domain> Institution(s)
```

#### Declaration

Ginkgo's source is distributed with a BSD-3 clause license. By contributing to Ginkgo and adding yourself to the contributors list, you agree to the following statement (also in [contributors.txt](contributors.txt)):

``` text
I hereby place all my contributions in this codebase under a BSD-3-Clause
license, as specified in the repository's LICENSE file.
```

#### Contribution Guidelines

When contributing to Ginkgo, to ease the review process, please follow the guidelines mentioned in [CONTRIBUTING.md](CONTRIBUTING.md).

It also contains other general recommendations such as writing proper commit messages, understanding Ginkgo's library design, relevant C++ information etc.


# Citing Ginkgo

The main Ginkgo paper describing Ginkgo's purpose, design and interface is
available through the following reference:
Expand Down
7 changes: 3 additions & 4 deletions benchmark/sparse_blas/operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


#include "benchmark/sparse_blas/operations.hpp"
#include "core/base/array_access.hpp"
#include "core/factorization/elimination_forest.hpp"
#include "core/factorization/symbolic.hpp"
#include "core/matrix/csr_kernels.hpp"
Expand Down Expand Up @@ -393,8 +394,7 @@ class GenerateLookupOperation : public BenchmarkOperation {
exec->run(make_build_lookup_offsets(
mtx_->get_const_row_ptrs(), mtx_->get_const_col_idxs(), num_rows,
allowed_sparsity_, storage_offsets_.get_data()));
storage_.resize_and_reset(exec->copy_val_to_host(
storage_offsets_.get_const_data() + num_rows));
storage_.resize_and_reset(get_element(storage_offsets_, num_rows));
}

std::pair<bool, double> validate() const override
Expand Down Expand Up @@ -479,8 +479,7 @@ class LookupOperation : public BenchmarkOperation {
exec->run(make_build_lookup_offsets(
mtx_->get_const_row_ptrs(), mtx_->get_const_col_idxs(), num_rows,
allowed_sparsity_, storage_offsets_.get_data()));
storage_.resize_and_reset(exec->copy_val_to_host(
storage_offsets_.get_const_data() + num_rows));
storage_.resize_and_reset(get_element(storage_offsets_, num_rows));
exec->run(make_build_lookup(
mtx_->get_const_row_ptrs(), mtx_->get_const_col_idxs(), num_rows,
allowed_sparsity_, storage_offsets_.get_const_data(),
Expand Down
2 changes: 1 addition & 1 deletion cmake/GinkgoConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ endif()

# Check that the same compilers as for Ginkgo are used
function(_ginkgo_check_compiler lang)
if(NOT "${CMAKE_${lang}_COMPILER}" STREQUAL "${GINKGO_${lang}_COMPILER}")
if(DEFINED CMAKE_${lang}_COMPILER AND (NOT "${CMAKE_${lang}_COMPILER}" STREQUAL "${GINKGO_${lang}_COMPILER}"))
set(_compiler_short "${CMAKE_${lang}_COMPILER_ID}:${CMAKE_${lang}_COMPILER_VERSION}")
if(NOT "${_compiler_short}" STREQUAL "${GINKGO_${lang}_COMPILER_SHORT}")
message(WARNING "The currently used ${lang} compiler: ${CMAKE_${lang}_COMPILER} does not match the compiler used to "
Expand Down
55 changes: 31 additions & 24 deletions cmake/install_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,66 +44,64 @@ endfunction()
function(ginkgo_install_library name)
ginkgo_add_install_rpath("${name}" "${ARGN}")

if (WIN32 OR CYGWIN)
# dll is considered as runtime
install(TARGETS "${name}"
EXPORT Ginkgo
LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}"
)
else ()
# install .so and .a files
install(TARGETS "${name}"
EXPORT Ginkgo
LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
install(TARGETS "${name}"
EXPORT Ginkgo
LIBRARY
DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
COMPONENT Ginkgo_Runtime
NAMELINK_COMPONENT Ginkgo_Development
RUNTIME
DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}"
COMPONENT Ginkgo_Runtime
ARCHIVE
DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
COMPONENT Ginkgo_Development
)
endif ()
endfunction()

function(ginkgo_install)
# pkg-config file
install(FILES ${Ginkgo_BINARY_DIR}/ginkgo_$<CONFIG>.pc
DESTINATION "${GINKGO_INSTALL_PKGCONFIG_DIR}"
RENAME ginkgo.pc)
RENAME ginkgo.pc
COMPONENT Ginkgo_Development)

# install the public header files
install(DIRECTORY "${Ginkgo_SOURCE_DIR}/include/"
DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}"
COMPONENT Ginkgo_Development
FILES_MATCHING PATTERN "*.hpp"
)
install(FILES "${Ginkgo_BINARY_DIR}/include/ginkgo/config.hpp"
DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/ginkgo"
COMPONENT Ginkgo_Development
)

if (GINKGO_HAVE_HWLOC AND NOT HWLOC_FOUND)
get_filename_component(HWLOC_LIB_PATH ${HWLOC_LIBRARIES} DIRECTORY)
file(GLOB HWLOC_LIBS "${HWLOC_LIB_PATH}/libhwloc*")
install(FILES ${HWLOC_LIBS}
DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
COMPONENT Ginkgo_Runtime
)
# We only use hwloc and not netloc
install(DIRECTORY "${HWLOC_INCLUDE_DIRS}/hwloc"
DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}"
COMPONENT Ginkgo_Development
)
install(FILES "${HWLOC_INCLUDE_DIRS}/hwloc.h"
DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}"
COMPONENT Ginkgo_Development
)
endif()

# Install CMake modules
install(DIRECTORY "${Ginkgo_SOURCE_DIR}/cmake/Modules/"
DESTINATION "${GINKGO_INSTALL_MODULE_DIR}"
COMPONENT Ginkgo_Development
FILES_MATCHING PATTERN "*.cmake"
)

# export targets
export(EXPORT Ginkgo
NAMESPACE Ginkgo::
FILE "${Ginkgo_BINARY_DIR}/GinkgoTargets.cmake"
)

# export configuration file for importing
write_basic_package_version_file(
"${Ginkgo_BINARY_DIR}/GinkgoConfigVersion.cmake"
Expand All @@ -120,14 +118,23 @@ function(ginkgo_install)
"${Ginkgo_BINARY_DIR}/GinkgoConfig.cmake"
"${Ginkgo_BINARY_DIR}/GinkgoConfigVersion.cmake"
DESTINATION "${GINKGO_INSTALL_CONFIG_DIR}"
)
COMPONENT Ginkgo_Development)
install(EXPORT Ginkgo
NAMESPACE Ginkgo::
FILE GinkgoTargets.cmake
DESTINATION "${GINKGO_INSTALL_CONFIG_DIR}")
DESTINATION "${GINKGO_INSTALL_CONFIG_DIR}"
COMPONENT Ginkgo_Development)

# Export package for use from the build tree
if (GINKGO_EXPORT_BUILD_DIR)
export(PACKAGE Ginkgo)
endif()

if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND BUILD_SHARED_LIBS)
install(FILES
"${Ginkgo_SOURCE_DIR}/dev_tools/scripts/gdb-ginkgo.py"
DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
RENAME "$<TARGET_FILE_NAME:ginkgo>-gdb.py"
COMPONENT Ginkgo_Development)
endif()
endfunction()
3 changes: 1 addition & 2 deletions common/cuda_hip/factorization/factorization_kernels.hpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,7 @@ void add_diagonal_elements(std::shared_ptr<const DefaultExecutor> exec,
components::prefix_sum_nonnegative(exec, row_ptrs_add, row_ptrs_size);
exec->synchronize();

auto total_additions =
exec->copy_val_to_host(row_ptrs_add + row_ptrs_size - 1);
auto total_additions = get_element(row_ptrs_addition, row_ptrs_size - 1);
size_type new_num_elems = static_cast<size_type>(total_additions) +
mtx->get_num_stored_elements();

Expand Down
Loading

0 comments on commit 63a6f55

Please sign in to comment.