Skip to content

Commit

Permalink
Merge #330 #346 #347 #352
Browse files Browse the repository at this point in the history
330: Update CUDA sender functionality to work with P2300 reference implementation r=msimberg a=msimberg

Continuation of #315. Part 2/n to fix #302.

This has now been tested with clang 14 and CUDA. ~but a CI configuration will follow in a separate PR (the llvm build requires this patch: spack/spack#31661

- Makes `get_env` customizations `noexcept` as required (and enforced) by the P2300 reference implementation.
- Add a missing `range` header to `cuda_scheduler_bulk.hpp`.
- ADL-isolate sender and receiver types in `async_cuda` module.
- Fixes the `completion_signatures` for senders in `async_cuda`. Note that the helpers for computing the types have to be guarded with a `requires is_invocable_v...` because `make_completion_signatures` instantiates the helper with non-`set_value_t` signatures as well. I have to investigate whether this is a bug or expected behaviour.
- Because of the above, a number of helper "kernels" have received trailing `decltype`s to enable SFINAE with bogus arguments.
- Removes the SFINAE for `then_with_cuda_stream` etc. since the HIP branch has been merged into DLA-Future. The SFINAE is no longer needed for choosing a `then_with_*` overload and adds unnecessary complexity.
- The reference implementation's `split` does not yet support move-only senders, so some additional tests are disabled with CUDA and the reference implementation.
- Change the `clang-14` Jenkins configuration to use CUDA and the P2300 reference implementation.

Note, this is not for 0.7.0 as it needs more work. Reviews are, however, already welcome.

346: Remove `operator|` overloads for `sync_wait` and `start_detached` r=msimberg a=msimberg

Fixes #329 .

347: Add Codacy coverage report r=msimberg a=msimberg

Part of #4. Not fully tested, but I got some reporting already to Codacy so there is hope that this works...

To do:
- [x] badge

352: Increase timeout for container algorithms tests on macOS CI configuration r=msimberg a=msimberg

I'm increasing the timeout to check if these timeouts https://github.com/pika-org/pika/runs/7692289838?check_suite_focus=true#step:6:237 are simply due to the test taking long to complete or if it really hangs. `partial_sort_copy_range` is one of the longer running tests so it's possible that it indeed just doesn't have enough time to finish (the timeout is 120 seconds and one of the later runs finished in 101 seconds: https://github.com/pika-org/pika/runs/7691710341?check_suite_focus=true#step:6:237).

Co-authored-by: Mikael Simberg <simberg@cscs.ch>
Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>
  • Loading branch information
3 people authored Aug 8, 2022
5 parents 2c0b8be + 9c149a2 + dab083a + d8917d0 + 263b190 commit ea48252
Show file tree
Hide file tree
Showing 31 changed files with 587 additions and 519 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ working_dir_default: &working_dir_default

docker_default: &docker_default
docker:
- image: pikaorg/pika-ci-base:7
- image: pikaorg/pika-ci-base:8

defaults: &defaults
<<: *working_dir_default
Expand Down
2 changes: 1 addition & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ status = [
"jenkins/cscs/clang-11-debug",
"jenkins/cscs/clang-12-debug",
"jenkins/cscs/clang-13-debug",
"jenkins/cscs/clang-14-debug",
"jenkins/cscs/clang-14-cuda-debug",
"jenkins/cscs/gcc-9-debug",
"jenkins/cscs/gcc-10-apex-debug",
"jenkins/cscs/gcc-11-debug",
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/linux_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright (c) 2020-2022 ETH Zurich
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

name: Linux CI (Coverage)

on:
push:
branches:
- main
pull_request:

jobs:
build:
name: github/linux/coverage
runs-on: ubuntu-latest
container: pikaorg/pika-ci-base:8

steps:
- uses: actions/checkout@v2
- name: Configure
shell: bash
run: |
cmake \
. \
-Bbuild \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DPIKA_WITH_UNITY_BUILD=ON \
-DPIKA_WITH_PRECOMPILED_HEADERS=ON \
-DPIKA_WITH_MALLOC=system \
-DPIKA_WITH_EXAMPLES=ON \
-DPIKA_WITH_TESTS=ON \
-DPIKA_WITH_TESTS_HEADERS=OFF \
-DPIKA_WITH_TESTS_MAX_THREADS=2 \
-DPIKA_WITH_PARALLEL_TESTS_BIND_NONE=ON
- name: Build
shell: bash
run: |
cmake --build build --target tests
- name: Test
shell: bash
working-directory: build
continue-on-error: true
run: |
ctest -j2 --timeout 120 --output-on-failure
- name: Upload coverage report
shell: bash
working-directory: build
run: |
grcov . \
--source-dir .. \
--output-path lcov.info \
--output-type lcov \
--llvm \
--ignore-not-existing
bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
--project-token ${{ secrets.CODACY_PIKA_PROJECT_TOKEN }} \
--language CPP \
--coverage-reports lcov.info
2 changes: 1 addition & 1 deletion .github/workflows/linux_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
build:
name: github/linux/debug/fast
runs-on: ubuntu-latest
container: pikaorg/pika-ci-base:7
container: pikaorg/pika-ci-base:8

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_release_fetchcontent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
build:
name: github/linux/fetchcontent/fast
runs-on: ubuntu-latest
container: pikaorg/pika-ci-base:7
container: pikaorg/pika-ci-base:8

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
build:
name: github/linux/sanitizers/fast
runs-on: ubuntu-latest
container: pikaorg/pika-ci-base:7
container: pikaorg/pika-ci-base:8

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_tracy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
build:
name: github/linux/tracy/fast
runs-on: ubuntu-latest
container: pikaorg/pika-ci-base:7
container: pikaorg/pika-ci-base:8

steps:
- name: Check out Tracy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,6 @@ jobs:
ctest \
-j3 \
--output-on-failure \
--timeout 120 \
--timeout 300 \
--tests-regex tests.unit.modules.algorithms.container_algorithms \
--exclude-regex tests.unit.modules.algorithms.container_algorithms.inplace_merge_range
2 changes: 1 addition & 1 deletion .jenkins/cscs/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pipeline {
axes {
axis {
name 'configuration_name'
values 'gcc-12', 'gcc-11', 'gcc-10-apex', 'gcc-9', 'gcc-cuda', 'clang-14', 'clang-13', 'clang-12', 'clang-11', 'cce-cuda'
values 'gcc-12', 'gcc-11', 'gcc-10-apex', 'gcc-9', 'gcc-cuda', 'clang-14-cuda', 'clang-13', 'clang-12', 'clang-11', 'cce-cuda'
}
axis {
name 'build_type'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

cxx_std="20"
clang_version="14.0.2"
clang_version="14.0.6"
boost_version="1.79.0"
hwloc_version="2.7.0"
cuda_version="11.5.0"
spack_compiler="clang@${clang_version}"
spack_arch="cray-cnl7-broadwell"
spack_arch="cray-cnl7-haswell"

spack_spec="pika@main arch=${spack_arch} %${spack_compiler} malloc=system cxxstd=${cxx_std} ^boost@${boost_version} ^hwloc@${hwloc_version}"
spack_spec="pika@main arch=${spack_arch} %${spack_compiler} +cuda malloc=system cxxstd=${cxx_std} ^boost@${boost_version} ^cuda@${cuda_version} +allow-unsupported-compilers ^hwloc@${hwloc_version}"

configure_extra_options+=" -DPIKA_WITH_CXX_STANDARD=${cxx_std}"
configure_extra_options+=" -DPIKA_WITH_MALLOC=system"
configure_extra_options+=" -DPIKA_WITH_SPINLOCK_DEADLOCK_DETECTION=ON"
configure_extra_options+=" -DPIKA_WITH_P2300_REFERENCE_IMPLEMENTATION=ON"
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
|github_actions_linux_sanitizers_status|
|github_actions_macos_debug_status|
|codacy|
|codacy_coverage|

====
pika
Expand Down Expand Up @@ -147,3 +148,7 @@ Pick your favourite meaning from the following:
.. |codacy| image:: https://api.codacy.com/project/badge/Grade/e03f57f1c4cd40e7b514e552a723c125
:target: https://www.codacy.com/gh/pika-org/pika
:alt: Codacy

.. |codacy_coverage| image:: https://api.codacy.com/project/badge/Coverage/e03f57f1c4cd40e7b514e552a723c125
:target: https://www.codacy.com/gh/pika-org/pika
:alt: Codacy coverage
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ void test_for_each_sender(ExPolicy&& p, IteratorTag)
auto rng = pika::util::make_iterator_range(
iterator(std::begin(c)), iterator(std::end(c)));
auto f = [](std::size_t& v) { v = 42; };
auto result = ex::just(rng, f) |
pika::ranges::for_each(std::forward<ExPolicy>(p)) | tt::sync_wait();
auto result = tt::sync_wait(
ex::just(rng, f) | pika::ranges::for_each(std::forward<ExPolicy>(p)));
PIKA_TEST(result == iterator(std::end(c)));

// verify values
Expand Down Expand Up @@ -380,8 +380,8 @@ void test_for_each_exception_sender(ExPolicy p, IteratorTag)
bool caught_exception = false;
try
{
ex::just(rng, f) | pika::ranges::for_each(std::forward<ExPolicy>(p)) |
tt::sync_wait();
tt::sync_wait(ex::just(rng, f) |
pika::ranges::for_each(std::forward<ExPolicy>(p)));

PIKA_TEST(false);
}
Expand Down Expand Up @@ -417,8 +417,8 @@ void test_for_each_bad_alloc_sender(ExPolicy p, IteratorTag)
bool caught_exception = false;
try
{
ex::just(rng, f) | pika::ranges::for_each(std::forward<ExPolicy>(p)) |
tt::sync_wait();
tt::sync_wait(ex::just(rng, f) |
pika::ranges::for_each(std::forward<ExPolicy>(p)));

PIKA_TEST(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ namespace pika::cuda::experimental {
cuda_scheduler scheduler;
PIKA_NO_UNIQUE_ADDRESS std::decay_t<Receiver> receiver;

template <typename Receiver_>
operation_state(cuda_scheduler scheduler, Receiver_&& receiver)
: scheduler(PIKA_MOVE(scheduler))
, receiver(PIKA_FORWARD(Receiver_, receiver))
{
}
operation_state(operation_state&&) = delete;
operation_state(operation_state const&) = delete;
operation_state& operator=(operation_state&&) = delete;
Expand Down Expand Up @@ -148,7 +154,7 @@ namespace pika::cuda::experimental {
friend cuda_scheduler tag_invoke(
pika::execution::experimental::get_completion_scheduler_t<
pika::execution::experimental::set_value_t>,
cuda_scheduler_sender const& s)
cuda_scheduler_sender const& s) noexcept
{
return s.scheduler;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <pika/execution_base/operation_state.hpp>
#include <pika/execution_base/receiver.hpp>
#include <pika/execution_base/sender.hpp>
#include <pika/iterator_support/range.hpp>

#include <type_traits>

Expand Down
Loading

0 comments on commit ea48252

Please sign in to comment.