From 1148cc404e1903dfa5e871969422ed0954f3c903 Mon Sep 17 00:00:00 2001 From: kadimitra Date: Tue, 17 Jan 2023 15:20:50 +0100 Subject: [PATCH 01/63] Add list of new namespaces for new release --- docs/sphinx/releases.rst | 12 +++++++ docs/sphinx/releases/new_namespaces_1_9_0.rst | 36 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 docs/sphinx/releases/new_namespaces_1_9_0.rst diff --git a/docs/sphinx/releases.rst b/docs/sphinx/releases.rst index 8162d2b96a41..1de9f8930e91 100644 --- a/docs/sphinx/releases.rst +++ b/docs/sphinx/releases.rst @@ -11,6 +11,9 @@ Releases ======== +List of releases +================ + .. toctree:: :maxdepth: 1 @@ -41,3 +44,12 @@ Releases releases/whats_new_0_8_1 releases/whats_new_0_8_0 releases/whats_new_0_7_0 + + +Namespace changes +================= + +.. toctree:: + :maxdepth: 1 + + releases/new_namespaces_1_9_0 diff --git a/docs/sphinx/releases/new_namespaces_1_9_0.rst b/docs/sphinx/releases/new_namespaces_1_9_0.rst new file mode 100644 index 000000000000..2b5d29b9f277 --- /dev/null +++ b/docs/sphinx/releases/new_namespaces_1_9_0.rst @@ -0,0 +1,36 @@ +.. + Copyright (C) 2023 Dimitra Karatza + + 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) + +.. _new_namespaces_1_9_0: + +============================== +|hpx| V1.9.0 Namespace changes +============================== + +The latest release includes amongst others changes in the namespaces so that |hpx| +facilities correspond to the C++ Standard Library. The old namespaces are +deprecated. Below is a comprehensive list of the namespace changes. + +.. table:: Namespace changes in V1.9.0 + + =========================================================== ============================================================== + Old namespace New namespace + =========================================================== ============================================================== + :cpp:func:`hpx::util::mem_fn` :cpp:func:`hpx::mem_fn` + :cpp:func:`hpx::util::invoke` :cpp:func:`hpx::invoke` + :cpp:func:`hpx::util::invoke_r` :cpp:func:`hpx::invoke_r` + :cpp:func:`hpx::util::invoke_fused` :cpp:func:`hpx::invoke_fused` + :cpp:func:`hpx::util::invoke_fused_r` :cpp:func:`hpx::invoke_fused_r` + :cpp:class:`hpx::util::unlock_guard` :cpp:class:`hpx::unlock_guard` + :cpp:func:`hpx::parallel::v1::reduce_by_key` :cpp:func:`hpx::experimental::reduce_by_key` + :cpp:func:`hpx::parallel::v1::sort_by_key` :cpp:func:`hpx::experimental::sort_by_key` + :cpp:class:`hpx::parallel::task_canceled_exception` :cpp:class:`hpx::experimental::task_canceled_exception` + :cpp:class:`hpx::parallel::task_block` :cpp:class:`hpx::experimental::task_block` + :cpp:func:`hpx::parallel::define_task_block` :cpp:func:`hpx::experimental::define_task_block` | + :cpp:func:`hpx::parallel::define_task_block_restore_thread` :cpp:func:`hpx::experimental::define_task_block_restore_thread` + :cpp:class:`hpx::execution::experimental::task_group` :cpp:class:`hpx::experimental::task_group` + =========================================================== ============================================================== From 34d93c730c103314fac95f9be9825c66476e6cd7 Mon Sep 17 00:00:00 2001 From: gonidelis Date: Fri, 13 Jan 2023 21:42:27 -0600 Subject: [PATCH 02/63] Update release notes, people and release number references for 1.9.0 rc1 --- CITATION.cff | 4 +- CMakeLists.txt | 4 +- docs/sphinx/about_hpx/people.rst | 3 +- .../sphinx/contributing/release_procedure.rst | 2 +- docs/sphinx/releases/whats_new_1_9_0.rst | 167 +++++++++++++++++- 5 files changed, 169 insertions(+), 11 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index a8c6caefb68b..ac772cf7b966 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -7,7 +7,7 @@ # Metadata for citation of this software according to the CFF format (https://citation-file-format.github.io/) cff-version: 1.2.0 message: If you use this software, please cite it using these metadata. -title: 'STEllAR-GROUP/hpx: HPX V1.8.1: The C++ Standards Library for Parallelism and +title: 'STEllAR-GROUP/hpx: HPX V1.9.0: The C++ Standards Library for Parallelism and Concurrency' doi: 10.5281/zenodo.5185328 authors: @@ -84,7 +84,7 @@ authors: - given-names: Zahra family-names: Khatami affiliation: Louisiana State University -version: 1.8.1 +version: 1.9.0 date-released: 2022-07-18 repository-code: https://github.com/STEllAR-GROUP/hpx license: BSL-1.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 55123858f25c..75d376d2d072 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,8 +60,8 @@ endif() set(HPX_VERSION_MAJOR 1) set(HPX_VERSION_MINOR 9) set(HPX_VERSION_SUBMINOR 0) -set(HPX_VERSION_DATE 20220805) -set(HPX_VERSION_TAG "-trunk") +set(HPX_VERSION_DATE 20230113) +set(HPX_VERSION_TAG "-rc1") set(HPX_VERSION "${HPX_VERSION_MAJOR}.${HPX_VERSION_MINOR}.${HPX_VERSION_SUBMINOR}" diff --git a/docs/sphinx/about_hpx/people.rst b/docs/sphinx/about_hpx/people.rst index 67a1e821df0c..409620350d7f 100644 --- a/docs/sphinx/about_hpx/people.rst +++ b/docs/sphinx/about_hpx/people.rst @@ -112,8 +112,9 @@ Acknowledgements Thanks also to the following people who contributed directly or indirectly to the project through discussions, pull requests, documentation patches, etc. +* Panos Syskakis for benchmarking and optimizing our parallel algorithms. * Shreyas Atre, for contributing fixes to our implementation of - senders/receivers. + senders/receivers and extending our coroutines integration with senders/receivers. * Alexander Neumann, for contributing fixes to the cmake build system. * Dimitra Karatza, for her work on refactoring the documentation and providing a new user-friendly environment during and after Google Season of Docs 2021. diff --git a/docs/sphinx/contributing/release_procedure.rst b/docs/sphinx/contributing/release_procedure.rst index 32f47aec22c6..1fc56f3aa3fe 100644 --- a/docs/sphinx/contributing/release_procedure.rst +++ b/docs/sphinx/contributing/release_procedure.rst @@ -79,7 +79,7 @@ are completed to avoid confusion. keep them around in case (like Vc for example). #. Update the minimum required versions if necessary (compilers, dependencies, - etc.) in ``building_hpx.rst``. + etc.) in ``prerequisites.rst``. #. Verify that the Jenkins setups for the release branch on Rostam and Piz Daint are running and do not display any errors. diff --git a/docs/sphinx/releases/whats_new_1_9_0.rst b/docs/sphinx/releases/whats_new_1_9_0.rst index 515ff63a3421..7cdad871b6e8 100644 --- a/docs/sphinx/releases/whats_new_1_9_0.rst +++ b/docs/sphinx/releases/whats_new_1_9_0.rst @@ -13,19 +13,176 @@ General changes =============== - +- LCI parcelport was optimized. +- HPX namespaces collapsed under `hpx::*`. `hpx::parallel` and `hpx::util` are now just `hpx`. +- Codebase was modernized. +- Additional facilities on senders/receivers (P2300) integration were added. +- Further improvement were made on the documentation. Breaking changes ================ -- Stopped supporting Clang V8, the minimal version supported is now Clang V10 -- Stopped supporting gcc V8, the minimal version supported is now gcc V9 +- Stopped supporting Clang V8, the minimal version supported is now Clang V10. +- Stopped supporting gcc V8, the minimal version supported is now gcc V9. - Stopped supporting Visual Studio 2015, the minimal version supported is - now Visual Studion 2019 + now Visual Studion 2019. -Closed issues +Closed issues ============= +* :hpx-issue:`6108` - cxx17_aligned_new.cpp on msvc fails due to wrong pragma directive +* :hpx-issue:`6045` - Can't call nullary callables wrapped with `hpx::unwrapping` +* :hpx-issue:`6008` - Missing `constexpr` default constructor for `hpx::mutex` +* :hpx-issue:`5999` - Add HPX Conda package to conda-forge +* :hpx-issue:`5998` - Serializing multiple arguments when applying distributed action results in segfault +* :hpx-issue:`5908` - Windows: duplicated symbols in static builds +* :hpx-issue:`5802` - Lost status is_ready from future +* :hpx-issue:`5767` - Performance drop on Piz Daint +* :hpx-issue:`5752` - Implement stride_view from P1899 (experimental) +* :hpx-issue:`5744` - HPX_WITH_FETCH_ASIO not working on Ookami +* :hpx-issue:`5561` - Possible race condition in helper thread / hpx::cout Closed pull requests ==================== + +* :hpx-pr:`6132` - Fixing to_non_par() for parallel simd policies +* :hpx-pr:`6130` - Remove the mutex lock in the critical path of get_partitioner. +* :hpx-pr:`6127` - Working around gccV9 problem that prevent us from storing enum classes in bit fields +* :hpx-pr:`6126` - Deprecate hpx::parallel::task_block in favor of hpx::experimental::ta… +* :hpx-pr:`6125` - Making sure sync_wait compiles when used with an lvalue sender involving bulk +* :hpx-pr:`6124` - Fixing use of any_sender in combination with when_all +* :hpx-pr:`6123` - Fixed issues found by PVS-Studio +* :hpx-pr:`6121` - Modernize modules of level 21, 22 +* :hpx-pr:`6120` - Use index_queue for parallel executors bulk_async_execute +* :hpx-pr:`6119` - Update CMakeLists.txt +* :hpx-pr:`6118` - Modernize modules from level 17, 18, 19, and 20 +* :hpx-pr:`6117` - Initialize buffer_allocate_time_ to 0 +* :hpx-pr:`6116` - Add new command line argument --hpx:loopback_network +* :hpx-pr:`6115` - Modernize modules of levels 14, 15, and 16 +* :hpx-pr:`6114` - Enhance the formatting of the documentation +* :hpx-pr:`6113` - Modernize modules in module level 11, 12, and 13 +* :hpx-pr:`6112` - Modernize modules from levels 9 and 10 +* :hpx-pr:`6111` - Modernize all modules from module level 8 +* :hpx-pr:`6110` - Use pragma error directive to report warnings as errors on msvc +* :hpx-pr:`6109` - Modernize serialization module +* :hpx-pr:`6107` - Modernize error module +* :hpx-pr:`6106` - Modernizing modules of levels 0 to 5 +* :hpx-pr:`6104` - Adding parameters API: measure_iteration +* :hpx-pr:`6103` - Document `task_group` and include in Public API +* :hpx-pr:`6102` - Prevent warnings generated by clang-cl +* :hpx-pr:`6101` - Using more fold expressions +* :hpx-pr:`6100` - Deprecate `hpx::parallel::reduce_by_key` in favor of `hpx::experimental::reduce_by_key` +* :hpx-pr:`6098` - Forking Boost.Lockfree +* :hpx-pr:`6096` - Forking Boost.Tokenizer +* :hpx-pr:`6095` - Replacing facilities from Boost.Range +* :hpx-pr:`6094` - Removing object_semaphore +* :hpx-pr:`6093` - Replace boost::string_ref with std::string_view +* :hpx-pr:`6092` - Use C++17 static_assert where possible +* :hpx-pr:`6091` - Replace artificial sequencing with fold expressions +* :hpx-pr:`6090` - Fixing use of get_chunk_size customization point +* :hpx-pr:`6088` - Add/fix Public API documentation +* :hpx-pr:`6086` - Deprecate `hpx::util::unlock_guard` in favor of `hpx::unlock_guard` +* :hpx-pr:`6084` - Renaming hpx::apply and friends to hpx::post +* :hpx-pr:`6083` - Using if constexpr instead of tag-dispatching, where possible +* :hpx-pr:`6082` - Replace util::always_void_t with std::void_t +* :hpx-pr:`6081` - Update github actions to avoid warnings +* :hpx-pr:`6080` - Disable some tests that fail on LCI +* :hpx-pr:`6079` - Adding more natvis files, correct existing +* :hpx-pr:`6078` - Changing target name of memory_counters component +* :hpx-pr:`6077` - Making default constructor of hpx::mutex constexpr +* :hpx-pr:`6076` - Cleaning up functionality that was deprecated in V1.7 +* :hpx-pr:`6075` - Remove conditional code for gcc V7 and below +* :hpx-pr:`6074` - Fixing compilation issues on gcc V8 +* :hpx-pr:`6073` - Fixing PAPI counter component compilation +* :hpx-pr:`6072` - Adding ex::when_all_vector +* :hpx-pr:`6071` - Making get_forward_progress_guarantee_t specializations constexpr +* :hpx-pr:`6070` - Implement P2690 for our algorithms +* :hpx-pr:`6069` - Do not check for cancellation during each iteration but only once per partition +* :hpx-pr:`6068` - Prevent using task and non_task as a CPO +* :hpx-pr:`6067` - Deprecated hpx::util::mem_fn in favor of hpx::mem_fn +* :hpx-pr:`6066` - Create codeql.yml +* :hpx-pr:`6064` - Adapting adjacent_difference for S/R execution +* :hpx-pr:`6063` - Modernize iterator_support module +* :hpx-pr:`6062` - Make sure wrapping executor does not go out of scope prematurely +* :hpx-pr:`6061` - Minor fix in small_vector (from upstream) +* :hpx-pr:`6060` - Allow to disable registering signal handlers +* :hpx-pr:`6059` - [P2300] Fix: declval cannot be ODR used +* :hpx-pr:`6058` - Avoid ambiguity for hpx::get used with std::variant +* :hpx-pr:`6056` - Fix coroutine test for clang +* :hpx-pr:`6055` - Patches needed to be able to build HPX 1.8.1 on various platforms +* :hpx-pr:`6054` - Use MSVC specific attribute [[msvc::no_unique_address]] +* :hpx-pr:`6052` - Deprecated hpx::util::invoke_fused in favor of hpx::invoke_fused +* :hpx-pr:`6051` - Add non-contiguous index queue and use it in thread_pool_bulk_scheduler +* :hpx-pr:`6049` - Crosscompile arm sve +* :hpx-pr:`6048` - Deprecated hpx::util::invoke in favor of hpx::invoke +* :hpx-pr:`6047` - Separating binary_semaphore into its own file +* :hpx-pr:`6046` - Support using unwrapping with nullary function objects +* :hpx-pr:`6044` - Generalize the use of then() and dataflow +* :hpx-pr:`6043` - Clean up scan_partitioner +* :hpx-pr:`6042` - Modernize dataflow API +* :hpx-pr:`6041` - docs: document semaphores +* :hpx-pr:`6040` - Add/Fix documentation of Public API page +* :hpx-pr:`6039` - remove MPI dependency when only using LCI parcelport +* :hpx-pr:`6038` - Clean up command line handling +* :hpx-pr:`6037` - Avoid performing parcel related background work if networking is disabled +* :hpx-pr:`6036` - Support new datapar backend : SVE +* :hpx-pr:`6035` - Simplify datapar replace copy if +* :hpx-pr:`6034` - Add/Fix documentation of Public API +* :hpx-pr:`6033` - Support for data-parallelism for replace, replace_if, replace_copy, replace_copy_if algorithms +* :hpx-pr:`6032` - Add documentation in public API +* :hpx-pr:`6031` - Expose available cache sizes from topology object +* :hpx-pr:`6030` - Adding parcelport initialization hook for resource partitioner operation +* :hpx-pr:`6029` - Simplify startup code +* :hpx-pr:`6027` - Add/Fix documentation in Public API page +* :hpx-pr:`6026` - add option hpx:force_ipv4 to force resolving hostnames to ipv4 adresses +* :hpx-pr:`6025` - build(docs): remove leftover sections +* :hpx-pr:`6023` - Minor fixes on "How to build on Windows" +* :hpx-pr:`6022` - build(doxy): don't extract private members +* :hpx-pr:`6021` - Adding pu_mask to thread_pool_bulk_scheduler +* :hpx-pr:`6020` - docs: add cppref NamedRequirements support +* :hpx-pr:`6017` - loop and transform_loop unseq adaptation +* :hpx-pr:`6016` - Config and structural updates to support unseq implementation +* :hpx-pr:`6015` - Integrating sync_wait & sync_wait_with_variant +* :hpx-pr:`6012` - docs: add missing links to public api +* :hpx-pr:`6009` - Fixing sender&receiver integration with for_each and for_loop +* :hpx-pr:`6007` - docs: add docs for mutex.hpp +* :hpx-pr:`6006` - Relax future::is_ready where possible +* :hpx-pr:`6005` - reshuffle header tests to different instances +* :hpx-pr:`6004` - Add documentation Public API +* :hpx-pr:`6003` - Always exporting get_component_name implementations +* :hpx-pr:`6002` - Making sure that default constructble arguments are properly constructed during deserialization +* :hpx-pr:`5996` - Add back explicit template parameters to lock_guards for nvcc +* :hpx-pr:`5994` - Fix CTRL+C on windows +* :hpx-pr:`5993` - Using EVE requires C++20 +* :hpx-pr:`5992` - This properly terminates an application on Ctrl-C on Windows +* :hpx-pr:`5991` - Support IPV6 on command line for explicit network initialization +* :hpx-pr:`5990` - P2300 enhancements +* :hpx-pr:`5989` - Fix missing documentation in Public API page +* :hpx-pr:`5987` - Attempting to fix timed executor API +* :hpx-pr:`5986` - Fix warnings when building docs +* :hpx-pr:`5985` - Re-add deprecated tag_policy_tag et.al. types that were removed in V1.8.1 +* :hpx-pr:`5981` - docs: add docs for condition_variable.hpp +* :hpx-pr:`5980` - More work on execution::read +* :hpx-pr:`5979` - Unsupport clang-v8 and clang-v9, switch LSU clang-v13 to C++17 +* :hpx-pr:`5977` - fix: Compilation errors for -std=c++17 builders +* :hpx-pr:`5975` - docs: fix & improve parallel algorithms documentation 5 +* :hpx-pr:`5974` - [P2300] Adapt get completion signatures for awaitable senders +* :hpx-pr:`5973` - defaults boost.context on riscv64 +* :hpx-pr:`5972` - Fix documentation for container algorithms +* :hpx-pr:`5971` - added logic to detect riscv compiler configured for 64 bit target +* :hpx-pr:`5968` - adds risc-v 64 bit support +* :hpx-pr:`5967` - Adding missing pieces to sync_wait, adding run_loop +* :hpx-pr:`5966` - docs: fix & improve parallel algorithms documentation 4 +* :hpx-pr:`5965` - Fixing inspect problems, adding missing header file +* :hpx-pr:`5962` - Changes in html page of documentation +* :hpx-pr:`5961` - Prevent stalling during shutdown when running hello_world_distributed +* :hpx-pr:`5956` - Adding sync_wait_with_variant +* :hpx-pr:`5955` - Fix documentation for container algorithms +* :hpx-pr:`5952` - docs: fix & improve parallel algorithms documentation 3 +* :hpx-pr:`5950` - Change executors to directly implement the executor CPOs +* :hpx-pr:`5949` - Converting async combinators into CPOs +* :hpx-pr:`5948` - Adding support for pure sender/receiver based executors to parallel algorithms +* :hpx-pr:`5945` - [P2300] Added fundamental coroutine_traits for S/R +* :hpx-pr:`5883` - Optimization on LCI parcelport: uses LCI_putva +* :hpx-pr:`5872` - Block fork join executor +* :hpx-pr:`5855` - Adding performance test Jenkins builder at LSU From 83009f195719410fdef113840f013120d351404a Mon Sep 17 00:00:00 2001 From: gonidelis Date: Wed, 1 Feb 2023 16:53:17 -0600 Subject: [PATCH 03/63] Add extended release notes for V1.9.0 --- docs/sphinx/releases/whats_new_1_9_0.rst | 51 ++++++++++++++++++++---- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/docs/sphinx/releases/whats_new_1_9_0.rst b/docs/sphinx/releases/whats_new_1_9_0.rst index 7cdad871b6e8..84fee13734ac 100644 --- a/docs/sphinx/releases/whats_new_1_9_0.rst +++ b/docs/sphinx/releases/whats_new_1_9_0.rst @@ -13,11 +13,31 @@ General changes =============== -- LCI parcelport was optimized. -- HPX namespaces collapsed under `hpx::*`. `hpx::parallel` and `hpx::util` are now just `hpx`. -- Codebase was modernized. -- Additional facilities on senders/receivers (P2300) integration were added. -- Further improvement were made on the documentation. +- Added RISC-V 64bit support. HPX is now compatible with RISC-V architectures which have revolutionized the HPC world. +- LCI parcelport has been optimized to transfer parcels with fewer messages and use the HPX resource partitioner for + its progress thread allocation. It should generally provide better performance than before. It also removes its + dependency on the MPI library. +- HPX dependency on Boost was further relaxed by replacing headers from Boost.Range, Boost.Tokenizer and Boost.Lockfree. +- Improvements took place on our parallel algorithms implementation. +- Our Senders/Receivers (P2300) integration was extended: + + - Coroutines were integrated with senders/receivers. ``get_completion_signatures`` now works with awaitable senders. + - ``with_awaitable_senders`` allows the passed senders to retrieve the value i.e. senders are transparently + awaitable from within a coroutine. + - ``when_all_vector`` was added. + +- ``sync_wait`` and ``sync_wait_with_variant`` sender consumers were added. The user can now initiate the execution of + their asynchronous pipeline by blocking the current thread that executes the main() function until the result + is retrieved. +- The combinators for futures (a.k.a. async_combinators) ``when_*``, ``wait_*``, ``wait_*_nothrow`` were turned into CPOs + allowing for end-user customization. For more information on the async_combinators refer to the documentation, + https://hpx-docs.stellar-group.org/latest/html/libs/core/async_combinators/docs/index.html?highlight=combinators. +- The new datapar backend SVE allows simd and par_simd execution policies to exploit dataparalleism in the processors that + have SVE vector registers like A64FX and Neoverse V1. +- The documentation for parallel algorithms, container algorithms was further improved. The Public API page was vastly enriched. +- Copy button shortkey was added at the top-right of code-blocks. +- Pragma directive that reports warnings as errors on MSVC was fixed. +- Command line argument ``--hpx:loopback_network`` was added to facilitie debugging with networks. Breaking changes ================ @@ -25,7 +45,25 @@ Breaking changes - Stopped supporting Clang V8, the minimal version supported is now Clang V10. - Stopped supporting gcc V8, the minimal version supported is now gcc V9. - Stopped supporting Visual Studio 2015, the minimal version supported is - now Visual Studion 2019. + now Visual Studio 2019. +- ``tag_policy_tag`` et.al. were re-added after HPX V1.8.1 depracation. +- ``get_chunk_size`` and ``processing_units_count`` API is now expecting the time for one iteration as an argument. +- ``hpx::parallel::reduce_by_key`` is deprecated in favor of ``hpx::experimental::reduce_by_key``. +- ``hpx::parallel::task_block`` is deprecated in favor of ``hpx::experimental::task_block``. +- ``hpx::util::mem_fn`` is deprecated in favor of ``hpx::mem_fn``. +- ``hpx::util::invoke`` is deprecated in favor of ``hpx::invoke``. +- ``hpx::util::invoke_r`` is deprecated in favor of ``hpx::invoke_r``. +- ``hpx::util::invoke_fused`` is deprecated in favor of ``hpx::invoke_fused``. +- ``hpx::util::invoke_fused_r`` is deprecated in favor of ``hpx::invoke_fused_r``. +- ``hpx::util::unlock_guard`` is deprecated in favor of ``hpx::unlock_guard``. +- ``hpx::parallel::v1::reduce_by_key`` is deprecated in favor of ``hpx::experimental::reduce_by_key``. +- ``hpx::parallel::v1::sort_by_key`` is deprecated in favor of ``hpx::experimental::sort_by_key``. +- ``hpx::parallel::task_canceled_exception`` is deprecated in favor of ``hpx::experimental::task_canceled_exception``. +- ``hpx::parallel::task_block`` is deprecated in favor of ``hpx::experimental::task_block``. +- ``hpx::parallel::define_task_block`` is deprecated in favor of ``hpx::experimental::define_task_block``. +- ``hpx::parallel::define_task_block_restore_thread`` is deprecated in favor of ``hpx::experimental::define_task_block_restore_thread``. +- ``hpx::execution::experimental::task_group`` is deprecated in favor of ``hpx::experimental::task_group``. + Closed issues ============= @@ -176,7 +214,6 @@ Closed pull requests * :hpx-pr:`5965` - Fixing inspect problems, adding missing header file * :hpx-pr:`5962` - Changes in html page of documentation * :hpx-pr:`5961` - Prevent stalling during shutdown when running hello_world_distributed -* :hpx-pr:`5956` - Adding sync_wait_with_variant * :hpx-pr:`5955` - Fix documentation for container algorithms * :hpx-pr:`5952` - docs: fix & improve parallel algorithms documentation 3 * :hpx-pr:`5950` - Change executors to directly implement the executor CPOs From ddec604f3af790a3845485e088c83e67c4016773 Mon Sep 17 00:00:00 2001 From: gonidelis Date: Wed, 22 Feb 2023 19:28:50 -0600 Subject: [PATCH 04/63] Add 'v' prefix before release tagging to conform to GitHub's default convention --- docs/sphinx/releases/whats_new_1_9_0.rst | 41 +++++++++++++++++++++--- tools/roll_release.sh | 2 +- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/docs/sphinx/releases/whats_new_1_9_0.rst b/docs/sphinx/releases/whats_new_1_9_0.rst index 84fee13734ac..29949e414712 100644 --- a/docs/sphinx/releases/whats_new_1_9_0.rst +++ b/docs/sphinx/releases/whats_new_1_9_0.rst @@ -68,11 +68,13 @@ Breaking changes Closed issues ============= +* :hpx-issue:`6162` - Current master does not compile on ROSTAM * :hpx-issue:`6108` - cxx17_aligned_new.cpp on msvc fails due to wrong pragma directive * :hpx-issue:`6045` - Can't call nullary callables wrapped with `hpx::unwrapping` * :hpx-issue:`6008` - Missing `constexpr` default constructor for `hpx::mutex` * :hpx-issue:`5999` - Add HPX Conda package to conda-forge * :hpx-issue:`5998` - Serializing multiple arguments when applying distributed action results in segfault +* :hpx-issue:`5958` - HPX 1.8.0 and Blaze issues * :hpx-issue:`5908` - Windows: duplicated symbols in static builds * :hpx-issue:`5802` - Lost status is_ready from future * :hpx-issue:`5767` - Performance drop on Piz Daint @@ -83,8 +85,36 @@ Closed issues Closed pull requests ==================== +* :hpx-pr:`6179` - Taking predicates for algorithms by value +* :hpx-pr:`6178` - Changes needed to make chapel_hpx examples work +* :hpx-pr:`6176` - Fixing warnings that were generated by PVS Studio +* :hpx-pr:`6174` - Replace boost::integer::gcd with std::gcd +* :hpx-pr:`6172` - [Docs] Fix example of how to run single/specific test(s) +* :hpx-pr:`6170` - Adding missing fallback for processing_units_count customization point +* :hpx-pr:`6169` - LCI parcelport: bypass the parcel queue and connection cache. +* :hpx-pr:`6167` - Add create_local_communicator API function +* :hpx-pr:`6166` - Add missing header for std::intmax_t +* :hpx-pr:`6165` - Attempt to work around MSVC problem +* :hpx-pr:`6161` - Update EVE integration +* :hpx-pr:`6160` - More cleanup for module levels 0 to 10 +* :hpx-pr:`6159` - Fix minor spelling mistake in generate_issue_pr_list.sh +* :hpx-pr:`6157` - Improve index_queue_spawning +* :hpx-pr:`6154` - Avoid performing late command line handling twice in distributed runtime +* :hpx-pr:`6152` - The -rd and -mr options didn't work, and they should have been --rd and --mr +* :hpx-pr:`6151` - Refactoring the Manual page in documentation +* :hpx-pr:`6148` - Investigate the failure of the LCI parcelport. +* :hpx-pr:`6147` - Make posix co-routine stacks non-executable +* :hpx-pr:`6146` - Avoid ambiguities wrt tag_invoke +* :hpx-pr:`6144` - General improvements to scheduling and related fixes +* :hpx-pr:`6140` - Fixing background scheduler to properly exit in the end +* :hpx-pr:`6137` - Adding example of a simple master/slave distributed application +* :hpx-pr:`6136` - Deprecate `execution::experimental::task_group` in favor of `experimental::task_group` +* :hpx-pr:`6135` - Fixing warnings reported by MSVC analysis +* :hpx-pr:`6134` - Adding notification function for parcelports to be called after early parcel handling * :hpx-pr:`6132` - Fixing to_non_par() for parallel simd policies +* :hpx-pr:`6131` - modernize modules from level 25 * :hpx-pr:`6130` - Remove the mutex lock in the critical path of get_partitioner. +* :hpx-pr:`6129` - Modernize module from levels 22, 23 * :hpx-pr:`6127` - Working around gccV9 problem that prevent us from storing enum classes in bit fields * :hpx-pr:`6126` - Deprecate hpx::parallel::task_block in favor of hpx::experimental::ta… * :hpx-pr:`6125` - Making sure sync_wait compiles when used with an lvalue sender involving bulk @@ -97,7 +127,7 @@ Closed pull requests * :hpx-pr:`6117` - Initialize buffer_allocate_time_ to 0 * :hpx-pr:`6116` - Add new command line argument --hpx:loopback_network * :hpx-pr:`6115` - Modernize modules of levels 14, 15, and 16 -* :hpx-pr:`6114` - Enhance the formatting of the documentation +* :hpx-pr:`6114` - Enhance the formatting of the documentation * :hpx-pr:`6113` - Modernize modules in module level 11, 12, and 13 * :hpx-pr:`6112` - Modernize modules from levels 9 and 10 * :hpx-pr:`6111` - Modernize all modules from module level 8 @@ -105,6 +135,7 @@ Closed pull requests * :hpx-pr:`6109` - Modernize serialization module * :hpx-pr:`6107` - Modernize error module * :hpx-pr:`6106` - Modernizing modules of levels 0 to 5 +* :hpx-pr:`6105` - Optimizations on LCI parcelport: merge small messages; remove sender mutex lock. * :hpx-pr:`6104` - Adding parameters API: measure_iteration * :hpx-pr:`6103` - Document `task_group` and include in Public API * :hpx-pr:`6102` - Prevent warnings generated by clang-cl @@ -146,6 +177,7 @@ Closed pull requests * :hpx-pr:`6060` - Allow to disable registering signal handlers * :hpx-pr:`6059` - [P2300] Fix: declval cannot be ODR used * :hpx-pr:`6058` - Avoid ambiguity for hpx::get used with std::variant +* :hpx-pr:`6057` - Create a dedicated thread pool to run LCI_progress. * :hpx-pr:`6056` - Fix coroutine test for clang * :hpx-pr:`6055` - Patches needed to be able to build HPX 1.8.1 on various platforms * :hpx-pr:`6054` - Use MSVC specific attribute [[msvc::no_unique_address]] @@ -172,12 +204,13 @@ Closed pull requests * :hpx-pr:`6030` - Adding parcelport initialization hook for resource partitioner operation * :hpx-pr:`6029` - Simplify startup code * :hpx-pr:`6027` - Add/Fix documentation in Public API page -* :hpx-pr:`6026` - add option hpx:force_ipv4 to force resolving hostnames to ipv4 adresses +* :hpx-pr:`6026` - add option hpx:force_ipv4 to force resolving hostnames to ipv4 addresses * :hpx-pr:`6025` - build(docs): remove leftover sections * :hpx-pr:`6023` - Minor fixes on "How to build on Windows" * :hpx-pr:`6022` - build(doxy): don't extract private members * :hpx-pr:`6021` - Adding pu_mask to thread_pool_bulk_scheduler * :hpx-pr:`6020` - docs: add cppref NamedRequirements support +* :hpx-pr:`6018` - Unseq adaptation for for_each, transform, reduce, transform_reduce, etc. * :hpx-pr:`6017` - loop and transform_loop unseq adaptation * :hpx-pr:`6016` - Config and structural updates to support unseq implementation * :hpx-pr:`6015` - Integrating sync_wait & sync_wait_with_variant @@ -197,11 +230,11 @@ Closed pull requests * :hpx-pr:`5990` - P2300 enhancements * :hpx-pr:`5989` - Fix missing documentation in Public API page * :hpx-pr:`5987` - Attempting to fix timed executor API -* :hpx-pr:`5986` - Fix warnings when building docs +* :hpx-pr:`5986` - Fix warnings when building docs * :hpx-pr:`5985` - Re-add deprecated tag_policy_tag et.al. types that were removed in V1.8.1 * :hpx-pr:`5981` - docs: add docs for condition_variable.hpp * :hpx-pr:`5980` - More work on execution::read -* :hpx-pr:`5979` - Unsupport clang-v8 and clang-v9, switch LSU clang-v13 to C++17 +* :hpx-pr:`5979` - Unsupported clang-v8 and clang-v9, switch LSU clang-v13 to C++17 * :hpx-pr:`5977` - fix: Compilation errors for -std=c++17 builders * :hpx-pr:`5975` - docs: fix & improve parallel algorithms documentation 5 * :hpx-pr:`5974` - [P2300] Adapt get completion signatures for awaitable senders diff --git a/tools/roll_release.sh b/tools/roll_release.sh index a8faf73796d5..878156e37d36 100755 --- a/tools/roll_release.sh +++ b/tools/roll_release.sh @@ -17,7 +17,7 @@ VERSION_MINOR=$(sed -n 's/set(HPX_VERSION_MINOR \(.*\))/\1/p' CMakeLists.txt) VERSION_SUBMINOR=$(sed -n 's/set(HPX_VERSION_SUBMINOR \(.*\))/\1/p' CMakeLists.txt) VERSION_TAG=$(sed -n 's/set(HPX_VERSION_TAG "\(.*\)")/\1/p' CMakeLists.txt) VERSION_FULL_NOTAG=${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_SUBMINOR} -VERSION_FULL_TAG=${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_SUBMINOR}${VERSION_TAG} +VERSION_FULL_TAG=v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_SUBMINOR}${VERSION_TAG} VERSION_FULL_NOTAG_UNDERSCORE=${VERSION_MAJOR}_${VERSION_MINOR}_${VERSION_SUBMINOR} VERSION_TITLE="HPX V${VERSION_FULL_NOTAG}: The C++ Standards Library for Parallelism and Concurrency" VERSION_RELEASE_NOTES_URL="https://hpx-docs.stellar-group.org/tags/${VERSION_FULL_TAG}/html/releases/whats_new_${VERSION_FULL_NOTAG_UNDERSCORE}.html" From 7476fc8455f1b1feb7159a4076b9e40320b35539 Mon Sep 17 00:00:00 2001 From: STE||AR Group Date: Tue, 28 Mar 2023 03:01:38 -0400 Subject: [PATCH 05/63] Add release candidate 2 --- CMakeLists.txt | 2 +- .../sphinx/contributing/release_procedure.rst | 3 +- docs/sphinx/releases/whats_new_1_9_0.rst | 36 +++++++++++++++++-- libs/core/version/src/version.cpp | 2 +- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75d376d2d072..8372cf6cd280 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ set(HPX_VERSION_MAJOR 1) set(HPX_VERSION_MINOR 9) set(HPX_VERSION_SUBMINOR 0) set(HPX_VERSION_DATE 20230113) -set(HPX_VERSION_TAG "-rc1") +set(HPX_VERSION_TAG "-rc2") set(HPX_VERSION "${HPX_VERSION_MAJOR}.${HPX_VERSION_MINOR}.${HPX_VERSION_SUBMINOR}" diff --git a/docs/sphinx/contributing/release_procedure.rst b/docs/sphinx/contributing/release_procedure.rst index 1fc56f3aa3fe..5fb0773f8b52 100644 --- a/docs/sphinx/contributing/release_procedure.rst +++ b/docs/sphinx/contributing/release_procedure.rst @@ -58,7 +58,8 @@ are completed to avoid confusion. #. Make sure ``HPX_VERSION_MAJOR/MINOR/SUBMINOR`` in ``CMakeLists.txt`` contain the correct values. Change them if needed. -#. Change version references in CITATION.cff. There are two occurrences. +#. Change version references in CITATION.cff. There are two occurrences. Change + year in the copyright file under ``/libs/core/version/src/version.cpp``. #. This step does not apply to patch releases. Remove features which have been deprecated for at least 2 releases. This involves removing build options diff --git a/docs/sphinx/releases/whats_new_1_9_0.rst b/docs/sphinx/releases/whats_new_1_9_0.rst index 29949e414712..4d64b8f3ce15 100644 --- a/docs/sphinx/releases/whats_new_1_9_0.rst +++ b/docs/sphinx/releases/whats_new_1_9_0.rst @@ -38,6 +38,9 @@ General changes - Copy button shortkey was added at the top-right of code-blocks. - Pragma directive that reports warnings as errors on MSVC was fixed. - Command line argument ``--hpx:loopback_network`` was added to facilitie debugging with networks. +- We added an HPX-SYCL integration, allowing users to obtain HPX futures for SYCL events. This effectively enables the + integration of arbitrary asynchronous SYCL operations into the HPX task graph. Bolted on top of this integration, + we further added an HPX-SYCL executor for ease of use. Breaking changes ================ @@ -65,10 +68,16 @@ Breaking changes - ``hpx::execution::experimental::task_group`` is deprecated in favor of ``hpx::experimental::task_group``. -Closed issues +Closed issues ============= +* :hpx-issue:`6203` - Compilation error with `-mcpu=a64fx` on Ookami +* :hpx-issue:`6196` - Incorrect log destination +* :hpx-issue:`6191` - installing HPX +* :hpx-issue:`6184` - Wrong processing_units_count of restricted_thread_pool_executor +* :hpx-issue:`6171` - Release Tag Name Request * :hpx-issue:`6162` - Current master does not compile on ROSTAM +* :hpx-issue:`6156` - hpxcxx does not work if HPX_WITH_PKGCONFIG=OFF * :hpx-issue:`6108` - cxx17_aligned_new.cpp on msvc fails due to wrong pragma directive * :hpx-issue:`6045` - Can't call nullary callables wrapped with `hpx::unwrapping` * :hpx-issue:`6008` - Missing `constexpr` default constructor for `hpx::mutex` @@ -85,6 +94,26 @@ Closed issues Closed pull requests ==================== +* :hpx-pr:`6210` - Fixing MPI parcelport initialization if MPI is initialized outside of HPX +* :hpx-pr:`6209` - Prevent thread stealing during scheduler shutdown +* :hpx-pr:`6208` - Fix the compilation warning in the MPI parcelport with gcc 11.2 +* :hpx-pr:`6207` - Automatically enable Boost.Context when compiling for arm64. +* :hpx-pr:`6206` - Update CMakeLists.txt +* :hpx-pr:`6205` - Do not generate hpxcxx if support for pkgconfig was disabled +* :hpx-pr:`6204` - Use LRT_ instead of LAPP_ logging in barrier implementation +* :hpx-pr:`6202` - Fixing Fedora build errors on Power systems +* :hpx-pr:`6201` - Update the LCI parcelport documents +* :hpx-pr:`6200` - Par link jobs +* :hpx-pr:`6197` - LCI parcelport: add doc, upgrade to v1.7.4, refactor cmake autofetch. +* :hpx-pr:`6195` - Change the default tag of autofetch LCI to v1.7.3. +* :hpx-pr:`6189` - Making sure restricted_thread_pool_executor properly reports used number of cores +* :hpx-pr:`6187` - Enable using for_loop with range generators +* :hpx-pr:`6186` - thread_support/CMakeLists: Fix build issue +* :hpx-pr:`6185` - Fix EVE datapar with cxx_standard less than 20 +* :hpx-pr:`6183` - Update CI integration for EVE +* :hpx-pr:`6182` - Fixing performance regressions +* :hpx-pr:`6181` - LCI parcelport: backlog queue, aggregation, separate devices, and more +* :hpx-pr:`6180` - Fixing use of for_loop with rebound execution policy (using `.with()`) * :hpx-pr:`6179` - Taking predicates for algorithms by value * :hpx-pr:`6178` - Changes needed to make chapel_hpx examples work * :hpx-pr:`6176` - Fixing warnings that were generated by PVS Studio @@ -98,6 +127,7 @@ Closed pull requests * :hpx-pr:`6161` - Update EVE integration * :hpx-pr:`6160` - More cleanup for module levels 0 to 10 * :hpx-pr:`6159` - Fix minor spelling mistake in generate_issue_pr_list.sh +* :hpx-pr:`6158` - Update documentation in `writing single-node applications` page * :hpx-pr:`6157` - Improve index_queue_spawning * :hpx-pr:`6154` - Avoid performing late command line handling twice in distributed runtime * :hpx-pr:`6152` - The -rd and -mr options didn't work, and they should have been --rd and --mr @@ -107,6 +137,7 @@ Closed pull requests * :hpx-pr:`6146` - Avoid ambiguities wrt tag_invoke * :hpx-pr:`6144` - General improvements to scheduling and related fixes * :hpx-pr:`6140` - Fixing background scheduler to properly exit in the end +* :hpx-pr:`6139` - [P2300] execution: Cleanup coroutines integration and improve ADL isolation * :hpx-pr:`6137` - Adding example of a simple master/slave distributed application * :hpx-pr:`6136` - Deprecate `execution::experimental::task_group` in favor of `experimental::task_group` * :hpx-pr:`6135` - Fixing warnings reported by MSVC analysis @@ -127,7 +158,7 @@ Closed pull requests * :hpx-pr:`6117` - Initialize buffer_allocate_time_ to 0 * :hpx-pr:`6116` - Add new command line argument --hpx:loopback_network * :hpx-pr:`6115` - Modernize modules of levels 14, 15, and 16 -* :hpx-pr:`6114` - Enhance the formatting of the documentation +* :hpx-pr:`6114` - Enhance the formatting of the documentation * :hpx-pr:`6113` - Modernize modules in module level 11, 12, and 13 * :hpx-pr:`6112` - Modernize modules from levels 9 and 10 * :hpx-pr:`6111` - Modernize all modules from module level 8 @@ -151,6 +182,7 @@ Closed pull requests * :hpx-pr:`6090` - Fixing use of get_chunk_size customization point * :hpx-pr:`6088` - Add/fix Public API documentation * :hpx-pr:`6086` - Deprecate `hpx::util::unlock_guard` in favor of `hpx::unlock_guard` +* :hpx-pr:`6085` - Add experimental sycl integration/executor * :hpx-pr:`6084` - Renaming hpx::apply and friends to hpx::post * :hpx-pr:`6083` - Using if constexpr instead of tag-dispatching, where possible * :hpx-pr:`6082` - Replace util::always_void_t with std::void_t diff --git a/libs/core/version/src/version.cpp b/libs/core/version/src/version.cpp index 249719adffc6..d86dc1c6bc7d 100644 --- a/libs/core/version/src/version.cpp +++ b/libs/core/version/src/version.cpp @@ -138,7 +138,7 @@ namespace hpx { "(A general purpose parallel C++ runtime system for distributed " "applications\n" "of any scale).\n\n" - "Copyright (c) 2007-2022, The STE||AR Group,\n" + "Copyright (c) 2007-2023, The STE||AR Group,\n" "http://stellar-group.org, email:hpx-users@stellar-group.org\n\n" "Distributed under the Boost Software License, " "Version 1.0. (See accompanying\n" From dbf42fe414a6a4516d0d6dc7fde6f1bba6c01083 Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 2 Apr 2023 15:51:14 +0530 Subject: [PATCH 06/63] added tests for set_difference, updated set_operation.hpp to fix #6198 --- .../algorithms/detail/set_operation.hpp | 24 ++-- .../tests/regressions/set_operations_3442.cpp | 106 ++++++++++-------- 2 files changed, 75 insertions(+), 55 deletions(-) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp index 17ce7810fcab..6847c0ba7f31 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp @@ -74,11 +74,18 @@ namespace hpx::parallel::detail { struct set_chunk_data { - std::size_t start = static_cast(-1); - std::size_t len = static_cast(-1); - std::size_t start_index = static_cast(-1); - std::size_t first1 = static_cast(-1); - std::size_t first2 = static_cast(-1); + static const std::size_t uninit_start = static_cast(-1); + static const std::size_t uninit_len = static_cast(0); + static const std::size_t uninit_start_index = + static_cast(-1); + static const std::size_t uninit_first1 = static_cast(-1); + static const std::size_t uninit_first2 = static_cast(-1); + + std::size_t start = uninit_start; + std::size_t len = uninit_len; + std::size_t start_index = uninit_start_index; + std::size_t first1 = uninit_first1; + std::size_t first2 = uninit_first2; }; /////////////////////////////////////////////////////////////////////////// @@ -246,9 +253,10 @@ namespace hpx::parallel::detail { hpx::execution::par, chunks.get(), cores, [buffer, dest]( set_chunk_data* ch, std::size_t, std::size_t) { - if (ch->start == static_cast(-1) || - ch->start_index == static_cast(-1) || - ch->len == static_cast(-1)) + if (ch->start == set_chunk_data::uninit_start || + ch->start_index == + set_chunk_data::uninit_start_index || + ch->len == set_chunk_data::uninit_len) { return; } diff --git a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp index 565d64b57c18..984cf8d1a904 100644 --- a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp +++ b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp @@ -9,70 +9,82 @@ #include #include +#include +#include +#include #include #include -void set_difference_small_test(int rounds) +// returns random integer in range (rangeMin, rangeMax] +struct RandomIntInRange { - std::vector set_a{1, 2, 3, 4, 5}; - std::vector set_b{1, 2, 4}; - std::vector a_minus_b(2); - - std::vector perfect(2); - std::set_difference(set_a.begin(), set_a.end(), set_b.begin(), set_b.end(), - perfect.begin()); - - while (--rounds) + int rangeMin, rangeMax; + RandomIntInRange(int rangeMin, int rangeMax) + : rangeMin(rangeMin) + , rangeMax(rangeMax){}; + int operator()() { - hpx::set_difference(hpx::execution::par, set_a.begin(), set_a.end(), - set_b.begin(), set_b.end(), a_minus_b.begin()); - HPX_TEST(perfect == a_minus_b); + return (rand() % (rangeMax - rangeMin + 1)) + rangeMin; } -} +}; -void set_difference_medium_test(int rounds) +void set_difference_randomized(int rounds, int maxLen) { - std::vector set_a(50); - std::vector set_b(20); - - std::iota(set_a.begin(), set_a.end(), 1); - std::iota(set_b.begin(), set_b.end(), 2); - - std::vector a_minus_b(50); - - std::vector perfect(50); - std::set_difference(set_a.begin(), set_a.end(), set_b.begin(), set_b.end(), - perfect.begin()); - - while (--rounds) + while (rounds--) { + std::size_t len_a = rand() % maxLen, len_b = rand() % maxLen; + std::vector set_a(len_a), set_b(len_b); + + int rangeMin = 0; + // rangeMax is set to increase probability of common elements + int rangeMax = std::min(len_a, len_b) * 2; + +#ifdef HPX_WITH_CXX17_STD_EXECUTION_POLICES + std::generate(std::execution::par_unseq, set_a.begin(), set_a.end(), + RandomIntInRange(rangeMin, rangeMax)); + std::generate(std::execution::par_unseq, set_b.begin(), set_b.end(), + RandomIntInRange(rangeMin, rangeMax)); +#else + std::generate( + set_a.begin(), set_a.end(), RandomIntInRange(rangeMin, rangeMax)); + std::generate( + set_b.begin(), set_b.end(), RandomIntInRange(rangeMin, rangeMax)); +#endif + std::sort(set_a.begin(), set_a.end()); + std::sort(set_b.begin(), set_b.end()); + + len_a = std::unique(set_a.begin(), set_a.end()) - set_a.begin(); + len_b = std::unique(set_b.begin(), set_b.end()) - set_b.begin(); + + set_a.resize(len_a); + set_b.resize(len_b); + + // rand always gives non negative values, rangeMin >= 0 + std::vector perfect(std::max(len_a, len_b), -1); + std::vector a_minus_b(std::max(len_a, len_b), -1); + + std::set_difference(set_a.begin(), set_a.end(), set_b.begin(), + set_b.end(), perfect.begin()); + hpx::set_difference(hpx::execution::par, set_a.begin(), set_a.end(), set_b.begin(), set_b.end(), a_minus_b.begin()); - HPX_TEST(perfect == a_minus_b); + assert(perfect == a_minus_b); } } -void set_difference_large_test(int rounds) +void set_difference_small_test(int rounds) { - std::vector set_a(5000000); - std::vector set_b(3000000); - - std::iota(set_a.begin(), set_a.end(), 1); - std::fill(set_b.begin(), set_b.begin() + 1000000, 1); - std::iota(set_b.begin() + 1000000, set_b.end(), 2); - - std::vector a_minus_b(5000000); + set_difference_randomized(rounds, 1 << 3); +} - std::vector perfect(5000000); - std::set_difference(set_a.begin(), set_a.end(), set_b.begin(), set_b.end(), - perfect.begin()); +void set_difference_medium_test(int rounds) +{ + set_difference_randomized(rounds, 1 << 10); +} - while (--rounds) - { - hpx::set_difference(hpx::execution::par, set_a.begin(), set_a.end(), - set_b.begin(), set_b.end(), a_minus_b.begin()); - HPX_TEST(perfect == a_minus_b); - } +void set_difference_large_test(int rounds) +{ + set_difference_randomized(rounds, 1 << 20); } void set_difference_test(int rounds) From 7cc227f2e5282fcb90ac015235f1204758487e0c Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 2 Apr 2023 17:02:31 +0530 Subject: [PATCH 07/63] include execution header only if HPX_WITH_CXX17_STD_EXECUTION_POLICES is defined Signed-off-by: Johan511 --- .../algorithms/tests/regressions/set_operations_3442.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp index 984cf8d1a904..04d147603432 100644 --- a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp +++ b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp @@ -10,11 +10,14 @@ #include #include -#include #include #include #include +#ifdef HPX_WITH_CXX17_STD_EXECUTION_POLICES +#include +#endif + // returns random integer in range (rangeMin, rangeMax] struct RandomIntInRange { From 5eab464560d268537e121d01238c182f0875944a Mon Sep 17 00:00:00 2001 From: Johan511 Date: Wed, 5 Apr 2023 19:35:29 +0530 Subject: [PATCH 08/63] fix inspect test failures Signed-off-by: Johan511 --- .../algorithms/tests/regressions/set_operations_3442.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp index 04d147603432..ccebbe08f80b 100644 --- a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp +++ b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,7 @@ void set_difference_randomized(int rounds, int maxLen) int rangeMin = 0; // rangeMax is set to increase probability of common elements - int rangeMax = std::min(len_a, len_b) * 2; + int rangeMax = (std::min)(len_a, len_b) * 2; #ifdef HPX_WITH_CXX17_STD_EXECUTION_POLICES std::generate(std::execution::par_unseq, set_a.begin(), set_a.end(), @@ -63,15 +64,15 @@ void set_difference_randomized(int rounds, int maxLen) set_b.resize(len_b); // rand always gives non negative values, rangeMin >= 0 - std::vector perfect(std::max(len_a, len_b), -1); - std::vector a_minus_b(std::max(len_a, len_b), -1); + std::vector perfect((std::max)(len_a, len_b), -1); + std::vector a_minus_b((std::max)(len_a, len_b), -1); std::set_difference(set_a.begin(), set_a.end(), set_b.begin(), set_b.end(), perfect.begin()); hpx::set_difference(hpx::execution::par, set_a.begin(), set_a.end(), set_b.begin(), set_b.end(), a_minus_b.begin()); - assert(perfect == a_minus_b); + HPX_TEST(perfect == a_minus_b); } } From 0623b8c86b3c72847f4a974a975b32b5ce1a3907 Mon Sep 17 00:00:00 2001 From: Johan511 Date: Wed, 5 Apr 2023 23:25:14 +0530 Subject: [PATCH 09/63] changing static const to static constexpr Signed-off-by: Johan511 --- .../hpx/parallel/algorithms/detail/set_operation.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp index 6847c0ba7f31..67eb89238f50 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp @@ -74,12 +74,12 @@ namespace hpx::parallel::detail { struct set_chunk_data { - static const std::size_t uninit_start = static_cast(-1); - static const std::size_t uninit_len = static_cast(0); - static const std::size_t uninit_start_index = + static constexpr std::size_t uninit_start = static_cast(-1); + static constexpr std::size_t uninit_len = static_cast(0); + static constexpr std::size_t uninit_start_index = static_cast(-1); - static const std::size_t uninit_first1 = static_cast(-1); - static const std::size_t uninit_first2 = static_cast(-1); + static constexpr std::size_t uninit_first1 = static_cast(-1); + static constexpr std::size_t uninit_first2 = static_cast(-1); std::size_t start = uninit_start; std::size_t len = uninit_len; From 5a6404b01f125ca3cd1f37f6a052fe7868f38b7f Mon Sep 17 00:00:00 2001 From: Johan511 Date: Fri, 7 Apr 2023 12:46:53 +0530 Subject: [PATCH 10/63] clang format Signed-off-by: Johan511 --- .../hpx/parallel/algorithms/detail/set_operation.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp index 67eb89238f50..6ad845a27d70 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp @@ -74,12 +74,15 @@ namespace hpx::parallel::detail { struct set_chunk_data { - static constexpr std::size_t uninit_start = static_cast(-1); + static constexpr std::size_t uninit_start = + static_cast(-1); static constexpr std::size_t uninit_len = static_cast(0); static constexpr std::size_t uninit_start_index = static_cast(-1); - static constexpr std::size_t uninit_first1 = static_cast(-1); - static constexpr std::size_t uninit_first2 = static_cast(-1); + static constexpr std::size_t uninit_first1 = + static_cast(-1); + static constexpr std::size_t uninit_first2 = + static_cast(-1); std::size_t start = uninit_start; std::size_t len = uninit_len; From 344666158c2248747aacaf61c9032e495a51e543 Mon Sep 17 00:00:00 2001 From: Johan511 Date: Fri, 7 Apr 2023 17:30:19 +0530 Subject: [PATCH 11/63] fixed warning bugprone-narrowing-conversions Signed-off-by: Johan511 --- .../core/algorithms/tests/regressions/set_operations_3442.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp index ccebbe08f80b..f6bbb88bf781 100644 --- a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp +++ b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp @@ -39,9 +39,9 @@ void set_difference_randomized(int rounds, int maxLen) std::size_t len_a = rand() % maxLen, len_b = rand() % maxLen; std::vector set_a(len_a), set_b(len_b); - int rangeMin = 0; + std::size_t rangeMin = 0; // rangeMax is set to increase probability of common elements - int rangeMax = (std::min)(len_a, len_b) * 2; + std::size_t rangeMax = (std::min)(len_a, len_b) * 2; #ifdef HPX_WITH_CXX17_STD_EXECUTION_POLICES std::generate(std::execution::par_unseq, set_a.begin(), set_a.end(), From 563889fe8a013a974e580043314e3aa728be8efb Mon Sep 17 00:00:00 2001 From: dimitraka Date: Thu, 13 Apr 2023 12:21:06 +0200 Subject: [PATCH 12/63] Add hpx::post documentation --- .../include/hpx/async_base/post.hpp | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/libs/core/async_base/include/hpx/async_base/post.hpp b/libs/core/async_base/include/hpx/async_base/post.hpp index 6cbb5956ed32..a824c2482cab 100644 --- a/libs/core/async_base/include/hpx/async_base/post.hpp +++ b/libs/core/async_base/include/hpx/async_base/post.hpp @@ -4,8 +4,38 @@ // 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) +/// \file async_base/post.hpp + #pragma once +#if defined(DOXYGEN) + +namespace hpx { + // clang-format off + + /// \brief Runs the function \c f asynchronously (potentially in a separate + /// thread which might be a part of a thread pool). This is done in + /// a fire-and-forget manner, meaning there is no return value or way + /// to synchronize with the function execution (it does not return an + /// \c hpx::future that would hold the result of that function call). + /// + /// \details \c hpx::post is particularly useful when synchronization mechanisms + /// as heavyweight as futures are not desired, and instead, more + /// lightweight mechanisms like latches or atomic variables are preferred. + /// Essentially, the post function enables the launch of a new thread + /// without the overhead of creating a future. + /// + /// \note \c hpx::post is similar to \c hpx::async but does not return a future. + /// This is why there is no way of finding out the result/failure of the + /// execution of this function. + /// + template + HPX_FORCEINLINE bool post(F&& f, Ts&&... ts); + // clang-format on +} // namespace hpx + +#else + #include #include @@ -20,7 +50,6 @@ namespace hpx::detail { } // namespace hpx::detail namespace hpx { - template HPX_FORCEINLINE bool post(F&& f, Ts&&... ts) { @@ -36,3 +65,5 @@ namespace hpx { HPX_FORWARD(F, f), HPX_FORWARD(Ts, ts)...); } } // namespace hpx + +#endif From 00bc0a5c85f03a738042357118b489ad4b80c7bc Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Sat, 8 Apr 2023 16:32:04 -0500 Subject: [PATCH 13/63] Creating INSTALL component 'runtime' to enable installing binaries only --- .cmake-format.py | 3 +- CMakeLists.txt | 21 +++-------- cmake/HPX_AddComponent.cmake | 13 ++++--- cmake/HPX_AddExecutable.cmake | 7 ++-- cmake/HPX_AddLibrary.cmake | 9 ++--- cmake/HPX_AddModule.cmake | 7 ++-- cmake/HPX_CompilerFlagsTargets.cmake | 10 +++--- cmake/HPX_ForwardCacheVariables.cmake | 2 +- cmake/HPX_GeneratePackage.cmake | 4 ++- cmake/HPX_SetupAsio.cmake | 3 +- cmake/HPX_SetupEve.cmake | 1 + cmake/HPX_SetupLCI.cmake | 15 +++++--- cmake/HPX_SetupSVE.cmake | 1 + cmake/HPX_SetupTarget.cmake | 2 +- components/component_storage/CMakeLists.txt | 3 +- .../partitioned_vector/CMakeLists.txt | 5 +-- .../containers/unordered/CMakeLists.txt | 5 +-- components/iostreams/CMakeLists.txt | 3 +- .../performance_counters/io/CMakeLists.txt | 3 +- .../memory_counters/CMakeLists.txt | 3 +- .../performance_counters/papi/CMakeLists.txt | 3 +- .../performance_counters/power/CMakeLists.txt | 3 +- components/process/CMakeLists.txt | 3 +- examples/accumulators/CMakeLists.txt | 3 +- .../cancelable_action/CMakeLists.txt | 3 +- .../interpolate1d/CMakeLists.txt | 3 +- .../jacobi/jacobi_component/CMakeLists.txt | 1 + examples/nqueen/CMakeLists.txt | 3 +- .../performance_counters/sine/CMakeLists.txt | 3 +- .../random_mem_access/CMakeLists.txt | 3 +- examples/sheneos/sheneos/CMakeLists.txt | 3 +- examples/startup_shutdown/CMakeLists.txt | 3 +- examples/throttle/throttle/CMakeLists.txt | 3 +- .../central_tuplespace/CMakeLists.txt | 3 +- init/CMakeLists.txt | 11 +++--- libs/CMakeLists.txt | 36 ++++++++++++------- .../regressions/components/CMakeLists.txt | 3 +- .../tests/unit/agas/components/CMakeLists.txt | 5 ++- .../unit/components/components/CMakeLists.txt | 3 +- wrap/CMakeLists.txt | 25 ++++++++++--- 40 files changed, 154 insertions(+), 89 deletions(-) diff --git a/.cmake-format.py b/.cmake-format.py index 4ce7b1e49130..8e44cf90089a 100644 --- a/.cmake-format.py +++ b/.cmake-format.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022 Hartmut Kaiser +# Copyright (c) 2020-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -238,6 +238,7 @@ 'HEADER_ROOT': 1, 'INI': 1, 'INSTALL_SUFFIX': 1, + 'INSTALL_COMPONENT': 1, 'LANGUAGE': 1, 'LINK_FLAGS': '+', 'OUTPUT_SUFFIX': 1, diff --git a/CMakeLists.txt b/CMakeLists.txt index 55123858f25c..292a7feb2a7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright (c) 2020 Mikael Simberg -# Copyright (c) 2007-2022 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011-2014 Thomas Heller # Copyright (c) 2007-2008 Chirag Dekate # Copyright (c) 2011 Bryce Lelbach @@ -2439,7 +2439,7 @@ if(PYTHONINTERP_FOUND) install( FILES "${PROJECT_BINARY_DIR}/bin/hpxrun.py" DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT core + COMPONENT runtime PERMISSIONS OWNER_READ OWNER_WRITE @@ -2485,18 +2485,6 @@ install( PATTERN ".git" EXCLUDE ) -if("${HPX_PLATFORM_UC}" STREQUAL "XEONPHI") - # FIXME: push changes upstream - install( - DIRECTORY external/asio/boost - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hpx/external - COMPONENT core - FILES_MATCHING - PATTERN "*.hpp" - PATTERN ".git" EXCLUDE - ) -endif() - install( FILES "${PROJECT_SOURCE_DIR}/LICENSE_1_0.txt" DESTINATION ${CMAKE_INSTALL_DATADIR}/hpx @@ -2581,12 +2569,13 @@ include(HPX_PrintSummary) create_configuration_summary("Configuration summary:\n--" "hpx") include(HPX_ExportTargets) + # Modules can't link to this if not exported install( TARGETS hpx_base_libraries EXPORT HPXInternalTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_base_libraries + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_base_libraries RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT hpx_base_libraries ) hpx_export_internal_targets(hpx_base_libraries) diff --git a/cmake/HPX_AddComponent.cmake b/cmake/HPX_AddComponent.cmake index 60cb0b9053cb..31e5fe8df4a7 100644 --- a/cmake/HPX_AddComponent.cmake +++ b/cmake/HPX_AddComponent.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # # SPDX-License-Identifier: BSL-1.0 @@ -28,6 +28,7 @@ function(add_hpx_component name) HEADER_GLOB OUTPUT_SUFFIX INSTALL_SUFFIX + INSTALL_COMPONENT LANGUAGE ) set(multi_value_args @@ -191,12 +192,15 @@ function(add_hpx_component name) set(archive_install_destination ${${name}_INSTALL_SUFFIX}) set(runtime_install_destination ${${name}_INSTALL_SUFFIX}) endif() + if(${name}_INSTALL_COMPONENT) + set(install_component COMPONENT ${${name}_INSTALL_COMPONENT}) + endif() # cmake-format: off set(_target_flags INSTALL INSTALL_FLAGS - LIBRARY DESTINATION ${library_install_destination} - ARCHIVE DESTINATION ${archive_install_destination} - RUNTIME DESTINATION ${runtime_install_destination} + LIBRARY DESTINATION ${library_install_destination} ${install_component} + ARCHIVE DESTINATION ${archive_install_destination} ${install_component} + RUNTIME DESTINATION ${runtime_install_destination} ${install_component} ) # cmake-format: on @@ -210,6 +214,7 @@ function(add_hpx_component name) ${_target_flags} INSTALL_PDB $ DESTINATION ${runtime_install_destination} + ${install_component} CONFIGURATIONS Debug RelWithDebInfo OPTIONAL ) diff --git a/cmake/HPX_AddExecutable.cmake b/cmake/HPX_AddExecutable.cmake index 6db831c58cce..87c3117dadc0 100644 --- a/cmake/HPX_AddExecutable.cmake +++ b/cmake/HPX_AddExecutable.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # # SPDX-License-Identifier: BSL-1.0 @@ -165,7 +165,9 @@ function(add_hpx_executable name) if(${name}_INSTALL_SUFFIX) set(install_destination ${${name}_INSTALL_SUFFIX}) endif() - set(_target_flags INSTALL INSTALL_FLAGS DESTINATION ${install_destination}) + set(_target_flags INSTALL INSTALL_FLAGS DESTINATION ${install_destination} + COMPONENT executables + ) # install PDB if needed if(MSVC AND NOT ${name}_STATIC @@ -176,6 +178,7 @@ function(add_hpx_executable name) ${_target_flags} INSTALL_PDB $ DESTINATION ${install_destination} + COMPONENT executables CONFIGURATIONS Debug RelWithDebInfo OPTIONAL ) diff --git a/cmake/HPX_AddLibrary.cmake b/cmake/HPX_AddLibrary.cmake index 3ebd99d04747..ca0f25f403ec 100644 --- a/cmake/HPX_AddLibrary.cmake +++ b/cmake/HPX_AddLibrary.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # # SPDX-License-Identifier: BSL-1.0 @@ -180,9 +180,9 @@ function(add_hpx_library name) # cmake-format: off set(_target_flags INSTALL INSTALL_FLAGS - LIBRARY DESTINATION ${library_install_destination} - ARCHIVE DESTINATION ${archive_install_destination} - RUNTIME DESTINATION ${runtime_install_destination} + LIBRARY DESTINATION ${library_install_destination} COMPONENT runtime + ARCHIVE DESTINATION ${archive_install_destination} COMPONENT runtime + RUNTIME DESTINATION ${runtime_install_destination} COMPONENT runtime ) # cmake-format: on @@ -196,6 +196,7 @@ function(add_hpx_library name) ${_target_flags} INSTALL_PDB $ DESTINATION ${runtime_install_destination} + COMPONENT runtime CONFIGURATIONS Debug RelWithDebInfo OPTIONAL ) diff --git a/cmake/HPX_AddModule.cmake b/cmake/HPX_AddModule.cmake index 4fb192e968ce..f63f6ec29029 100644 --- a/cmake/HPX_AddModule.cmake +++ b/cmake/HPX_AddModule.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2019 ETH Zurich +# Copyright (c) 2019-2023 ETH Zurich # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -380,8 +380,8 @@ function(add_hpx_module libname modulename) install( TARGETS hpx_${modulename} EXPORT HPXInternalTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${modulename} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${modulename} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${modulename} ) hpx_export_internal_targets(hpx_${modulename}) @@ -420,6 +420,7 @@ function(add_hpx_module libname modulename) FILES ${_pdb_dir}/${_pdb_file}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} CONFIGURATIONS ${cfg} + COMPONENT ${modulename} OPTIONAL ) endforeach() diff --git a/cmake/HPX_CompilerFlagsTargets.cmake b/cmake/HPX_CompilerFlagsTargets.cmake index 5bf4649f42a0..66410dd6369d 100644 --- a/cmake/HPX_CompilerFlagsTargets.cmake +++ b/cmake/HPX_CompilerFlagsTargets.cmake @@ -34,20 +34,22 @@ target_compile_definitions( # Remaining flags are set through the macros in cmake/HPX_AddCompileFlag.cmake include(HPX_ExportTargets) + # Modules can't link to this if not exported install( TARGETS hpx_private_flags EXPORT HPXInternalTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_private_flags + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_private_flags RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT hpx_private_flags ) install( TARGETS hpx_public_flags EXPORT HPXInternalTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_public_flags + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_public_flags RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT hpx_public_flags ) + hpx_export_internal_targets(hpx_private_flags) hpx_export_internal_targets(hpx_public_flags) diff --git a/cmake/HPX_ForwardCacheVariables.cmake b/cmake/HPX_ForwardCacheVariables.cmake index 34cc47c7750b..f97a3abf98d3 100644 --- a/cmake/HPX_ForwardCacheVariables.cmake +++ b/cmake/HPX_ForwardCacheVariables.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Ste||ar Group +# Copyright (c) 2019-2023 Ste||ar Group # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/cmake/HPX_GeneratePackage.cmake b/cmake/HPX_GeneratePackage.cmake index 45a60d29476e..d0f473945c74 100644 --- a/cmake/HPX_GeneratePackage.cmake +++ b/cmake/HPX_GeneratePackage.cmake @@ -32,6 +32,7 @@ install( NAMESPACE HPXInternal:: FILE HPXInternalTargets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} + COMPONENT cmake ) # Export HPXTargets in the build directory @@ -56,6 +57,7 @@ install( NAMESPACE HPX:: FILE HPXTargets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} + COMPONENT cmake ) # Install dir @@ -117,7 +119,7 @@ if(HPX_WITH_PKGCONFIG) install( FILES "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/hpxcxx" DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT compiler_wrapper + COMPONENT runtime PERMISSIONS OWNER_READ OWNER_WRITE diff --git a/cmake/HPX_SetupAsio.cmake b/cmake/HPX_SetupAsio.cmake index 71c8a8fc320d..1dfbdd9416d6 100644 --- a/cmake/HPX_SetupAsio.cmake +++ b/cmake/HPX_SetupAsio.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Hartmut Kaiser +# Copyright (c) 2021-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -61,6 +61,7 @@ elseif(NOT TARGET Asio::asio AND NOT HPX_FIND_PACKAGE) NAMESPACE Asio:: FILE HPXAsioTarget.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} + COMPONENT cmake ) add_library(Asio::asio ALIAS asio) diff --git a/cmake/HPX_SetupEve.cmake b/cmake/HPX_SetupEve.cmake index 04d08db9fe85..9dff0f454a4d 100644 --- a/cmake/HPX_SetupEve.cmake +++ b/cmake/HPX_SetupEve.cmake @@ -60,6 +60,7 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "EVE") AND NOT TARGET eve::eve) NAMESPACE eve:: FILE HPXEveTarget.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} + COMPONENT cmake ) add_library(eve::eve ALIAS eve) diff --git a/cmake/HPX_SetupLCI.cmake b/cmake/HPX_SetupLCI.cmake index 638e8aba3b0b..98a01ea68205 100644 --- a/cmake/HPX_SetupLCI.cmake +++ b/cmake/HPX_SetupLCI.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Ste||ar Group +# Copyright (c) 2021-2023 Ste||ar Group # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -103,13 +103,18 @@ macro(hpx_setup_lci) NAMESPACE LCI:: FILE HPXLCITarget.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} + COMPONENT cmake ) - install(FILES "${lci_SOURCE_DIR}/cmake_modules/FindIBV.cmake" - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} + install( + FILES "${lci_SOURCE_DIR}/cmake_modules/FindIBV.cmake" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} + COMPONENT cmake ) - install(FILES "${lci_SOURCE_DIR}/cmake_modules/FindOFI.cmake" - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} + install( + FILES "${lci_SOURCE_DIR}/cmake_modules/FindOFI.cmake" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} + COMPONENT cmake ) endif() endif() diff --git a/cmake/HPX_SetupSVE.cmake b/cmake/HPX_SetupSVE.cmake index e528b6085832..c85b69c51104 100644 --- a/cmake/HPX_SetupSVE.cmake +++ b/cmake/HPX_SetupSVE.cmake @@ -61,6 +61,7 @@ if(("${HPX_WITH_DATAPAR_BACKEND}" STREQUAL "SVE") AND NOT TARGET SVE::sve) NAMESPACE SVE:: FILE HPXSVETarget.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME} + COMPONENT cmake ) else() diff --git a/cmake/HPX_SetupTarget.cmake b/cmake/HPX_SetupTarget.cmake index 7f8256465a54..0a15727ca69a 100644 --- a/cmake/HPX_SetupTarget.cmake +++ b/cmake/HPX_SetupTarget.cmake @@ -1,5 +1,5 @@ # Copyright (c) 2014 Thomas Heller -# Copyright (c) 2007-2018 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # # SPDX-License-Identifier: BSL-1.0 diff --git a/components/component_storage/CMakeLists.txt b/components/component_storage/CMakeLists.txt index 328bf511721d..69dfa7eb293f 100644 --- a/components/component_storage/CMakeLists.txt +++ b/components/component_storage/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2015 Hartmut Kaiser +# Copyright (c) 2015-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -32,6 +32,7 @@ add_hpx_component( component_storage INTERNAL_FLAGS FOLDER "Core/Components/IO" INSTALL_HEADERS PREPEND_HEADER_ROOT + INSTALL_COMPONENT runtime HEADER_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/include HEADERS ${component_storage_headers} PREPEND_SOURCE_ROOT diff --git a/components/containers/partitioned_vector/CMakeLists.txt b/components/containers/partitioned_vector/CMakeLists.txt index a17a3b40cba6..c0aa1f2433fc 100644 --- a/components/containers/partitioned_vector/CMakeLists.txt +++ b/components/containers/partitioned_vector/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2015-2017 Hartmut Kaiser +# Copyright (c) 2015-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -45,7 +45,8 @@ set(partitioned_vector_sources add_hpx_component( partitioned_vector INTERNAL_FLAGS FOLDER "Core/Components/Containers" - INSTALL_HEADERS PREPEND_HEADER_ROOT + PREPEND_HEADER_ROOT INSTALL_HEADERS + INSTALL_COMPONENT runtime HEADER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include" HEADERS ${partitioned_vector_headers} PREPEND_SOURCE_ROOT diff --git a/components/containers/unordered/CMakeLists.txt b/components/containers/unordered/CMakeLists.txt index 39d15eec094a..333b5702d41b 100644 --- a/components/containers/unordered/CMakeLists.txt +++ b/components/containers/unordered/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2015 Hartmut Kaiser +# Copyright (c) 2015-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -25,7 +25,8 @@ set(unordered_sources partition_unordered_map_component.cpp) add_hpx_component( unordered INTERNAL_FLAGS FOLDER "Core/Components/Containers" - INSTALL_HEADERS PREPEND_HEADER_ROOT + PREPEND_HEADER_ROOT INSTALL_HEADERS + INSTALL_COMPONENT runtime HEADER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include" HEADERS ${unordered_headers} PREPEND_SOURCE_ROOT diff --git a/components/iostreams/CMakeLists.txt b/components/iostreams/CMakeLists.txt index 790cecfa8cfd..cf366aa13dc3 100644 --- a/components/iostreams/CMakeLists.txt +++ b/components/iostreams/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # # SPDX-License-Identifier: BSL-1.0 @@ -35,6 +35,7 @@ add_hpx_component( iostreams INTERNAL_FLAGS FOLDER "Core/Components/IO" INSTALL_HEADERS PREPEND_HEADER_ROOT + INSTALL_COMPONENT runtime HEADER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include" HEADERS ${iostreams_headers} PREPEND_SOURCE_ROOT diff --git a/components/performance_counters/io/CMakeLists.txt b/components/performance_counters/io/CMakeLists.txt index 4f674df41ac1..623a0ff03b9c 100644 --- a/components/performance_counters/io/CMakeLists.txt +++ b/components/performance_counters/io/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2016 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -20,6 +20,7 @@ if(HPX_WITH_IO_COUNTERS) io_counters INTERNAL_FLAGS FOLDER "Core/Components/Counters" INSTALL_HEADERS PLUGIN PREPEND_HEADER_ROOT + INSTALL_COMPONENT runtime HEADER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include" HEADERS ${io_counters_headers} PREPEND_SOURCE_ROOT diff --git a/components/performance_counters/memory_counters/CMakeLists.txt b/components/performance_counters/memory_counters/CMakeLists.txt index 7f2262e23861..ffd466045ec7 100644 --- a/components/performance_counters/memory_counters/CMakeLists.txt +++ b/components/performance_counters/memory_counters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2022 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -30,6 +30,7 @@ add_hpx_component( memory_counters INTERNAL_FLAGS FOLDER "Core/Components/Counters" INSTALL_HEADERS PLUGIN PREPEND_HEADER_ROOT + INSTALL_COMPONENT runtime HEADER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include" HEADERS ${memory_headers} PREPEND_SOURCE_ROOT diff --git a/components/performance_counters/papi/CMakeLists.txt b/components/performance_counters/papi/CMakeLists.txt index 851a8c166cbb..72641541976a 100644 --- a/components/performance_counters/papi/CMakeLists.txt +++ b/components/performance_counters/papi/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -21,6 +21,7 @@ if(HPX_WITH_PAPI) papi_counters INTERNAL_FLAGS FOLDER "Core/Components/Counters" INSTALL_HEADERS PLUGIN PREPEND_HEADER_ROOT + INSTALL_COMPONENT runtime HEADER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include" HEADERS ${papi_counters_headers} PREPEND_SOURCE_ROOT diff --git a/components/performance_counters/power/CMakeLists.txt b/components/performance_counters/power/CMakeLists.txt index 73778baeaa58..fe96fd48ea76 100644 --- a/components/performance_counters/power/CMakeLists.txt +++ b/components/performance_counters/power/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2022 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -47,6 +47,7 @@ add_hpx_component( power INTERNAL_FLAGS FOLDER "Core/Components/Counters" INSTALL_HEADERS PLUGIN PREPEND_HEADER_ROOT + INSTALL_COMPONENT runtime HEADER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include" HEADERS ${power_headers} PREPEND_SOURCE_ROOT diff --git a/components/process/CMakeLists.txt b/components/process/CMakeLists.txt index 56d69125567f..cfb793fcc83f 100644 --- a/components/process/CMakeLists.txt +++ b/components/process/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2016 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -113,6 +113,7 @@ add_hpx_component( process INTERNAL_FLAGS FOLDER "Core/Components/Process" INSTALL_HEADERS PREPEND_HEADER_ROOT + INSTALL_COMPONENT runtime HEADER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include" HEADERS ${process_headers} PREPEND_SOURCE_ROOT diff --git a/examples/accumulators/CMakeLists.txt b/examples/accumulators/CMakeLists.txt index b9018e4f2f23..6123c0217a20 100644 --- a/examples/accumulators/CMakeLists.txt +++ b/examples/accumulators/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2016 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # # SPDX-License-Identifier: BSL-1.0 @@ -26,6 +26,7 @@ foreach(example_program ${example_programs}) # add example components add_hpx_component( ${example_program} INTERNAL_FLAGS NOEXPORT + INSTALL_COMPONENT examples SOURCES ${component_sources} HEADERS ${component_headers} FOLDER "Examples/Quickstart/Accumulators/${example_program}" diff --git a/examples/cancelable_action/cancelable_action/CMakeLists.txt b/examples/cancelable_action/cancelable_action/CMakeLists.txt index 4218c74206f0..bec12e4e6859 100644 --- a/examples/cancelable_action/cancelable_action/CMakeLists.txt +++ b/examples/cancelable_action/cancelable_action/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,6 +6,7 @@ add_hpx_component( cancelable_action INTERNAL_FLAGS NOEXPORT AUTOGLOB + INSTALL_COMPONENT examples HEADER_GLOB "cancelable_action.h*" SOURCE_GLOB "cancelable_action.c*" FOLDER "Examples/CancelableAction" diff --git a/examples/interpolate1d/interpolate1d/CMakeLists.txt b/examples/interpolate1d/interpolate1d/CMakeLists.txt index cb1daf22a5a5..81a1076b5ed5 100644 --- a/examples/interpolate1d/interpolate1d/CMakeLists.txt +++ b/examples/interpolate1d/interpolate1d/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2017 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,6 +6,7 @@ add_hpx_component( interpolate1d INTERNAL_FLAGS + INSTALL_COMPONENT examples FOLDER "Examples/Interpolate1D" AUTOGLOB ) diff --git a/examples/jacobi/jacobi_component/CMakeLists.txt b/examples/jacobi/jacobi_component/CMakeLists.txt index 8640b298b553..9ded29027a6f 100644 --- a/examples/jacobi/jacobi_component/CMakeLists.txt +++ b/examples/jacobi/jacobi_component/CMakeLists.txt @@ -6,6 +6,7 @@ add_hpx_component( jacobi INTERNAL_FLAGS NOEXPORT AUTOGLOB + INSTALL_COMPONENT examples SOURCE_GLOB "*.c*" HEADER_GLOB "*.h*" ${jacobi_component_FLAGS} FOLDER "Examples/Jacobi" diff --git a/examples/nqueen/CMakeLists.txt b/examples/nqueen/CMakeLists.txt index 8cb0d3a6c606..16b39ac4bcba 100644 --- a/examples/nqueen/CMakeLists.txt +++ b/examples/nqueen/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2009 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # Copyright (c) 2011 Vinay C Amatya # @@ -12,6 +12,7 @@ endif() add_hpx_component( nqueen INTERNAL_FLAGS NOEXPORT + INSTALL_COMPONENT examples SOURCE_GLOB "nqueen.cp*" HEADER_GLOB "nqueen.hp*" FOLDER "Examples/Applications/NQueen" diff --git a/examples/performance_counters/sine/CMakeLists.txt b/examples/performance_counters/sine/CMakeLists.txt index bc5098179377..04b1c22203a4 100644 --- a/examples/performance_counters/sine/CMakeLists.txt +++ b/examples/performance_counters/sine/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -10,6 +10,7 @@ set(root "${PROJECT_SOURCE_DIR}/examples/performance_counters/sine") # add component add_hpx_component( sine INTERNAL_FLAGS NOEXPORT + INSTALL_COMPONENT examples FOLDER "Examples/PerformanceCounters/Sine" HEADER_GLOB "${root}/*.h*" SOURCE_GLOB "${root}/sine.c*" diff --git a/examples/random_mem_access/random_mem_access/CMakeLists.txt b/examples/random_mem_access/random_mem_access/CMakeLists.txt index 8fe52d32f858..2101b000e06d 100644 --- a/examples/random_mem_access/random_mem_access/CMakeLists.txt +++ b/examples/random_mem_access/random_mem_access/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2009 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Matt Anderson # # SPDX-License-Identifier: BSL-1.0 @@ -24,6 +24,7 @@ source_group("Header Files\\Server" FILES ${server_headers}) # ############################################################################## add_hpx_component( random_mem_access INTERNAL_FLAGS NOEXPORT MODULE random_mem_access + INSTALL_COMPONENT examples SOURCES ${client_sources} HEADERS ${headers} FOLDER "Examples/RandomMemoryAccess/random_mem_access" diff --git a/examples/sheneos/sheneos/CMakeLists.txt b/examples/sheneos/sheneos/CMakeLists.txt index 4f12f93b4c44..1ec2e47d0295 100644 --- a/examples/sheneos/sheneos/CMakeLists.txt +++ b/examples/sheneos/sheneos/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2017 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,6 +6,7 @@ add_hpx_component( sheneos + INSTALL_COMPONENT examples DEPENDENCIES ${HDF5_LIBRARIES} FOLDER "Examples/ShenEOS" AUTOGLOB diff --git a/examples/startup_shutdown/CMakeLists.txt b/examples/startup_shutdown/CMakeLists.txt index 0217893860ae..65e0ad11ebe1 100644 --- a/examples/startup_shutdown/CMakeLists.txt +++ b/examples/startup_shutdown/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -10,6 +10,7 @@ endif() add_hpx_component( startup_shutdown INTERNAL_FLAGS NOEXPORT + INSTALL_COMPONENT examples FOLDER "Examples/StartupShutdown" AUTOGLOB ) diff --git a/examples/throttle/throttle/CMakeLists.txt b/examples/throttle/throttle/CMakeLists.txt index d27bfcd509a2..bef4aa0f72d9 100644 --- a/examples/throttle/throttle/CMakeLists.txt +++ b/examples/throttle/throttle/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -28,6 +28,7 @@ source_group("Header Files\\Server" FILES ${server_headers}) # ############################################################################## add_hpx_component( throttle INTERNAL_FLAGS NOEXPORT + INSTALL_COMPONENT examples SOURCES ${client_sources} ${server_sources} HEADERS ${headers} FOLDER "Examples/Throttle" diff --git a/examples/tuplespace/central_tuplespace/CMakeLists.txt b/examples/tuplespace/central_tuplespace/CMakeLists.txt index eaa46755f642..d3a295fc4aef 100644 --- a/examples/tuplespace/central_tuplespace/CMakeLists.txt +++ b/examples/tuplespace/central_tuplespace/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2009 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Adelstein-Lelbach # # SPDX-License-Identifier: BSL-1.0 @@ -15,6 +15,7 @@ foreach(component ${components}) add_hpx_component( ${component} INTERNAL_FLAGS NOEXPORT AUTOGLOB + INSTALL_COMPONENT examples HEADER_GLOB "${component}.h*" SOURCE_GLOB "${component}.c*" FOLDER "Examples/TupleSpace/${component}" diff --git a/init/CMakeLists.txt b/init/CMakeLists.txt index 356df22f712f..159b6c356c1b 100644 --- a/init/CMakeLists.txt +++ b/init/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2017 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # Copyright (c) 2018 Nikunj Gupta # @@ -83,15 +83,15 @@ endif() install( TARGETS hpx_init EXPORT HPXInternalTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_init + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_init + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT hpx_init ) install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT runtime + COMPONENT core ) # install PDB if needed @@ -103,6 +103,7 @@ if(MSVC) FILES ${_pdb_dir}/${_pdb_file}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} CONFIGURATIONS ${cfg} + COMPONENT runtime OPTIONAL ) endforeach() diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index d6b4cba26fcf..1791882be2e0 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2021 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # Copyright (c) 2018 Nikunj Gupta # Copyright (c) 2020 The STE||AR-Group @@ -218,25 +218,25 @@ target_compile_definitions( set(hpx_targets hpx wrap_main plugin component) set(hpx_internal_targets hpx_full hpx_interface hpx_interface_wrap_main) +# cmake-format: off install( TARGETS ${hpx_targets} EXPORT HPXTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT runtime + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime ${_optional} ) install( TARGETS ${hpx_internal_targets} EXPORT HPXInternalTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT runtime + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime ${_optional} ) +# cmake-format: on # install PDB if needed if(MSVC AND NOT HPX_WITH_STATIC_LINKING) @@ -244,6 +244,7 @@ if(MSVC AND NOT HPX_WITH_STATIC_LINKING) FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo + COMPONENT runtime OPTIONAL ) endif() @@ -319,11 +320,22 @@ foreach(lib ${HPX_LIBS}) install( TARGETS hpx_${lib} EXPORT HPXInternalTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${lib} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime ) + # install PDB if needed + if(MSVC AND NOT HPX_WITH_STATIC_LINKING) + install( + FILES $ + DESTINATION ${CMAKE_INSTALL_BINDIR} + CONFIGURATIONS Debug RelWithDebInfo + COMPONENT runtime + OPTIONAL + ) + endif() + hpx_export_internal_targets(hpx_${lib}) endif() diff --git a/libs/full/async_distributed/tests/regressions/components/CMakeLists.txt b/libs/full/async_distributed/tests/regressions/components/CMakeLists.txt index 9d7ae3b46860..789a3ef30b5b 100644 --- a/libs/full/async_distributed/tests/regressions/components/CMakeLists.txt +++ b/libs/full/async_distributed/tests/regressions/components/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2014 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,6 +6,7 @@ add_hpx_component( action_move_semantics INTERNAL_FLAGS + INSTALL_COMPONENT tests FOLDER "Tests/Regressions/Modules/Full/AsyncDistributed/Actions" EXCLUDE_FROM_ALL AUTOGLOB ) diff --git a/libs/full/runtime_components/tests/unit/agas/components/CMakeLists.txt b/libs/full/runtime_components/tests/unit/agas/components/CMakeLists.txt index 5007bc034f6d..9f8abafe6096 100644 --- a/libs/full/runtime_components/tests/unit/agas/components/CMakeLists.txt +++ b/libs/full/runtime_components/tests/unit/agas/components/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2021 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # # SPDX-License-Identifier: BSL-1.0 @@ -11,6 +11,7 @@ set(root add_hpx_component( simple_refcnt_checker INTERNAL_FLAGS + INSTALL_COMPONENT tests DEPENDENCIES iostreams_component HEADER_GLOB "${root}/simple_refcnt_checker.h*" SOURCE_GLOB "${root}/simple_refcnt_checker.c*" @@ -20,6 +21,7 @@ add_hpx_component( add_hpx_component( managed_refcnt_checker INTERNAL_FLAGS + INSTALL_COMPONENT tests DEPENDENCIES iostreams_component HEADER_GLOB "${root}/managed_refcnt_checker.h*" SOURCE_GLOB "${root}/managed_refcnt_checker.c*" @@ -29,6 +31,7 @@ add_hpx_component( add_hpx_component( simple_mobile_object INTERNAL_FLAGS + INSTALL_COMPONENT tests HEADER_GLOB "${root}/simple_mobile_object.h*" SOURCE_GLOB "${root}/simple_mobile_object.c*" FOLDER "Tests/Unit/Modules/Full/AGAS" diff --git a/libs/full/runtime_components/tests/unit/components/components/CMakeLists.txt b/libs/full/runtime_components/tests/unit/components/components/CMakeLists.txt index e24283d5eb57..ceb5d2b83a6d 100644 --- a/libs/full/runtime_components/tests/unit/components/components/CMakeLists.txt +++ b/libs/full/runtime_components/tests/unit/components/components/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Hartmut Kaiser +# Copyright (c) 2016-2023 Hartmut Kaiser # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,6 +6,7 @@ add_hpx_component( launch_process_test_server INTERNAL_FLAGS + INSTALL_COMPONENT tests FOLDER "Tests/Unit/Modules/Full/Components" EXCLUDE_FROM_ALL AUTOGLOB ) diff --git a/wrap/CMakeLists.txt b/wrap/CMakeLists.txt index 8c138b25db2d..6fde4be49b22 100644 --- a/wrap/CMakeLists.txt +++ b/wrap/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2017 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Lelbach # Copyright (c) 2018 Nikunj Gupta # @@ -77,17 +77,32 @@ endif() install( TARGETS hpx_wrap EXPORT HPXInternalTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_init + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_init + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT hpx_init ) install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT runtime + COMPONENT core ) +# install PDB if needed +if(MSVC) + foreach(cfg DEBUG;RELWITHDEBINFO) + get_target_property(_pdb_file hpx_wrap COMPILE_PDB_NAME_${cfg}) + get_target_property(_pdb_dir hpx_wrap COMPILE_PDB_OUTPUT_DIRECTORY_${cfg}) + install( + FILES ${_pdb_dir}/${_pdb_file}.pdb + DESTINATION ${CMAKE_INSTALL_LIBDIR} + CONFIGURATIONS ${cfg} + COMPONENT runtime + OPTIONAL + ) + endforeach() +endif() + hpx_export_internal_targets(hpx_wrap) add_hpx_pseudo_dependencies(core hpx_wrap) From 6aa72a554a69131c4d7a15510defe5c7d11905cf Mon Sep 17 00:00:00 2001 From: Panos Date: Fri, 14 Apr 2023 21:39:24 +0300 Subject: [PATCH 14/63] Fix compilation of segmented algorithm tests on MSVC --- .../tests/unit/partitioned_vector_all_of1.cpp | 6 +++--- .../tests/unit/partitioned_vector_all_of2.cpp | 6 +++--- .../tests/unit/partitioned_vector_any_of1.cpp | 6 +++--- .../tests/unit/partitioned_vector_any_of2.cpp | 6 +++--- .../tests/unit/partitioned_vector_none1.cpp | 6 +++--- .../tests/unit/partitioned_vector_none2.cpp | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of1.cpp index d363e73b2b86..f23c9b2c147c 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of1.cpp @@ -38,7 +38,7 @@ void initialize(hpx::partitioned_vector& xvalues) struct op5 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 5; } @@ -47,7 +47,7 @@ struct op5 struct op0 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 0; } @@ -56,7 +56,7 @@ struct op0 struct op8 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 8; } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of2.cpp index 0ef3d63201ed..2f41abfc1c03 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of2.cpp @@ -38,7 +38,7 @@ void initialize(hpx::partitioned_vector& xvalues) struct op5 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 5; } @@ -47,7 +47,7 @@ struct op5 struct op0 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 0; } @@ -56,7 +56,7 @@ struct op0 struct op8 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 8; } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of1.cpp index 127ba5880133..08834cf9162a 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of1.cpp @@ -38,7 +38,7 @@ void initialize(hpx::partitioned_vector& xvalues) struct op5 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 5; } @@ -47,7 +47,7 @@ struct op5 struct op0 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 0; } @@ -56,7 +56,7 @@ struct op0 struct op8 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 8; } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of2.cpp index f4088dcc00d5..6278307c6cae 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of2.cpp @@ -38,7 +38,7 @@ void initialize(hpx::partitioned_vector& xvalues) struct op5 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 5; } @@ -47,7 +47,7 @@ struct op5 struct op0 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 0; } @@ -56,7 +56,7 @@ struct op0 struct op8 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 8; } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none1.cpp index 8b70a21753b2..f86de22ef8a4 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none1.cpp @@ -38,7 +38,7 @@ void initialize(hpx::partitioned_vector& xvalues) struct op5 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 5; } @@ -47,7 +47,7 @@ struct op5 struct op0 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 0; } @@ -56,7 +56,7 @@ struct op0 struct op8 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 8; } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none2.cpp index 22ffe5f018d3..1774fb83918b 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none2.cpp @@ -38,7 +38,7 @@ void initialize(hpx::partitioned_vector& xvalues) struct op5 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 5; } @@ -47,7 +47,7 @@ struct op5 struct op0 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 0; } @@ -56,7 +56,7 @@ struct op0 struct op8 { template - bool operator()(T& value) + bool operator()(T& value) const { return value > 8; } From 9b7f2f57f8c501adcc03e2acd34a7f2cb228e2d4 Mon Sep 17 00:00:00 2001 From: Panos Syskakis Date: Wed, 12 Apr 2023 08:25:11 -0500 Subject: [PATCH 15/63] Fix segmented algorithm tests --- .../tests/unit/partitioned_vector_adjacent_find1.cpp | 5 +++-- .../tests/unit/partitioned_vector_adjacent_find2.cpp | 5 +++-- .../tests/unit/partitioned_vector_all_of1.cpp | 5 +++-- .../tests/unit/partitioned_vector_all_of2.cpp | 5 +++-- .../tests/unit/partitioned_vector_any_of1.cpp | 5 +++-- .../tests/unit/partitioned_vector_any_of2.cpp | 5 +++-- .../tests/unit/partitioned_vector_max_element1.cpp | 5 +++-- .../tests/unit/partitioned_vector_max_element2.cpp | 5 +++-- .../tests/unit/partitioned_vector_min_element1.cpp | 5 +++-- .../tests/unit/partitioned_vector_min_element2.cpp | 5 +++-- .../tests/unit/partitioned_vector_minmax_element1.cpp | 5 +++-- .../tests/unit/partitioned_vector_minmax_element2.cpp | 5 +++-- .../tests/unit/partitioned_vector_none1.cpp | 5 +++-- .../tests/unit/partitioned_vector_none2.cpp | 5 +++-- 14 files changed, 42 insertions(+), 28 deletions(-) diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_adjacent_find1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_adjacent_find1.cpp index 8f7ba5e7589a..fce18239e11e 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_adjacent_find1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_adjacent_find1.cpp @@ -34,9 +34,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 1, 2, 3, 1, 5, 2, 3, 4, 2, 3, 2, 1, 2, 3, 4, 5, 6, 5, 6, 1, 2, 3, 4, 2, 1, 2, 3, 3, 5, 4, 3, 2, 1, 1, 2, 3, 4, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 5, 7, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_adjacent_find2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_adjacent_find2.cpp index e61ccd6c4d2b..158f9af4a465 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_adjacent_find2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_adjacent_find2.cpp @@ -34,9 +34,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 1, 2, 3, 1, 5, 2, 3, 4, 2, 3, 2, 1, 2, 3, 4, 5, 6, 5, 6, 1, 2, 3, 4, 2, 1, 2, 3, 3, 5, 4, 3, 2, 1, 1, 2, 3, 4, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 5, 7, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of1.cpp index f23c9b2c147c..65f24bdc64a5 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of1.cpp @@ -29,9 +29,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 1, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 1, 2, 3, 4, 5, 6, 5, 6, 1, 2, 3, 4, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 5, 7, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of2.cpp index 2f41abfc1c03..3b26d3a07476 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_all_of2.cpp @@ -29,9 +29,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 1, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 1, 2, 3, 4, 5, 6, 5, 6, 1, 2, 3, 4, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 5, 7, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of1.cpp index 08834cf9162a..0fb2703bde82 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of1.cpp @@ -29,9 +29,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 1, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 1, 2, 3, 4, 5, 6, 5, 6, 1, 2, 3, 4, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 5, 7, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of2.cpp index 6278307c6cae..21efe43a41f0 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_any_of2.cpp @@ -29,9 +29,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 1, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 1, 2, 3, 4, 5, 6, 5, 6, 1, 2, 3, 4, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 5, 7, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_max_element1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_max_element1.cpp index f580fd7c1827..9ab993b923de 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_max_element1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_max_element1.cpp @@ -31,9 +31,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 6, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 6, 2, 3, 4, 5, 6, 5, 6, 6, 2, 3, 4, 6, 6, 2, 3, 4, 5, 4, 3, 2, 6, 6, 2, 3, 4, 6, 2, 3, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 5, 8, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_max_element2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_max_element2.cpp index ff64d71780f3..eef3ac0e1c51 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_max_element2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_max_element2.cpp @@ -31,9 +31,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 6, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 6, 2, 3, 4, 5, 6, 5, 6, 6, 2, 3, 4, 6, 6, 2, 3, 4, 5, 4, 3, 2, 6, 6, 2, 3, 4, 6, 2, 3, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 5, 8, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_min_element1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_min_element1.cpp index 07a26115f608..2a7e4768a2ad 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_min_element1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_min_element1.cpp @@ -31,9 +31,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 6, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 6, 2, 3, 4, 5, 6, 5, 6, 6, 2, 3, 4, 6, 6, 2, 3, 4, 5, 4, 3, 2, 6, 6, 2, 3, 4, 6, 2, 3, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 5, 8, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_min_element2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_min_element2.cpp index d7179b2ad8a2..34a56def97b6 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_min_element2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_min_element2.cpp @@ -31,9 +31,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 6, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 6, 2, 3, 4, 5, 6, 5, 6, 6, 2, 3, 4, 6, 6, 2, 3, 4, 5, 4, 3, 2, 6, 6, 2, 3, 4, 6, 2, 3, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 5, 8, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_minmax_element1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_minmax_element1.cpp index 278820fe9fb4..9e2066fb4b3c 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_minmax_element1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_minmax_element1.cpp @@ -31,9 +31,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 6, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 6, 2, 3, 4, 5, 6, 5, 6, 6, 2, 3, 4, 6, 6, 2, 3, 4, 5, 4, 3, 2, 6, 6, 2, 3, 4, 6, 2, 3, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 5, 8, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_minmax_element2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_minmax_element2.cpp index c2e2b595e9a3..80dfee171ded 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_minmax_element2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_minmax_element2.cpp @@ -31,9 +31,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 6, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 6, 2, 3, 4, 5, 6, 5, 6, 6, 2, 3, 4, 6, 6, 2, 3, 4, 5, 4, 3, 2, 6, 6, 2, 3, 4, 6, 2, 3, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 5, 8, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none1.cpp index f86de22ef8a4..bb87eac2d466 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none1.cpp @@ -29,9 +29,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 1, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 1, 2, 3, 4, 5, 6, 5, 6, 1, 2, 3, 4, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 5, 7, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none2.cpp index 1774fb83918b..5088bca7a75a 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_none2.cpp @@ -29,9 +29,10 @@ void initialize(hpx::partitioned_vector& xvalues) T init_array[SIZE] = {1, 2, 3, 4, 5, 1, 2, 3, 3, 5, 5, 3, 4, 2, 3, 2, 1, 2, 3, 4, 5, 6, 5, 6, 1, 2, 3, 4, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 5, 7, 5, 4, 2, 3, 4, 5, 2}; - for (int i = 0; i < SIZE; i++) + typename hpx::partitioned_vector::iterator it = xvalues.begin(); + for (int i = 0; i < SIZE; i++, it++) { - xvalues.set_value(i, init_array[i]); + *it = init_array[i]; } } From 0c47698d171d2c112fc60cb40f76f823ea227d0a Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 01:40:47 +0530 Subject: [PATCH 16/63] end exclusive becomes has negative overflow bug for small values of start Signed-off-by: Johan511 --- .../include/hpx/parallel/algorithms/make_heap.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp index 8f0c6bcc3afb..a2ad8d5dada6 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp @@ -393,11 +393,18 @@ namespace hpx::parallel { std::size_t start = (n - 2) / 2; while (start > 0) { - // Index of start of level, and amount of items in level + // Index of start of level, and amount of items in level above start std::size_t const end_exclusive = static_cast( - std::pow(2, std::floor(std::log2(start)))) - - 2; + std::pow(2, std::floor(std::log2(start)))); + if (end_exclusive >= 2) + { + end_exclusive -= 2; + } + else + { + end_exclusive = 0; + } std::size_t level_items = start - end_exclusive; // If we can't at least run two chunks in parallel, From 52cdfd9e3900b30244e1c86ff009ab9e166e516e Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 01:45:37 +0530 Subject: [PATCH 17/63] end exclusive becomes has negative overflow bug for small values of start Signed-off-by: Johan511 --- .../include/hpx/parallel/algorithms/make_heap.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp index a2ad8d5dada6..0c5a6f6ea2c5 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp @@ -394,16 +394,15 @@ namespace hpx::parallel { while (start > 0) { // Index of start of level, and amount of items in level above start - std::size_t const end_exclusive = - static_cast( - std::pow(2, std::floor(std::log2(start)))); + std::size_t end_exclusive = static_cast( + std::pow(2, std::floor(std::log2(start)))); if (end_exclusive >= 2) { - end_exclusive -= 2; + end_exclusive -= static_cast(2); } else { - end_exclusive = 0; + end_exclusive = static_cast(0); } std::size_t level_items = start - end_exclusive; From fda700b1262b4df24e2b78bb7148126f14e1f6be Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 02:05:09 +0530 Subject: [PATCH 18/63] added tests for small heaps, make_heap` Signed-off-by: Johan511 --- .../tests/unit/algorithms/make_heap.cpp | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp b/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp index 85215c58f573..546010bc9b52 100644 --- a/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp @@ -24,6 +24,25 @@ int seed = std::random_device{}(); std::mt19937 gen(seed); /////////////////////////////////////////////////////////////////////////// +template +void test_make_heap_small1(IteratorTag) +{ + typedef std::vector::iterator base_iterator; + typedef test::test_iterator iterator; + + std::size_t len = -1; + while (len++ < 15) + { + std::vector c(len); + std::iota(hpx::util::begin(c), hpx::util::end(c), gen()); + + hpx::make_heap( + iterator(hpx::util::begin(c)), iterator(hpx::util::end(c))); + + HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c)), true); + } +} + template void test_make_heap1(IteratorTag) { @@ -31,13 +50,35 @@ void test_make_heap1(IteratorTag) typedef test::test_iterator iterator; std::vector c(10007); - std::iota(hpx::util::begin(c), hpx::util::end(c), 0); + std::iota(hpx::util::begin(c), hpx::util::end(c), gen()); hpx::make_heap(iterator(hpx::util::begin(c)), iterator(hpx::util::end(c))); HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c)), true); } +template +void test_make_heap_small1(ExPolicy&& policy, IteratorTag) +{ + static_assert(hpx::is_execution_policy::value, + "hpx::is_execution_policy::value"); + + typedef std::vector::iterator base_iterator; + typedef test::test_iterator iterator; + + std::size_t len = -1; + while (len++ < 15) + { + std::vector c(len); + std::iota(hpx::util::begin(c), hpx::util::end(c), gen()); + + hpx::make_heap( + policy, iterator(hpx::util::begin(c)), iterator(hpx::util::end(c))); + + HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c)), true); + } +} + template void test_make_heap1(ExPolicy&& policy, IteratorTag) { @@ -78,11 +119,16 @@ void test_make_heap1() using namespace hpx::execution; test_make_heap1(IteratorTag()); + test_make_heap_small1(IteratorTag()); test_make_heap1(seq, IteratorTag()); test_make_heap1(par, IteratorTag()); test_make_heap1(par_unseq, IteratorTag()); + test_make_heap_small1(seq, IteratorTag()); + test_make_heap_small1(par, IteratorTag()); + test_make_heap_small1(par_unseq, IteratorTag()); + test_make_heap_async1(seq(task), IteratorTag()); test_make_heap_async1(par(task), IteratorTag()); } From f2f8bca6f668bd8d14db76edf7a1cc940445cb3b Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 02:12:30 +0530 Subject: [PATCH 19/63] changed rand() to mt::rand() Signed-off-by: Johan511 --- .../algorithms/tests/regressions/set_operations_3442.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp index f6bbb88bf781..fc1db02efd47 100644 --- a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp +++ b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp @@ -15,10 +15,15 @@ #include #include +#include "test_utils.hpp" + #ifdef HPX_WITH_CXX17_STD_EXECUTION_POLICES #include #endif +int seed = std::random_device{}(); +std::mt19937 gen(seed); + // returns random integer in range (rangeMin, rangeMax] struct RandomIntInRange { @@ -28,7 +33,7 @@ struct RandomIntInRange , rangeMax(rangeMax){}; int operator()() { - return (rand() % (rangeMax - rangeMin + 1)) + rangeMin; + return (gen() % (rangeMax - rangeMin + 1)) + rangeMin; } }; @@ -36,7 +41,7 @@ void set_difference_randomized(int rounds, int maxLen) { while (rounds--) { - std::size_t len_a = rand() % maxLen, len_b = rand() % maxLen; + std::size_t len_a = gen() % maxLen, len_b = gen() % maxLen; std::vector set_a(len_a), set_b(len_b); std::size_t rangeMin = 0; From b6b4beb935fa49cc0301f3a068d1d01d462eeecb Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 02:38:26 +0530 Subject: [PATCH 20/63] added deterministic test which was known to previously fail Signed-off-by: Johan511 --- .../tests/regressions/set_operations_3442.cpp | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp index fc1db02efd47..dd4dd7b329a3 100644 --- a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp +++ b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp @@ -103,7 +103,7 @@ void set_difference_test(int rounds) set_difference_large_test(rounds); } -void set_intersection_small_test(int rounds) +void set_intersection_small_test1(int rounds) { std::vector set_a{1, 2, 3, 4, 5}; std::vector set_b{1, 2, 7}; @@ -121,6 +121,24 @@ void set_intersection_small_test(int rounds) } } +void set_intersection_small_test2(int rounds) +{ + std::vector set_a{-1, 1, 2, 3, 4, 5}; + std::vector set_b{0, 1, 2, 3, 8, 10}; + std::vector a_and_b(3); + + std::vector perfect(3); + std::set_intersection(set_a.begin(), set_a.end(), set_b.begin(), + set_b.end(), perfect.begin()); + + while (--rounds) + { + hpx::set_intersection(hpx::execution::par, set_a.begin(), set_a.end(), + set_b.begin(), set_b.end(), a_and_b.begin()); + HPX_TEST(perfect == a_and_b); + } +} + void set_intersection_medium_test(int rounds) { std::vector set_a(50); @@ -168,7 +186,7 @@ void set_intersection_large_test(int rounds) void set_intersection_test(int rounds) { - set_intersection_small_test(rounds); + set_intersection_small_test1(rounds); set_intersection_medium_test(rounds); set_intersection_large_test(rounds); } From 28b82a50b11d926eff94cf2bf2c6c26d1917bbf2 Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 02:42:04 +0530 Subject: [PATCH 21/63] forgot to call test Signed-off-by: Johan511 --- libs/core/algorithms/tests/regressions/set_operations_3442.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp index dd4dd7b329a3..ce6ba806330b 100644 --- a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp +++ b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp @@ -187,6 +187,7 @@ void set_intersection_large_test(int rounds) void set_intersection_test(int rounds) { set_intersection_small_test1(rounds); + set_intersection_small_test2(rounds); set_intersection_medium_test(rounds); set_intersection_large_test(rounds); } From cc52024845f8bff7c0c18f9d667de52ee1085a41 Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 04:01:09 +0530 Subject: [PATCH 22/63] fixed negative overflow bug in std::size_t len Signed-off-by: Johan511 --- .../algorithms/tests/unit/algorithms/make_heap.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp b/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp index 546010bc9b52..6feeff74165c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp @@ -30,8 +30,8 @@ void test_make_heap_small1(IteratorTag) typedef std::vector::iterator base_iterator; typedef test::test_iterator iterator; - std::size_t len = -1; - while (len++ < 15) + std::size_t len = 0; + while (len < 15) { std::vector c(len); std::iota(hpx::util::begin(c), hpx::util::end(c), gen()); @@ -40,6 +40,7 @@ void test_make_heap_small1(IteratorTag) iterator(hpx::util::begin(c)), iterator(hpx::util::end(c))); HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c)), true); + len++; } } @@ -66,8 +67,8 @@ void test_make_heap_small1(ExPolicy&& policy, IteratorTag) typedef std::vector::iterator base_iterator; typedef test::test_iterator iterator; - std::size_t len = -1; - while (len++ < 15) + std::size_t len = 0; + while (len < 15) { std::vector c(len); std::iota(hpx::util::begin(c), hpx::util::end(c), gen()); @@ -76,6 +77,7 @@ void test_make_heap_small1(ExPolicy&& policy, IteratorTag) policy, iterator(hpx::util::begin(c)), iterator(hpx::util::end(c))); HPX_TEST_EQ(std::is_heap(hpx::util::begin(c), hpx::util::end(c)), true); + len++; } } From e645ce1e04eef061c4095c7076a12dc857e27d42 Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 04:08:16 +0530 Subject: [PATCH 23/63] fixed adding test_utils.hpp which does not exist for regression tests Signed-off-by: Johan511 --- libs/core/algorithms/tests/regressions/set_operations_3442.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp index ce6ba806330b..fcbb9acd5d21 100644 --- a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp +++ b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp @@ -15,8 +15,6 @@ #include #include -#include "test_utils.hpp" - #ifdef HPX_WITH_CXX17_STD_EXECUTION_POLICES #include #endif From 43f72323eced2c6af6716f5b9e1ea461e20e1cf1 Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 12:40:09 +0530 Subject: [PATCH 24/63] fixed narrowing cast warning Signed-off-by: Johan511 --- libs/core/algorithms/tests/regressions/set_operations_3442.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp index fcbb9acd5d21..a579d55679d9 100644 --- a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp +++ b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp @@ -31,7 +31,7 @@ struct RandomIntInRange , rangeMax(rangeMax){}; int operator()() { - return (gen() % (rangeMax - rangeMin + 1)) + rangeMin; + return (static_cast(gen()) % (rangeMax - rangeMin + 1)) + rangeMin; } }; From 966488d1ad049b0997b42da2781759fe88a95cfa Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 20:13:20 +0530 Subject: [PATCH 25/63] added better comments, fixed line length limit inspect failure Signed-off-by: Johan511 --- .../hpx/parallel/algorithms/make_heap.hpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp index 0c5a6f6ea2c5..4b04e004681b 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp @@ -389,11 +389,25 @@ namespace hpx::parallel { try { - // Get workitems that are to be run in parallel + // parent of last node + // last node has index (n-1) + // parent of x is floor of (x-1)/2 std::size_t start = (n - 2) / 2; while (start > 0) { - // Index of start of level, and amount of items in level above start + /* + helps find number of elements + in parent level of start + 0 + 1 2 + 3 4 5 6 + + (size of heap) n = 7 + (parent of last element) start = 2 + end_exclusive => + last element index in + parent level of start + */ std::size_t end_exclusive = static_cast( std::pow(2, std::floor(std::log2(start)))); if (end_exclusive >= 2) From 68140cd05edabe36873871fc7a4a0bdded1ded3b Mon Sep 17 00:00:00 2001 From: Johan511 Date: Sun, 16 Apr 2023 20:21:00 +0530 Subject: [PATCH 26/63] added comment Signed-off-by: Johan511 --- .../algorithms/include/hpx/parallel/algorithms/make_heap.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp index 4b04e004681b..15f58fc407ff 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp @@ -398,6 +398,9 @@ namespace hpx::parallel { /* helps find number of elements in parent level of start + The following are indexes of + elements in the heap, not the + value of the elements 0 1 2 3 4 5 6 From ec01019a918315ddd30c7fa896c6a0fb07c1c623 Mon Sep 17 00:00:00 2001 From: Johan511 Date: Mon, 17 Apr 2023 00:00:07 +0530 Subject: [PATCH 27/63] removed endline whitespace Signed-off-by: Johan511 --- .../include/hpx/parallel/algorithms/make_heap.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp index 15f58fc407ff..96c7771778b8 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/make_heap.hpp @@ -404,11 +404,10 @@ namespace hpx::parallel { 0 1 2 3 4 5 6 - - (size of heap) n = 7 - (parent of last element) start = 2 - end_exclusive => - last element index in + (size of heap) n = 7 + (parent of last element) start = 2 + end_exclusive => + last element index in parent level of start */ std::size_t end_exclusive = static_cast( From c82e8f3bc59b2dd2794fed07a364f34720dff411 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Tue, 18 Apr 2023 12:48:27 -0500 Subject: [PATCH 28/63] Reliably disable background work when no networking is enabled --- .../hpx/thread_pools/scheduling_loop.hpp | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/libs/core/thread_pools/include/hpx/thread_pools/scheduling_loop.hpp b/libs/core/thread_pools/include/hpx/thread_pools/scheduling_loop.hpp index b0b807485533..117a24baffcf 100644 --- a/libs/core/thread_pools/include/hpx/thread_pools/scheduling_loop.hpp +++ b/libs/core/thread_pools/include/hpx/thread_pools/scheduling_loop.hpp @@ -186,12 +186,15 @@ namespace hpx::threads::detail { std::shared_ptr background_running; thread_id_ref_type background_thread; - - if (scheduler.has_scheduler_mode( + bool const do_background_work = + scheduler.has_scheduler_mode( policies::scheduler_mode::do_background_work) && num_thread < params.max_background_threads_ && - !params.background_.empty()) + !params.background_.empty(); + + if (do_background_work) { + // do background work in parcel layer and in agas background_thread = create_background_thread(scheduler, num_thread, params, background_running, idle_loop_count); } @@ -543,11 +546,14 @@ namespace hpx::threads::detail { continue; } - // do background work in parcel layer and in agas - call_and_create_background_thread(background_thread, next_thrd, - scheduler, num_thread, bg_work_exec_time_init, - context_storage, params, background_running, - idle_loop_count); + if (do_background_work) + { + // do background work in parcel layer and in agas + call_and_create_background_thread(background_thread, + next_thrd, scheduler, num_thread, + bg_work_exec_time_init, context_storage, params, + background_running, idle_loop_count); + } // call back into invoking context if (!params.inner_.empty()) @@ -575,11 +581,14 @@ namespace hpx::threads::detail { { busy_loop_count = 0; - // do background work in parcel layer and in agas - call_and_create_background_thread(background_thread, next_thrd, - scheduler, num_thread, bg_work_exec_time_init, - context_storage, params, background_running, - idle_loop_count); + if (do_background_work) + { + // do background work in parcel layer and in agas + call_and_create_background_thread(background_thread, + next_thrd, scheduler, num_thread, + bg_work_exec_time_init, context_storage, params, + background_running, idle_loop_count); + } } else if (idle_loop_count > params.max_idle_loop_count_ || may_exit) { From 6fd11be4488ff865dbc799452725b4aa85bc599b Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Tue, 18 Apr 2023 14:17:14 -0500 Subject: [PATCH 29/63] Fixing algorithms for zero length sequences when run with s/r scheduler --- .../hpx/parallel/util/detail/chunk_size.hpp | 50 ++++++++++++++++--- .../util/detail/chunk_size_iterator.hpp | 6 ++- .../tests/unit/algorithms/foreach_sender.cpp | 1 - 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size.hpp index 2247ad70001d..22836ce2de03 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size.hpp @@ -135,6 +135,12 @@ namespace hpx::parallel::util::detail { get_bulk_iteration_shape(ExPolicy&& policy, IterOrR& it_or_r, std::size_t& count, Stride s = Stride(1)) { + if (count == 0) + { + auto it = chunk_size_iterator(it_or_r, 1); + return hpx::util::iterator_range(it, it); + } + std::size_t const cores = execution::processing_units_count(policy.parameters(), policy.executor(), hpx::chrono::null_duration, count); @@ -172,6 +178,12 @@ namespace hpx::parallel::util::detail { get_bulk_iteration_shape(ExPolicy&& policy, std::vector& workitems, F1&& f1, IterOrR& it_or_r, std::size_t& count, Stride s = Stride(1)) { + if (count == 0) + { + auto it = chunk_size_iterator(it_or_r, 1); + return hpx::util::iterator_range(it, it); + } + Stride stride = parallel::detail::abs(s); auto test_function = [&](std::size_t test_chunk_size) -> std::size_t { @@ -242,6 +254,12 @@ namespace hpx::parallel::util::detail { std::size_t& count, Stride s = Stride(1)) { using tuple_type = hpx::tuple; + std::vector shape; + + if (count == 0) + { + return shape; + } std::size_t const cores = execution::processing_units_count(policy.parameters(), @@ -251,7 +269,6 @@ namespace hpx::parallel::util::detail { policy.parameters(), policy.executor(), cores, count); HPX_ASSERT(0 != max_chunks); - std::vector shape; Stride stride = parallel::detail::abs(s); // different versions of clang-format do different things @@ -346,6 +363,15 @@ namespace hpx::parallel::util::detail { get_bulk_iteration_shape_idx(ExPolicy&& policy, FwdIter begin, std::size_t count, Stride s = Stride(1)) { + using iterator = + parallel::util::detail::chunk_size_idx_iterator; + + if (count == 0) + { + auto it = iterator(begin, 1); + return hpx::util::iterator_range(it, it); + } + std::size_t const cores = execution::processing_units_count(policy.parameters(), policy.executor(), hpx::chrono::null_duration, count); @@ -371,9 +397,6 @@ namespace hpx::parallel::util::detail { // clang-format on } - using iterator = - parallel::util::detail::chunk_size_idx_iterator; - iterator shape_begin(begin, chunk_size, count, 0, 0); iterator shape_end(last, chunk_size, count, count, 0); @@ -388,6 +411,15 @@ namespace hpx::parallel::util::detail { std::vector& workitems, F1&& f1, FwdIter begin, std::size_t count, Stride s = Stride(1)) { + using iterator = + parallel::util::detail::chunk_size_idx_iterator; + + if (count == 0) + { + auto it = iterator(begin, 1); + return hpx::util::iterator_range(it, it); + } + Stride stride = parallel::detail::abs(s); std::size_t base_idx = 0; @@ -443,9 +475,6 @@ namespace hpx::parallel::util::detail { // clang-format on } - using iterator = - parallel::util::detail::chunk_size_idx_iterator; - iterator shape_begin(begin, chunk_size, count, 0, base_idx); iterator shape_end(last, chunk_size, count, count, base_idx); @@ -459,6 +488,12 @@ namespace hpx::parallel::util::detail { std::size_t count, Stride s = Stride(1)) { using tuple_type = hpx::tuple; + std::vector shape; + + if (count == 0) + { + return shape; + } std::size_t const cores = execution::processing_units_count(policy.parameters(), @@ -467,7 +502,6 @@ namespace hpx::parallel::util::detail { std::size_t max_chunks = execution::maximal_number_of_chunks( policy.parameters(), policy.executor(), cores, count); - std::vector shape; Stride stride = parallel::detail::abs(s); // different versions of clang-format do different things diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size_iterator.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size_iterator.hpp index 4b8c30bb9208..546cf5508536 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size_iterator.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size_iterator.hpp @@ -130,7 +130,8 @@ namespace hpx::parallel::util::detail { HPX_HOST_DEVICE chunk_size_iterator(IterOrR it, std::size_t chunk_size, std::size_t count = 0, std::size_t current = 0) noexcept : data_(it, 0) - , chunk_size_((hpx::detail::min)(chunk_size, count)) + , chunk_size_( + (std::max)((std::min)(chunk_size, count), std::size_t(1))) , last_chunk_size_(get_last_chunk_size(count, chunk_size)) , count_(count) , current_(get_current(current, chunk_size)) @@ -352,7 +353,8 @@ namespace hpx::parallel::util::detail { std::size_t chunk_size, std::size_t count = 0, std::size_t current = 0, std::size_t base_idx = 0) : data_(it, 0, base_idx) - , chunk_size_((hpx::detail::min)(chunk_size, count)) + , chunk_size_( + (std::max)((std::min)(chunk_size, count), std::size_t(1))) , last_chunk_size_(get_last_chunk_size(count, chunk_size)) , count_(count) , current_(get_current(current, chunk_size)) diff --git a/libs/core/algorithms/tests/unit/algorithms/foreach_sender.cpp b/libs/core/algorithms/tests/unit/algorithms/foreach_sender.cpp index ad40d9a0fa48..8685e651edaa 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreach_sender.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreach_sender.cpp @@ -32,7 +32,6 @@ void test_for_each_explicit_sender_direct( std::iota(std::begin(c), std::end(c), std::rand()); namespace ex = hpx::execution::experimental; - namespace tt = hpx::this_thread::experimental; auto f = [](std::size_t& v) { v = 42; }; From 98e219d13d8babede39c7d36dd136133afd3d3a5 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Tue, 28 Mar 2023 11:51:02 -0500 Subject: [PATCH 30/63] Modernize and streamline MPI parcelport - adding more locking where needed, more sanity tests - adding HPX_LOGGING_WITH_SEPARATE_DESTINATIONS to allow for all logging to go to the same file --- .circleci/config.yml | 1 + cmake/HPX_AddDefinitions.cmake | 4 +- .../include/hpx/modules/assertion.hpp | 2 +- .../command_line_handling_local.hpp | 12 +- .../src/command_line_handling_local.cpp | 128 +++++++------ .../src/parse_command_line_local.cpp | 62 ++++--- .../detail/init_logging.hpp | 21 +-- .../init_runtime_local/src/init_logging.cpp | 113 +++++++----- libs/core/logging/CMakeLists.txt | 20 ++- .../include/hpx/logging/detail/logger.hpp | 2 +- .../logging/include/hpx/logging/message.hpp | 8 +- .../logging/include/hpx/modules/logging.hpp | 72 +++++--- libs/core/logging/src/logging.cpp | 18 +- .../include/hpx/mpi_base/mpi_environment.hpp | 27 ++- libs/core/mpi_base/src/mpi_environment.cpp | 62 ++++--- libs/core/runtime_local/src/runtime_local.cpp | 11 +- .../src/detail/background_thread.cpp | 25 ++- libs/full/agas/src/route.cpp | 16 +- .../command_line_handling.hpp | 3 +- .../src/command_line_handling.cpp | 19 +- .../src/parse_command_line.cpp | 2 +- libs/full/init_runtime/src/pre_main.cpp | 2 +- .../include/hpx/parcelport_mpi/header.hpp | 66 +++---- .../include/hpx/parcelport_mpi/locality.hpp | 12 +- .../include/hpx/parcelport_mpi/receiver.hpp | 62 ++++--- .../parcelport_mpi/receiver_connection.hpp | 60 ++++--- .../include/hpx/parcelport_mpi/sender.hpp | 42 +++-- .../hpx/parcelport_mpi/sender_connection.hpp | 77 ++++---- .../hpx/parcelport_mpi/tag_provider.hpp | 4 +- libs/full/parcelport_mpi/src/locality.cpp | 3 +- .../parcelport_mpi/src/parcelport_mpi.cpp | 134 +++++++------- .../hpx/parcelset/connection_cache.hpp | 5 +- .../include/hpx/parcelset/decode_parcels.hpp | 53 +++--- .../hpx/parcelset/detail/parcel_await.hpp | 4 +- .../include/hpx/parcelset/encode_parcels.hpp | 45 +++-- .../include/hpx/parcelset/parcel.hpp | 7 +- .../include/hpx/parcelset/parcelhandler.hpp | 50 +++--- .../hpx/parcelset/parcelport_connection.hpp | 3 +- .../include/hpx/parcelset/parcelport_impl.hpp | 170 +++++++++--------- .../include/hpx/parcelset/parcelset_fwd.hpp | 3 +- libs/full/parcelset/src/parcel.cpp | 26 +-- libs/full/parcelset/src/parcelhandler.cpp | 170 +++++++++++------- libs/full/parcelset_base/CMakeLists.txt | 3 +- .../hpx/parcelset_base/parcel_interface.hpp | 51 +++--- .../include/hpx/parcelset_base/parcelport.hpp | 2 +- .../hpx/parcelset_base/parcelset_base_fwd.hpp | 5 +- .../parcelset_base/src/parcel_interface.cpp | 21 ++- .../parcelset_base/src/parcelset_base.cpp | 44 +++++ .../src/parcelhandler_counter_types.cpp | 10 +- .../src/console_logging.cpp | 1 + .../src/server/console_logging_server.cpp | 1 + 51 files changed, 1023 insertions(+), 741 deletions(-) create mode 100644 libs/full/parcelset_base/src/parcelset_base.cpp diff --git a/.circleci/config.yml b/.circleci/config.yml index 4db624cc8ca8..373266a51e98 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -244,6 +244,7 @@ jobs: -DHPX_WITH_TESTS_DEBUG_LOG_DESTINATION=/hpx/build/debug-log.txt \ -DHPX_WITH_SPINLOCK_DEADLOCK_DETECTION=On \ -DHPX_WITH_CHECK_MODULE_DEPENDENCIES=On \ + -DHPX_LOGGING_WITH_SEPARATE_DESTINATIONS=Off \ -DCMAKE_EXPORT_COMPILE_COMMANDS=On \ -DHPX_WITH_DOCUMENTATION=On \ -DHPX_WITH_DOCUMENTATION_OUTPUT_FORMATS="${DOCUMENTATION_OUTPUT_FORMATS}" diff --git a/cmake/HPX_AddDefinitions.cmake b/cmake/HPX_AddDefinitions.cmake index b9c367719e7a..d2a9f3373ad8 100644 --- a/cmake/HPX_AddDefinitions.cmake +++ b/cmake/HPX_AddDefinitions.cmake @@ -185,7 +185,7 @@ function(write_config_defines_file) if(NOT OPTION_TEMPLATE) string(TOUPPER ${OPTION_NAMESPACE} NAMESPACE_UPPER) set(PREAMBLE - "// Copyright (c) 2019-2020 STE||AR Group\n" + "// Copyright (c) 2019-2023 STE||AR Group\n" "//\n" "// SPDX-License-Identifier: BSL-1.0\n" "// Distributed under the Boost Software License, Version 1.0. (See accompanying\n" @@ -193,7 +193,7 @@ function(write_config_defines_file) "\n" "// Do not edit this file! It has been generated by the cmake configuration step.\n" "\n" - "#pragma once" + "#pragma once\n" ) set(TEMP_FILENAME "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${NAMESPACE_UPPER}" diff --git a/libs/core/assertion/include/hpx/modules/assertion.hpp b/libs/core/assertion/include/hpx/modules/assertion.hpp index 0213e053c8a7..6efad0a0e304 100644 --- a/libs/core/assertion/include/hpx/modules/assertion.hpp +++ b/libs/core/assertion/include/hpx/modules/assertion.hpp @@ -67,7 +67,7 @@ namespace hpx::assertion { #define HPX_ASSERT_LOCKED_(l, expr, msg) \ (!!(expr) ? void() : \ - (l.unlock(), \ + ((l).unlock(), \ ::hpx::assertion::detail::handle_assert( \ HPX_CURRENT_SOURCE_LOCATION(), HPX_PP_STRINGIZE(expr), \ msg))) /**/ diff --git a/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/command_line_handling_local.hpp b/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/command_line_handling_local.hpp index 9159a50f2879..6dc26a88747d 100644 --- a/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/command_line_handling_local.hpp +++ b/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/command_line_handling_local.hpp @@ -63,7 +63,8 @@ namespace hpx::local::detail { hpx::program_options::variables_map& vm, std::vector& ini_config); - void enable_logging_settings(hpx::program_options::variables_map& vm, + static void enable_logging_settings( + hpx::program_options::variables_map& vm, std::vector& ini_config); void store_command_line(int argc, char** argv); @@ -85,8 +86,8 @@ namespace hpx::local::detail { hpx::program_options::variables_map& prevm); void handle_high_priority_threads( - hpx::program_options::variables_map& vm, - std::vector& ini_config); + hpx::program_options::variables_map const& vm, + std::vector& ini_config) const; }; /////////////////////////////////////////////////////////////////////////// @@ -98,8 +99,9 @@ namespace hpx::local::detail { HPX_CORE_EXPORT std::string convert_to_log_file(std::string const& dest); - HPX_CORE_EXPORT std::size_t handle_num_cores(util::manage_config& cfgmap, - hpx::program_options::variables_map& vm, std::size_t num_threads, + HPX_CORE_EXPORT std::size_t handle_num_cores_default( + util::manage_config& cfgmap, + hpx::program_options::variables_map const& vm, std::size_t num_threads, std::size_t num_default_cores); HPX_CORE_EXPORT std::size_t get_number_of_default_threads( diff --git a/libs/core/command_line_handling_local/src/command_line_handling_local.cpp b/libs/core/command_line_handling_local/src/command_line_handling_local.cpp index 105af2c0f510..6dab0322fed0 100644 --- a/libs/core/command_line_handling_local/src/command_line_handling_local.cpp +++ b/libs/core/command_line_handling_local/src/command_line_handling_local.cpp @@ -1,10 +1,12 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // 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) #include +#include + #include #include #include @@ -17,10 +19,11 @@ #include #include #include -#include -#include #include #include +#if defined(HPX_HAVE_MAX_CPU_COUNT) +#include +#endif #include #include @@ -110,8 +113,9 @@ namespace hpx::local::detail { return "file(" + dest + ")"; } - std::string handle_queuing(util::manage_config& cfgmap, - hpx::program_options::variables_map& vm, std::string const& default_) + std::string handle_queuing(util::manage_config const& cfgmap, + hpx::program_options::variables_map const& vm, + std::string const& default_) { // command line options is used preferred if (vm.count("hpx:queuing")) @@ -121,8 +125,9 @@ namespace hpx::local::detail { return cfgmap.get_value("hpx.scheduler", default_); } - std::string handle_affinity(util::manage_config& cfgmap, - hpx::program_options::variables_map& vm, std::string const& default_) + std::string handle_affinity(util::manage_config const& cfgmap, + hpx::program_options::variables_map const& vm, + std::string const& default_) { // command line options is used preferred if (vm.count("hpx:affinity")) @@ -132,15 +137,16 @@ namespace hpx::local::detail { return cfgmap.get_value("hpx.affinity", default_); } - std::string handle_affinity_bind(util::manage_config& cfgmap, - hpx::program_options::variables_map& vm, std::string const& default_) + std::string handle_affinity_bind(util::manage_config const& cfgmap, + hpx::program_options::variables_map const& vm, + std::string const& default_) { // command line options is used preferred if (vm.count("hpx:bind")) { std::string affinity_desc; - std::vector bind_affinity = + std::vector const bind_affinity = vm["hpx:bind"].as>(); for (std::string const& s : bind_affinity) { @@ -156,8 +162,8 @@ namespace hpx::local::detail { return cfgmap.get_value("hpx.bind", default_); } - std::size_t handle_pu_step(util::manage_config& cfgmap, - hpx::program_options::variables_map& vm, std::size_t default_) + std::size_t handle_pu_step(util::manage_config const& cfgmap, + hpx::program_options::variables_map const& vm, std::size_t default_) { // command line options is used preferred if (vm.count("hpx:pu-step")) @@ -167,8 +173,8 @@ namespace hpx::local::detail { return cfgmap.get_value("hpx.pu_step", default_); } - std::size_t handle_pu_offset(util::manage_config& cfgmap, - hpx::program_options::variables_map& vm, std::size_t default_) + std::size_t handle_pu_offset(util::manage_config const& cfgmap, + hpx::program_options::variables_map const& vm, std::size_t default_) { // command line options is used preferred if (vm.count("hpx:pu-offset")) @@ -178,12 +184,12 @@ namespace hpx::local::detail { return cfgmap.get_value("hpx.pu_offset", default_); } - std::size_t handle_numa_sensitive(util::manage_config& cfgmap, - hpx::program_options::variables_map& vm, std::size_t default_) + std::size_t handle_numa_sensitive(util::manage_config const& cfgmap, + hpx::program_options::variables_map const& vm, std::size_t default_) { if (vm.count("hpx:numa-sensitive") != 0) { - std::size_t numa_sensitive = + std::size_t const numa_sensitive = vm["hpx:numa-sensitive"].as(); if (numa_sensitive > 2) { @@ -203,7 +209,7 @@ namespace hpx::local::detail { { if (use_process_mask) { - threads::topology& top = threads::create_topology(); + threads::topology const& top = threads::create_topology(); return threads::count(top.get_cpubind_mask()); } return static_cast(threads::hardware_concurrency()); @@ -211,13 +217,12 @@ namespace hpx::local::detail { std::size_t get_number_of_default_cores(bool use_process_mask) { - threads::topology& top = threads::create_topology(); - - std::size_t num_cores = top.get_number_of_cores(); + threads::topology const& top = threads::create_topology(); + std::size_t const num_cores = top.get_number_of_cores(); if (use_process_mask) { - threads::mask_type proc_mask = top.get_cpubind_mask(); + threads::mask_type const proc_mask = top.get_cpubind_mask(); std::size_t num_cores_proc_mask = 0; for (std::size_t num_core = 0; num_core < num_cores; ++num_core) @@ -237,9 +242,9 @@ namespace hpx::local::detail { } /////////////////////////////////////////////////////////////////////// - std::size_t handle_num_threads(util::manage_config& cfgmap, + std::size_t handle_num_threads(util::manage_config const& cfgmap, hpx::util::runtime_configuration const& rtcfg, - hpx::program_options::variables_map& vm, bool use_process_mask) + hpx::program_options::variables_map const& vm, bool use_process_mask) { // If using the process mask we override "cores" and "all" options but // keep explicit numeric values. @@ -248,11 +253,10 @@ namespace hpx::local::detail { std::size_t const init_cores = get_number_of_default_cores(use_process_mask); - std::string threads_str = cfgmap.get_value( - "hpx.os_threads", + auto threads_str = cfgmap.get_value("hpx.os_threads", rtcfg.get_entry("hpx.os_threads", std::to_string(init_threads))); - std::size_t threads = 0; + std::size_t threads; if ("cores" == threads_str) { threads = init_cores; @@ -303,7 +307,7 @@ namespace hpx::local::detail { } // make sure minimal requested number of threads is observed - std::size_t min_os_threads = + auto min_os_threads = cfgmap.get_value("hpx.force_min_os_threads", threads); if (min_os_threads == 0) @@ -328,17 +332,17 @@ namespace hpx::local::detail { return threads; } - std::size_t handle_num_cores(util::manage_config& cfgmap, - hpx::program_options::variables_map& vm, std::size_t num_threads, + std::size_t handle_num_cores_default(util::manage_config& cfgmap, + hpx::program_options::variables_map const& vm, std::size_t num_threads, std::size_t num_default_cores) { - std::string cores_str = cfgmap.get_value("hpx.cores", ""); + auto cores_str = cfgmap.get_value("hpx.cores", ""); if ("all" == cores_str) { cfgmap.config_["hpx.cores"] = std::to_string(num_default_cores); } - std::size_t num_cores = + auto num_cores = cfgmap.get_value("hpx.cores", num_threads); if (vm.count("hpx:cores")) { @@ -357,10 +361,10 @@ namespace hpx::local::detail { } std::size_t handle_num_cores(util::manage_config& cfgmap, - hpx::program_options::variables_map& vm, std::size_t num_threads, + hpx::program_options::variables_map const& vm, std::size_t num_threads, bool use_process_mask) { - return handle_num_cores(cfgmap, vm, num_threads, + return handle_num_cores_default(cfgmap, vm, num_threads, get_number_of_default_cores(use_process_mask)); } @@ -386,7 +390,7 @@ namespace hpx::local::detail { , num_threads_(1) , num_cores_(1) , pu_step_(1) - , pu_offset_(std::size_t(-1)) + , pu_offset_(static_cast(-1)) , numa_sensitive_(0) , use_process_mask_(false) , cmd_line_parsed_(false) @@ -418,7 +422,8 @@ namespace hpx::local::detail { return; } - if (!(pu_offset_ == std::size_t(-1) || pu_offset_ == std::size_t(0)) || + if (!(pu_offset_ == static_cast(-1) || + pu_offset_ == static_cast(0)) || pu_step_ != 1 || affinity_domain_ != "pu") { throw hpx::detail::command_line_error( @@ -429,7 +434,7 @@ namespace hpx::local::detail { void command_line_handling::check_pu_offset() const { - if (pu_offset_ != std::size_t(-1) && + if (pu_offset_ != static_cast(-1) && pu_offset_ >= static_cast(hpx::threads::hardware_concurrency())) { @@ -454,14 +459,14 @@ namespace hpx::local::detail { } void command_line_handling::handle_high_priority_threads( - hpx::program_options::variables_map& vm, - std::vector& ini_config) + hpx::program_options::variables_map const& vm, + std::vector& ini_config) const { if (vm_.count("hpx:high-priority-threads")) { - std::size_t num_high_priority_queues = + std::size_t const num_high_priority_queues = vm["hpx:high-priority-threads"].as(); - if (num_high_priority_queues != std::size_t(-1) && + if (num_high_priority_queues != static_cast(-1) && num_high_priority_queues > num_threads_) { throw hpx::detail::command_line_error( @@ -488,7 +493,7 @@ namespace hpx::local::detail { hpx::program_options::variables_map& vm, std::vector& ini_config) { - bool debug_clp = vm.count("hpx:debug-clp"); + bool const debug_clp = vm.count("hpx:debug-clp"); if (vm.count("hpx:ini")) { @@ -554,10 +559,11 @@ namespace hpx::local::detail { check_pu_step(); - pu_offset_ = detail::handle_pu_offset(cfgmap, vm, std::size_t(-1)); + pu_offset_ = + detail::handle_pu_offset(cfgmap, vm, static_cast(-1)); // NOLINTNEXTLINE(bugprone-branch-clone) - if (pu_offset_ != std::size_t(-1)) + if (pu_offset_ != static_cast(-1)) { #if defined(__APPLE__) std::cerr << "Warning: PU offset set to \"" << pu_offset_ @@ -585,7 +591,7 @@ namespace hpx::local::detail { // default affinity mode is now 'balanced' (only if no pu-step or // pu-offset is given) - if (pu_step_ == 1 && pu_offset_ == std::size_t(-1) && + if (pu_step_ == 1 && pu_offset_ == static_cast(-1) && affinity_bind_.empty()) { #if defined(__APPLE__) @@ -640,6 +646,7 @@ namespace hpx::local::detail { ini_config.emplace_back("hpx.logging.level=5"); } +#if defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) if (vm.count("hpx:debug-timing-log")) { ini_config.emplace_back("hpx.logging.console.timing.destination=" + @@ -651,7 +658,15 @@ namespace hpx::local::detail { ini_config.emplace_back("hpx.logging.console.timing.level=1"); ini_config.emplace_back("hpx.logging.timing.level=1"); } - +#else + if (vm.count("hpx:debug-timing-log")) + { + throw hpx::detail::command_line_error( + "Command line option error: can't enable logging while it was " + "disabled at configuration time. Please re-configure HPX using " + "the option -DHPX_LOGGING_WITH_SEPARATE_DESTINATIONS=On."); + } +#endif if (vm.count("hpx:debug-app-log")) { ini_config.emplace_back( @@ -721,13 +736,12 @@ namespace hpx::local::detail { if (!unregistered_options.empty()) { - typedef std::vector::const_iterator iterator_type; - - iterator_type end = unregistered_options.end(); - for (iterator_type it = unregistered_options.begin(); it != end; - ++it) + auto const end = unregistered_options.end(); + for (auto it = unregistered_options.begin(); it != end; ++it) + { unregistered_options_cmd_line += " " + detail::encode_and_enquote(*it); + } ini_config_.emplace_back("hpx.unknown_cmd_line!=" + detail::encode_and_enquote(cmd_name) + @@ -746,7 +760,7 @@ namespace hpx::local::detail { { if (vm_.count("hpx:help")) { - std::string help_option(vm_["hpx:help"].as()); + std::string const help_option(vm_["hpx:help"].as()); if (0 == std::string("minimal").find(help_option)) { // print static help only @@ -780,7 +794,8 @@ namespace hpx::local::detail { #if defined(_POSIX_VERSION) || defined(HPX_WINDOWS) if (vm_.count("hpx:attach-debugger")) { - std::string option = vm_["hpx:attach-debugger"].as(); + std::string const option = + vm_["hpx:attach-debugger"].as(); if (option != "off" && option != "startup" && option != "exception" && option != "test-failure") { @@ -812,8 +827,9 @@ namespace hpx::local::detail { // extract all command line arguments from configuration settings and // remove them from this list - auto it = std::stable_partition(ini_config_.begin(), ini_config_.end(), - [](std::string const& e) { return e.find("--hpx:") != 0; }); + auto const it = + std::stable_partition(ini_config_.begin(), ini_config_.end(), + [](std::string const& e) { return e.find("--hpx:") != 0; }); std::move(it, ini_config_.end(), std::back_inserter(options)); ini_config_.erase(it, ini_config_.end()); @@ -850,7 +866,7 @@ namespace hpx::local::detail { } hpx::string_util::escaped_list_separator sep('\\', ' ', '\"'); - hpx::string_util::tokenizer tok(options, sep); + hpx::string_util::tokenizer const tok(options, sep); std::vector result(tok.begin(), tok.end()); std::move(args.begin(), args.end(), std::back_inserter(result)); diff --git a/libs/core/command_line_handling_local/src/parse_command_line_local.cpp b/libs/core/command_line_handling_local/src/parse_command_line_local.cpp index 1befcfa1b423..09cafec8d687 100644 --- a/libs/core/command_line_handling_local/src/parse_command_line_local.cpp +++ b/libs/core/command_line_handling_local/src/parse_command_line_local.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -9,30 +9,27 @@ #include #include #include -#include -#include #include #include #include -#include #include #include #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace local { namespace detail { +namespace hpx::local::detail { /////////////////////////////////////////////////////////////////////// std::string trim_whitespace(std::string const& s) { using size_type = std::string::size_type; - size_type first = s.find_first_not_of(" \t"); + size_type const first = s.find_first_not_of(" \t"); if (std::string::npos == first) - return std::string(); + return {}; - size_type last = s.find_last_not_of(" \t"); + size_type const last = s.find_last_not_of(" \t"); return s.substr(first, last - first + 1); } @@ -178,7 +175,7 @@ namespace hpx { namespace local { namespace detail { using hpx::local::detail::trim_whitespace; // skip empty lines - std::string::size_type pos = line.find_first_not_of(" \t"); + std::string::size_type const pos = line.find_first_not_of(" \t"); if (pos == std::string::npos) continue; @@ -188,7 +185,7 @@ namespace hpx { namespace local { namespace detail { // skip comment lines if ('#' != line[0]) { - std::string::size_type p1 = line.find_first_of(" \t"); + std::string::size_type const p1 = line.find_first_of(" \t"); if (p1 != std::string::npos) { // rebuild the line connecting the parts with a '=' @@ -217,9 +214,9 @@ namespace hpx { namespace local { namespace detail { using hpx::program_options::store; using hpx::program_options::command_line_style::unix_style; - util::commandline_error_mode mode = + util::commandline_error_mode const mode = error_mode & util::commandline_error_mode::ignore_aliases; - util::commandline_error_mode notmode = + util::commandline_error_mode const notmode = error_mode & util::commandline_error_mode::ignore_aliases; store(get_commandline_parser( @@ -248,22 +245,21 @@ namespace hpx { namespace local { namespace detail { return; filesystem::path dir(filesystem::initial_path()); - filesystem::path app(appname); + filesystem::path const app(appname); appname = filesystem::basename(app.filename()); // walk up the hierarchy, trying to find a file .cfg while (!dir.empty()) { filesystem::path filename = dir / (appname + ".cfg"); - util::commandline_error_mode mode = error_mode & + util::commandline_error_mode const mode = error_mode & ~util::commandline_error_mode::report_missing_config_file; std::vector options = read_config_file_options(filename.string(), mode); - bool result = handle_config_file_options( - options, desc_cfgfile, vm, ini, mode); - if (result) + if (handle_config_file_options( + options, desc_cfgfile, vm, ini, mode)) { break; // break on the first options file found } @@ -291,7 +287,7 @@ namespace hpx { namespace local { namespace detail { using hpx::program_options::options_description; if (vm.count("hpx:options-file")) { - std::vector const& cfg_files = + auto const& cfg_files = vm["hpx:options-file"].as>(); for (std::string const& cfg_file : cfg_files) @@ -310,7 +306,7 @@ namespace hpx { namespace local { namespace detail { { for (auto const& opt : opts) { - std::string::size_type p = opt.find("--hpx:"); + std::string::size_type const p = opt.find("--hpx:"); if (p != std::string::npos) { throw hpx::detail::command_line_error( @@ -356,19 +352,19 @@ namespace hpx { namespace local { namespace detail { pd.add("hpx:positional", -1); // parse command line, allow for unregistered options this point - util::commandline_error_mode mode = + util::commandline_error_mode const mode = error_mode & util::commandline_error_mode::ignore_aliases; - util::commandline_error_mode notmode = + util::commandline_error_mode const notmode = error_mode & ~util::commandline_error_mode::ignore_aliases; - parsed_options opts(get_commandline_parser( + parsed_options const opts(get_commandline_parser( command_line_parser(args) .options(all_options[options_type::desc_cmdline]) .positional(pd) .style(unix_style) .extra_parser(option_parser(rtcfg, as_bool(mode))), notmode) - .run()); + .run()); // collect unregistered options, if needed if (unregistered_options) @@ -386,18 +382,18 @@ namespace hpx { namespace local { namespace detail { else { // parse command line, allow for unregistered options this point - util::commandline_error_mode mode = + util::commandline_error_mode const mode = error_mode & util::commandline_error_mode::ignore_aliases; - util::commandline_error_mode notmode = + util::commandline_error_mode const notmode = error_mode & ~util::commandline_error_mode::ignore_aliases; - parsed_options opts(get_commandline_parser( + parsed_options const opts(get_commandline_parser( command_line_parser(args) .options(all_options[options_type::desc_cmdline]) .style(unix_style) .extra_parser(option_parser(rtcfg, as_bool(mode))), notmode) - .run()); + .run()); // collect unregistered options, if needed if (unregistered_options) @@ -604,8 +600,9 @@ namespace hpx { namespace local { namespace detail { compose_all_options(app_options, all_options); - bool result = parse_commandline(rtcfg, all_options, app_options, - args, vm, error_mode, visible, unregistered_options); + bool const result = + parse_commandline(rtcfg, all_options, app_options, args, vm, + error_mode, visible, unregistered_options); handle_generic_config_options(arg0, vm, all_options[options_type::desc_cfgfile], rtcfg, error_mode); @@ -631,7 +628,7 @@ namespace hpx { namespace local { namespace detail { std::string extract_arg0(std::string const& cmdline) { - std::string::size_type p = cmdline.find_first_of(" \t"); + std::string::size_type const p = cmdline.find_first_of(" \t"); if (p != std::string::npos) { return cmdline.substr(0, p); @@ -661,7 +658,8 @@ namespace hpx { namespace local { namespace detail { /////////////////////////////////////////////////////////////////////////// std::string embed_in_quotes(std::string const& s) { - char quote = (s.find_first_of('"') != std::string::npos) ? '\'' : '"'; + char const quote = + (s.find_first_of('"') != std::string::npos) ? '\'' : '"'; if (s.find_first_of("\t ") != std::string::npos) return quote + s + quote; @@ -718,4 +716,4 @@ namespace hpx { namespace local { namespace detail { } return command_line; } -}}} // namespace hpx::local::detail +} // namespace hpx::local::detail diff --git a/libs/core/init_runtime_local/include/hpx/init_runtime_local/detail/init_logging.hpp b/libs/core/init_runtime_local/include/hpx/init_runtime_local/detail/init_logging.hpp index 67daf03598b2..54b1d2fc7aec 100644 --- a/libs/core/init_runtime_local/include/hpx/init_runtime_local/detail/init_logging.hpp +++ b/libs/core/init_runtime_local/include/hpx/init_runtime_local/detail/init_logging.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -15,7 +15,7 @@ #if defined(HPX_HAVE_LOGGING) /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace util { +namespace hpx::util { /// \cond NOINTERNAL @@ -23,7 +23,8 @@ namespace hpx { namespace util { // custom log destination: send generated strings to console struct HPX_CORE_EXPORT console_local : logging::destination::manipulator { - console_local(logging::level level, logging_destination dest) + constexpr console_local( + logging::level level, logging_destination dest) noexcept : level_(level) , dest_(dest) { @@ -31,8 +32,8 @@ namespace hpx { namespace util { void operator()(logging::message const& msg) override; - friend bool operator==( - console_local const& lhs, console_local const& rhs) + friend constexpr bool operator==( + console_local const& lhs, console_local const& rhs) noexcept { return lhs.dest_ == rhs.dest_; } @@ -78,12 +79,12 @@ namespace hpx { namespace util { std::string logformat = ""); /// Disable all logging for the given destination - HPX_CORE_EXPORT void disable_logging(logging_destination dest); -}} // namespace hpx::util + HPX_CORE_EXPORT void disable_logging(logging_destination dest) noexcept; +} // namespace hpx::util #else // HPX_HAVE_LOGGING -namespace hpx { namespace util { +namespace hpx::util { namespace detail { HPX_CORE_EXPORT void warn_if_logging_requested(runtime_configuration&); @@ -94,7 +95,7 @@ namespace hpx { namespace util { std::string const& lvl = "5", std::string logdest = "", std::string logformat = ""); - HPX_CORE_EXPORT void disable_logging(logging_destination dest); -}} // namespace hpx::util + HPX_CORE_EXPORT void disable_logging(logging_destination dest) noexcept; +} // namespace hpx::util #endif // HPX_HAVE_LOGGING diff --git a/libs/core/init_runtime_local/src/init_logging.cpp b/libs/core/init_runtime_local/src/init_logging.cpp index 96cb043f0060..d9bca2288d32 100644 --- a/libs/core/init_runtime_local/src/init_logging.cpp +++ b/libs/core/init_runtime_local/src/init_logging.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -8,6 +8,8 @@ #include #if defined(HPX_HAVE_LOGGING) +#include + #include #include #include @@ -17,7 +19,6 @@ #include #include #include -#include #include #if defined(ANDROID) || defined(__ANDROID__) @@ -25,7 +26,7 @@ #endif /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace util { +namespace hpx::util { using logger_writer_type = logging::writer::named_write; @@ -36,9 +37,9 @@ namespace hpx { namespace util { void operator()(std::ostream& to) const override { error_code ec(throwmode::lightweight); - std::size_t thread_num = hpx::get_worker_thread_num(ec); + std::size_t const thread_num = hpx::get_worker_thread_num(ec); - if (std::size_t(-1) != thread_num) + if (static_cast(-1) != thread_num) { util::format_to(to, "{:016x}", thread_num); } @@ -55,7 +56,7 @@ namespace hpx { namespace util { { void operator()(std::ostream& to) const override { - std::uint32_t locality_id = hpx::get_locality_id(); + std::uint32_t const locality_id = hpx::get_locality_id(); if (~static_cast(0) != locality_id) { @@ -75,14 +76,14 @@ namespace hpx { namespace util { { void operator()(std::ostream& to) const override { - threads::thread_self* self = threads::get_self_ptr(); + threads::thread_self const* self = threads::get_self_ptr(); if (nullptr != self) { // called from inside a HPX thread - threads::thread_id_type id = threads::get_self_id(); + threads::thread_id_type const id = threads::get_self_id(); if (id != threads::invalid_thread_id) { - std::ptrdiff_t value = + auto const value = reinterpret_cast(id.get()); util::format_to(to, "{:016x}", value); return; @@ -100,11 +101,11 @@ namespace hpx { namespace util { { void operator()(std::ostream& to) const override { - threads::thread_self* self = threads::get_self_ptr(); + threads::thread_self const* self = threads::get_self_ptr(); if (nullptr != self) { // called from inside a HPX thread - std::size_t phase = self->get_thread_phase(); + std::size_t const phase = self->get_thread_phase(); if (0 != phase) { util::format_to(to, "{:04x}", self->get_thread_phase()); @@ -123,7 +124,7 @@ namespace hpx { namespace util { { void operator()(std::ostream& to) const override { - std::uint32_t parent_locality_id = + std::uint32_t const parent_locality_id = threads::get_parent_locality_id(); if (~static_cast(0) != parent_locality_id) { @@ -144,11 +145,11 @@ namespace hpx { namespace util { { void operator()(std::ostream& to) const override { - threads::thread_id_type parent_id = threads::get_parent_id(); + threads::thread_id_type const parent_id = threads::get_parent_id(); if (nullptr != parent_id) { // called from inside a HPX thread - std::ptrdiff_t value = + auto const value = reinterpret_cast(parent_id.get()); util::format_to(to, "{:016x}", value); } @@ -166,7 +167,7 @@ namespace hpx { namespace util { { void operator()(std::ostream& to) const override { - std::size_t parent_phase = threads::get_parent_phase(); + std::size_t const parent_phase = threads::get_parent_phase(); if (0 != parent_phase) { // called from inside a HPX thread @@ -219,7 +220,7 @@ namespace hpx { namespace util { { switch (dest_) { - default: + // NOLINTNEXTLINE(bugprone-branch-clone) case logging_destination::hpx: LHPX_CONSOLE_(level_) << msg; break; @@ -252,10 +253,10 @@ namespace hpx { namespace util { std::string unescape(std::string const& value) { std::string result; - std::string::size_type pos = 0; - std::string::size_type pos1 = value.find_first_of('\\', 0); - if (std::string::npos != pos1) + if (std::string::size_type pos1 = value.find_first_of('\\', 0); + std::string::npos != pos1) { + std::string::size_type pos = 0; do { switch (value[pos1 + 1]) @@ -338,6 +339,7 @@ namespace hpx { namespace util { writer.set_destination(name, console_local(lvl, dest)); } +#if defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) /////////////////////////////////////////////////////////////////////// // initialize logging for AGAS void init_agas_log(logging::level lvl, std::string logdest, @@ -372,7 +374,7 @@ namespace hpx { namespace util { agas_logger()->set_enabled(lvl); } - void init_agas_log(runtime_configuration& ini, bool isconsole, + void init_agas_log(runtime_configuration const& ini, bool isconsole, void (*set_console_dest)(logger_writer_type&, char const*, logging::level, logging_destination), void (*define_formatters)(logging::writer::named_write&)) @@ -422,7 +424,7 @@ namespace hpx { namespace util { parcel_logger()->set_enabled(lvl); } - void init_parcel_log(runtime_configuration& ini, bool isconsole, + void init_parcel_log(runtime_configuration const& ini, bool isconsole, void (*set_console_dest)(logger_writer_type&, char const*, logging::level, logging_destination), void (*define_formatters)(logging::writer::named_write&)) @@ -473,7 +475,7 @@ namespace hpx { namespace util { timing_logger()->set_enabled(lvl); } - void init_timing_log(runtime_configuration& ini, bool isconsole, + void init_timing_log(runtime_configuration const& ini, bool isconsole, void (*set_console_dest)(logger_writer_type&, char const*, logging::level, logging_destination), void (*define_formatters)(logging::writer::named_write&)) @@ -488,6 +490,7 @@ namespace hpx { namespace util { HPX_MOVE(settings.format_), isconsole, set_console_dest, define_formatters); } +#endif /////////////////////////////////////////////////////////////////////// void init_hpx_log(logging::level lvl, std::string logdest, @@ -559,7 +562,7 @@ namespace hpx { namespace util { } } - void init_hpx_log(runtime_configuration& ini, bool isconsole, + void init_hpx_log(runtime_configuration const& ini, bool isconsole, void (*set_console_dest)(logger_writer_type&, char const*, logging::level, logging_destination), void (*define_formatters)(logging::writer::named_write&)) @@ -609,7 +612,7 @@ namespace hpx { namespace util { app_logger()->set_enabled(lvl); } - void init_app_log(runtime_configuration& ini, bool isconsole, + void init_app_log(runtime_configuration const& ini, bool isconsole, void (*set_console_dest)(logger_writer_type&, char const*, logging::level, logging_destination), void (*define_formatters)(logging::writer::named_write&)) @@ -660,7 +663,7 @@ namespace hpx { namespace util { debuglog_logger()->set_enabled(lvl); } - void init_debuglog_log(runtime_configuration& ini, bool isconsole, + void init_debuglog_log(runtime_configuration const& ini, bool isconsole, void (*set_console_dest)(logger_writer_type&, char const*, logging::level, logging_destination), void (*define_formatters)(logging::writer::named_write&)) @@ -677,6 +680,7 @@ namespace hpx { namespace util { define_formatters); } +#if defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) /////////////////////////////////////////////////////////////////////// void init_agas_console_log( logging::level lvl, std::string logdest, std::string logformat) @@ -795,6 +799,7 @@ namespace hpx { namespace util { init_timing_console_log( lvl, HPX_MOVE(settings.dest_), HPX_MOVE(settings.format_)); } +#endif /////////////////////////////////////////////////////////////////////// void init_hpx_console_log( @@ -935,21 +940,25 @@ namespace hpx { namespace util { default_set_console_dest = set_console_dest; default_define_formatters = define_formatters; +#if defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) // initialize normal logs init_agas_log(ini, isconsole, set_console_dest, define_formatters); init_parcel_log( ini, isconsole, set_console_dest, define_formatters); init_timing_log( ini, isconsole, set_console_dest, define_formatters); +#endif init_hpx_log(ini, isconsole, set_console_dest, define_formatters); init_app_log(ini, isconsole, set_console_dest, define_formatters); init_debuglog_log( ini, isconsole, set_console_dest, define_formatters); // initialize console logs +#if defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) init_agas_console_log(ini); init_parcel_console_log(ini); init_timing_console_log(ini); +#endif init_hpx_console_log(ini); init_app_console_log(ini); init_debuglog_console_log(ini); @@ -963,15 +972,11 @@ namespace hpx { namespace util { } // namespace detail /////////////////////////////////////////////////////////////////////////// - void disable_logging(logging_destination dest) + void disable_logging(logging_destination dest) noexcept { switch (dest) { - case logging_destination::hpx: - hpx_logger()->set_enabled(logging::level::disable_all); - hpx_console_logger()->set_enabled(logging::level::disable_all); - break; - +#if defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) case logging_destination::timing: timing_logger()->set_enabled(logging::level::disable_all); timing_console_logger()->set_enabled(logging::level::disable_all); @@ -986,6 +991,17 @@ namespace hpx { namespace util { parcel_logger()->set_enabled(logging::level::disable_all); parcel_console_logger()->set_enabled(logging::level::disable_all); break; +#else + case logging_destination::agas: + case logging_destination::timing: + case logging_destination::parcel: + [[fallthrough]]; +#endif + + case logging_destination::hpx: + hpx_logger()->set_enabled(logging::level::disable_all); + hpx_console_logger()->set_enabled(logging::level::disable_all); + break; case logging_destination::app: app_logger()->set_enabled(logging::level::disable_all); @@ -1010,14 +1026,7 @@ namespace hpx { namespace util { switch (dest) { - case logging_destination::hpx: - detail::init_hpx_log(lvl, logdest, logformat, - detail::default_isconsole, detail::default_set_console_dest, - detail::default_define_formatters); - detail::init_hpx_console_log( - lvl, HPX_MOVE(logdest), HPX_MOVE(logformat)); - break; - +#if defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) case logging_destination::timing: detail::init_timing_log(lvl, logdest, logformat, detail::default_isconsole, detail::default_set_console_dest, @@ -1041,6 +1050,20 @@ namespace hpx { namespace util { detail::init_parcel_console_log( lvl, HPX_MOVE(logdest), HPX_MOVE(logformat)); break; +#else + case logging_destination::agas: + case logging_destination::timing: + case logging_destination::parcel: + [[fallthrough]]; +#endif + + case logging_destination::hpx: + detail::init_hpx_log(lvl, logdest, logformat, + detail::default_isconsole, detail::default_set_console_dest, + detail::default_define_formatters); + detail::init_hpx_console_log( + lvl, HPX_MOVE(logdest), HPX_MOVE(logformat)); + break; case logging_destination::app: detail::init_app_log(lvl, logdest, logformat, @@ -1059,7 +1082,7 @@ namespace hpx { namespace util { break; } } -}} // namespace hpx::util +} // namespace hpx::util #else @@ -1070,15 +1093,15 @@ namespace hpx { namespace util { #include #include -namespace hpx { namespace util { +namespace hpx::util { ////////////////////////////////////////////////////////////////////////// - void enable_logging( - logging_destination, std::string const&, std::string, std::string) + void enable_logging(logging_destination, std::string const&, + std::string const&, std::string const&) { } - void disable_logging(logging_destination) {} + void disable_logging(logging_destination) noexcept {} ////////////////////////////////////////////////////////////////////////// namespace detail { @@ -1103,6 +1126,6 @@ namespace hpx { namespace util { } } } // namespace detail -}} // namespace hpx::util +} // namespace hpx::util #endif // HPX_HAVE_LOGGING diff --git a/libs/core/logging/CMakeLists.txt b/libs/core/logging/CMakeLists.txt index 632b5433e313..0fba9551fdb0 100644 --- a/libs/core/logging/CMakeLists.txt +++ b/libs/core/logging/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019 The STE||AR-Group +# Copyright (c) 2019-2023 The STE||AR-Group # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,6 +6,23 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +# Compatibility with various Boost types, introduced in V1.4.0 +hpx_option( + HPX_LOGGING_WITH_SEPARATE_DESTINATIONS + BOOL + "Enable separate logging channels for AGAS, timing, and parcel transport. (default: ON)" + ON + ADVANCED + CATEGORY "Modules" + MODULE LOGGING +) + +if(HPX_LOGGING_WITH_SEPARATE_DESTINATIONS) + hpx_add_config_define_namespace( + DEFINE HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS NAMESPACE LOGGING + ) +endif() + # Default location is $HPX_ROOT/libs/logging/include set(logging_headers hpx/modules/logging.hpp @@ -67,5 +84,6 @@ add_hpx_module( hpx_preprocessor hpx_timing hpx_thread_support + hpx_type_support CMAKE_SUBDIRS examples tests ) diff --git a/libs/core/logging/include/hpx/logging/detail/logger.hpp b/libs/core/logging/include/hpx/logging/detail/logger.hpp index 65f5a29702a3..dce86781ad32 100644 --- a/libs/core/logging/include/hpx/logging/detail/logger.hpp +++ b/libs/core/logging/include/hpx/logging/detail/logger.hpp @@ -168,7 +168,7 @@ namespace hpx::util::logging { } public: - HPX_CORE_EXPORT void turn_cache_off(); + HPX_CORE_EXPORT void turn_cache_off() const; // called after all data has been gathered void write(message msg) const diff --git a/libs/core/logging/include/hpx/logging/message.hpp b/libs/core/logging/include/hpx/logging/message.hpp index 190cb0bf8ad5..17777176bb95 100644 --- a/libs/core/logging/include/hpx/logging/message.hpp +++ b/libs/core/logging/include/hpx/logging/message.hpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -28,14 +29,14 @@ namespace hpx::util::logging { /** - @brief Optimizes the formatting for prepending and/or appending + @brief Optimizes the formatting for pre-pending and/or appending strings to the original message It keeps all the modified message in one string. Useful if some formatter needs to access the whole string at once. - reserve() - the size that is reserved for prepending + reserve() - the size that is reserved for pre-pending (similar to string::reserve function) Note : as strings are prepended, reserve() shrinks. @@ -48,12 +49,13 @@ namespace hpx::util::logging { /** @param msg - the message that is originally cached */ - explicit message([[maybe_unused]] std::stringstream msg) noexcept + explicit message(std::stringstream msg) noexcept : m_full_msg_computed(false) #if defined(HPX_COMPUTE_HOST_CODE) , m_str(HPX_MOVE(msg)) #endif { + HPX_UNUSED(msg); } message(message&& other) noexcept diff --git a/libs/core/logging/include/hpx/modules/logging.hpp b/libs/core/logging/include/hpx/modules/logging.hpp index 1b90aa4aed27..3d438adfe43c 100644 --- a/libs/core/logging/include/hpx/modules/logging.hpp +++ b/libs/core/logging/include/hpx/modules/logging.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -7,6 +7,7 @@ #pragma once #include +#include namespace hpx { @@ -84,8 +85,30 @@ namespace hpx::util { std::string const& env, bool allow_always = false); } + //////////////////////////////////////////////////////////////////////////// + HPX_CORE_EXPORT HPX_DECLARE_LOG(hpx) + HPX_CORE_EXPORT HPX_DECLARE_LOG(hpx_console) + +#define LHPX_(lvl, cat) \ + HPX_LOG_FORMAT(hpx::util::hpx, ::hpx::util::logging::level::lvl, "{}{}", \ + ::hpx::util::logging::level::lvl, (cat)) /**/ + +#define LHPX_ENABLED(lvl) \ + hpx::util::hpx_logger()->is_enabled(::hpx::util::logging::level::lvl) /**/ + + //////////////////////////////////////////////////////////////////////////// + // errors are logged in a special manner (always to cerr and additionally, + // if enabled to 'normal' logging destination as well) + HPX_CORE_EXPORT HPX_DECLARE_LOG(hpx_error) + +#define LFATAL_ \ + HPX_LOG_FORMAT(hpx::util::hpx_error, ::hpx::util::logging::level::fatal, \ + "{} [ERR] ", ::hpx::util::logging::level::fatal) + +#if defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) /////////////////////////////////////////////////////////////////////////// HPX_CORE_EXPORT HPX_DECLARE_LOG(agas) + HPX_CORE_EXPORT HPX_DECLARE_LOG(agas_console) #define LAGAS_(lvl) \ HPX_LOG_FORMAT(hpx::util::agas, ::hpx::util::logging::level::lvl, "{} ", \ @@ -96,6 +119,7 @@ namespace hpx::util { //////////////////////////////////////////////////////////////////////////// HPX_CORE_EXPORT HPX_DECLARE_LOG(parcel) + HPX_CORE_EXPORT HPX_DECLARE_LOG(parcel_console) #define LPT_(lvl) \ HPX_LOG_FORMAT(hpx::util::parcel, ::hpx::util::logging::level::lvl, "{} ", \ @@ -107,6 +131,7 @@ namespace hpx::util { //////////////////////////////////////////////////////////////////////////// HPX_CORE_EXPORT HPX_DECLARE_LOG(timing) + HPX_CORE_EXPORT HPX_DECLARE_LOG(timing_console) #define LTIM_(lvl) \ HPX_LOG_FORMAT(hpx::util::timing, ::hpx::util::logging::level::lvl, "{} ", \ @@ -119,18 +144,24 @@ namespace hpx::util { hpx::util::timing_logger()->is_enabled( \ ::hpx::util::logging::level::lvl) /**/ - //////////////////////////////////////////////////////////////////////////// - HPX_CORE_EXPORT HPX_DECLARE_LOG(hpx) +#else -#define LHPX_(lvl, cat) \ - HPX_LOG_FORMAT(hpx::util::hpx, ::hpx::util::logging::level::lvl, "{}{}", \ - ::hpx::util::logging::level::lvl, (cat)) /**/ +#define LAGAS_(lvl) LHPX_(lvl, "[AGAS] ") +#define LAGAS_ENABLED(lvl) LHPX_ENABLED(lvl) -#define LHPX_ENABLED(lvl) \ - hpx::util::hpx_logger()->is_enabled(::hpx::util::logging::level::lvl) /**/ +#define LPT_(lvl) LHPX_(lvl, " [PT] ") +#define LPT_ENABLED(lvl) LHPX_ENABLED(lvl) + +#define LTIM_(lvl) LHPX_(lvl, " [TIM] ") +#define LPROGRESS_ LTIM_(fatal) +#define LTIM_ENABLED(lvl) LHPX_ENABLED(lvl) + +#endif //////////////////////////////////////////////////////////////////////////// + // Application specific logging HPX_CORE_EXPORT HPX_DECLARE_LOG(app) + HPX_CORE_EXPORT HPX_DECLARE_LOG(app_console) #define LAPP_(lvl) \ HPX_LOG_FORMAT(hpx::util::app, ::hpx::util::logging::level::lvl, "{} ", \ @@ -142,6 +173,7 @@ namespace hpx::util { //////////////////////////////////////////////////////////////////////////// // special debug logging channel HPX_CORE_EXPORT HPX_DECLARE_LOG(debuglog) + HPX_CORE_EXPORT HPX_DECLARE_LOG(debuglog_console) #define LDEB_ \ HPX_LOG_FORMAT(hpx::util::debuglog, ::hpx::util::logging::level::error, \ @@ -151,27 +183,10 @@ namespace hpx::util { hpx::util::debuglog_logger()->is_enabled( \ ::hpx::util::logging::level::error) /**/ - //////////////////////////////////////////////////////////////////////////// - // errors are logged in a special manner (always to cerr and additionally, - // if enabled to 'normal' logging destination as well) - HPX_CORE_EXPORT HPX_DECLARE_LOG(hpx_error) - -#define LFATAL_ \ - HPX_LOG_FORMAT(hpx::util::hpx_error, ::hpx::util::logging::level::fatal, \ - "{} [ERR] ", ::hpx::util::logging::level::fatal) - - HPX_CORE_EXPORT HPX_DECLARE_LOG(agas_console) - HPX_CORE_EXPORT HPX_DECLARE_LOG(parcel_console) - HPX_CORE_EXPORT HPX_DECLARE_LOG(timing_console) - HPX_CORE_EXPORT HPX_DECLARE_LOG(hpx_console) - HPX_CORE_EXPORT HPX_DECLARE_LOG(app_console) - - // special debug logging channel - HPX_CORE_EXPORT HPX_DECLARE_LOG(debuglog_console) - // clang-format on } // namespace hpx::util +#if defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) /////////////////////////////////////////////////////////////////////////////// #define LAGAS_CONSOLE_(lvl) \ HPX_LOG_USE_LOG(hpx::util::agas_console, \ @@ -187,6 +202,11 @@ namespace hpx::util { HPX_LOG_USE_LOG(hpx::util::timing_console, \ static_cast<::hpx::util::logging::level>(lvl)) \ /**/ +#else +#define LAGAS_CONSOLE_(lvl) LHPX_CONSOLE_(lvl) +#define LPT_CONSOLE_(lvl) LHPX_CONSOLE_(lvl) +#define LTIM_CONSOLE_(lvl) LHPX_CONSOLE_(lvl) +#endif #define LHPX_CONSOLE_(lvl) \ HPX_LOG_USE_LOG( \ diff --git a/libs/core/logging/src/logging.cpp b/libs/core/logging/src/logging.cpp index 31077de5b41a..f3a4997b3dc4 100644 --- a/libs/core/logging/src/logging.cpp +++ b/libs/core/logging/src/logging.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -8,13 +8,12 @@ #include #if defined(HPX_HAVE_LOGGING) +#include + #include #include #include -#include -#include -#include #include #include #include @@ -22,8 +21,6 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx::util { - HPX_DEFINE_LOG(agas, disable_all) - HPX_DEFINE_LOG(agas_console, disable_all) HPX_DEFINE_LOG(app, disable_all) HPX_DEFINE_LOG(app_console, disable_all) HPX_DEFINE_LOG(app_error, fatal) @@ -33,10 +30,15 @@ namespace hpx::util { HPX_DEFINE_LOG(hpx, disable_all) HPX_DEFINE_LOG(hpx_console, disable_all) HPX_DEFINE_LOG(hpx_error, fatal) + +#if defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) + HPX_DEFINE_LOG(agas, disable_all) + HPX_DEFINE_LOG(agas_console, disable_all) HPX_DEFINE_LOG(parcel, disable_all) HPX_DEFINE_LOG(parcel_console, disable_all) HPX_DEFINE_LOG(timing, disable_all) HPX_DEFINE_LOG(timing_console, disable_all) +#endif namespace detail { @@ -45,7 +47,7 @@ namespace hpx::util { { try { - int env_val = hpx::util::from_string(env); + int const env_val = hpx::util::from_string(env); if (env_val < 0) return hpx::util::logging::level::disable_all; @@ -81,7 +83,7 @@ namespace hpx::util { namespace hpx::util::logging { - void logger::turn_cache_off() + void logger::turn_cache_off() const { if (m_is_caching_off) return; // already turned off diff --git a/libs/core/mpi_base/include/hpx/mpi_base/mpi_environment.hpp b/libs/core/mpi_base/include/hpx/mpi_base/mpi_environment.hpp index d01d27cb4151..c8746f39d59f 100644 --- a/libs/core/mpi_base/include/hpx/mpi_base/mpi_environment.hpp +++ b/libs/core/mpi_base/include/hpx/mpi_base/mpi_environment.hpp @@ -29,16 +29,16 @@ namespace hpx::util { static int init(int* argc, char*** argv, int const minimal, int const required, int& provided); static void init(int* argc, char*** argv, runtime_configuration& cfg); - static void finalize(); + static void finalize() noexcept; - static bool enabled(); - static bool multi_threaded(); - static bool has_called_init(); + static bool enabled() noexcept; + static bool multi_threaded() noexcept; + static bool has_called_init() noexcept; - static int rank(); - static int size(); + static int rank() noexcept; + static int size() noexcept; - static MPI_Comm& communicator(); + static MPI_Comm& communicator() noexcept; static std::string get_processor_name(); @@ -54,7 +54,13 @@ namespace hpx::util { ~scoped_lock(); - static void unlock(); + constexpr bool owns_lock() const noexcept + { + return locked; + } + + void unlock(); + bool locked; }; struct HPX_CORE_EXPORT scoped_try_lock @@ -69,6 +75,11 @@ namespace hpx::util { ~scoped_try_lock(); + constexpr bool owns_lock() const noexcept + { + return locked; + } + void unlock(); bool locked; }; diff --git a/libs/core/mpi_base/src/mpi_environment.cpp b/libs/core/mpi_base/src/mpi_environment.cpp index d50590c57d9e..3fe15d7a1d20 100644 --- a/libs/core/mpi_base/src/mpi_environment.cpp +++ b/libs/core/mpi_base/src/mpi_environment.cpp @@ -16,10 +16,11 @@ #include #include +#include #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace util { +namespace hpx::util { namespace detail { @@ -39,7 +40,7 @@ namespace hpx { namespace util { mpi_environment_strings, sep); for (auto const& tok : tokens) { - if (char* env = std::getenv(tok.c_str())) + if (char const* env = std::getenv(tok.c_str())) { LBT_(debug) << "Found MPI environment variable: " << tok << "=" @@ -91,12 +92,12 @@ namespace hpx { namespace util { return false; #endif } -}} // namespace hpx::util +} // namespace hpx::util #if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI)) || \ defined(HPX_HAVE_MODULE_MPI_BASE) -namespace hpx { namespace util { +namespace hpx::util { mpi_environment::mutex_type mpi_environment::mtx_; bool mpi_environment::enabled_ = false; @@ -119,6 +120,7 @@ namespace hpx { namespace util { { return retval; } + if (!is_initialized) { retval = MPI_Init_thread(nullptr, nullptr, required, &provided); @@ -174,12 +176,12 @@ namespace hpx { namespace util { rtcfg.add_entry("hpx.parcel.bootstrap", "mpi"); - int required = MPI_THREAD_SINGLE; + int required = MPI_THREAD_SERIALIZED; #if defined(HPX_HAVE_PARCELPORT_MPI_MULTITHREADED) required = (get_entry_as(rtcfg, "hpx.parcel.mpi.multithreaded", 1) != 0) ? MPI_THREAD_MULTIPLE : - MPI_THREAD_SINGLE; + MPI_THREAD_SERIALIZED; #if defined(MVAPICH2_VERSION) && defined(_POSIX_SOURCE) // This enables multi threading support in MVAPICH2 if requested. @@ -216,9 +218,9 @@ namespace hpx { namespace util { MPI_Comm_dup(MPI_COMM_WORLD, &communicator_); - if (provided_threading_flag_ < MPI_THREAD_SERIALIZED) + if (provided_threading_flag_ <= MPI_THREAD_SERIALIZED) { - // explicitly disable mpi if not run by mpirun + // explicitly disable multi-threaded mpi if needed rtcfg.add_entry("hpx.parcel.mpi.multithreaded", "0"); } @@ -230,8 +232,8 @@ namespace hpx { namespace util { "mpi_environment::init: MPI_Init_thread: " "The underlying MPI implementation only supports " "MPI_THREAD_FUNNELED. This mode is not supported by HPX. " - "Please pass -Ihpx.parcel.mpi.multithreaded=0 to explicitly " - "disable MPI multi-threading."); + "Please pass -hpx:ini=hpx.parcel.mpi.multithreaded=0 to " + "explicitly disable MPI multi-threading."); } this_rank = rank(); @@ -257,17 +259,21 @@ namespace hpx { namespace util { std::string mpi_environment::get_processor_name() { + scoped_lock l; + char name[MPI_MAX_PROCESSOR_NAME + 1] = {'\0'}; int len = 0; MPI_Get_processor_name(name, &len); - return name; + return {name}; } - void mpi_environment::finalize() + void mpi_environment::finalize() noexcept { if (enabled() && has_called_init()) { + scoped_lock l; + int is_finalized = 0; MPI_Finalized(&is_finalized); if (!is_finalized) @@ -277,43 +283,50 @@ namespace hpx { namespace util { } } - bool mpi_environment::enabled() + bool mpi_environment::enabled() noexcept { return enabled_; } - bool mpi_environment::multi_threaded() + bool mpi_environment::multi_threaded() noexcept { - return provided_threading_flag_ >= MPI_THREAD_SERIALIZED; + return provided_threading_flag_ > MPI_THREAD_SERIALIZED; } - bool mpi_environment::has_called_init() + bool mpi_environment::has_called_init() noexcept { return has_called_init_; } - int mpi_environment::size() + int mpi_environment::size() noexcept { int res(-1); if (enabled()) + { + scoped_lock l; MPI_Comm_size(communicator(), &res); + } return res; } - int mpi_environment::rank() + int mpi_environment::rank() noexcept { int res(-1); if (enabled()) + { + scoped_lock l; MPI_Comm_rank(communicator(), &res); + } return res; } - MPI_Comm& mpi_environment::communicator() + MPI_Comm& mpi_environment::communicator() noexcept { return communicator_; } mpi_environment::scoped_lock::scoped_lock() + : locked(true) { if (!multi_threaded()) mtx_.lock(); @@ -322,13 +335,19 @@ namespace hpx { namespace util { mpi_environment::scoped_lock::~scoped_lock() { if (!multi_threaded()) + { + locked = false; mtx_.unlock(); + } } void mpi_environment::scoped_lock::unlock() { if (!multi_threaded()) + { + locked = false; mtx_.unlock(); + } } mpi_environment::scoped_try_lock::scoped_try_lock() @@ -343,7 +362,10 @@ namespace hpx { namespace util { mpi_environment::scoped_try_lock::~scoped_try_lock() { if (!multi_threaded() && locked) + { + locked = false; mtx_.unlock(); + } } void mpi_environment::scoped_try_lock::unlock() @@ -354,6 +376,6 @@ namespace hpx { namespace util { mtx_.unlock(); } } -}} // namespace hpx::util +} // namespace hpx::util #endif diff --git a/libs/core/runtime_local/src/runtime_local.cpp b/libs/core/runtime_local/src/runtime_local.cpp index d77231ca487d..fc00acfc3d7c 100644 --- a/libs/core/runtime_local/src/runtime_local.cpp +++ b/libs/core/runtime_local/src/runtime_local.cpp @@ -1348,19 +1348,22 @@ namespace hpx { if (call_startup) { call_startup_functions(true); - lbt_ << "(3rd stage) run_helper: ran pre-startup functions"; + lbt_ << "(3rd stage, local) runtime::run_helper: ran " + "pre-startup functions"; call_startup_functions(false); - lbt_ << "(4th stage) run_helper: ran startup functions"; + lbt_ << "(4th stage, local) runtime::run_helper: ran startup " + "functions"; } - lbt_ << "(4th stage) runtime::run_helper: bootstrap complete"; + lbt_ + << "(4th stage, local) runtime::run_helper: bootstrap complete"; set_state(hpx::state::running); // Now, execute the user supplied thread function (hpx_main) if (!!func) { - lbt_ << "(last stage) runtime::run_helper: about to " + lbt_ << "(last stage, local) runtime::run_helper: about to " "invoke hpx_main"; // Change our thread description, as we're about to call hpx_main diff --git a/libs/core/thread_pools/src/detail/background_thread.cpp b/libs/core/thread_pools/src/detail/background_thread.cpp index 6bd914a768d5..6906b05a9b65 100644 --- a/libs/core/thread_pools/src/detail/background_thread.cpp +++ b/libs/core/thread_pools/src/detail/background_thread.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -67,6 +68,11 @@ namespace hpx::threads::detail { scheduler_base.increment_background_thread_count(); + LTM_(debug).format("create_background_thread: pool({}), " + "scheduler({}), worker_thread({}), thread({})", + scheduler_base.get_parent_pool(), scheduler_base, num_thread, + get_thread_id_data(background_thread)); + // We can now set the state to pending get_thread_id_data(background_thread) ->set_state(thread_schedule_state::pending); @@ -180,7 +186,12 @@ namespace hpx::threads::detail { hpx::execution_base::this_thread::detail::agent_storage* context_storage) { - if (HPX_UNLIKELY(background_thread)) + LTM_(debug).format("call_background_thread: pool({}), " + "scheduler({}), worker_thread({}), thread({})", + scheduler_base.get_parent_pool(), scheduler_base, num_thread, + get_thread_id_data(background_thread)); + + if (HPX_LIKELY(background_thread)) { auto* thrdptr = get_thread_id_data(background_thread); thread_state state = thrdptr->get_state(); @@ -236,11 +247,23 @@ namespace hpx::threads::detail { } else if (thread_schedule_state::terminated == state_val) { + LTM_(debug).format( + "call_background_thread terminated: pool({}), " + "scheduler({}), worker_thread({}), thread({})", + scheduler_base.get_parent_pool(), scheduler_base, + num_thread, get_thread_id_data(background_thread)); + scheduler_base.decrement_background_thread_count(); background_thread = thread_id_type(); } else if (thread_schedule_state::suspended == state_val) { + LTM_(debug).format( + "call_background_thread suspended: pool({}), " + "scheduler({}), worker_thread({}), thread({})", + scheduler_base.get_parent_pool(), scheduler_base, + num_thread, get_thread_id_data(background_thread)); + return false; } } diff --git a/libs/full/agas/src/route.cpp b/libs/full/agas/src/route.cpp index 3355ddb163de..3fde16520a9f 100644 --- a/libs/full/agas/src/route.cpp +++ b/libs/full/agas/src/route.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2011 Vinay C Amatya -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -43,6 +43,8 @@ namespace hpx::agas::server { void primary_namespace::route(parcelset::parcel&& p) { + LPT_(debug).format("primary_namespace::route: {}", p.parcel_id()); + util::scoped_timer> update( counter_data_.route_.time_, counter_data_.route_.enabled_); counter_data_.increment_route_count(); @@ -92,7 +94,7 @@ namespace hpx::agas::server { addr.address_ = g.lva(); } - hpx::id_type source = p.source_id(); + hpx::id_type const source = p.source_id(); // either send the parcel on its way or execute actions locally if (naming::get_locality_id_from_gid(addr.locality_) == @@ -113,21 +115,21 @@ namespace hpx::agas::server { hpx::parcelset::put_parcel(HPX_MOVE(p)); } - runtime& rt = get_runtime(); + runtime const& rt = get_runtime(); if (rt.get_state() < hpx::state::pre_shutdown) { - // asynchronously update cache on source locality - // update remote cache if the id is not flagged otherwise + // asynchronously update cache on source locality update remote + // cache if the id is not flagged otherwise naming::gid_type const& id = hpx::get<0>(cache_address); if (id && naming::detail::store_in_cache(id)) { gva const& g = hpx::get<1>(cache_address); - naming::address addr(g.prefix, g.type, g.lva()); + naming::address address(g.prefix, g.type, g.lva()); HPX_ASSERT(naming::is_locality(source)); hpx::post( - source, id, addr, g.count, g.offset); + source, id, address, g.count, g.offset); } } } diff --git a/libs/full/command_line_handling/include/hpx/command_line_handling/command_line_handling.hpp b/libs/full/command_line_handling/include/hpx/command_line_handling/command_line_handling.hpp index 173ae0002a71..55ed47532afd 100644 --- a/libs/full/command_line_handling/include/hpx/command_line_handling/command_line_handling.hpp +++ b/libs/full/command_line_handling/include/hpx/command_line_handling/command_line_handling.hpp @@ -49,7 +49,8 @@ namespace hpx::util { std::vector& ini_config, std::size_t& node, bool initial = false); - void enable_logging_settings(hpx::program_options::variables_map& vm, + static void enable_logging_settings( + hpx::program_options::variables_map& vm, std::vector& ini_config); }; } // namespace hpx::util diff --git a/libs/full/command_line_handling/src/command_line_handling.cpp b/libs/full/command_line_handling/src/command_line_handling.cpp index 5c08e36f6b07..a04e3073bd8d 100644 --- a/libs/full/command_line_handling/src/command_line_handling.cpp +++ b/libs/full/command_line_handling/src/command_line_handling.cpp @@ -5,6 +5,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include +#include + #include #include #include @@ -700,9 +702,9 @@ namespace hpx::util { num_threads_ = detail::handle_num_threads(cfgmap, rtcfg_, vm, env, using_nodelist, initial, use_process_mask_); - num_cores_ = - hpx::local::detail::handle_num_cores(cfgmap, vm, num_threads_, - detail::get_number_of_default_cores(env, use_process_mask_)); + num_cores_ = hpx::local::detail::handle_num_cores_default(cfgmap, vm, + num_threads_, + detail::get_number_of_default_cores(env, use_process_mask_)); // Set number of cores and OS threads in configuration. ini_config.emplace_back( @@ -866,7 +868,7 @@ namespace hpx::util { { base_type::enable_logging_settings(vm, ini_config); -#if defined(HPX_HAVE_LOGGING) +#if defined(HPX_HAVE_LOGGING) && defined(HPX_LOGGING_HAVE_SEPARATE_DESTINATIONS) if (vm.count("hpx:debug-agas-log")) { ini_config.emplace_back("hpx.logging.console.agas.destination=" + @@ -893,12 +895,11 @@ namespace hpx::util { #else if (vm.count("hpx:debug-agas-log") || vm.count("hpx:debug-parcel-log")) { - // clang-format off throw hpx::detail::command_line_error( - "Command line option error: can't enable logging while it " - "was disabled at configuration time. Please re-configure " - "HPX using the option -DHPX_WITH_LOGGING=On."); - // clang-format on + "Command line option error: can't enable logging while it was " + "disabled at configuration time. Please re-configure HPX using " + "the options -DHPX_WITH_LOGGING=On and " + "-DHPX_LOGGING_WITH_SEPARATE_DESTINATIONS=On."); } #endif } diff --git a/libs/full/command_line_handling/src/parse_command_line.cpp b/libs/full/command_line_handling/src/parse_command_line.cpp index 0b882ec84373..a2a6a0a4896e 100644 --- a/libs/full/command_line_handling/src/parse_command_line.cpp +++ b/libs/full/command_line_handling/src/parse_command_line.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/libs/full/init_runtime/src/pre_main.cpp b/libs/full/init_runtime/src/pre_main.cpp index 5a2dda3a80c0..a9b9e77f5995 100644 --- a/libs/full/init_runtime/src/pre_main.cpp +++ b/libs/full/init_runtime/src/pre_main.cpp @@ -196,7 +196,7 @@ namespace hpx { namespace detail { // all user code, including startup functions, are only run after the // component tables are populated. distributed::barrier::synchronize(); - lbt_ << "(5th stage) pre_main: passed 4th stage boot barrier"; + lbt_ << "(5th stage) pre_main: passed 5th stage boot barrier"; } // Enable logging. Even if we terminate at this point we will see all diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/header.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/header.hpp index 6b5d011cf029..953609bbb0ac 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/header.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/header.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2021 Hartmut Kaiser +// Copyright (c) 2013-2023 Hartmut Kaiser // Copyright (c) 2013-2015 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 @@ -11,7 +11,7 @@ #if defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI) #include - +#include #include #include @@ -37,30 +37,35 @@ namespace hpx::parcelset::policies::mpi { pos_piggy_back_data = 5 * sizeof(value_type) + 1 }; - static constexpr int data_size_ = 512; + static constexpr std::int32_t data_size_ = 512; template header(Buffer const& buffer, int tag) noexcept { - std::int64_t size = static_cast(buffer.size_); - std::int64_t numbytes = - static_cast(buffer.data_size_); + init(buffer, tag); + } + + template + void init(Buffer const& buffer, int tag) noexcept + { + auto const size = static_cast(buffer.size_); + auto const numbytes = static_cast(buffer.data_size_); HPX_ASSERT(size <= (std::numeric_limits::max)()); HPX_ASSERT(numbytes <= (std::numeric_limits::max)()); - set(tag); - set(static_cast(size)); - set(static_cast(numbytes)); - set( + set(pos_tag, tag); + set(pos_size, static_cast(size)); + set(pos_numbytes, static_cast(numbytes)); + set(pos_numchunks_first, static_cast(buffer.num_chunks_.first)); - set( + set(pos_numchunks_second, static_cast(buffer.num_chunks_.second)); if (buffer.data_.size() <= (data_size_ - pos_piggy_back_data)) { data_[pos_piggy_back_flag] = 1; - std::memcpy(&data_[pos_piggy_back_data], &buffer.data_[0], + std::memcpy(&data_[pos_piggy_back_data], buffer.data_.data(), buffer.data_.size()); } else @@ -76,11 +81,11 @@ namespace hpx::parcelset::policies::mpi { void reset() noexcept { - std::memset(&data_[0], static_cast(-1), data_size_); + std::memset(data_.data(), static_cast(-1), data_size_); data_[pos_piggy_back_flag] = 1; } - bool valid() const noexcept + [[nodiscard]] constexpr bool valid() const noexcept { return data_[0] != static_cast(-1); } @@ -96,31 +101,32 @@ namespace hpx::parcelset::policies::mpi { constexpr char* data() noexcept { - return &data_[0]; + return data_.data(); } - value_type tag() const noexcept + [[nodiscard]] constexpr value_type tag() const noexcept { - return get(); + return get(pos_tag); } - value_type size() const noexcept + [[nodiscard]] constexpr value_type size() const noexcept { - return get(); + return get(pos_size); } - value_type numbytes() const noexcept + [[nodiscard]] constexpr value_type numbytes() const noexcept { - return get(); + return get(pos_numbytes); } - std::pair num_chunks() const noexcept + [[nodiscard]] constexpr std::pair num_chunks() + const noexcept { return std::make_pair( - get(), get()); + get(pos_numchunks_first), get(pos_numchunks_second)); } - constexpr char* piggy_back() noexcept + [[nodiscard]] constexpr char* piggy_back() noexcept { if (data_[pos_piggy_back_flag]) return &data_[pos_piggy_back_data]; @@ -130,18 +136,14 @@ namespace hpx::parcelset::policies::mpi { private: std::array data_; - template - void set(T const& t) noexcept + constexpr void set(std::size_t Pos, value_type const& t) noexcept { - std::memcpy(&data_[Pos], &t, sizeof(t)); + *hpx::bit_cast(&data_[Pos]) = t; } - template - value_type get() const noexcept + [[nodiscard]] constexpr value_type get(std::size_t Pos) const noexcept { - value_type res; - std::memcpy(&res, &data_[Pos], sizeof(res)); - return res; + return *hpx::bit_cast(&data_[Pos]); } }; } // namespace hpx::parcelset::policies::mpi diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/locality.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/locality.hpp index ac0bd60ff7dc..0d2e3983485b 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/locality.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/locality.hpp @@ -13,6 +13,7 @@ #include #include +#include namespace hpx::parcelset::policies::mpi { @@ -29,17 +30,17 @@ namespace hpx::parcelset::policies::mpi { { } - constexpr std::int32_t rank() const noexcept + [[nodiscard]] constexpr std::int32_t rank() const noexcept { return rank_; } - static constexpr const char* type() noexcept + [[nodiscard]] static constexpr const char* type() noexcept { return "mpi"; } - explicit constexpr operator bool() const noexcept + [[nodiscard]] explicit constexpr operator bool() const noexcept { return rank_ != -1; } @@ -48,13 +49,14 @@ namespace hpx::parcelset::policies::mpi { HPX_EXPORT void load(serialization::input_archive& ar); private: - friend bool operator==( + friend constexpr bool operator==( locality const& lhs, locality const& rhs) noexcept { return lhs.rank_ == rhs.rank_; } - friend bool operator<(locality const& lhs, locality const& rhs) noexcept + friend constexpr bool operator<( + locality const& lhs, locality const& rhs) noexcept { return lhs.rank_ < rhs.rank_; } diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver.hpp index 1d630dce65fd..eb9805513edb 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver.hpp @@ -12,21 +12,18 @@ #if defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI) #include #include - +#include #include #include #include #include -#include #include #include #include #include #include -#include - namespace hpx::parcelset::policies::mpi { template @@ -47,7 +44,9 @@ namespace hpx::parcelset::policies::mpi { void run() noexcept { util::mpi_environment::scoped_lock l; - new_header(); + + [[maybe_unused]] header h; + new_header(l, h); } bool background_work() noexcept @@ -59,7 +58,7 @@ namespace hpx::parcelset::policies::mpi { // already accepted ones. if (!connection) { - std::unique_lock l(connections_mtx_, std::try_to_lock); + std::unique_lock const l(connections_mtx_, std::try_to_lock); if (l.owns_lock() && !connections_.empty()) { connection = HPX_MOVE(connections_.front()); @@ -80,7 +79,7 @@ namespace hpx::parcelset::policies::mpi { { if (!connection->receive()) { - std::unique_lock l(connections_mtx_); + std::unique_lock const l(connections_mtx_); connections_.push_back(HPX_MOVE(connection)); } } @@ -98,7 +97,8 @@ namespace hpx::parcelset::policies::mpi { template connection_ptr accept_locked(Lock& header_lock) { - connection_ptr res; + HPX_ASSERT_OWNS_LOCK(header_lock); + util::mpi_environment::scoped_try_lock l; // Caller failing to hold lock 'header_lock' before calling function @@ -110,14 +110,16 @@ namespace hpx::parcelset::policies::mpi { if (l.locked) { MPI_Status status; - if (request_done_locked(hdr_request_, &status)) + if (request_done_locked(l, hdr_request_, &status)) { - header h = new_header(); + header h; + new_header(l, h); + l.unlock(); header_lock.unlock(); - res.reset(new connection_type(status.MPI_SOURCE, h, pp_)); - return res; + return std::make_shared( + status.MPI_SOURCE, h, pp_); } } @@ -125,19 +127,21 @@ namespace hpx::parcelset::policies::mpi { #pragma warning(pop) #endif - return res; //-V614 + return {}; } - header new_header() noexcept + template + void new_header([[maybe_unused]] Lock& l, header& h) noexcept { - header h = rcv_header_; - rcv_header_.reset(); + HPX_ASSERT_OWNS_LOCK(l); - MPI_Irecv(rcv_header_.data(), rcv_header_.data_size_, MPI_BYTE, - MPI_ANY_SOURCE, 0, util::mpi_environment::communicator(), - &hdr_request_); + h = rcv_header_; + rcv_header_.reset(); - return h; + [[maybe_unused]] int const ret = MPI_Irecv(rcv_header_.data(), + header::data_size_, MPI_BYTE, MPI_ANY_SOURCE, 0, + util::mpi_environment::communicator(), &hdr_request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); } Parcelport& pp_; @@ -152,17 +156,17 @@ namespace hpx::parcelset::policies::mpi { hpx::spinlock connections_mtx_; connection_list connections_; - bool request_done_locked(MPI_Request& r, MPI_Status* status) noexcept + template + static bool request_done_locked([[maybe_unused]] Lock& l, + MPI_Request& r, MPI_Status* status) noexcept { + HPX_ASSERT_OWNS_LOCK(l); + int completed = 0; - int ret = MPI_Test(&r, &completed, status); - HPX_ASSERT(ret == MPI_SUCCESS); - (void) ret; - if (completed) - { - return true; - } - return false; + [[maybe_unused]] int const ret = MPI_Test(&r, &completed, status); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + + return completed ? true : false; } }; } // namespace hpx::parcelset::policies::mpi diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp index 3893e7b78ce8..f831c3339370 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp @@ -1,5 +1,5 @@ // Copyright (c) 2014-2015 Thomas Heller -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -12,11 +12,12 @@ #if defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI) #include #include -#include - #include #include #include +#if defined(HPX_HAVE_PARCELPORT_COUNTERS) +#include +#endif #include #include @@ -24,8 +25,6 @@ #include #include -#include - namespace hpx::parcelset::policies::mpi { template @@ -45,7 +44,7 @@ namespace hpx::parcelset::policies::mpi { using buffer_type = parcel_buffer; public: - receiver_connection(int src, header h, Parcelport& pp) noexcept + receiver_connection(int src, header const& h, Parcelport& pp) noexcept : state_(initialized) , src_(src) , tag_(h.tag()) @@ -93,9 +92,9 @@ namespace hpx::parcelset::policies::mpi { bool receive_transmission_chunks(std::size_t num_thread = -1) { // determine the size of the chunk buffer - std::size_t num_zero_copy_chunks = static_cast( + auto const num_zero_copy_chunks = static_cast( static_cast(buffer_.num_chunks_.first)); - std::size_t num_non_zero_copy_chunks = static_cast( + auto const num_non_zero_copy_chunks = static_cast( static_cast(buffer_.num_chunks_.second)); buffer_.transmission_chunks_.resize( num_zero_copy_chunks + num_non_zero_copy_chunks); @@ -104,11 +103,15 @@ namespace hpx::parcelset::policies::mpi { buffer_.chunks_.resize(num_zero_copy_chunks); { util::mpi_environment::scoped_lock l; - MPI_Irecv(buffer_.transmission_chunks_.data(), + + [[maybe_unused]] int const ret = MPI_Irecv( + buffer_.transmission_chunks_.data(), static_cast(buffer_.transmission_chunks_.size() * sizeof(buffer_type::transmission_chunk_type)), MPI_BYTE, src_, tag_, util::mpi_environment::communicator(), &request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + request_ptr_ = &request_; } } @@ -125,18 +128,20 @@ namespace hpx::parcelset::policies::mpi { return false; } - char* piggy_back = header_.piggy_back(); - if (piggy_back) + if (char const* piggy_back = header_.piggy_back()) { std::memcpy( - &buffer_.data_[0], piggy_back, buffer_.data_.size()); + buffer_.data_.data(), piggy_back, buffer_.data_.size()); } else { util::mpi_environment::scoped_lock l; - MPI_Irecv(buffer_.data_.data(), + + [[maybe_unused]] int const ret = MPI_Irecv(buffer_.data_.data(), static_cast(buffer_.data_.size()), MPI_BYTE, src_, tag_, util::mpi_environment::communicator(), &request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + request_ptr_ = &request_; } @@ -154,17 +159,20 @@ namespace hpx::parcelset::policies::mpi { return false; } - std::size_t idx = chunks_idx_++; - std::size_t chunk_size = + std::size_t const idx = chunks_idx_++; + std::size_t const chunk_size = buffer_.transmission_chunks_[idx].second; data_type& c = buffer_.chunks_[idx]; c.resize(chunk_size); { util::mpi_environment::scoped_lock l; - MPI_Irecv(c.data(), static_cast(c.size()), MPI_BYTE, - src_, tag_, util::mpi_environment::communicator(), - &request_); + + [[maybe_unused]] int const ret = MPI_Irecv(c.data(), + static_cast(c.size()), MPI_BYTE, src_, tag_, + util::mpi_environment::communicator(), &request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + request_ptr_ = &request_; } } @@ -180,14 +188,18 @@ namespace hpx::parcelset::policies::mpi { { return false; } + #if defined(HPX_HAVE_PARCELPORT_COUNTERS) parcelset::data_point& data = buffer_.data_point_; data.time_ = timer_.elapsed_nanoseconds() - data.time_; #endif { util::mpi_environment::scoped_lock l; - MPI_Isend(&tag_, 1, MPI_INT, src_, 1, - util::mpi_environment::communicator(), &request_); + + [[maybe_unused]] int const ret = MPI_Isend(&tag_, 1, MPI_INT, + src_, 1, util::mpi_environment::communicator(), &request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + request_ptr_ = &request_; } @@ -217,10 +229,10 @@ namespace hpx::parcelset::policies::mpi { } int completed = 0; - int ret = 0; - ret = MPI_Test(request_ptr_, &completed, MPI_STATUS_IGNORE); - HPX_ASSERT(ret == MPI_SUCCESS); - (void) ret; + [[maybe_unused]] int const ret = + MPI_Test(request_ptr_, &completed, MPI_STATUS_IGNORE); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + if (completed) { request_ptr_ = nullptr; diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender.hpp index bf656a882bbf..c6927ece6ec4 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender.hpp @@ -14,7 +14,7 @@ #include #include #include - +#include #include #include @@ -25,8 +25,6 @@ #include #include -#include - namespace hpx::parcelset::policies::mpi { struct sender @@ -46,7 +44,8 @@ namespace hpx::parcelset::policies::mpi { void run() noexcept { - get_next_free_tag(); + util::mpi_environment::scoped_lock l; + get_next_free_tag(l); } connection_ptr create_connection(int dest, parcelset::parcelport* pp) @@ -70,7 +69,7 @@ namespace hpx::parcelset::policies::mpi { // Check if sending has been completed.... if (connection->send()) { - error_code ec(throwmode::lightweight); + error_code const ec(throwmode::lightweight); hpx::move_only_function postprocess_handler; @@ -89,7 +88,7 @@ namespace hpx::parcelset::policies::mpi { { connection_ptr connection; { - std::unique_lock l(connections_mtx_, std::try_to_lock); + std::unique_lock const l(connections_mtx_, std::try_to_lock); if (l && !connections_.empty()) { connection = HPX_MOVE(connections_.front()); @@ -117,7 +116,7 @@ namespace hpx::parcelset::policies::mpi { std::unique_lock l(next_free_tag_mtx_, std::try_to_lock); if (l.owns_lock()) { - next_free = next_free_tag_locked(); + next_free = next_free_tag_locked(l); } } @@ -128,30 +127,39 @@ namespace hpx::parcelset::policies::mpi { } } - int next_free_tag_locked() noexcept + template + int next_free_tag_locked([[maybe_unused]] Lock& lock) noexcept { + HPX_ASSERT_OWNS_LOCK(lock); + util::mpi_environment::scoped_try_lock l; if (l.locked) { - MPI_Status status; int completed = 0; - int ret = - MPI_Test(&next_free_tag_request_, &completed, &status); + [[maybe_unused]] int const ret = MPI_Test( + &next_free_tag_request_, &completed, MPI_STATUS_IGNORE); HPX_ASSERT(ret == MPI_SUCCESS); - (void) ret; - if (completed) // && status->MPI_ERROR != MPI_ERR_PENDING) + + if (completed) { - return get_next_free_tag(); + return get_next_free_tag(l); } } return -1; } - int get_next_free_tag() noexcept + template + int get_next_free_tag([[maybe_unused]] Lock& l) noexcept { - int next_free = next_free_tag_; - MPI_Irecv(&next_free_tag_, 1, MPI_INT, MPI_ANY_SOURCE, 1, + HPX_ASSERT_OWNS_LOCK(l); + + int const next_free = next_free_tag_; + + [[maybe_unused]] int const ret = MPI_Irecv(&next_free_tag_, 1, + MPI_INT, MPI_ANY_SOURCE, 1, util::mpi_environment::communicator(), &next_free_tag_request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + return next_free; } diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender_connection.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender_connection.hpp index e37f79a8af5e..5a1b85ea21f4 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender_connection.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender_connection.hpp @@ -13,23 +13,23 @@ #include #include #include -#include - #include #include #include #include #include #include +#if defined(HPX_HAVE_PARCELPORT_COUNTERS) +#include +#endif #include +#include #include #include #include #include -#include - namespace hpx::parcelset::policies::mpi { struct sender; @@ -76,13 +76,13 @@ namespace hpx::parcelset::policies::mpi { { } - parcelset::locality const& destination() const noexcept + constexpr parcelset::locality const& destination() const noexcept { return there_; } - constexpr void verify_( - parcelset::locality const& /* parcel_locality_id */) const noexcept + static constexpr void verify_( + parcelset::locality const& /* parcel_locality_id */) noexcept { } @@ -95,13 +95,13 @@ namespace hpx::parcelset::policies::mpi { HPX_ASSERT(!buffer_.data_.empty()); #if defined(HPX_HAVE_PARCELPORT_COUNTERS) - buffer_.data_point_.time_ = - hpx::chrono::high_resolution_clock::now(); + buffer_.data_point_.time_ = static_cast( + hpx::chrono::high_resolution_clock::now()); #endif request_ptr_ = nullptr; chunks_idx_ = 0; tag_ = acquire_tag(sender_); - header_ = header(buffer_, tag_); + header_.init(buffer_, tag_); header_.assert_valid(); state_ = initialized; @@ -153,8 +153,12 @@ namespace hpx::parcelset::policies::mpi { util::mpi_environment::scoped_lock l; HPX_ASSERT(state_ == initialized); HPX_ASSERT(request_ptr_ == nullptr); - MPI_Isend(header_.data(), header_.data_size_, MPI_BYTE, dst_, 0, + + [[maybe_unused]] int const ret = MPI_Isend(header_.data(), + header::data_size_, MPI_BYTE, dst_, 0, util::mpi_environment::communicator(), &request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + request_ptr_ = &request_; } @@ -173,16 +177,18 @@ namespace hpx::parcelset::policies::mpi { HPX_ASSERT(request_ptr_ == nullptr); - std::vector& - chunks = buffer_.transmission_chunks_; + auto const& chunks = buffer_.transmission_chunks_; if (!chunks.empty()) { util::mpi_environment::scoped_lock l; - MPI_Isend(chunks.data(), + + [[maybe_unused]] int const ret = MPI_Isend(chunks.data(), static_cast(chunks.size() * sizeof(parcel_buffer_type::transmission_chunk_type)), MPI_BYTE, dst_, tag_, util::mpi_environment::communicator(), &request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + request_ptr_ = &request_; } @@ -201,9 +207,12 @@ namespace hpx::parcelset::policies::mpi { if (!header_.piggy_back()) { util::mpi_environment::scoped_lock l; - MPI_Isend(buffer_.data_.data(), + + [[maybe_unused]] int const ret = MPI_Isend(buffer_.data_.data(), static_cast(buffer_.data_.size()), MPI_BYTE, dst_, tag_, util::mpi_environment::communicator(), &request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + request_ptr_ = &request_; } state_ = sent_data; @@ -217,8 +226,7 @@ namespace hpx::parcelset::policies::mpi { while (chunks_idx_ < buffer_.chunks_.size()) { - serialization::serialization_chunk& c = - buffer_.chunks_[chunks_idx_]; + auto const& c = buffer_.chunks_[chunks_idx_]; if (c.type_ == serialization::chunk_type::chunk_type_pointer) { if (!request_done()) @@ -227,13 +235,17 @@ namespace hpx::parcelset::policies::mpi { } util::mpi_environment::scoped_lock l; - MPI_Isend(const_cast(c.data_.cpos_), - static_cast(c.size_), MPI_BYTE, dst_, tag_, - util::mpi_environment::communicator(), &request_); + + [[maybe_unused]] int const ret = + MPI_Isend(const_cast(c.data_.cpos_), + static_cast(c.size_), MPI_BYTE, dst_, tag_, + util::mpi_environment::communicator(), &request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + request_ptr_ = &request_; } - chunks_idx_++; + ++chunks_idx_; } state_ = sent_chunks; @@ -248,12 +260,13 @@ namespace hpx::parcelset::policies::mpi { return false; } - error_code ec(throwmode::lightweight); + error_code const ec(throwmode::lightweight); handler_(ec); handler_.reset(); #if defined(HPX_HAVE_PARCELPORT_COUNTERS) buffer_.data_point_.time_ = - hpx::chrono::high_resolution_clock::now() - + static_cast( + hpx::chrono::high_resolution_clock::now()) - buffer_.data_point_.time_; pp_->add_sent_data(buffer_.data_point_); #endif @@ -271,16 +284,16 @@ namespace hpx::parcelset::policies::mpi { return true; } - util::mpi_environment::scoped_try_lock l; + util::mpi_environment::scoped_try_lock const l; if (!l.locked) { return false; } int completed = 0; - int ret = MPI_Test(request_ptr_, &completed, MPI_STATUS_IGNORE); + [[maybe_unused]] int const ret = + MPI_Test(request_ptr_, &completed, MPI_STATUS_IGNORE); HPX_ASSERT(ret == MPI_SUCCESS); - (void) ret; if (completed) { request_ptr_ = nullptr; @@ -293,10 +306,14 @@ namespace hpx::parcelset::policies::mpi { sender_type* sender_; int tag_; int dst_; - hpx::move_only_function handler_; - hpx::move_only_function)> - postprocess_handler_; + + using handler_type = hpx::move_only_function; + handler_type handler_; + + using post_handler_type = hpx::move_only_function)>; + post_handler_type postprocess_handler_; header header_; diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/tag_provider.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/tag_provider.hpp index aa0eb7ce5a91..4d0ecede5ff2 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/tag_provider.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/tag_provider.hpp @@ -20,12 +20,12 @@ namespace hpx::parcelset::policies::mpi { struct tag_provider { - tag_provider() noexcept + tag_provider() : next_tag_(2) { } - int acquire() noexcept + [[nodiscard]] int acquire() noexcept { int tag = -1; std::lock_guard l(mtx_); diff --git a/libs/full/parcelport_mpi/src/locality.cpp b/libs/full/parcelport_mpi/src/locality.cpp index f32a01d388bd..4a8cd82f8485 100644 --- a/libs/full/parcelport_mpi/src/locality.cpp +++ b/libs/full/parcelport_mpi/src/locality.cpp @@ -10,9 +10,10 @@ #if defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI) #include #include - #include +#include + namespace hpx::parcelset::policies::mpi { void locality::save(serialization::output_archive& ar) const diff --git a/libs/full/parcelport_mpi/src/parcelport_mpi.cpp b/libs/full/parcelport_mpi/src/parcelport_mpi.cpp index 35f3fa7a85a1..632c1edd3f77 100644 --- a/libs/full/parcelport_mpi/src/parcelport_mpi.cpp +++ b/libs/full/parcelport_mpi/src/parcelport_mpi.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2014-2015 Thomas Heller // Copyright (c) 2020 Google // @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -31,10 +30,8 @@ #include #include -#include #include #include -#include #include #include @@ -121,7 +118,12 @@ namespace hpx::parcelset { { } - ~parcelport() + parcelport(parcelport const&) = delete; + parcelport(parcelport&&) = delete; + parcelport& operator=(parcelport const&) = delete; + parcelport& operator=(parcelport&&) = delete; + + ~parcelport() override { util::mpi_environment::finalize(); } @@ -134,8 +136,8 @@ namespace hpx::parcelset { for (std::size_t i = 0; i != io_service_pool_.size(); ++i) { - io_service_pool_.get_io_service(int(i)).post( - hpx::bind(&parcelport::io_service_work, this)); + io_service_pool_.get_io_service(static_cast(i)) + .post(hpx::bind(&parcelport::io_service_work, this)); } return true; } @@ -146,12 +148,22 @@ namespace hpx::parcelset { while (do_background_work(0, parcelport_background_mode_all)) { if (threads::get_self_ptr()) + { hpx::this_thread::suspend( hpx::threads::thread_schedule_state::pending, "mpi::parcelport::do_stop"); + } + } + + bool expected = false; + if (stopped_.compare_exchange_strong(expected, true)) + { + util::mpi_environment::scoped_lock l; + + [[maybe_unused]] int const ret = + MPI_Barrier(util::mpi_environment::communicator()); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); } - stopped_ = true; - MPI_Barrier(util::mpi_environment::communicator()); } /// Return the name of this locality @@ -163,7 +175,7 @@ namespace hpx::parcelset { std::shared_ptr create_connection( parcelset::locality const& l, error_code&) { - int dest_rank = l.get().rank(); + int const dest_rank = l.get().rank(); return sender_.create_connection(dest_rank, this); } @@ -182,7 +194,8 @@ namespace hpx::parcelset { bool background_work( std::size_t num_thread, parcelport_background_mode mode) { - if (stopped_ || num_thread >= background_threads_) + if (stopped_.load(std::memory_order_acquire) || + num_thread >= background_threads_) { return false; } @@ -235,69 +248,64 @@ namespace hpx::parcelset { #include -namespace hpx::traits { - - // Inject additional configuration data into the factory registry for this - // type. This information ends up in the system wide configuration database - // under the plugin specific section: - // - // [hpx.parcel.mpi] - // ... - // priority = 100 - // - template <> - struct plugin_config_data +// Inject additional configuration data into the factory registry for this +// type. This information ends up in the system wide configuration database +// under the plugin specific section: +// +// [hpx.parcel.mpi] +// ... +// priority = 100 +// +template <> +struct hpx::traits::plugin_config_data< + hpx::parcelset::policies::mpi::parcelport> +{ + static constexpr char const* priority() noexcept { - static constexpr char const* priority() noexcept - { - return "100"; - } + return "100"; + } - static void init( - int* argc, char*** argv, util::command_line_handling& cfg) - { - util::mpi_environment::init(argc, argv, cfg.rtcfg_); - cfg.num_localities_ = - static_cast(util::mpi_environment::size()); - cfg.node_ = static_cast(util::mpi_environment::rank()); - } + static void init(int* argc, char*** argv, util::command_line_handling& cfg) + { + util::mpi_environment::init(argc, argv, cfg.rtcfg_); + cfg.num_localities_ = + static_cast(util::mpi_environment::size()); + cfg.node_ = static_cast(util::mpi_environment::rank()); + } - // by default no additional initialization using the resource - // partitioner is required - static constexpr void init(hpx::resource::partitioner&) noexcept {} + // by default no additional initialization using the resource + // partitioner is required + static constexpr void init(hpx::resource::partitioner&) noexcept {} - static void destroy() - { - util::mpi_environment::finalize(); - } + static void destroy() noexcept + { + util::mpi_environment::finalize(); + } - static constexpr char const* call() noexcept - { - return + static constexpr char const* call() noexcept + { + return #if defined(HPX_HAVE_PARCELPORT_MPI_ENV) - "env = " - "${HPX_HAVE_PARCELPORT_MPI_ENV:" HPX_HAVE_PARCELPORT_MPI_ENV - "}\n" + "env = ${HPX_HAVE_PARCELPORT_MPI_ENV:" HPX_HAVE_PARCELPORT_MPI_ENV + "}\n" #else - "env = ${HPX_HAVE_PARCELPORT_MPI_ENV:" - "MV2_COMM_WORLD_RANK,PMIX_RANK,PMI_RANK,OMPI_COMM_WORLD_SIZE," - "ALPS_APP_PE,PALS_NODEID" - "}\n" + "env = ${HPX_HAVE_PARCELPORT_MPI_ENV:" + "MV2_COMM_WORLD_RANK,PMIX_RANK,PMI_RANK,OMPI_COMM_WORLD_SIZE," + "ALPS_APP_PE,PALS_NODEID}\n" #endif #if defined(HPX_HAVE_PARCELPORT_MPI_MULTITHREADED) - "multithreaded = ${HPX_HAVE_PARCELPORT_MPI_MULTITHREADED:1}\n" + "multithreaded = ${HPX_HAVE_PARCELPORT_MPI_MULTITHREADED:1}\n" #else - "multithreaded = ${HPX_HAVE_PARCELPORT_MPI_MULTITHREADED:0}\n" + "multithreaded = ${HPX_HAVE_PARCELPORT_MPI_MULTITHREADED:0}\n" #endif - "max_connections = " - "${HPX_HAVE_PARCELPORT_MPI_MAX_CONNECTIONS:8192}\n" - - // number of cores that do background work, default: all - "background_threads = " - "${HPX_HAVE_PARCELPORT_MPI_BACKGROUND_THREADS:-1}\n"; - } - }; -} // namespace hpx::traits + "max_connections = " + "${HPX_HAVE_PARCELPORT_MPI_MAX_CONNECTIONS:8192}\n" + + // number of cores that do background work, default: all + "background_threads = " + "${HPX_HAVE_PARCELPORT_MPI_BACKGROUND_THREADS:-1}\n"; + } +}; // namespace hpx::traits HPX_REGISTER_PARCELPORT(hpx::parcelset::policies::mpi::parcelport, mpi) diff --git a/libs/full/parcelset/include/hpx/parcelset/connection_cache.hpp b/libs/full/parcelset/include/hpx/parcelset/connection_cache.hpp index 6a40234e9ea0..f1b1b533e22c 100644 --- a/libs/full/parcelset/include/hpx/parcelset/connection_cache.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/connection_cache.hpp @@ -37,12 +37,11 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace util { +namespace hpx::util { /////////////////////////////////////////////////////////////////////////// /// This class implements an LRU cache to hold connections. It includes /// entries checked out from the cache in its cache size. - // TODO: investigate usage of boost.cache. template class connection_cache { @@ -640,6 +639,6 @@ namespace hpx { namespace util { std::int64_t misses_; std::int64_t reclaims_; }; -}} // namespace hpx::util +} // namespace hpx::util #endif diff --git a/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp b/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp index 89b01ee515d4..308291d4cf07 100644 --- a/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2014-2021 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -55,20 +54,21 @@ namespace hpx::parcelset { data.num_zchunks_ += buffer.chunks_.size(); data.num_zchunks_per_msg_max_ = (std::max)(data.num_zchunks_per_msg_max_, - (std::int64_t) buffer.chunks_.size()); + static_cast(buffer.chunks_.size())); for (auto& chunk : buffer.chunks_) { data.size_zchunks_total_ += chunk.size(); - data.size_zchunks_max_ = - (std::max)(data.size_zchunks_max_, (std::int64_t) chunk.size()); + data.size_zchunks_max_ = (std::max)(data.size_zchunks_max_, + static_cast(chunk.size())); } #endif if (num_zero_copy_chunks != 0) { // decode chunk information - std::size_t num_non_zero_copy_chunks = static_cast( - static_cast(buffer.num_chunks_.second)); + std::size_t const num_non_zero_copy_chunks = + static_cast( + static_cast(buffer.num_chunks_.second)); chunks.resize(num_zero_copy_chunks + num_non_zero_copy_chunks); @@ -76,9 +76,9 @@ namespace hpx::parcelset { for (std::size_t i = 0; i != num_zero_copy_chunks; ++i) { transmission_chunk_type& c = buffer.transmission_chunks_[i]; - std::size_t first = static_cast( + auto const first = static_cast( static_cast(c.first)); - std::size_t second = static_cast( + auto second = static_cast( static_cast(c.second)); HPX_ASSERT(buffer.chunks_[i].size() == second); @@ -92,9 +92,9 @@ namespace hpx::parcelset { i != num_zero_copy_chunks + num_non_zero_copy_chunks; ++i) { transmission_chunk_type& c = buffer.transmission_chunks_[i]; - std::size_t first = static_cast( + auto const first = static_cast( static_cast(c.first)); - std::size_t second = static_cast( + auto const second = static_cast( static_cast(c.second)); // find next free entry @@ -126,7 +126,7 @@ namespace hpx::parcelset { std::vector& chunks, std::size_t num_thread = -1) { - std::size_t inbound_data_size = static_cast( + auto inbound_data_size = static_cast( static_cast(buffer.data_size_)); // protect from unhandled exceptions bubbling up @@ -136,7 +136,7 @@ namespace hpx::parcelset { { // mark start of serialization #if defined(HPX_HAVE_PARCELPORT_COUNTERS) - hpx::chrono::high_resolution_timer timer; + hpx::chrono::high_resolution_timer const timer; std::int64_t overall_add_parcel_time = 0; parcelset::data_point& data = buffer.data_point_; #endif @@ -161,8 +161,8 @@ namespace hpx::parcelset { #if defined(HPX_HAVE_PARCELPORT_COUNTERS) && \ defined(HPX_HAVE_PARCELPORT_ACTION_COUNTERS) - std::size_t archive_pos = archive.current_pos(); - std::int64_t serialize_time = + std::size_t const archive_pos = archive.current_pos(); + std::int64_t const serialize_time = timer.elapsed_nanoseconds(); #endif // de-serialize parcel and add it to incoming parcel queue @@ -173,11 +173,11 @@ namespace hpx::parcelset { // one parcel to decode, deferred_schedule will be // preset to false and the direct action will be called // directly - bool migrated = p.load_schedule( + bool const migrated = p.load_schedule( archive, num_thread, deferred_schedule); #if defined(HPX_HAVE_PARCELPORT_COUNTERS) - std::int64_t add_parcel_time = + std::int64_t const add_parcel_time = timer.elapsed_nanoseconds(); #endif @@ -192,7 +192,7 @@ namespace hpx::parcelset { pp.add_received_data(p.get_action_name(), action_data); #endif // make sure this parcel ended up on the right locality - std::uint32_t here = agas::get_locality_id(); + std::uint32_t const here = agas::get_locality_id(); if (hpx::get_runtime_ptr() && here != naming::invalid_locality_id && (naming::get_locality_id_from_gid( @@ -203,7 +203,6 @@ namespace hpx::parcelset { "parcel destination does not match locality " "which received the parcel ({}), {}", here, p); - return; } if (migrated) @@ -235,11 +234,15 @@ namespace hpx::parcelset { for (std::size_t i = 1; i != deferred_parcels.size(); ++i) { + LPT_(debug).format( + "decode_message_with_chunks: received: {}", + deferred_parcels[i].parcel_id()); + auto f = [num_thread](parcelset::parcel&& p) { if (p.schedule_action(num_thread)) { - // route this parcel as the object - // was migrated + // route this parcel as the object was + // migrated agas::route(HPX_MOVE(p), &parcelset::detail:: parcel_route_handler, @@ -248,7 +251,7 @@ namespace hpx::parcelset { }; // schedule all but the first parcel on a new thread. - hpx::threads::thread_init_data data( + hpx::threads::thread_init_data init_data( hpx::threads::make_thread_function_nullary( util::deferred_call(HPX_MOVE(f), HPX_MOVE(deferred_parcels[i]))), @@ -258,11 +261,15 @@ namespace hpx::parcelset { static_cast(num_thread)), threads::thread_stacksize::default_, threads::thread_schedule_state::pending, true); - hpx::threads::register_thread(data); + hpx::threads::register_thread(init_data); } // If we are the first deferred parcel, we don't need to spin // up a new thread... + LPT_(debug).format( + "decode_message_with_chunks: received: {}", + deferred_parcels[0].parcel_id()); + if (deferred_parcels[0].schedule_action(num_thread)) { // route this parcel as the object was migrated diff --git a/libs/full/parcelset/include/hpx/parcelset/detail/parcel_await.hpp b/libs/full/parcelset/include/hpx/parcelset/detail/parcel_await.hpp index daa74c10f491..4f0d90ad96e8 100644 --- a/libs/full/parcelset/include/hpx/parcelset/detail/parcel_await.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/detail/parcel_await.hpp @@ -17,7 +17,7 @@ #include #include -namespace hpx { namespace parcelset { namespace detail { +namespace hpx::parcelset::detail { using put_parcel_type = hpx::move_only_function; @@ -32,6 +32,6 @@ namespace hpx { namespace parcelset { namespace detail { void HPX_EXPORT parcels_await_apply(std::vector&& p, std::vector&& f, std::uint32_t archive_flags, put_parcels_type pp); -}}} // namespace hpx::parcelset::detail +} // namespace hpx::parcelset::detail #endif diff --git a/libs/full/parcelset/include/hpx/parcelset/encode_parcels.hpp b/libs/full/parcelset/include/hpx/parcelset/encode_parcels.hpp index f97c37638048..2812ce6fba3f 100644 --- a/libs/full/parcelset/include/hpx/parcelset/encode_parcels.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/encode_parcels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011-2015 Thomas Heller // Copyright (c) 2007 Richard D Guidry Jr // Copyright (c) 2011 Bryce Lelbach @@ -46,9 +46,9 @@ namespace hpx::parcelset { #if defined(HPX_HAVE_LOGGING) /////////////////////////////////////////////////////////////////// - inline constexpr char to_digit(int number) noexcept + constexpr char to_digit(int number) noexcept { - char number_tmp = static_cast(number); + char const number_tmp = static_cast(number); if (number >= 0 && number <= 9) { return static_cast(number_tmp + '0'); @@ -56,11 +56,11 @@ namespace hpx::parcelset { return static_cast(number_tmp - 10 + 'A'); } - inline constexpr void convert_byte( + constexpr void convert_byte( std::uint8_t b, char* buffer, char const* /* end */) noexcept { *buffer++ = to_digit((b & 0xF0) >> 4); - *buffer++ = to_digit(b & 0x0F); + *buffer = to_digit(b & 0x0F); } template @@ -70,7 +70,7 @@ namespace hpx::parcelset { if (LPT_ENABLED(debug)) { result.reserve(buffer.data_.size() * 2 + 1); - for (std::uint8_t byte : buffer.data_) + for (std::uint8_t const byte : buffer.data_) { char b[3] = {0}; convert_byte(byte, &b[0], &b[3]); @@ -122,13 +122,14 @@ namespace hpx::parcelset { buffer.chunks_.size() - chunks.size())); #if defined(HPX_HAVE_PARCELPORT_COUNTERS) data.num_zchunks_ += chunks.size(); - data.num_zchunks_per_msg_max_ = (std::max)( - data.num_zchunks_per_msg_max_, (std::int64_t) chunks.size()); + data.num_zchunks_per_msg_max_ = + (std::max)(data.num_zchunks_per_msg_max_, + static_cast(chunks.size())); for (auto& chunk : chunks) { data.size_zchunks_total_ += chunk.second; - data.size_zchunks_max_ = (std::max)( - data.size_zchunks_max_, (std::int64_t) chunk.second); + data.size_zchunks_max_ = (std::max)(data.size_zchunks_max_, + static_cast(chunk.second)); } #endif @@ -159,7 +160,7 @@ namespace hpx::parcelset { std::size_t parcels_sent = 0; std::size_t parcels_size = 1; - if (num_parcels != std::size_t(-1)) + if (num_parcels != static_cast(-1)) { arg_size = sizeof(std::int64_t); parcels_size = num_parcels; @@ -170,14 +171,15 @@ namespace hpx::parcelset { { try { - std::unique_ptr filter( + std::unique_ptr const filter( ps[0].get_serialization_filter()); int archive_flags = archive_flags_; - if (filter.get() != nullptr) + if (filter) { archive_flags = archive_flags | - int(serialization::archive_flags::enable_compression); + static_cast( + serialization::archive_flags::enable_compression); } // preallocate data @@ -195,7 +197,7 @@ namespace hpx::parcelset { // mark start of serialization #if defined(HPX_HAVE_PARCELPORT_COUNTERS) - hpx::chrono::high_resolution_timer timer; + hpx::chrono::high_resolution_timer const timer; #endif { // Serialize the data @@ -208,15 +210,15 @@ namespace hpx::parcelset { archive_flags, &buffer.chunks_, filter.get(), pp.get_zero_copy_serialization_threshold()); - if (num_parcels != std::size_t(-1)) + if (num_parcels != static_cast(-1)) archive << parcels_sent; //-V128 for (std::size_t i = 0; i != parcels_sent; ++i) { #if defined(HPX_HAVE_PARCELPORT_COUNTERS) && \ defined(HPX_HAVE_PARCELPORT_ACTION_COUNTERS) - std::size_t archive_pos = archive.current_pos(); - std::int64_t serialize_time = + std::size_t const archive_pos = archive.current_pos(); + std::int64_t const serialize_time = timer.elapsed_nanoseconds(); #endif LPT_(debug) << ps[i]; @@ -240,8 +242,6 @@ namespace hpx::parcelset { timer.elapsed_nanoseconds() - serialize_time; action_data.num_parcels_ = 1; pp.add_sent_data(ps[i].get_action_name(), action_data); -#else - HPX_UNUSED(pp); #endif } archive.flush(); @@ -279,11 +279,10 @@ namespace hpx::parcelset { catch (std::exception const& e) { // We have to repackage all exceptions thrown by the - // serialization library as otherwise we will loose the - // e.what() description of the problem, due to slicing. + // serialization library as otherwise we will loose the e.what() + // description of the problem, due to slicing. hpx::throw_with_info( hpx::exception(hpx::error::serialization_error, e.what())); - return 0; } } catch (...) diff --git a/libs/full/parcelset/include/hpx/parcelset/parcel.hpp b/libs/full/parcelset/include/hpx/parcelset/parcel.hpp index df32a5245d71..31d99d56b110 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcel.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcel.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Hartmut Kaiser +// Copyright (c) 2021-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -42,7 +42,7 @@ namespace hpx::parcelset::detail { inline parcel_data& operator=(parcel_data&& rhs) noexcept; void serialize(serialization::input_archive& ar, unsigned); - void serialize(serialization::output_archive& ar, unsigned); + void serialize(serialization::output_archive& ar, unsigned) const; naming::gid_type source_id_; naming::gid_type dest_; @@ -149,7 +149,8 @@ namespace hpx::parcelset::detail { void load(serialization::input_archive& ar, unsigned) override; void save(serialization::output_archive& ar, unsigned) const override; - std::pair determine_lva(); + std::pair determine_lva() + const; detail::parcel_data data_; std::unique_ptr action_; diff --git a/libs/full/parcelset/include/hpx/parcelset/parcelhandler.hpp b/libs/full/parcelset/include/hpx/parcelset/parcelhandler.hpp index b4b0fd32bbb7..3b09f86cd636 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcelhandler.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcelhandler.hpp @@ -1,5 +1,5 @@ // Copyright (c) 2014 Thomas Heller -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -58,14 +58,8 @@ namespace hpx::parcelset { parcelhandler& operator=(parcelhandler&&) = delete; private: - void parcel_sink(parcel const& p); - - threads::thread_schedule_state decode_parcel(parcelport& pp, - std::shared_ptr> parcel_data, - parcelset::data_point receive_data); - // make sure the parcel has been properly initialized - void init_parcel(parcel& p); + static void init_parcel(parcel& p); using mutex_type = hpx::spinlock; @@ -78,11 +72,11 @@ namespace hpx::parcelset { using write_handler_type = parcelport::write_handler_type; /// Construct a new \a parcelhandler. - parcelhandler(util::runtime_configuration& cfg); + explicit parcelhandler(util::runtime_configuration const& cfg); ~parcelhandler(); - void set_notification_policies(util::runtime_configuration& cfg, + void set_notification_policies(util::runtime_configuration const& cfg, threads::threadmanager* tm, threads::policies::callback_notifier const& notifier); @@ -90,7 +84,7 @@ namespace hpx::parcelset { void initialize(); - void flush_parcels(); + void flush_parcels() const; /// \brief Stop all parcel ports associated with this parcelhandler void stop(bool blocking = true); @@ -105,10 +99,11 @@ namespace hpx::parcelset { /// Return the list of all remote localities supporting the given /// component type /// - /// \param prefixes [out] The reference to a vector of id_types filled - /// by the function. + /// \param locality_ids [in/out] The reference to a vector of id_types + /// filled by the function. /// \param type [in] The type of the component which needs to exist /// on the returned localities. + /// \param ec [in/out] /// /// \returns The function returns \a true if there is at least one /// remote locality known by AGAS @@ -121,10 +116,11 @@ namespace hpx::parcelset { /// Return the list of all localities supporting the given /// component type /// - /// \param prefixes [out] The reference to a vector of id_types filled - /// by the function. + /// \param locality_ids [in/out] The reference to a vector of id_types + /// filled by the function. /// \param type [in] The type of the component which needs to exist /// on the returned localities. + /// \param ec [in/out] /// /// \returns The function returns \a true if there is at least one /// locality known by AGAS @@ -188,8 +184,8 @@ namespace hpx::parcelset { /// function or function object gets invoked on completion of the send /// operation or on any error. /// - /// \param p [in] The parcels to send. - /// \param f [in] The function objects to be invoked on + /// \param parcels [in] The parcels to send. + /// \param funcs [in] The function objects to be invoked on /// successful completion or on errors. The signature /// of these function object are expected to be: /// @@ -201,14 +197,14 @@ namespace hpx::parcelset { /// \a size is the number of successfully /// transferred bytes. void put_parcels( - std::vector p, std::vector f); + std::vector parcels, std::vector funcs); /// This put_parcel() function overload is asynchronous, but no /// callback is provided by the user. /// /// \note The function \a put_parcel() is asynchronous. /// - /// \param p [in, out] A reference to the parcel to send. The + /// \param parcels [in, out] A reference to the parcel to send. The /// parcel \a p will be modified in place, as it will /// get set the resolved destination address and parcel /// id (if not already set). @@ -225,16 +221,10 @@ namespace hpx::parcelset { /// parcelport std::string get_locality_name() const; - /////////////////////////////////////////////////////////////////////// - /// The function register_counter_types() is called during startup to - /// allow the registration of all performance counter types for this - /// parcel-handler instance. - void register_counter_types(); - /// \brief Make sure the specified locality is not held by any /// connection caches anymore void remove_from_connection_cache( - naming::gid_type const& gid, endpoints_type const& endpoints); + naming::gid_type const& gid, endpoints_type const& endpoints) const; /// \brief return the endpoints associated with this parcelhandler /// \returns all connection information for the enabled parcelports @@ -254,7 +244,7 @@ namespace hpx::parcelset { } /// Return the reference to an existing io_service - util::io_service_pool* get_thread_pool(char const* name); + util::io_service_pool* get_thread_pool(char const* name) const; /////////////////////////////////////////////////////////////////////// policies::message_handler* get_message_handler(char const* action, @@ -399,8 +389,8 @@ namespace hpx::parcelset { std::string const& ppname, int priority, bool bootstrap) const; void put_parcel_impl(parcel&& p, write_handler_type&& f); - void put_parcels_impl( - std::vector&& p, std::vector&& f); + void put_parcels_impl(std::vector&& parcels, + std::vector&& handlers); // manage default exception handler void invoke_write_handler( @@ -421,7 +411,7 @@ namespace hpx::parcelset { protected: std::pair, locality> find_appropriate_destination(naming::gid_type const& dest_gid); - locality find_endpoint( + static locality find_endpoint( endpoints_type const& eps, std::string const& name); private: diff --git a/libs/full/parcelset/include/hpx/parcelset/parcelport_connection.hpp b/libs/full/parcelset/include/hpx/parcelset/parcelport_connection.hpp index 7427b40c651e..fd565d3b282f 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcelport_connection.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcelport_connection.hpp @@ -1,5 +1,5 @@ // Copyright (c) 2014 Thomas Heller -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -16,7 +16,6 @@ #include #include -#include #include #include diff --git a/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp b/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp index cd2866298de5..2c7b632683e7 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp @@ -1,5 +1,5 @@ // Copyright (c) 2014 Thomas Heller -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2007 Richard D Guidry Jr // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2011 Katelyn Kufahl @@ -145,17 +145,19 @@ namespace hpx::parcelset { , num_thread_(0) , max_background_thread_(max_background_threads(ini)) { - std::string endian_out = get_config_entry("hpx.parcel.endian_out", - endian::native == endian::big ? "big" : "little"); + std::string const endian_out = + get_config_entry("hpx.parcel.endian_out", + endian::native == endian::big ? "big" : "little"); if (endian_out == "little") { archive_flags_ = archive_flags_ | - int(serialization::archive_flags::endian_little); + static_cast( + serialization::archive_flags::endian_little); } else if (endian_out == "big") { archive_flags_ = archive_flags_ | - int(serialization::archive_flags::endian_big); + static_cast(serialization::archive_flags::endian_big); } else { @@ -165,15 +167,17 @@ namespace hpx::parcelset { if (!this->allow_array_optimizations()) { archive_flags_ = archive_flags_ | - int(serialization::archive_flags:: + static_cast(serialization::archive_flags:: disable_array_optimization); archive_flags_ = archive_flags_ | - int(serialization::archive_flags::disable_data_chunking); + static_cast( + serialization::archive_flags::disable_data_chunking); } else if (!this->allow_zero_copy_optimizations()) { archive_flags_ = archive_flags_ | - int(serialization::archive_flags::disable_data_chunking); + static_cast( + serialization::archive_flags::disable_data_chunking); } } @@ -192,7 +196,7 @@ namespace hpx::parcelset { { io_service_pool_.run(false); // start pool - bool success = connection_handler().do_run(); + bool const success = connection_handler().do_run(); if (success && blocking) io_service_pool_.join(); @@ -271,7 +275,6 @@ namespace hpx::parcelset { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "parcelport::put_parcels", "mismatched number of parcels and handlers"); - return; } #if defined(HPX_DEBUG) @@ -378,7 +381,7 @@ namespace hpx::parcelset { static_cast(get_next_num_thread())), threads::thread_stacksize::default_, threads::thread_schedule_state::suspended, true); - threads::thread_id_ref_type id = + threads::thread_id_ref_type const id = hpx::threads::register_thread(data, ec); if (ec) return; @@ -425,7 +428,6 @@ namespace hpx::parcelset { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "parcelport_impl::get_connection_cache_statistics", "invalid connection cache statistics type"); - return 0; } private: @@ -439,29 +441,28 @@ namespace hpx::parcelset { return static_cast(*this); } - void send_early_parcel_impl(locality const& dest, parcel p) + void send_early_parcel_impl( + [[maybe_unused]] locality const& dest, [[maybe_unused]] parcel p) { if constexpr (connection_handler_traits< ConnectionHandler>::send_early_parcel::value) { put_parcel(dest, HPX_MOVE(p), - [HPX_CXX20_CAPTURE_THIS(=)]( - std::error_code const& ec, parcel const& p) -> void { - return early_pending_parcel_handler(ec, p); + [HPX_CXX20_CAPTURE_THIS(=)](std::error_code const& ec, + parcel const& parcel) -> void { + return early_pending_parcel_handler(ec, parcel); }); } else { - HPX_UNUSED(dest); - HPX_UNUSED(p); HPX_THROW_EXCEPTION(hpx::error::network_error, "send_early_parcel", "This parcelport does not support sending early parcels"); } } - bool do_background_work_impl( - std::size_t num_thread, parcelport_background_mode mode) + bool do_background_work_impl([[maybe_unused]] std::size_t num_thread, + [[maybe_unused]] parcelport_background_mode mode) { if constexpr (connection_handler_traits< ConnectionHandler>::do_background_work::value) @@ -497,7 +498,7 @@ namespace hpx::parcelset { ConnectionHandler>::send_immediate_parcels::value, "This parcelport is not suitable for the connectionless " "version of send_immediate!"); - std::size_t encoded_parcels = 0; + std::vector parcels; std::vector handlers; if (fs == nullptr) @@ -518,8 +519,9 @@ namespace hpx::parcelset { // encode the parcels typename ConnectionHandler::sender_type::parcel_buffer_type buffer; - encoded_parcels = encode_parcels(*this, ps, num_parcels, buffer, - archive_flags_, get_max_outbound_message_size()); + std::size_t const encoded_parcels = + encode_parcels(*this, ps, num_parcels, buffer, archive_flags_, + get_max_outbound_message_size()); typename ConnectionHandler::sender_type::callback_fn_type callback_fn = detail::call_for_each( @@ -535,6 +537,7 @@ namespace hpx::parcelset { { // we don't propagate errors for now } + if (num_parcels != encoded_parcels && fs != nullptr) { std::vector overflow_parcels( @@ -688,13 +691,12 @@ namespace hpx::parcelset { { using mapped_type = pending_parcels_map::mapped_type; - std::unique_lock l(mtx_); + std::unique_lock const l(mtx_); // We ignore the lock here. It might happen that while enqueuing, // we need to acquire a lock. This should not cause any problems // (famous last words) - util::ignore_while_checking il(&l); - HPX_UNUSED(il); + [[maybe_unused]] util::ignore_while_checking il(&l); mapped_type& e = pending_parcels_[locality_id]; hpx::get<0>(e).push_back(HPX_MOVE(p)); @@ -710,13 +712,12 @@ namespace hpx::parcelset { { using mapped_type = pending_parcels_map::mapped_type; - std::unique_lock l(mtx_); + std::unique_lock const l(mtx_); // We ignore the lock here. It might happen that while enqueuing, // we need to acquire a lock. This should not cause any problems // (famous last words) - util::ignore_while_checking il(&l); - HPX_UNUSED(il); + [[maybe_unused]] util::ignore_while_checking il(&l); HPX_ASSERT(parcels.size() == handlers.size()); @@ -730,7 +731,8 @@ namespace hpx::parcelset { else { HPX_ASSERT(hpx::get<0>(e).size() == hpx::get<1>(e).size()); - std::size_t new_size = hpx::get<0>(e).size() + parcels.size(); + std::size_t const new_size = + hpx::get<0>(e).size() + parcels.size(); hpx::get<0>(e).reserve(new_size); std::move(parcels.begin(), parcels.end(), @@ -748,50 +750,46 @@ namespace hpx::parcelset { std::vector& parcels, std::vector& handlers) { - using iterator = pending_parcels_map::iterator; - - { - std::unique_lock l(mtx_, std::try_to_lock); - if (!l.owns_lock()) - return false; + std::unique_lock const l(mtx_, std::try_to_lock); + if (!l.owns_lock()) + return false; - iterator it = pending_parcels_.find(locality_id); + auto const it = pending_parcels_.find(locality_id); - // do nothing if parcels have already been picked up by - // another thread - if (it != pending_parcels_.end() && - !hpx::get<0>(it->second).empty()) - { - HPX_ASSERT(it->first == locality_id); - HPX_ASSERT(handlers.size() == 0); - HPX_ASSERT(handlers.size() == parcels.size()); - std::swap(parcels, hpx::get<0>(it->second)); - HPX_ASSERT(hpx::get<0>(it->second).size() == 0); - std::swap(handlers, hpx::get<1>(it->second)); - HPX_ASSERT(handlers.size() == parcels.size()); - - HPX_ASSERT(!handlers.empty()); - } - else - { - HPX_ASSERT(hpx::get<1>(it->second).empty()); - return false; - } + // do nothing if parcels have already been picked up by another + // thread + if (it != pending_parcels_.end() && + !hpx::get<0>(it->second).empty()) + { + HPX_ASSERT(it->first == locality_id); + HPX_ASSERT(handlers.empty()); + HPX_ASSERT(handlers.size() == parcels.size()); + std::swap(parcels, hpx::get<0>(it->second)); + HPX_ASSERT(hpx::get<0>(it->second).empty()); + std::swap(handlers, hpx::get<1>(it->second)); + HPX_ASSERT(handlers.size() == parcels.size()); + + HPX_ASSERT(!handlers.empty()); + } + else + { + HPX_ASSERT(hpx::get<1>(it->second).empty()); + return false; + } - parcel_destinations_.erase(locality_id); + parcel_destinations_.erase(locality_id); - HPX_ASSERT(0 != num_parcel_destinations_.load()); - --num_parcel_destinations_; + HPX_ASSERT(0 != num_parcel_destinations_.load()); + --num_parcel_destinations_; - return true; - } + return true; } protected: bool dequeue_parcel( locality& dest, parcel& p, write_handler_type& handler) { - std::unique_lock l(mtx_, std::try_to_lock); + std::unique_lock const l(mtx_, std::try_to_lock); if (!l.owns_lock()) return false; @@ -825,7 +823,7 @@ namespace hpx::parcelset { std::vector destinations; { - std::unique_lock l(mtx_, std::try_to_lock); + std::unique_lock const l(mtx_, std::try_to_lock); if (l.owns_lock()) { if (parcel_destinations_.empty()) @@ -862,9 +860,9 @@ namespace hpx::parcelset { return; } - // If one of the sending threads are in suspended state, we - // need to force a new connection to avoid deadlocks. - bool force_connection = true; + // If one of the sending threads are in suspended state, we need to + // force a new connection to avoid deadlocks. + constexpr bool force_connection = true; error_code ec; std::shared_ptr sender_connection = @@ -872,10 +870,9 @@ namespace hpx::parcelset { if (!sender_connection) { - // We can safely return if no connection is available - // at this point. As soon as a connection becomes - // available it checks for pending parcels and sends - // those out. + // We can safely return if no connection is available at this + // point. As soon as a connection becomes available it checks + // for pending parcels and sends those out. return; } @@ -888,18 +885,13 @@ namespace hpx::parcelset { // Give this connection back to the cache as we couldn't dequeue // parcels. connection_cache_.reclaim(locality_id, sender_connection); - - return; } - - // send parcels if they didn't get sent by another connection - send_pending_parcels(locality_id, sender_connection, - HPX_MOVE(parcels), HPX_MOVE(handlers)); - - // We yield here for a short amount of time to give another - // HPX thread the chance to put a subsequent parcel which - // leads to a more effective parcel buffering - // hpx::execution_base::this_thread::yield(); + else + { + // send parcels if they didn't get sent by another connection + send_pending_parcels(locality_id, sender_connection, + HPX_MOVE(parcels), HPX_MOVE(handlers)); + } } void send_pending_parcels_trampoline(std::error_code const& ec, @@ -928,9 +920,8 @@ namespace hpx::parcelset { std::lock_guard l(mtx_); // HPX_ASSERT(locality_id == sender_connection->destination()); - pending_parcels_map::iterator it = - pending_parcels_.find(locality_id); - if (it == pending_parcels_.end() || + if (auto const it = pending_parcels_.find(locality_id); + it == pending_parcels_.end() || hpx::get<0>(it->second).empty()) { return; @@ -957,9 +948,9 @@ namespace hpx::parcelset { sender_connection->verify_(parcel_locality_id); #endif // encode the parcels - std::size_t num_parcels = encode_parcels(*this, &parcels[0], - parcels.size(), sender_connection->buffer_, archive_flags_, - this->get_max_outbound_message_size()); + std::size_t const num_parcels = encode_parcels(*this, + parcels.data(), parcels.size(), sender_connection->buffer_, + archive_flags_, this->get_max_outbound_message_size()); using hpx::parcelset::detail::call_for_each; if (num_parcels == parcels.size()) @@ -1009,6 +1000,9 @@ namespace hpx::parcelset { parcel_locality_id, HPX_MOVE(parcels), HPX_MOVE(handlers)); } + // We yield here for a short amount of time to give another HPX + // thread the chance to put a subsequent parcel which leads to a + // more effective parcel buffering hpx::execution_base::this_thread::yield(); } diff --git a/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp b/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp index c052dc21d8fe..f061fd005258 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -40,6 +40,7 @@ namespace hpx::parcelset { /// This returns true/false based on the background work. /// /// \param num_thread this represents the number of threads. + /// \param mode /// HPX_EXPORT bool do_background_work(std::size_t num_thread = 0, parcelport_background_mode mode = parcelport_background_mode_all); diff --git a/libs/full/parcelset/src/parcel.cpp b/libs/full/parcelset/src/parcel.cpp index de78598e29df..929ad97043bc 100644 --- a/libs/full/parcelset/src/parcel.cpp +++ b/libs/full/parcelset/src/parcel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -121,7 +121,8 @@ namespace hpx::parcelset::detail { ar >> has_continuation_; } - void parcel_data::serialize(serialization::output_archive& ar, unsigned) + void parcel_data::serialize( + serialization::output_archive& ar, unsigned) const { ar << source_id_; ar << dest_; @@ -159,7 +160,7 @@ namespace hpx::parcelset::detail { // verify that the action targets the correct type if (action_ && data_.addr_.type_ != components::component_invalid) { - int type = action_->get_component_type(); + int const type = action_->get_component_type(); if (!components::types_are_compatible(type, data_.addr_.type_)) { return false; @@ -218,8 +219,7 @@ namespace hpx::parcelset::detail { hpx::id_type parcel::source_id() const { - return hpx::id_type( - data_.source_id_, hpx::id_type::management_type::unmanaged); + return {data_.source_id_, hpx::id_type::management_type::unmanaged}; } void parcel::set_source_id(hpx::id_type const& source_id) @@ -329,7 +329,8 @@ namespace hpx::parcelset::detail { #if defined(HPX_HAVE_NETWORKING) serialization::binary_filter* parcel::get_serialization_filter() const { - hpx::optional p = action_->get_embedded_parcel(); + hpx::optional const p = + action_->get_embedded_parcel(); if (!p) { return action_->get_serialization_filter(); @@ -340,7 +341,8 @@ namespace hpx::parcelset::detail { policies::message_handler* parcel::get_message_handler( locality const& loc) const { - hpx::optional p = action_->get_embedded_parcel(); + hpx::optional const p = + action_->get_embedded_parcel(); if (!p) { return action_->get_message_handler(loc); @@ -388,7 +390,7 @@ namespace hpx::parcelset::detail { } std::pair - parcel::determine_lva() + parcel::determine_lva() const { int comptype = action_->get_component_type(); @@ -444,11 +446,11 @@ namespace hpx::parcelset::detail { // make sure this parcel destination matches the proper locality HPX_ASSERT(destination_locality() == data_.addr_.locality_); - std::pair p = + std::pair const p = determine_lva(); // make sure the target has not been migrated away - auto r = action_->was_object_migrated(data_.dest_, p.first); + auto const r = action_->was_object_migrated(data_.dest_, p.first); if (r.first) { // If the object was migrated, just load the action and return. @@ -481,11 +483,11 @@ namespace hpx::parcelset::detail { // make sure this parcel destination matches the proper locality HPX_ASSERT(destination_locality() == data_.addr_.locality_); - std::pair p = + std::pair const p = determine_lva(); // make sure the target has not been migrated away - auto r = action_->was_object_migrated(data_.dest_, p.first); + auto const r = action_->was_object_migrated(data_.dest_, p.first); if (r.first) { // If the object was migrated, just route. diff --git a/libs/full/parcelset/src/parcelhandler.cpp b/libs/full/parcelset/src/parcelhandler.cpp index 91926db76d98..79b0f2cab0eb 100644 --- a/libs/full/parcelset/src/parcelhandler.cpp +++ b/libs/full/parcelset/src/parcelhandler.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2013-2014 Thomas Heller // Copyright (c) 2007 Richard D Guidry Jr // Copyright (c) 2011 Bryce Lelbach & Katelyn Kufahl @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -82,7 +83,7 @@ namespace hpx::parcelset { sent_future.get(); // wait for the parcel to be sent } - parcelhandler::parcelhandler(util::runtime_configuration& cfg) + parcelhandler::parcelhandler(util::runtime_configuration const& cfg) : tm_(nullptr) , use_alternative_parcelports_(false) , enable_parcel_handling_(true) @@ -102,7 +103,7 @@ namespace hpx::parcelset { parcelhandler::~parcelhandler() = default; void parcelhandler::set_notification_policies( - util::runtime_configuration& cfg, threads::threadmanager* tm, + util::runtime_configuration const& cfg, threads::threadmanager* tm, threads::policies::callback_notifier const& notifier) { is_networking_enabled_ = hpx::is_networking_enabled(); @@ -122,10 +123,10 @@ namespace hpx::parcelset { std::shared_ptr parcelhandler::get_bootstrap_parcelport() const { - std::string cfgkey("hpx.parcel.bootstrap"); + std::string const cfgkey("hpx.parcel.bootstrap"); if (!pports_.empty()) { - auto it = + auto const it = pports_.find(get_priority(get_config_entry(cfgkey, "tcp"))); if (it != pports_.end() && it->first > 0) { @@ -169,7 +170,7 @@ namespace hpx::parcelset { std::terminate(); } - return std::shared_ptr(); + return {}; } void parcelhandler::initialize() @@ -220,7 +221,7 @@ namespace hpx::parcelset { agas::get_locality_id(), exceptions.get_message()); } - // clean up parcelports that have failed initializtion + // clean up parcelports that have failed initialization std::cerr << "the following parcelports will be disabled:\n"; for (int pp : failed_pps) { @@ -285,7 +286,7 @@ namespace hpx::parcelset { int parcelhandler::get_priority(std::string const& name) const { - std::map::const_iterator it = priority_.find(name); + auto const it = priority_.find(name); if (it == priority_.end()) return 0; return it->second; @@ -294,7 +295,7 @@ namespace hpx::parcelset { parcelport* parcelhandler::find_parcelport( std::string const& type, error_code&) const { - int priority = get_priority(type); + int const priority = get_priority(type); if (priority <= 0) return nullptr; HPX_ASSERT(pports_.find(priority) != pports_.end()); @@ -310,7 +311,8 @@ namespace hpx::parcelset { // add the new parcelport to the list of parcel-ports we care about int priority = pp->priority(); - std::string cfgkey(std::string("hpx.parcel.") + pp->type() + ".enable"); + std::string const cfgkey( + std::string("hpx.parcel.") + pp->type() + ".enable"); if (get_config_entry(cfgkey, "0") != "1") { priority = -priority; @@ -328,11 +330,11 @@ namespace hpx::parcelset { /// \brief Make sure the specified locality is not held by any /// connection caches anymore void parcelhandler::remove_from_connection_cache( - naming::gid_type const& gid, endpoints_type const& endpoints) + naming::gid_type const& gid, endpoints_type const& endpoints) const { for (endpoints_type::value_type const& loc : endpoints) { - for (pports_type::value_type& pp : pports_) + for (pports_type::value_type const& pp : pports_) { if (std::string(pp.second->type()) == loc.second.type()) { @@ -354,6 +356,10 @@ namespace hpx::parcelset { return did_some_work; } + LPT_(debug).format( + "parcelhandler::do_background_work: thread {}, mode {}", num_thread, + get_parcelport_background_mode_name(mode)); + // flush all parcel buffers if (0 == num_thread && (mode & parcelport_background_mode_flush_buffers)) @@ -363,16 +369,15 @@ namespace hpx::parcelset { if (l.owns_lock()) { using parcelset::policies::message_handler; - message_handler::flush_mode flush_mode = + constexpr message_handler::flush_mode flush_mode = message_handler::flush_mode_background_work; - message_handler_map::iterator end = handlers_.end(); - for (message_handler_map::iterator it = handlers_.begin(); - it != end; ++it) + auto const end = handlers_.end(); + for (auto it = handlers_.begin(); it != end; ++it) { if ((*it).second) { - std::shared_ptr p( + std::shared_ptr const p( (*it).second); unlock_guard> ul(l); did_some_work = p->flush(flush_mode, stop_buffering) || @@ -383,7 +388,7 @@ namespace hpx::parcelset { } // make sure all pending parcels are being handled - for (pports_type::value_type& pp : pports_) + for (pports_type::value_type const& pp : pports_) { if (pp.first > 0) { @@ -396,12 +401,12 @@ namespace hpx::parcelset { return did_some_work; } - void parcelhandler::flush_parcels() + void parcelhandler::flush_parcels() const { if (is_networking_enabled_) { // now flush all parcel ports to be shut down - for (pports_type::value_type& pp : pports_) + for (pports_type::value_type const& pp : pports_) { if (pp.first > 0) { @@ -414,7 +419,7 @@ namespace hpx::parcelset { void parcelhandler::stop(bool blocking) { // now stop all parcel ports - for (pports_type::value_type& pp : pports_) + for (pports_type::value_type const& pp : pports_) { if (pp.first > 0) { @@ -431,7 +436,7 @@ namespace hpx::parcelset { components::component_type type, error_code& ec) const { std::vector allprefixes; - bool result = get_raw_localities(allprefixes, type, ec); + bool const result = get_raw_localities(allprefixes, type, ec); if (ec || !result) return false; @@ -445,11 +450,11 @@ namespace hpx::parcelset { std::vector& locality_ids, components::component_type type, error_code&) const { - std::vector ids = agas::get_all_locality_ids(type); + std::vector const ids = agas::get_all_locality_ids(type); locality_ids.clear(); locality_ids.reserve(ids.size()); - for (auto id : ids) + for (auto const& id : ids) { locality_ids.emplace_back(naming::get_gid_from_locality_id(id)); } @@ -467,18 +472,20 @@ namespace hpx::parcelset { { if (pp.first > 0) { - locality const& dest = - find_endpoint(dest_endpoints, pp.second->type()); - if (dest && + if (locality const& dest = + find_endpoint(dest_endpoints, pp.second->type()); + dest && pp.second->can_connect(dest, use_alternative_parcelports_)) + { return std::make_pair(pp.second, dest); + } } } std::ostringstream strm; strm << "target locality: " << dest_gid << "\n"; strm << "available destination endpoints:\n" << dest_endpoints << "\n"; - strm << "available partcelports:\n"; + strm << "available parcelports:\n"; for (auto const& pp : pports_) { list_parcelport(strm, pp.second->type(), pp.second->priority(), @@ -491,23 +498,23 @@ namespace hpx::parcelset { "The locality gid cannot be resolved to a valid endpoint. " "No valid parcelport configured. Detailed information:\n{}", strm.str()); - return std::pair, locality>(); } locality parcelhandler::find_endpoint( endpoints_type const& eps, std::string const& name) { - endpoints_type::const_iterator it = eps.find(name); + auto const it = eps.find(name); if (it != eps.end()) return it->second; - return locality(); + return {}; } // Return the reference to an existing io_service - util::io_service_pool* parcelhandler::get_thread_pool(char const* name) + util::io_service_pool* parcelhandler::get_thread_pool( + char const* name) const { util::io_service_pool* result = nullptr; - for (pports_type::value_type& pp : pports_) + for (pports_type::value_type const& pp : pports_) { result = pp.second->get_thread_pool(name); if (result) @@ -517,8 +524,9 @@ namespace hpx::parcelset { } namespace detail { + void parcel_sent_handler( - parcelhandler::write_handler_type& f, //-V669 + parcelhandler::write_handler_type const& f, //-V669 std::error_code const& ec, parcelset::parcel const& p) { // inform termination detection of a sent message @@ -545,9 +553,15 @@ namespace hpx::parcelset { void parcelhandler::put_parcel(parcelset::parcel p) { + LPT_(debug).format( + "parcelhandler::put_parcel: submitted: {}", p.parcel_id()); + auto handler = [this](std::error_code const& ec, parcelset::parcel const& p) -> void { invoke_write_handler(ec, p); + + LPT_(debug).format( + "parcelhandler::put_parcel: handled: {}", p.parcel_id()); }; put_parcel_impl(HPX_MOVE(p), HPX_MOVE(handler)); @@ -555,10 +569,17 @@ namespace hpx::parcelset { void parcelhandler::put_parcel(parcelset::parcel p, write_handler_type f) { + LPT_(debug).format( + "parcelhandler::put_parcel (with handler): submitted: {}", + p.parcel_id()); + auto handler = [this, f = HPX_MOVE(f)](std::error_code const& ec, parcelset::parcel const& p) -> void { invoke_write_handler(ec, p); f(ec, p); + + LPT_(debug).format( + "parcelhandler::put_parcel: handled: {}", p.parcel_id()); }; put_parcel_impl(HPX_MOVE(p), HPX_MOVE(handler)); @@ -578,10 +599,13 @@ namespace hpx::parcelset { if (!this_thread::has_sufficient_stack_space() && hpx::threads::threadmanager_is(hpx::state::running)) { + LPT_(debug).format("parcelhandler::put_parcel_impl: reschedule: {}", + p.parcel_id()); + { // reschedule request as an HPX thread to avoid hangs - void (parcelhandler::*put_parcel_ptr)(parcel p, - write_handler_type f) = &parcelhandler::put_parcel; + void (parcelhandler::*put_parcel_ptr)( + parcel, write_handler_type) = &parcelhandler::put_parcel; threads::thread_init_data data( threads::make_thread_function_nullary(util::deferred_call( @@ -617,15 +641,13 @@ namespace hpx::parcelset { // encapsulated action using destination_pair = std::pair, locality>; - destination_pair dest = + destination_pair const dest = find_appropriate_destination(addr.locality_); if (load_message_handlers_ && !hpx::is_stopped_or_shutting_down()) { - policies::message_handler* mh = - p.get_message_handler(dest.second); - - if (mh) + if (policies::message_handler* mh = + p.get_message_handler(dest.second)) { mh->put_parcel( dest.second, HPX_MOVE(p), HPX_MOVE(wrapped_f)); @@ -647,9 +669,14 @@ namespace hpx::parcelset { void parcelhandler::put_parcels(std::vector parcels) { + LPT_(debug).format("parcelhandler::put_parcels: submitted: {} parcels", + parcels.size()); + std::vector handlers(parcels.size(), [this](std::error_code const& ec, parcel const& p) -> void { - return invoke_write_handler(ec, p); + invoke_write_handler(ec, p); + LPT_(debug).format( + "parcelhandler::put_parcels: handled: {}", p.parcel_id()); }); put_parcels_impl(HPX_MOVE(parcels), HPX_MOVE(handlers)); @@ -658,17 +685,24 @@ namespace hpx::parcelset { void parcelhandler::put_parcels( std::vector parcels, std::vector funcs) { + LPT_(debug).format( + "parcelhandler::put_parcels (with handlers): submitted: {} parcels", + parcels.size()); + std::vector handlers; handlers.reserve(parcels.size()); for (std::size_t i = 0; i != parcels.size(); ++i) { - handlers.emplace_back( - [this, f = HPX_MOVE(funcs[i])]( - std::error_code const& ec, parcel const& p) -> void { - invoke_write_handler(ec, p); - f(ec, p); - }); + handlers.emplace_back([this, f = HPX_MOVE(funcs[i])]( + std::error_code const& ec, + parcel const& p) -> void { + invoke_write_handler(ec, p); + f(ec, p); + + LPT_(debug).format( + "parcelhandler::put_parcels: handled: {}", p.parcel_id()); + }); } put_parcels_impl(HPX_MOVE(parcels), HPX_MOVE(handlers)); @@ -684,13 +718,16 @@ namespace hpx::parcelset { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "parcelhandler::put_parcels", "mismatched number of parcels and handlers"); - return; } // if this isn't an HPX thread, the stack space check will return false if (!this_thread::has_sufficient_stack_space() && hpx::threads::threadmanager_is(hpx::state::running)) { + LPT_(debug).format( + "parcelhandler::put_parcels_impl: rescheduling: {}", + parcels.size()); + // reschedule request as an HPX thread to avoid hangs void (parcelhandler::*put_parcels_ptr)(std::vector, std::vector) = &parcelhandler::put_parcels; @@ -709,7 +746,7 @@ namespace hpx::parcelset { // partition parcels depending on whether their destination can be // resolved locally - std::size_t num_parcels = parcels.size(); + std::size_t const num_parcels = parcels.size(); std::vector resolved_parcels; resolved_parcels.reserve(num_parcels); @@ -722,8 +759,9 @@ namespace hpx::parcelset { destination_pair resolved_dest; std::vector nonresolved_parcels; - nonresolved_parcels.reserve(num_parcels); std::vector nonresolved_handlers; + + nonresolved_parcels.reserve(num_parcels); nonresolved_handlers.reserve(num_parcels); for (std::size_t i = 0; i != num_parcels; ++i) @@ -751,7 +789,6 @@ namespace hpx::parcelset { "parcelhandler::put_parcels", "mismatched destinations, all parcels are expected to " "target the same locality"); - return; } // If we were able to resolve the address(es) locally we would send @@ -765,10 +802,8 @@ namespace hpx::parcelset { if (load_message_handlers_) { - policies::message_handler* mh = - p.get_message_handler(dest.second); - - if (mh) + if (policies::message_handler* mh = + p.get_message_handler(dest.second)) { mh->put_parcel(dest.second, HPX_MOVE(p), HPX_MOVE(f)); continue; @@ -793,7 +828,7 @@ namespace hpx::parcelset { } } - // handle parcel which have been locally resolved + // handle parcel that have been locally resolved if (!resolved_parcels.empty()) { HPX_ASSERT(!!resolved_dest.first && !!resolved_dest.second); @@ -814,7 +849,7 @@ namespace hpx::parcelset { void parcelhandler::invoke_write_handler( std::error_code const& ec, parcel const& p) const { - write_handler_type f = write_handler_; + write_handler_type const f = write_handler_; f(ec, p); } @@ -858,7 +893,7 @@ namespace hpx::parcelset { } // all unhandled exceptions terminate the whole application - std::exception_ptr exception = hpx::detail::get_exception( + std::exception_ptr const exception = hpx::detail::get_exception( hpx::exception(ec), "default_write_handler", __FILE__, __LINE__, parcelset::dump_parcel(p)); @@ -878,9 +913,9 @@ namespace hpx::parcelset { } std::unique_lock l(handlers_mtx_); - handler_key_type key(loc, action); - message_handler_map::iterator it = handlers_.find(key); + handler_key_type key(loc, action); + auto it = handlers_.find(key); if (it == handlers_.end()) { std::shared_ptr p; @@ -889,8 +924,7 @@ namespace hpx::parcelset { // Just ignore the handlers_mtx_ while checking. We need to hold // the lock here to avoid multiple registrations that happens // right now in the parcel coalescing plugin - hpx::util::ignore_while_checking il(&l); - HPX_UNUSED(il); + [[maybe_unused]] hpx::util::ignore_while_checking const il(&l); p.reset(hpx::create_message_handler(message_handler_type, action, find_parcelport(loc.type()), num_messages, interval, @@ -904,7 +938,7 @@ namespace hpx::parcelset { l.unlock(); if (&ec != &throws) { - if ((*it).second.get()) + if ((*it).second) ec = make_success_code(); else ec = make_error_code( @@ -913,10 +947,10 @@ namespace hpx::parcelset { return (*it).second.get(); } - if (ec || !p.get()) + if (ec || !p) { - // insert an empty entry into the map to avoid trying to - // create this handler again + // insert an empty entry into the map to avoid trying to create + // this handler again p.reset(); std::pair const r = handlers_.emplace(key, p); @@ -945,7 +979,7 @@ namespace hpx::parcelset { } it = r.first; } - else if (!(*it).second.get()) + else if (!(*it).second) { l.unlock(); if (&ec != &throws) diff --git a/libs/full/parcelset_base/CMakeLists.txt b/libs/full/parcelset_base/CMakeLists.txt index 8b31cd4608a4..78eb49583e2b 100644 --- a/libs/full/parcelset_base/CMakeLists.txt +++ b/libs/full/parcelset_base/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021 The STE||AR-Group +# Copyright (c) 2019-2023 The STE||AR-Group # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -42,6 +42,7 @@ set(parcelset_base_sources locality_interface.cpp parcelport.cpp parcel_interface.cpp + parcelset_base.cpp set_parcel_write_handler.cpp ) diff --git a/libs/full/parcelset_base/include/hpx/parcelset_base/parcel_interface.hpp b/libs/full/parcelset_base/include/hpx/parcelset_base/parcel_interface.hpp index a157044e66e1..ae43e20c2b90 100644 --- a/libs/full/parcelset_base/include/hpx/parcelset_base/parcel_interface.hpp +++ b/libs/full/parcelset_base/include/hpx/parcelset_base/parcel_interface.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2015-2016 Thomas Heller // Copyright (c) 2007 Richard D Guidry Jr // Copyright (c) 2007 Alexandre (aka Alex) TABBAL @@ -113,7 +113,7 @@ namespace hpx::parcelset { class HPX_EXPORT parcel { private: - using split_gids_type = typename detail::parcel_base::split_gids_type; + using split_gids_type = detail::parcel_base::split_gids_type; bool is_valid() const; @@ -124,37 +124,37 @@ namespace hpx::parcelset { ~parcel(); public: - void reset(); + void reset() const; - char const* get_action_name() const; - int get_component_type() const; - int get_action_type() const; + [[nodiscard]] char const* get_action_name() const; + [[nodiscard]] int get_component_type() const; + [[nodiscard]] int get_action_type() const; - hpx::id_type source_id() const; - void set_source_id(hpx::id_type const& source_id); - void set_destination_id(naming::gid_type&& dest); + [[nodiscard]] hpx::id_type source_id() const; + void set_source_id(hpx::id_type const& source_id) const; + void set_destination_id(naming::gid_type&& dest) const; naming::address const& addr() const; naming::address& addr(); - std::uint32_t destination_locality_id() const; + [[nodiscard]] std::uint32_t destination_locality_id() const; naming::gid_type const& destination() const; naming::gid_type const& destination_locality() const; - double start_time() const; - void set_start_time(double time); - double creation_time() const; + [[nodiscard]] double start_time() const; + void set_start_time(double time) const; + [[nodiscard]] double creation_time() const; - threads::thread_priority get_thread_priority() const; - threads::thread_stacksize get_thread_stacksize() const; + [[nodiscard]] threads::thread_priority get_thread_priority() const; + [[nodiscard]] threads::thread_stacksize get_thread_stacksize() const; - std::uint32_t get_parent_locality_id() const; - threads::thread_id_type get_parent_thread_id() const; - std::uint64_t get_parent_thread_phase() const; + [[nodiscard]] std::uint32_t get_parent_locality_id() const; + [[nodiscard]] threads::thread_id_type get_parent_thread_id() const; + [[nodiscard]] std::uint64_t get_parent_thread_phase() const; -#if defined(HPX_HAVE_PARCEL_PROFILING) naming::gid_type const& parcel_id() const; +#if defined(HPX_HAVE_PARCEL_PROFILING) naming::gid_type& parcel_id(); #endif @@ -164,18 +164,19 @@ namespace hpx::parcelset { locality const& loc) const; #endif - bool does_termination_detection() const; + [[nodiscard]] bool does_termination_detection() const; split_gids_type move_split_gids() const; - void set_split_gids(split_gids_type&& split_gids); + void set_split_gids(split_gids_type&& split_gids) const; - std::size_t num_chunks() const; + [[nodiscard]] std::size_t num_chunks() const; std::size_t& num_chunks(); - std::size_t size() const; + [[nodiscard]] std::size_t size() const; std::size_t& size(); - bool schedule_action(std::size_t num_thread = std::size_t(-1)); + bool schedule_action( + std::size_t num_thread = static_cast(-1)) const; // returns true if parcel was migrated, false if scheduled locally bool load_schedule(serialization::input_archive& ar, @@ -191,7 +192,7 @@ namespace hpx::parcelset { friend class hpx::serialization::access; void serialize(serialization::input_archive& ar, unsigned); - void serialize(serialization::output_archive& ar, unsigned); + void serialize(serialization::output_archive& ar, unsigned) const; std::shared_ptr data_; }; diff --git a/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp b/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp index 7d8585ed630b..eef8cd16336e 100644 --- a/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp +++ b/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp @@ -1,5 +1,5 @@ // Copyright (c) 2014-2015 Thomas Heller -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2007 Richard D Guidry Jr // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2011 Katelyn Kufahl diff --git a/libs/full/parcelset_base/include/hpx/parcelset_base/parcelset_base_fwd.hpp b/libs/full/parcelset_base/include/hpx/parcelset_base/parcelset_base_fwd.hpp index 4d86b68ec6fd..0cd07d074cbe 100644 --- a/libs/full/parcelset_base/include/hpx/parcelset_base/parcelset_base_fwd.hpp +++ b/libs/full/parcelset_base/include/hpx/parcelset_base/parcelset_base_fwd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Hartmut Kaiser +// Copyright (c) 2021-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -40,4 +40,7 @@ namespace hpx::parcelset { /// perform all operations parcelport_background_mode_all = 0x07 }; + + HPX_EXPORT char const* get_parcelport_background_mode_name( + parcelport_background_mode mode); } // namespace hpx::parcelset diff --git a/libs/full/parcelset_base/src/parcel_interface.cpp b/libs/full/parcelset_base/src/parcel_interface.cpp index ffd3bbae2662..b1698252abcb 100644 --- a/libs/full/parcelset_base/src/parcel_interface.cpp +++ b/libs/full/parcelset_base/src/parcel_interface.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -43,7 +43,7 @@ namespace hpx::parcelset { parcel::~parcel() = default; - void parcel::reset() + void parcel::reset() const { data_->reset(); } @@ -68,12 +68,12 @@ namespace hpx::parcelset { return data_->source_id(); } - void parcel::set_source_id(hpx::id_type const& source_id) + void parcel::set_source_id(hpx::id_type const& source_id) const { data_->set_source_id(source_id); } - void parcel::set_destination_id(naming::gid_type&& dest) + void parcel::set_destination_id(naming::gid_type&& dest) const { data_->set_destination_id(HPX_MOVE(dest)); } @@ -108,7 +108,7 @@ namespace hpx::parcelset { return data_->start_time(); } - void parcel::set_start_time(double time) + void parcel::set_start_time(double time) const { data_->set_start_time(time); } @@ -166,7 +166,7 @@ namespace hpx::parcelset { return data_->move_split_gids(); } - void parcel::set_split_gids(split_gids_type&& split_gids) + void parcel::set_split_gids(split_gids_type&& split_gids) const { data_->set_split_gids(HPX_MOVE(split_gids)); } @@ -191,7 +191,7 @@ namespace hpx::parcelset { return data_->size(); } - bool parcel::schedule_action(std::size_t num_thread) + bool parcel::schedule_action(std::size_t num_thread) const { return data_->schedule_action(num_thread); } @@ -224,6 +224,11 @@ namespace hpx::parcelset { result.set_lsb(++id); return result; } +#else + naming::gid_type const& parcel::parcel_id() const + { + return naming::invalid_gid; + } #endif /////////////////////////////////////////////////////////////////////////// @@ -233,7 +238,7 @@ namespace hpx::parcelset { data_->load(ar, 0); } - void parcel::serialize(serialization::output_archive& ar, unsigned) + void parcel::serialize(serialization::output_archive& ar, unsigned) const { data_->save(ar, 0); } diff --git a/libs/full/parcelset_base/src/parcelset_base.cpp b/libs/full/parcelset_base/src/parcelset_base.cpp new file mode 100644 index 000000000000..137ed155196a --- /dev/null +++ b/libs/full/parcelset_base/src/parcelset_base.cpp @@ -0,0 +1,44 @@ +// Copyright (c) 2023 Hartmut Kaiser +// +// 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) + +#include + +#include + +namespace hpx::parcelset { + + /////////////////////////////////////////////////////////////////////////// + namespace strings { + + // clang-format off + inline constexpr char const* const parcelport_background_mode_names[] = { + "unknown", + "parcelport_background_mode_flush_buffers", + "unknown", + "parcelport_background_mode_send", + "parcelport_background_mode_receive", + "unknown", + "unknown", + "parcelport_background_mode_all", + }; + // clang-format on + + } // namespace strings + + char const* get_parcelport_background_mode_name( + parcelport_background_mode mode) + { + if (mode < parcelport_background_mode:: + parcelport_background_mode_flush_buffers || + mode > parcelport_background_mode::parcelport_background_mode_all) + { + return "unknown"; + } + + return strings::parcelport_background_mode_names + [static_cast(mode)]; + } +} // namespace hpx::parcelset diff --git a/libs/full/performance_counters/src/parcelhandler_counter_types.cpp b/libs/full/performance_counters/src/parcelhandler_counter_types.cpp index daa44216a77c..a550d4a10349 100644 --- a/libs/full/performance_counters/src/parcelhandler_counter_types.cpp +++ b/libs/full/performance_counters/src/parcelhandler_counter_types.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Hartmut Kaiser +// Copyright (c) 2021-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -479,7 +479,7 @@ namespace hpx::performance_counters { }; performance_counters::install_counter_types( - counter_types, sizeof(counter_types) / sizeof(counter_types[0])); + counter_types, std::size(counter_types)); #else HPX_UNUSED(ph); HPX_UNUSED(pp_type); @@ -586,8 +586,8 @@ namespace hpx::performance_counters { HPX_MOVE(cache_reclaims), _2), &performance_counters::locality_counter_discoverer, ""}}; - performance_counters::install_counter_types(connection_cache_types, - sizeof(connection_cache_types) / sizeof(connection_cache_types[0])); + performance_counters::install_counter_types( + connection_cache_types, std::size(connection_cache_types)); } /////////////////////////////////////////////////////////////////////////// @@ -643,7 +643,7 @@ namespace hpx::performance_counters { &performance_counters::locality_counter_discoverer, ""}}; performance_counters::install_counter_types( - counter_types, sizeof(counter_types) / sizeof(counter_types[0])); + counter_types, std::size(counter_types)); } } // namespace hpx::performance_counters diff --git a/libs/full/runtime_components/src/console_logging.cpp b/libs/full/runtime_components/src/console_logging.cpp index 689b3b751d4f..03032122d517 100644 --- a/libs/full/runtime_components/src/console_logging.cpp +++ b/libs/full/runtime_components/src/console_logging.cpp @@ -47,6 +47,7 @@ namespace hpx { namespace components { message_type const& msg = msgs[i]; switch (get<0>(msg)) { + // NOLINTNEXTLINE(bugprone-branch-clone) default: case logging_destination::hpx: LHPX_CONSOLE_(get<1>(msg)) << fail_msg << get<2>(msg); diff --git a/libs/full/runtime_components/src/server/console_logging_server.cpp b/libs/full/runtime_components/src/server/console_logging_server.cpp index 4aab2fa20caf..e26bdcb1a30e 100644 --- a/libs/full/runtime_components/src/server/console_logging_server.cpp +++ b/libs/full/runtime_components/src/server/console_logging_server.cpp @@ -61,6 +61,7 @@ namespace hpx { namespace components { namespace server { switch (dest) { + // NOLINTNEXTLINE(bugprone-branch-clone) case logging_destination::hpx: LHPX_CONSOLE_(level) << s; break; From b1fef600db7b99b5ba722431a9c199e0ac08ee12 Mon Sep 17 00:00:00 2001 From: STE||AR Group Date: Wed, 3 May 2023 01:36:00 -0500 Subject: [PATCH 31/63] Remove deprecated email from release procedure --- docs/sphinx/contributing/release_procedure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/contributing/release_procedure.rst b/docs/sphinx/contributing/release_procedure.rst index 32f47aec22c6..c0a252b1d8f7 100644 --- a/docs/sphinx/contributing/release_procedure.rst +++ b/docs/sphinx/contributing/release_procedure.rst @@ -161,7 +161,7 @@ are completed to avoid confusion. #. Announce the release on hpx-users@stellar-group.org, stellar@cct.lsu.edu, allcct@cct.lsu.edu, faculty@csc.lsu.edu, faculty@ece.lsu.edu, - xpress@crest.iu.edu, the |hpx| Slack channel, the IRC channel, + the |hpx| Slack channel, the IRC channel, our list of external collaborators, isocpp.org, reddit.com, HPC Wire, Inside HPC, Heise Online, and a CCT press release. From 0ef6e62153281d481d059c34c63a837e769ea1cc Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Wed, 3 May 2023 08:31:44 -0500 Subject: [PATCH 32/63] Switching to next version --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a17a011aa41..ad9903a02e09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,10 +58,10 @@ endif() # Build all of HPX # ############################################################################## set(HPX_VERSION_MAJOR 1) -set(HPX_VERSION_MINOR 9) +set(HPX_VERSION_MINOR 10) set(HPX_VERSION_SUBMINOR 0) set(HPX_VERSION_DATE 20230502) -set(HPX_VERSION_TAG "") +set(HPX_VERSION_TAG "-trunk") set(HPX_VERSION "${HPX_VERSION_MAJOR}.${HPX_VERSION_MINOR}.${HPX_VERSION_SUBMINOR}" From f50e929ea3d1bdd6b82f6bf0985689d0b46328c8 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 27 Mar 2023 17:43:28 +0300 Subject: [PATCH 33/63] Initial relocation trait definitions --- .../algorithms/traits/pointer_category.hpp | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp index 93213c9683e5..b6531fdc43ad 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp @@ -24,6 +24,10 @@ namespace hpx::traits { { }; + struct relocatable_pointer_tag : general_pointer_tag + { + }; + namespace detail { /////////////////////////////////////////////////////////////////////// @@ -100,6 +104,9 @@ namespace hpx::traits { template > + // Why do we need to check if the iterators are contiguous in the trivially + // copyable case? Is this category refering to buffers of + // the underlying types or the individual objects? struct pointer_move_category { using type = general_pointer_tag; @@ -133,6 +140,28 @@ namespace hpx::traits { iter_value_t>, general_pointer_tag>; }; + + template > + struct pointer_relocate_category + // The relocatability of the object has nothing to do with the iterators, + // So maybe we skip checking if the iterators are contiguous. + { + using type = general_pointer_tag; + }; + + // Would it make more sense to create a relocate_category instead or + // a pointer_relocate_category? + template + struct pointer_relocate_category + { + using type = std::conditional_t< + std::is_same_v, iter_value_t> && + std::is_move_constructible_v> && + std::is_destructible_v>, + relocatable_pointer_tag, + general_pointer_tag>; + }; } // namespace detail // isolate iterators that refer to contiguous trivially copyable sequences or @@ -157,6 +186,16 @@ namespace hpx::traits { using pointer_move_category_t = typename pointer_move_category::type; + template + struct pointer_relocate_category + { + using type = typename detail::pointer_relocate_category::type; + }; + + template + using pointer_relocate_category_t = + typename pointer_relocate_category::type; + // Allow for matching of iterator to iterator while calculating // pointer category. template From c86b5b5976bbfdd6e95da4f83e7adb2da557edc1 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 27 Mar 2023 18:09:34 +0300 Subject: [PATCH 34/63] Metafunc to determine if type is relocatable --- .../algorithms/traits/pointer_category.hpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp index b6531fdc43ad..c5d83ef2afce 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp @@ -104,9 +104,6 @@ namespace hpx::traits { template > - // Why do we need to check if the iterators are contiguous in the trivially - // copyable case? Is this category refering to buffers of - // the underlying types or the individual objects? struct pointer_move_category { using type = general_pointer_tag; @@ -141,24 +138,30 @@ namespace hpx::traits { general_pointer_tag>; }; + // check if a type is relocatable + template struct is_relocatable { + static constexpr bool value = + std::is_move_constructible_v && + std::is_destructible_v; + }; + + inline constexpr bool is_relocatable_v = is_relocatable::value; + template > struct pointer_relocate_category - // The relocatability of the object has nothing to do with the iterators, - // So maybe we skip checking if the iterators are contiguous. { using type = general_pointer_tag; }; // Would it make more sense to create a relocate_category instead or - // a pointer_relocate_category? + // a pointer_relocate_category, that does not involve iterators? template struct pointer_relocate_category { using type = std::conditional_t< std::is_same_v, iter_value_t> && - std::is_move_constructible_v> && - std::is_destructible_v>, + detail::is_relocatable_v>, relocatable_pointer_tag, general_pointer_tag>; }; From f641080419846ff85fb10db1841f8c2c245affe7 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 27 Mar 2023 18:09:49 +0300 Subject: [PATCH 35/63] remove some comments --- .../include/hpx/algorithms/traits/pointer_category.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp index c5d83ef2afce..4cdf1c95fb70 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp @@ -154,8 +154,6 @@ namespace hpx::traits { using type = general_pointer_tag; }; - // Would it make more sense to create a relocate_category instead or - // a pointer_relocate_category, that does not involve iterators? template struct pointer_relocate_category { From 1a541cf41833fc39832b2a4ade3801adc6c22dbc Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 27 Mar 2023 18:14:22 +0300 Subject: [PATCH 36/63] Comment --- .../include/hpx/algorithms/traits/pointer_category.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp index 4cdf1c95fb70..a195ea6ab6eb 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp @@ -138,7 +138,8 @@ namespace hpx::traits { general_pointer_tag>; }; - // check if a type is relocatable + // relocatabillity is true in almost all cases, + // an exception is std::mutex. template struct is_relocatable { static constexpr bool value = std::is_move_constructible_v && @@ -159,7 +160,7 @@ namespace hpx::traits { { using type = std::conditional_t< std::is_same_v, iter_value_t> && - detail::is_relocatable_v>, + is_relocatable_v>, relocatable_pointer_tag, general_pointer_tag>; }; From 7c7900009e8be9cf841a4a3261de0029c9772af5 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 27 Mar 2023 19:28:20 +0300 Subject: [PATCH 37/63] Add template<> line and clang format --- .../algorithms/traits/pointer_category.hpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp index a195ea6ab6eb..3775149a8ea9 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp @@ -138,19 +138,21 @@ namespace hpx::traits { general_pointer_tag>; }; - // relocatabillity is true in almost all cases, + // relocatabillity is true in almost all cases, // an exception is std::mutex. - template struct is_relocatable { - static constexpr bool value = - std::is_move_constructible_v && - std::is_destructible_v; + template + struct is_relocatable + { + static constexpr bool value = + std::is_move_constructible_v && std::is_destructible_v; }; + template inline constexpr bool is_relocatable_v = is_relocatable::value; template > - struct pointer_relocate_category + struct pointer_relocate_category { using type = general_pointer_tag; }; @@ -160,9 +162,8 @@ namespace hpx::traits { { using type = std::conditional_t< std::is_same_v, iter_value_t> && - is_relocatable_v>, - relocatable_pointer_tag, - general_pointer_tag>; + is_relocatable_v>, + relocatable_pointer_tag, general_pointer_tag>; }; } // namespace detail @@ -191,7 +192,8 @@ namespace hpx::traits { template struct pointer_relocate_category { - using type = typename detail::pointer_relocate_category::type; + using type = + typename detail::pointer_relocate_category::type; }; template From 161251ebb37930ea838b2876cf225bab09dc722d Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Tue, 28 Mar 2023 16:49:27 +0300 Subject: [PATCH 38/63] Suggested changes for entire file --- .../algorithms/traits/pointer_category.hpp | 45 +++++++++---------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp index 3775149a8ea9..1cbe90cc0a7f 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp @@ -103,14 +103,8 @@ namespace hpx::traits { // clang-format on template > + bool Contiguous = iterators_are_contiguous_v> struct pointer_move_category - { - using type = general_pointer_tag; - }; - - template - struct pointer_move_category { using type = std::conditional_t< std::is_trivially_assignable_v, @@ -120,15 +114,15 @@ namespace hpx::traits { general_pointer_tag>; }; - template > - struct pointer_copy_category + template + struct pointer_move_category { using type = general_pointer_tag; }; - template - struct pointer_copy_category + template > + struct pointer_copy_category { using type = std::conditional_t< std::is_trivially_assignable_v, @@ -138,6 +132,12 @@ namespace hpx::traits { general_pointer_tag>; }; + template + struct pointer_copy_category + { + using type = general_pointer_tag; + }; + // relocatabillity is true in almost all cases, // an exception is std::mutex. template @@ -151,28 +151,27 @@ namespace hpx::traits { inline constexpr bool is_relocatable_v = is_relocatable::value; template > + bool Contiguous = iterators_are_contiguous_v> struct pointer_relocate_category { - using type = general_pointer_tag; + using type = std::conditional_t< + std::is_same_v, iter_value_t> && + is_relocatable_v>, + relocatable_pointer_tag, general_pointer_tag>; }; template struct pointer_relocate_category { - using type = std::conditional_t< - std::is_same_v, iter_value_t> && - is_relocatable_v>, - relocatable_pointer_tag, general_pointer_tag>; + using type = general_pointer_tag; }; } // namespace detail // isolate iterators that refer to contiguous trivially copyable sequences or // which are pointers and their value_types are assignable template - struct pointer_copy_category + struct pointer_copy_category : detail::pointer_copy_category { - using type = typename detail::pointer_copy_category::type; }; template @@ -180,9 +179,8 @@ namespace hpx::traits { typename pointer_copy_category::type; template - struct pointer_move_category + struct pointer_move_category : detail::pointer_move_category { - using type = typename detail::pointer_move_category::type; }; template @@ -191,9 +189,8 @@ namespace hpx::traits { template struct pointer_relocate_category + : detail::pointer_relocate_category { - using type = - typename detail::pointer_relocate_category::type; }; template From 036e6ca05de86d8f2fa82ff58e904fc80701581b Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Tue, 28 Mar 2023 17:33:44 +0300 Subject: [PATCH 39/63] Split into files --- .../hpx/algorithms/traits/is_relocatable.hpp | 23 +++++++++++++++++++ .../algorithms/traits/pointer_category.hpp | 13 +---------- 2 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp new file mode 100644 index 000000000000..cbade6058a3b --- /dev/null +++ b/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp @@ -0,0 +1,23 @@ +// Copyright (c) 2023 Hartmut Kaiser +// +// 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) + +#pragma once + +#include + +namespace hpx::traits { + + template + struct is_relocatable + { + static constexpr bool value = + std::is_move_constructible_v && std::is_destructible_v; + }; + + template + inline constexpr bool is_relocatable_v = is_relocatable::value; +} // namespace hpx::traits + diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp index 1cbe90cc0a7f..5251dff0e3d6 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp @@ -8,6 +8,7 @@ #pragma once #include +#include #include @@ -138,18 +139,6 @@ namespace hpx::traits { using type = general_pointer_tag; }; - // relocatabillity is true in almost all cases, - // an exception is std::mutex. - template - struct is_relocatable - { - static constexpr bool value = - std::is_move_constructible_v && std::is_destructible_v; - }; - - template - inline constexpr bool is_relocatable_v = is_relocatable::value; - template > struct pointer_relocate_category From 4e689fb8ed4126603fff6a854bb4ccfca377a2fc Mon Sep 17 00:00:00 2001 From: Isidoros Date: Tue, 28 Mar 2023 19:01:11 +0300 Subject: [PATCH 40/63] include type_traits Co-authored-by: Hartmut Kaiser --- .../algorithms/include/hpx/algorithms/traits/is_relocatable.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp index cbade6058a3b..f407ec4c46e4 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace hpx::traits { From 789c64653d10cf68b5b92957d16ff6f024549434 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Tue, 28 Mar 2023 19:02:41 +0300 Subject: [PATCH 41/63] change copyright name --- .../algorithms/include/hpx/algorithms/traits/is_relocatable.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp index f407ec4c46e4..b6acee25d53e 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Hartmut Kaiser +// Copyright (c) 2023 Isidoros Tsaousis-Seiras // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying From 948f12d168cbbe47097710dfe9be4d4574010857 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Tue, 28 Mar 2023 21:42:31 +0300 Subject: [PATCH 42/63] clang-format + cmake additions --- libs/core/algorithms/CMakeLists.txt | 2 ++ .../hpx/algorithms/traits/is_relocatable.hpp | 17 ++++++++--------- .../hpx/algorithms/traits/pointer_category.hpp | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libs/core/algorithms/CMakeLists.txt b/libs/core/algorithms/CMakeLists.txt index c2fac77c66cf..2f0abc0024c8 100644 --- a/libs/core/algorithms/CMakeLists.txt +++ b/libs/core/algorithms/CMakeLists.txt @@ -6,6 +6,7 @@ set(algorithms_headers hpx/algorithms/traits/is_pair.hpp + hpx/algorithms/traits/is_relocatable.hpp hpx/algorithms/traits/is_value_proxy.hpp hpx/algorithms/traits/pointer_category.hpp hpx/algorithms/traits/projected.hpp @@ -225,6 +226,7 @@ set(algorithms_compat_headers hpx/algorithms.hpp => hpx/algorithm.hpp hpx/parallel/traits/projected.hpp => hpx/algorithms/traits/projected.hpp hpx/parallel/traits/projected_range.hpp => hpx/algorithms/traits/projected_range.hpp + hpx/traits/is_relocatable.hpp => hpx/algorithms/traits/is_relocatable.hpp hpx/traits/is_value_proxy.hpp => hpx/algorithms/traits/is_value_proxy.hpp hpx/traits/pointer_category.hpp => hpx/algorithms/traits/pointer_category.hpp hpx/traits/segmented_iterator_traits.hpp => hpx/algorithms/traits/segmented_iterator_traits.hpp diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp index b6acee25d53e..925c4c31d0f8 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp @@ -10,14 +10,13 @@ namespace hpx::traits { - template - struct is_relocatable - { - static constexpr bool value = - std::is_move_constructible_v && std::is_destructible_v; - }; + template + struct is_relocatable + { + static constexpr bool value = + std::is_move_constructible_v && std::is_destructible_v; + }; - template - inline constexpr bool is_relocatable_v = is_relocatable::value; + template + inline constexpr bool is_relocatable_v = is_relocatable::value; } // namespace hpx::traits - diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp index 5251dff0e3d6..75f77e142012 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp @@ -7,8 +7,8 @@ #pragma once -#include #include +#include #include From 5e65c90d3acacbbfadd838413850bfe9092d7074 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Wed, 29 Mar 2023 01:09:55 +0300 Subject: [PATCH 43/63] Remove from algorithms_compat_headers --- libs/core/algorithms/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/core/algorithms/CMakeLists.txt b/libs/core/algorithms/CMakeLists.txt index 2f0abc0024c8..8f37b9277a31 100644 --- a/libs/core/algorithms/CMakeLists.txt +++ b/libs/core/algorithms/CMakeLists.txt @@ -226,7 +226,6 @@ set(algorithms_compat_headers hpx/algorithms.hpp => hpx/algorithm.hpp hpx/parallel/traits/projected.hpp => hpx/algorithms/traits/projected.hpp hpx/parallel/traits/projected_range.hpp => hpx/algorithms/traits/projected_range.hpp - hpx/traits/is_relocatable.hpp => hpx/algorithms/traits/is_relocatable.hpp hpx/traits/is_value_proxy.hpp => hpx/algorithms/traits/is_value_proxy.hpp hpx/traits/pointer_category.hpp => hpx/algorithms/traits/pointer_category.hpp hpx/traits/segmented_iterator_traits.hpp => hpx/algorithms/traits/segmented_iterator_traits.hpp From e9e4159900d947e83f0c8b8d4be0f38788f4fce8 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 10 Apr 2023 18:32:09 +0300 Subject: [PATCH 44/63] Added static assertion tests --- .../algorithms/util/test_is_relocatable.cpp | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp diff --git a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp new file mode 100644 index 000000000000..6f393afc6d98 --- /dev/null +++ b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp @@ -0,0 +1,70 @@ +// Copyright (c) 2015-2017 Francisco Jose Tapia +// Copyright (c) 2020 Hartmut Kaiser +// +// 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) + +#include +#include + +#include + +#include + +// Integral types are relocatable +static_assert(hpx::relocatable); +static_assert(hpx::relocatable); +static_assert(hpx::relocatable); +static_assert(hpx::relocatable); + +// Array types are not move-constructible and thus not relocatable +static_assert(!hpx::relocatable); +static_assert(!hpx::relocatable); +static_assert(!hpx::relocatable); +static_assert(!hpx::relocatable); + +// Function types are not move-constructible and thus not relocatable +static_assert(!hpx::relocatable); + +// Void types are not move-constructible and thus not relocatable +static_assert(!hpx::relocatable); +static_assert(!hpx::relocatable); + +// std::mutex is not relocatable +static_assert(!hpx::relocatable); + +struct NotDestructible { + NotDestructible(const NotDestructible&); + NotDestructible(NotDestructible&&); + ~NotDestructible() = delete; +}; + +static_assert(!hpx::relocatable); + +struct NotMoveConstructible { + NotMoveConstructible(const NotMoveConstructible&); + NotMoveConstructible(NotMoveConstructible&&) = delete; +}; + +static_assert(!hpx::relocatable); + +struct NotCopyConstructible { + NotCopyConstructible(const NotCopyConstructible&) = delete; + NotCopyConstructible(NotCopyConstructible&&); +}; + +static_assert(hpx::relocatable); + +// reference types are relocatable +static_assert(hpx::relocatable); +static_assert(hpx::relocatable); +static_assert(hpx::relocatable); +static_assert(hpx::relocatable); +static_assert(std::relocatable); +static_assert(std::relocatable); +static_assert(std::relocatable); + +int main(int, char*[]) +{ +} From b534a5a27b02984ce7e2efb965a0053bfa5e7e0c Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 10 Apr 2023 20:01:35 +0300 Subject: [PATCH 45/63] clang-format --- .../algorithms/util/test_is_relocatable.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp index 6f393afc6d98..8e174fc57e09 100644 --- a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp @@ -16,7 +16,7 @@ static_assert(hpx::relocatable); static_assert(hpx::relocatable); static_assert(hpx::relocatable); -static_assert(hpx::relocatable); +static_assert(hpx::relocatable); // Array types are not move-constructible and thus not relocatable static_assert(!hpx::relocatable); @@ -34,7 +34,8 @@ static_assert(!hpx::relocatable); // std::mutex is not relocatable static_assert(!hpx::relocatable); -struct NotDestructible { +struct NotDestructible +{ NotDestructible(const NotDestructible&); NotDestructible(NotDestructible&&); ~NotDestructible() = delete; @@ -42,14 +43,16 @@ struct NotDestructible { static_assert(!hpx::relocatable); -struct NotMoveConstructible { +struct NotMoveConstructible +{ NotMoveConstructible(const NotMoveConstructible&); NotMoveConstructible(NotMoveConstructible&&) = delete; }; static_assert(!hpx::relocatable); -struct NotCopyConstructible { +struct NotCopyConstructible +{ NotCopyConstructible(const NotCopyConstructible&) = delete; NotCopyConstructible(NotCopyConstructible&&); }; @@ -59,12 +62,10 @@ static_assert(hpx::relocatable); // reference types are relocatable static_assert(hpx::relocatable); static_assert(hpx::relocatable); -static_assert(hpx::relocatable); +static_assert(hpx::relocatable); static_assert(hpx::relocatable); static_assert(std::relocatable); static_assert(std::relocatable); static_assert(std::relocatable); -int main(int, char*[]) -{ -} +int main(int, char*[]) {} From e44c601e5e93c2f57de6f86375f745adc7bcf414 Mon Sep 17 00:00:00 2001 From: Isidoros Date: Mon, 10 Apr 2023 18:34:35 +0300 Subject: [PATCH 46/63] Corrected copyrights name --- .../tests/unit/algorithms/util/test_is_relocatable.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp index 8e174fc57e09..9865f8648096 100644 --- a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp @@ -1,5 +1,4 @@ -// Copyright (c) 2015-2017 Francisco Jose Tapia -// Copyright (c) 2020 Hartmut Kaiser +// Copyright (c) 2023 Isidoros Tsaousis Seiras // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying From 97a89a34de50030a4b05040fd2c79d8a7496a974 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 10 Apr 2023 20:10:30 +0300 Subject: [PATCH 47/63] add relocatable tests to cmake --- .../core/algorithms/tests/unit/algorithms/util/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt b/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt index 95c4813c0c3d..c803032cd49a 100644 --- a/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt +++ b/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt @@ -4,8 +4,8 @@ # 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) -set(tests test_low_level test_merge_four test_merge_vector test_nbits - test_range +set(tests test_is_relocatable test_low_level test_merge_four test_merge_vector + test_nbits test_range ) foreach(test ${tests}) From 50946773003477712ff284a619ef78ed0e08e921 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 10 Apr 2023 21:09:40 +0300 Subject: [PATCH 48/63] cmake-format --- libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt b/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt index c803032cd49a..25e81f7364a1 100644 --- a/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt +++ b/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt @@ -4,7 +4,7 @@ # 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) -set(tests test_is_relocatable test_low_level test_merge_four test_merge_vector +set(tests test_is_relocatable test_low_level test_merge_four test_merge_vector test_nbits test_range ) From 1d4287d7435631f3efd8c0050a35daddb512f93b Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 10 Apr 2023 21:11:33 +0300 Subject: [PATCH 49/63] Add copyright --- libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt b/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt index 25e81f7364a1..426c259849fc 100644 --- a/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt +++ b/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt @@ -1,4 +1,5 @@ # Copyright (c) 2020 Hartmut Kaiser +# Copyright (c) 2023 Isidoros Tsaousis Seiras # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying From 128611cdde2706e36fe52e9fb95f50a298c5ba6d Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 10 Apr 2023 23:28:09 +0300 Subject: [PATCH 50/63] typo in assertions --- .../algorithms/util/test_is_relocatable.cpp | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp index 9865f8648096..53e9391e3cae 100644 --- a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp @@ -12,26 +12,26 @@ #include // Integral types are relocatable -static_assert(hpx::relocatable); -static_assert(hpx::relocatable); -static_assert(hpx::relocatable); -static_assert(hpx::relocatable); +static_assert(hpx::is_relocatable_v); +static_assert(hpx::is_relocatable_v); +static_assert(hpx::is_relocatable_v); +static_assert(hpx::is_relocatable_v); // Array types are not move-constructible and thus not relocatable -static_assert(!hpx::relocatable); -static_assert(!hpx::relocatable); -static_assert(!hpx::relocatable); -static_assert(!hpx::relocatable); +static_assert(!hpx::is_relocatable_v); +static_assert(!hpx::is_relocatable_v); +static_assert(!hpx::is_relocatable_v); +static_assert(!hpx::is_relocatable_v); // Function types are not move-constructible and thus not relocatable -static_assert(!hpx::relocatable); +static_assert(!hpx::is_relocatable_v); // Void types are not move-constructible and thus not relocatable -static_assert(!hpx::relocatable); -static_assert(!hpx::relocatable); +static_assert(!hpx::is_relocatable_v); +static_assert(!hpx::is_relocatable_v); // std::mutex is not relocatable -static_assert(!hpx::relocatable); +static_assert(!hpx::is_relocatable_v); struct NotDestructible { @@ -40,7 +40,7 @@ struct NotDestructible ~NotDestructible() = delete; }; -static_assert(!hpx::relocatable); +static_assert(!hpx::is_relocatable_v); struct NotMoveConstructible { @@ -48,7 +48,7 @@ struct NotMoveConstructible NotMoveConstructible(NotMoveConstructible&&) = delete; }; -static_assert(!hpx::relocatable); +static_assert(!hpx::is_relocatable_v); struct NotCopyConstructible { @@ -56,13 +56,13 @@ struct NotCopyConstructible NotCopyConstructible(NotCopyConstructible&&); }; -static_assert(hpx::relocatable); +static_assert(hpx::is_relocatable_v); // reference types are relocatable -static_assert(hpx::relocatable); -static_assert(hpx::relocatable); -static_assert(hpx::relocatable); -static_assert(hpx::relocatable); +static_assert(hpx::is_relocatable_v); +static_assert(hpx::is_relocatable_v); +static_assert(hpx::is_relocatable_v); +static_assert(hpx::is_relocatable_v); static_assert(std::relocatable); static_assert(std::relocatable); static_assert(std::relocatable); From dd5a4a2b761f032295de860920bbdd5b0488f232 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Mon, 10 Apr 2023 23:30:19 +0300 Subject: [PATCH 51/63] fix second typo --- .../tests/unit/algorithms/util/test_is_relocatable.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp index 53e9391e3cae..1ee1dcf1ac80 100644 --- a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp @@ -63,8 +63,8 @@ static_assert(hpx::is_relocatable_v); static_assert(hpx::is_relocatable_v); static_assert(hpx::is_relocatable_v); static_assert(hpx::is_relocatable_v); -static_assert(std::relocatable); -static_assert(std::relocatable); -static_assert(std::relocatable); +static_assert(hpx::is_relocatable_v); +static_assert(hpx::is_relocatable_v); +static_assert(hpx::is_relocatable_v); int main(int, char*[]) {} From d80d5ce6dfd978ff0850b679feb031b6fb8462a6 Mon Sep 17 00:00:00 2001 From: Isidoros Date: Tue, 25 Apr 2023 18:38:12 +0300 Subject: [PATCH 52/63] remove name from cr --- libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt b/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt index 426c259849fc..25e81f7364a1 100644 --- a/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt +++ b/libs/core/algorithms/tests/unit/algorithms/util/CMakeLists.txt @@ -1,5 +1,4 @@ # Copyright (c) 2020 Hartmut Kaiser -# Copyright (c) 2023 Isidoros Tsaousis Seiras # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying From 32376589207ba6196f39682adbf190d4dfd1503b Mon Sep 17 00:00:00 2001 From: Isidoros Date: Tue, 25 Apr 2023 18:39:07 +0300 Subject: [PATCH 53/63] Corrected spelling of my name (added the dash between last names) --- .../tests/unit/algorithms/util/test_is_relocatable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp index 1ee1dcf1ac80..af73f07695a5 100644 --- a/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/util/test_is_relocatable.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Isidoros Tsaousis Seiras +// Copyright (c) 2023 Isidoros Tsaousis-Seiras // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying From a9ea84d67e0b5a6290d9a66649066f29a1050e6f Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Fri, 5 May 2023 09:39:15 -0500 Subject: [PATCH 54/63] Moving is_relocatable to namespace hpx --- .../include/hpx/algorithms/traits/is_relocatable.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp index 925c4c31d0f8..5d983c3ec168 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/is_relocatable.hpp @@ -8,7 +8,7 @@ #include -namespace hpx::traits { +namespace hpx { template struct is_relocatable @@ -19,4 +19,4 @@ namespace hpx::traits { template inline constexpr bool is_relocatable_v = is_relocatable::value; -} // namespace hpx::traits +} // namespace hpx From 0ec20f4b22fde42fe4b4ba9dad4732f15b867a19 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Sun, 30 Apr 2023 16:21:31 -0500 Subject: [PATCH 55/63] Adding zero-copy support on the receiving end of the TCP parcel port - flyby: cleaning up and modernizing TCP parcel port --- ...ching_and_configuring_hpx_applications.rst | 2 +- libs/core/serialization/CMakeLists.txt | 6 +- .../include/hpx/serialization/array.hpp | 8 +- .../include/hpx/serialization/container.hpp | 5 +- .../detail/allow_zero_copy_receive.hpp | 30 ++ .../hpx/serialization/input_archive.hpp | 18 +- .../hpx/serialization/input_container.hpp | 44 +- .../hpx/serialization/serialization_chunk.hpp | 17 +- .../src/detail/allow_zero_copy_receive.cpp | 23 + .../include/hpx/parcelport_lci/receiver.hpp | 8 +- .../parcelport_libfabric/src/rma_receiver.cpp | 8 +- .../parcelport_mpi/receiver_connection.hpp | 3 +- .../hpx/parcelport_tcp/connection_handler.hpp | 12 +- .../include/hpx/parcelport_tcp/locality.hpp | 6 +- .../include/hpx/parcelport_tcp/receiver.hpp | 128 ++++-- .../include/hpx/parcelport_tcp/sender.hpp | 17 +- .../src/connection_handler_tcp.cpp | 12 +- .../parcelport_tcp/src/parcelport_tcp.cpp | 68 ++- .../include/hpx/parcelset/decode_parcels.hpp | 435 ++++++++++++------ .../include/hpx/parcelset/parcel_buffer.hpp | 1 + libs/full/parcelset/src/parcel.cpp | 9 +- libs/full/parcelset/tests/unit/CMakeLists.txt | 2 +- .../full/parcelset/tests/unit/put_parcels.cpp | 18 +- .../parcelset/tests/unit/zero_copy_parcel.cpp | 97 ++++ 24 files changed, 694 insertions(+), 283 deletions(-) create mode 100644 libs/core/serialization/include/hpx/serialization/detail/allow_zero_copy_receive.hpp create mode 100644 libs/core/serialization/src/detail/allow_zero_copy_receive.cpp create mode 100644 libs/full/parcelset/tests/unit/zero_copy_parcel.cpp diff --git a/docs/sphinx/manual/launching_and_configuring_hpx_applications.rst b/docs/sphinx/manual/launching_and_configuring_hpx_applications.rst index 159e7128e877..e38ad01994e3 100644 --- a/docs/sphinx/manual/launching_and_configuring_hpx_applications.rst +++ b/docs/sphinx/manual/launching_and_configuring_hpx_applications.rst @@ -703,7 +703,7 @@ equivalent CMake variable is ``HPX_WITH_PARCELPORT_MPI`` and has to be set to * This property defines the maximum allowed outbound coalesced message size that will be transferrable through the :term:`parcel` layer. The default is taken from ``hpx.parcel.max_outbound_connections``. - * * ``hpx.parcel.tcp.max_background_threads`` + * * ``hpx.parcel.mpi.max_background_threads`` * This property defines how many cores should be used to perform background operations. The default is taken from ``hpx.parcel.max_background_threads``. diff --git a/libs/core/serialization/CMakeLists.txt b/libs/core/serialization/CMakeLists.txt index 41b554c6aa7c..bf7a83439881 100644 --- a/libs/core/serialization/CMakeLists.txt +++ b/libs/core/serialization/CMakeLists.txt @@ -104,6 +104,7 @@ endif() # Default location is $HPX_ROOT/libs/serialization/include set(serialization_headers hpx/serialization.hpp + hpx/serialization/detail/allow_zero_copy_receive.hpp hpx/serialization/detail/constructor_selector.hpp hpx/serialization/detail/non_default_constructible.hpp hpx/serialization/detail/pointer.hpp @@ -218,8 +219,8 @@ endif() # Default location is $HPX_ROOT/libs/serialization/src set(serialization_sources - detail/pointer.cpp detail/polymorphic_id_factory.cpp - detail/polymorphic_intrusive_factory.cpp + detail/allow_zero_copy_receive.cpp detail/pointer.cpp + detail/polymorphic_id_factory.cpp detail/polymorphic_intrusive_factory.cpp detail/polymorphic_nonintrusive_factory.cpp exception_ptr.cpp ) @@ -243,5 +244,6 @@ add_hpx_module( hpx_preprocessor hpx_type_support DEPENDENCIES ${serialization_optional_dependencies} + ADD_TO_GLOBAL_HEADER hpx/serialization/detail/allow_zero_copy_receive.hpp CMAKE_SUBDIRS examples tests ) diff --git a/libs/core/serialization/include/hpx/serialization/array.hpp b/libs/core/serialization/include/hpx/serialization/array.hpp index 1f9dd9796895..542c95c3c920 100644 --- a/libs/core/serialization/include/hpx/serialization/array.hpp +++ b/libs/core/serialization/include/hpx/serialization/array.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -81,7 +82,12 @@ namespace hpx::serialization { // try using chunking if constexpr (std::is_same_v) { - ar.load_binary_chunk(m_t, m_element_count * sizeof(T)); + bool allow_zero_copy_receive = + ar.template try_get_extra_data< + detail::allow_zero_copy_receive>() != nullptr; + + ar.load_binary_chunk(m_t, m_element_count * sizeof(T), + allow_zero_copy_receive); } else { diff --git a/libs/core/serialization/include/hpx/serialization/container.hpp b/libs/core/serialization/include/hpx/serialization/container.hpp index 4343f95f27a7..74ae54c7ad07 100644 --- a/libs/core/serialization/include/hpx/serialization/container.hpp +++ b/libs/core/serialization/include/hpx/serialization/container.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2014 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 @@ -44,6 +44,7 @@ namespace hpx::serialization { virtual void set_zero_copy_serialization_threshold( std::size_t zero_copy_serialization_threshold) = 0; virtual void load_binary(void* address, std::size_t count) = 0; - virtual void load_binary_chunk(void* address, std::size_t count) = 0; + virtual void load_binary_chunk( + void* address, std::size_t count, bool allow_zero_copy_receive) = 0; }; } // namespace hpx::serialization diff --git a/libs/core/serialization/include/hpx/serialization/detail/allow_zero_copy_receive.hpp b/libs/core/serialization/include/hpx/serialization/detail/allow_zero_copy_receive.hpp new file mode 100644 index 000000000000..38333a6f9390 --- /dev/null +++ b/libs/core/serialization/include/hpx/serialization/detail/allow_zero_copy_receive.hpp @@ -0,0 +1,30 @@ +// Copyright (c) 2023 Hartmut Kaiser +// +// 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) + +#pragma once + +#include +#include + +namespace hpx::serialization::detail { + + struct allow_zero_copy_receive + { + }; +} // namespace hpx::serialization::detail + +// This is explicitly instantiated to ensure that the id is stable across shared +// libraries. +template <> +struct hpx::util::extra_data_helper< + hpx::serialization::detail::allow_zero_copy_receive> +{ + HPX_CORE_EXPORT static extra_data_id_type id() noexcept; + static constexpr void reset( + serialization::detail::allow_zero_copy_receive*) noexcept + { + } +}; diff --git a/libs/core/serialization/include/hpx/serialization/input_archive.hpp b/libs/core/serialization/include/hpx/serialization/input_archive.hpp index 705161737c09..36d67566691b 100644 --- a/libs/core/serialization/include/hpx/serialization/input_archive.hpp +++ b/libs/core/serialization/include/hpx/serialization/input_archive.hpp @@ -37,7 +37,7 @@ namespace hpx::serialization { template explicit input_archive(Container& buffer, std::size_t inbound_data_size = 0, - std::vector const* chunks = nullptr) + std::vector* chunks = nullptr) : base_type(0U) , buffer_(new input_container( buffer, chunks, inbound_data_size)) @@ -256,7 +256,7 @@ namespace hpx::serialization { public: void load_binary(void* address, std::size_t count) { - if (0 == count) + if (HPX_UNLIKELY(0 == count)) return; buffer_->load_binary(address, count); @@ -264,15 +264,21 @@ namespace hpx::serialization { size_ += count; } - void load_binary_chunk(void* address, std::size_t count) + void load_binary_chunk( + void* address, std::size_t count, bool allow_zero_copy_receive) { - if (0 == count) + if (HPX_UNLIKELY(0 == count)) return; - if (disable_data_chunking()) + if (HPX_UNLIKELY(disable_data_chunking())) + { buffer_->load_binary(address, count); + } else - buffer_->load_binary_chunk(address, count); + { + buffer_->load_binary_chunk( + address, count, allow_zero_copy_receive); + } size_ += count; } diff --git a/libs/core/serialization/include/hpx/serialization/input_container.hpp b/libs/core/serialization/include/hpx/serialization/input_container.hpp index 0d3167da4e63..2deb72895dde 100644 --- a/libs/core/serialization/include/hpx/serialization/input_container.hpp +++ b/libs/core/serialization/include/hpx/serialization/input_container.hpp @@ -29,25 +29,30 @@ namespace hpx::serialization { private: using access_traits = traits::serialization_access_data; - [[nodiscard]] std::size_t get_chunk_size( + [[nodiscard]] constexpr std::size_t get_chunk_size( std::size_t chunk) const noexcept { return (*chunks_)[chunk].size_; } - [[nodiscard]] chunk_type get_chunk_type( + [[nodiscard]] constexpr chunk_type get_chunk_type( std::size_t chunk) const noexcept { return (*chunks_)[chunk].type_; } - [[nodiscard]] chunk_data get_chunk_data( + constexpr chunk_data const& get_chunk_data( std::size_t chunk) const noexcept { return (*chunks_)[chunk].data_; } - [[nodiscard]] std::size_t get_num_chunks() const noexcept + constexpr chunk_data& get_chunk_data(std::size_t chunk) noexcept + { + return (*chunks_)[chunk].data_; + } + + [[nodiscard]] constexpr std::size_t get_num_chunks() const noexcept { return chunks_->size(); } @@ -67,7 +72,7 @@ namespace hpx::serialization { } input_container(Container const& cont, - std::vector const* chunks, + std::vector* chunks, std::size_t inbound_data_size) noexcept : cont_(cont) , current_(0) @@ -159,7 +164,8 @@ namespace hpx::serialization { } } - void load_binary_chunk(void* address, std::size_t count) override + void load_binary_chunk(void* address, std::size_t count, + bool allow_zero_copy_receive) override { HPX_ASSERT(static_cast(count) >= 0); @@ -183,11 +189,25 @@ namespace hpx::serialization { "archive data bstream data chunk size mismatch"); } - // unfortunately we can't implement a zero copy policy on the - // receiving end as the memory was already allocated by the - // serialization code - std::memcpy( - address, get_chunk_data(current_chunk_).pos_, count); + auto*& buffer = get_chunk_data(current_chunk_).pos_; + if (allow_zero_copy_receive) + { + // If the receiving end supports zer-copy serialization of + // larger chunks, the de-serialization pass should not copy + // the data, but simply return the address of the buffer + // where the data will be placed by the networking layer. + HPX_ASSERT(buffer == nullptr); + buffer = address; + } + else + { + // Unfortunately we can't implement a zero copy policy on + // the receiving end as the parcelport doesn't support this. + // The memory was already allocated by the serialization + // code, thus we copy the received data. + HPX_ASSERT(buffer != nullptr); + std::memcpy(address, buffer, count); + } ++current_chunk_; } } @@ -198,7 +218,7 @@ namespace hpx::serialization { std::size_t decompressed_size_; std::size_t zero_copy_serialization_threshold_; - std::vector const* chunks_; + std::vector* chunks_; std::size_t current_chunk_; std::size_t current_chunk_size_; }; diff --git a/libs/core/serialization/include/hpx/serialization/serialization_chunk.hpp b/libs/core/serialization/include/hpx/serialization/serialization_chunk.hpp index c3e0d7e35a71..1a145783284e 100644 --- a/libs/core/serialization/include/hpx/serialization/serialization_chunk.hpp +++ b/libs/core/serialization/include/hpx/serialization/serialization_chunk.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2014 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 @@ -8,6 +8,7 @@ #pragma once #include +#include #include #include @@ -40,10 +41,20 @@ namespace hpx::serialization { std::uint64_t rkey_; // optional RDMA remote key for parcelport // operations chunk_type type_; // chunk_type + + [[nodiscard]] constexpr void const* data() const noexcept + { + HPX_ASSERT(type_ == chunk_type::chunk_type_pointer); + return data_.cpos_; + } + [[nodiscard]] constexpr std::size_t size() const noexcept + { + return size_; + } }; /////////////////////////////////////////////////////////////////////// - inline serialization_chunk create_index_chunk( + [[nodiscard]] constexpr serialization_chunk create_index_chunk( std::size_t index, std::size_t size) noexcept { serialization_chunk retval = { @@ -52,7 +63,7 @@ namespace hpx::serialization { return retval; } - inline serialization_chunk create_pointer_chunk( + [[nodiscard]] constexpr serialization_chunk create_pointer_chunk( void const* pos, std::size_t size, std::uint64_t rkey = 0) noexcept { serialization_chunk retval = { diff --git a/libs/core/serialization/src/detail/allow_zero_copy_receive.cpp b/libs/core/serialization/src/detail/allow_zero_copy_receive.cpp new file mode 100644 index 000000000000..00c9d57f3c51 --- /dev/null +++ b/libs/core/serialization/src/detail/allow_zero_copy_receive.cpp @@ -0,0 +1,23 @@ +// Copyright (c) 2023 Hartmut Kaiser +// +// 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) + +#include +#include +#include + +#include + +namespace hpx::util { + + // This is explicitly instantiated to ensure that the id is stable across + // shared libraries. + extra_data_id_type extra_data_helper< + serialization::detail::allow_zero_copy_receive>::id() noexcept + { + static std::uint8_t id = 0; + return &id; + } +} // namespace hpx::util diff --git a/libs/full/parcelport_lci/include/hpx/parcelport_lci/receiver.hpp b/libs/full/parcelport_lci/include/hpx/parcelport_lci/receiver.hpp index 06deeffe441c..75299bf912f7 100644 --- a/libs/full/parcelport_lci/include/hpx/parcelport_lci/receiver.hpp +++ b/libs/full/parcelport_lci/include/hpx/parcelport_lci/receiver.hpp @@ -1,5 +1,4 @@ - -// Copyright (c) 2007-2013 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2014-2015 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 @@ -139,7 +138,8 @@ namespace hpx::parcelset::policies::lci { consumed += decode_eager( (char*) request.data.mbuffer.address + consumed, buffer); - decode_parcels(pp_, HPX_MOVE(buffer), -1); + handle_received_parcels( + decode_parcels(pp_, HPX_MOVE(buffer))); } HPX_ASSERT(consumed == request.data.mbuffer.length); } @@ -149,7 +149,7 @@ namespace hpx::parcelset::policies::lci { HPX_ASSERT(request.type == LCI_IOVEC); buffer_type buffer; decode_iovec(request.data.iovec, buffer); - decode_parcels(pp_, HPX_MOVE(buffer), -1); + handle_received_parcels(decode_parcels(pp_, HPX_MOVE(buffer))); } } diff --git a/libs/full/parcelport_libfabric/src/rma_receiver.cpp b/libs/full/parcelport_libfabric/src/rma_receiver.cpp index 036c60ae2c9c..5782978777e1 100644 --- a/libs/full/parcelport_libfabric/src/rma_receiver.cpp +++ b/libs/full/parcelport_libfabric/src/rma_receiver.cpp @@ -147,8 +147,10 @@ namespace hpx::parcelset::policies::libfabric { << hexpointer(this) << "calling parcel decode for complete NORMAL parcel"); std::size_t num_thread = hpx::get_worker_thread_num(); - decode_message_with_chunks( + std::vector parcels = decode_message_with_chunks( *pp_, HPX_MOVE(buffer), 0, chunks_, num_thread); + handle_received_parcels(HPX_MOVE(parcels), num_thread); + LOG_DEBUG_MSG("receiver " << hexpointer(this) << "parcel decode called for complete NORMAL (small) parcel"); @@ -482,8 +484,10 @@ namespace hpx::parcelset::policies::libfabric { << hexpointer(this) << "calling parcel decode for ZEROCOPY complete parcel"); std::size_t num_thread = hpx::get_worker_thread_num(); - decode_message_with_chunks( + std::vector parcels = decode_message_with_chunks( *pp_, HPX_MOVE(buffer), 0, chunks_, num_thread); + handle_received_parcels(HPX_MOVE(parcels), num_thread); + LOG_DEBUG_MSG("receiver " << hexpointer(this) << "parcel decode called for ZEROCOPY complete parcel"); diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp index f831c3339370..ff3ecec4c2a4 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp @@ -203,7 +203,8 @@ namespace hpx::parcelset::policies::mpi { request_ptr_ = &request_; } - decode_parcels(pp_, HPX_MOVE(buffer_), num_thread); + handle_received_parcels( + decode_parcels(pp_, HPX_MOVE(buffer_), num_thread), num_thread); state_ = sent_release_tag; diff --git a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/connection_handler.hpp b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/connection_handler.hpp index 838f84094ec7..1562f170413d 100644 --- a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/connection_handler.hpp +++ b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/connection_handler.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2014 Thomas Heller // Copyright (c) 2007 Richard D Guidry Jr // Copyright (c) 2011 Bryce Lelbach @@ -89,11 +89,11 @@ namespace hpx::parcelset { // Start the handling of connections. bool do_run(); - // Stop the handling of connectons. + // Stop the handling of connections. void do_stop(); // Return the name of this locality - std::string get_locality_name() const + std::string get_locality_name() const override { return asio::ip::host_name(); } @@ -102,15 +102,15 @@ namespace hpx::parcelset { parcelset::locality const& l, error_code& ec); parcelset::locality agas_locality( - util::runtime_configuration const& ini) const; + util::runtime_configuration const& ini) const override; - parcelset::locality create_locality() const; + parcelset::locality create_locality() const override; private: void handle_accept(std::error_code const& e, std::shared_ptr receiver_conn); void handle_read_completion(std::error_code const& e, - std::shared_ptr receiver_conn); + std::shared_ptr const& receiver_conn); /// Acceptor used to listen for incoming connections. asio::ip::tcp::acceptor* acceptor_; diff --git a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/locality.hpp b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/locality.hpp index b19b062e1015..8bd2c4b1474a 100644 --- a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/locality.hpp +++ b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/locality.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2014 Thomas Heller // Copyright (c) 2007 Richard D Guidry Jr // Copyright (c) 2011 Bryce Lelbach @@ -24,7 +24,7 @@ namespace hpx::parcelset::policies::tcp { { public: locality() noexcept - : port_(std::uint16_t(-1)) + : port_(static_cast(-1)) { } @@ -51,7 +51,7 @@ namespace hpx::parcelset::policies::tcp { explicit constexpr operator bool() const noexcept { - return port_ != std::uint16_t(-1); + return port_ != static_cast(-1); } HPX_EXPORT void save(serialization::output_archive& ar) const; diff --git a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp index 0565be942ee5..8ba22f3eb15a 100644 --- a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp +++ b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2014 Thomas Heller // Copyright (c) 2011 Katelyn Kufahl // Copyright (c) 2011 Bryce Lelbach @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -52,20 +51,24 @@ namespace hpx::parcelset::policies::tcp { class receiver : public parcelport_connection, - std::vector> + serialization::serialization_chunk> { public: receiver(asio::io_context& io_service, std::uint64_t max_inbound_size, connection_handler& parcelport) : socket_(io_service) , max_inbound_size_(max_inbound_size) - , ack_(0) + , ack_(false) , parcelport_(parcelport) - , mtx_() , operation_in_flight_(0) { } + receiver(receiver const&) = delete; + receiver(receiver&&) = delete; + receiver& operator=(receiver const&) = delete; + receiver& operator=(receiver&&) = delete; + ~receiver() { shutdown(); @@ -91,6 +94,8 @@ namespace hpx::parcelset::policies::tcp { data.bytes_ = 0; data.num_parcels_ = 0; #endif + parcels_.clear(); + // Issue a read operation to read the message size. using asio::buffer; std::vector buffers; @@ -133,22 +138,22 @@ namespace hpx::parcelset::policies::tcp { std::lock_guard lk(mtx_); // gracefully and portably shutdown the socket - std::error_code ec; if (socket_.is_open()) { + std::error_code ec; socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ec); - socket_.close( - ec); // close the socket to give it back to the OS + + // close the socket to give it back to the OS + socket_.close(ec); } hpx::util::yield_while( [this]() { return operation_in_flight_ != 0; }, - "tcp::reveiver::shutdown"); + "tcp::receiver::shutdown"); } private: - // Handle a completed read of the message size from the - // message header. + // Handle a completed read of the message size from the message header. template void handle_read_header(std::error_code const& e, std::size_t /* bytes_transferred */, Handler handler) @@ -157,16 +162,13 @@ namespace hpx::parcelset::policies::tcp { if (e) { handler(e); - - // Issue a read operation to read the next parcel. - // async_read(handler); } else { ++operation_in_flight_; // Determine the length of the serialized data. - std::uint64_t inbound_size = buffer_.size_; + std::uint64_t const inbound_size = buffer_.size_; if (inbound_size > max_inbound_size_) { @@ -184,12 +186,12 @@ namespace hpx::parcelset::policies::tcp { std::vector buffers; // determine the size of the chunk buffer - std::size_t num_zero_copy_chunks = static_cast( + auto const num_zero_copy_chunks = static_cast( static_cast(buffer_.num_chunks_.first)); - std::size_t num_non_zero_copy_chunks = static_cast( + auto const num_non_zero_copy_chunks = static_cast( static_cast(buffer_.num_chunks_.second)); - void (receiver::*f)(std::error_code const&, Handler) = nullptr; + void (receiver::*f)(std::error_code const&, Handler); if (num_zero_copy_chunks != 0) { @@ -205,7 +207,7 @@ namespace hpx::parcelset::policies::tcp { buffers.emplace_back(chunks.data(), chunks.size() * sizeof(transmission_chunk_type)); - // add main buffer holding data which was serialized normally + // add main buffer holding data that was serialized normally buffer_.data_.resize( static_cast(inbound_size)); buffers.emplace_back(asio::buffer(buffer_.data_)); @@ -215,7 +217,7 @@ namespace hpx::parcelset::policies::tcp { } else { - // add main buffer holding data which was serialized normally + // add main buffer holding data that was serialized normally buffer_.data_.resize( static_cast(inbound_size)); buffers.emplace_back(asio::buffer(buffer_.data_)); @@ -258,9 +260,8 @@ namespace hpx::parcelset::policies::tcp { { handler(e); --operation_in_flight_; - - // Issue a read operation to read the next parcel. - // async_read(handler); + buffer_ = parcel_buffer_type(); + parcels_.clear(); } else { @@ -268,23 +269,64 @@ namespace hpx::parcelset::policies::tcp { std::vector buffers; // add appropriately sized chunk buffers for the zero-copy data - std::size_t num_zero_copy_chunks = static_cast( + auto const num_zero_copy_chunks = static_cast( static_cast(buffer_.num_chunks_.first)); buffer_.chunks_.resize(num_zero_copy_chunks); + + // De-serialize the parcels such that all data but the zero-copy + // chunks are in place. This de-serialization also allocates all + // zero-chunk buffers and stores those in the chunks array for + // the subsequent networking to place the received data + // directly. for (std::size_t i = 0; i != num_zero_copy_chunks; ++i) { - std::size_t chunk_size = static_cast( + auto const chunk_size = static_cast( buffer_.transmission_chunks_[i].second); - buffer_.chunks_[i].resize(chunk_size); - buffers.emplace_back(buffer_.chunks_[i].data(), chunk_size); + buffer_.chunks_[i] = serialization::create_pointer_chunk( + nullptr, chunk_size); } - // Start an asynchronous call to receive the data. - void (receiver::*f)(std::error_code const&, Handler) = - &receiver::handle_read_data; + parcels_ = decode_parcels_zero_copy(parcelport_, buffer_); + auto const num_non_zero_copy_chunks = static_cast( + static_cast(buffer_.num_chunks_.second)); + + HPX_ASSERT(num_zero_copy_chunks + num_non_zero_copy_chunks == + buffer_.chunks_.size()); + + std::size_t zero_copy_chunks = 0; + for (std::size_t all_chunks = 0; all_chunks != + num_zero_copy_chunks + num_non_zero_copy_chunks; + ++all_chunks) { + if (buffer_.chunks_[all_chunks].type_ == + serialization::chunk_type::chunk_type_index) + { + continue; + } + + HPX_ASSERT_MSG( + buffer_.chunks_[all_chunks].data_.cpos_ != nullptr, + "zero-copy chunk buffer should have been initialized " + "during de-serialization"); + + auto const chunk_size = static_cast( + buffer_.transmission_chunks_[zero_copy_chunks].second); + + HPX_ASSERT(buffer_.chunks_[all_chunks].size_ == chunk_size); + + buffers.emplace_back( + buffer_.chunks_[all_chunks].data_.pos_, chunk_size); + ++zero_copy_chunks; + } + HPX_ASSERT(zero_copy_chunks == num_zero_copy_chunks); + + // Start an asynchronous call to receive the zero-copy data. + { + void (receiver::*f)(std::error_code const&, Handler) = + &receiver::handle_read_data; + std::unique_lock lk(mtx_); if (!socket_.is_open()) { @@ -318,9 +360,8 @@ namespace hpx::parcelset::policies::tcp { { handler(e); --operation_in_flight_; - - // Issue a read operation to read the next parcel. - // async_read(handler); + buffer_ = parcel_buffer_type(); + parcels_.clear(); } else { @@ -333,9 +374,19 @@ namespace hpx::parcelset::policies::tcp { void (receiver::*f)(std::error_code const&, Handler) = &receiver::handle_write_ack; - // decode the received parcels. - decode_parcels(parcelport_, HPX_MOVE(buffer_), std::size_t(-1)); - buffer_ = parcel_buffer_type(); + if (parcels_.empty()) + { + // decode and handle received data + HPX_ASSERT(buffer_.num_chunks_.first == 0); + handle_received_parcels( + decode_parcels(parcelport_, HPX_MOVE(buffer_))); + } + else + { + // handle the received zero-copy parcels. + HPX_ASSERT(buffer_.num_chunks_.first != 0); + handle_received_parcels(HPX_MOVE(parcels_)); + } ack_ = true; { @@ -368,6 +419,9 @@ namespace hpx::parcelset::policies::tcp { handler(e); --operation_in_flight_; + buffer_ = parcel_buffer_type(); + parcels_.clear(); + // Issue a read operation to read the next parcel. if (!e) { @@ -391,6 +445,8 @@ namespace hpx::parcelset::policies::tcp { #endif hpx::spinlock mtx_; hpx::util::atomic_count operation_in_flight_; + + std::vector parcels_; }; } // namespace hpx::parcelset::policies::tcp diff --git a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/sender.hpp b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/sender.hpp index b8f6378da223..f5874c1bb801 100644 --- a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/sender.hpp +++ b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/sender.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2014 Thomas Heller // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2011 Katelyn Kufahl @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -57,17 +56,15 @@ namespace hpx::parcelset::policies::tcp { public: // Construct a sending parcelport_connection with the given io_context. sender(asio::io_context& io_service, - parcelset::locality const& locality_id, parcelset::parcelport* pp) + parcelset::locality const& locality_id, + [[maybe_unused]] parcelset::parcelport* pp) : socket_(io_service) - , ack_(0) + , ack_(false) , there_(locality_id) #if defined(HPX_HAVE_PARCELPORT_COUNTERS) , pp_(pp) #endif { -#if !defined(HPX_HAVE_PARCELPORT_COUNTERS) - HPX_UNUSED(pp); -#endif } ~sender() @@ -98,7 +95,7 @@ namespace hpx::parcelset::policies::tcp { { #if defined(HPX_DEBUG) std::error_code ec; - asio::ip::tcp::socket::endpoint_type endpoint = + asio::ip::tcp::socket::endpoint_type const endpoint = socket_.remote_endpoint(ec); locality const& impl = parcel_locality_id.get(); @@ -185,8 +182,8 @@ namespace hpx::parcelset::policies::tcp { &sender::handle_write; asio::async_write(socket_, buffers, - hpx::bind( - f, shared_from_this(), placeholders::_1, placeholders::_2)); + hpx::bind(f, shared_from_this(), hpx::placeholders::_1, + hpx::placeholders::_2)); } private: diff --git a/libs/full/parcelport_tcp/src/connection_handler_tcp.cpp b/libs/full/parcelport_tcp/src/connection_handler_tcp.cpp index 8713b2557b9a..e0a4c7eb7114 100644 --- a/libs/full/parcelport_tcp/src/connection_handler_tcp.cpp +++ b/libs/full/parcelport_tcp/src/connection_handler_tcp.cpp @@ -90,7 +90,7 @@ namespace hpx::parcelset::policies::tcp { // initialize network std::size_t tried = 0; exception_list errors; - util::endpoint_iterator_type end = util::accept_end(); + util::endpoint_iterator_type const end = util::accept_end(); for (util::endpoint_iterator_type it = util::accept_begin(here_.get(), io_service); it != end; ++it, ++tried) @@ -121,7 +121,6 @@ namespace hpx::parcelset::policies::tcp { // all attempts failed HPX_THROW_EXCEPTION(hpx::error::network_error, "tcp::parcelport::run", errors.get_message()); - return false; } return true; } @@ -238,8 +237,9 @@ namespace hpx::parcelset::policies::tcp { #if defined(HPX_DEBUG) HPX_ASSERT(l == sender_connection->destination()); - std::string connection_addr = s.remote_endpoint().address().to_string(); - std::uint16_t connection_port = s.remote_endpoint().port(); + std::string const connection_addr = + s.remote_endpoint().address().to_string(); + std::uint16_t const connection_port = s.remote_endpoint().port(); HPX_ASSERT(hpx::util::cleanup_ip_address(l.get().address()) == hpx::util::cleanup_ip_address(connection_addr)); HPX_ASSERT(l.get().port() == connection_port); @@ -317,8 +317,8 @@ namespace hpx::parcelset::policies::tcp { } // Handle completion of a read operation. - void connection_handler::handle_read_completion( - std::error_code const& e, std::shared_ptr receiver_conn) + void connection_handler::handle_read_completion(std::error_code const& e, + std::shared_ptr const& receiver_conn) { if (!e) { diff --git a/libs/full/parcelport_tcp/src/parcelport_tcp.cpp b/libs/full/parcelport_tcp/src/parcelport_tcp.cpp index e851134858af..268f422b3322 100644 --- a/libs/full/parcelport_tcp/src/parcelport_tcp.cpp +++ b/libs/full/parcelport_tcp/src/parcelport_tcp.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -12,41 +12,39 @@ #include #include -namespace hpx::traits { - - // Inject additional configuration data into the factory registry for this - // type. This information ends up in the system wide configuration database - // under the plugin specific section: - // - // [hpx.parcel.tcp] - // ... - // priority = 1 - // - template <> - struct plugin_config_data +// Inject additional configuration data into the factory registry for this type. +// This information ends up in the system wide configuration database under the +// plugin specific section: +// +// [hpx.parcel.tcp] +// ... +// priority = 1 +// +template <> +struct hpx::traits::plugin_config_data< + hpx::parcelset::policies::tcp::connection_handler> +{ + static constexpr char const* priority() noexcept + { + return "1"; + } + + static constexpr void init(int* /* argc */, char*** /* argv */, + util::command_line_handling& /* cfg */) noexcept + { + } + + // by default no additional initialization using the resource + // partitioner is required + static constexpr void init(hpx::resource::partitioner&) noexcept {} + + static constexpr void destroy() noexcept {} + + static constexpr char const* call() noexcept { - static constexpr char const* priority() noexcept - { - return "1"; - } - - static constexpr void init(int* /* argc */, char*** /* argv */, - util::command_line_handling& /* cfg */) noexcept - { - } - - // by default no additional initialization using the resource - // partitioner is required - static constexpr void init(hpx::resource::partitioner&) noexcept {} - - static constexpr void destroy() noexcept {} - - static constexpr char const* call() noexcept - { - return ""; - } - }; -} // namespace hpx::traits + return ""; + } +}; // namespace hpx::traits HPX_REGISTER_PARCELPORT(hpx::parcelset::policies::tcp::connection_handler, tcp) diff --git a/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp b/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp index 308291d4cf07..f09559a8965f 100644 --- a/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp @@ -30,13 +30,13 @@ #include #include #include -#include #include #include #include namespace hpx::parcelset { + /////////////////////////////////////////////////////////////////////////// template std::vector decode_chunks( Buffer& buffer) @@ -46,8 +46,9 @@ namespace hpx::parcelset { std::vector chunks; - std::size_t num_zero_copy_chunks = static_cast( + auto num_zero_copy_chunks = static_cast( static_cast(buffer.num_chunks_.first)); + #if defined(HPX_HAVE_PARCELPORT_COUNTERS) HPX_ASSERT(num_zero_copy_chunks == buffer.chunks_.size()); parcelset::data_point& data = buffer.data_point_; @@ -66,9 +67,8 @@ namespace hpx::parcelset { if (num_zero_copy_chunks != 0) { // decode chunk information - std::size_t const num_non_zero_copy_chunks = - static_cast( - static_cast(buffer.num_chunks_.second)); + auto const num_non_zero_copy_chunks = static_cast( + static_cast(buffer.num_chunks_.second)); chunks.resize(num_zero_copy_chunks + num_non_zero_copy_chunks); @@ -87,6 +87,93 @@ namespace hpx::parcelset { buffer.chunks_[i].data(), second); } + // append non-zero-copy chunks as needed + std::size_t index = 0; + for (std::size_t i = num_zero_copy_chunks; + i != num_zero_copy_chunks + num_non_zero_copy_chunks; ++i) + { + transmission_chunk_type& c = buffer.transmission_chunks_[i]; + auto const first = static_cast( + static_cast(c.first)); + auto const second = static_cast( + static_cast(c.second)); + + // find next free entry + while (chunks[index].size_ != 0) + { + ++index; + } + + // place the index based chunk at the right spot + chunks[index] = + serialization::create_index_chunk(first, second); + ++index; + } + +#if defined(HPX_DEBUG) + // make sure that all spots have been populated + for (std::size_t i = 0; + i != num_zero_copy_chunks + num_non_zero_copy_chunks; ++i) + { + HPX_ASSERT(chunks[i].size_ != 0); + } +#endif + } + + return chunks; + } + + template + std::vector decode_chunks_zero_copy( + Buffer& buffer) + { + using transmission_chunk_type = + typename Buffer::transmission_chunk_type; + + std::vector chunks; + + auto num_zero_copy_chunks = static_cast( + static_cast(buffer.num_chunks_.first)); + +#if defined(HPX_HAVE_PARCELPORT_COUNTERS) + HPX_ASSERT(num_zero_copy_chunks == buffer.chunks_.size()); + parcelset::data_point& data = buffer.data_point_; + data.num_zchunks_ += buffer.chunks_.size(); + data.num_zchunks_per_msg_max_ = + (std::max)(data.num_zchunks_per_msg_max_, + static_cast(buffer.chunks_.size())); + for (auto& chunk : buffer.chunks_) + { + data.size_zchunks_total_ += chunk.size(); + data.size_zchunks_max_ = (std::max)(data.size_zchunks_max_, + static_cast(chunk.size())); + } +#endif + + if (num_zero_copy_chunks != 0) + { + // decode chunk information + auto const num_non_zero_copy_chunks = static_cast( + static_cast(buffer.num_chunks_.second)); + + chunks.resize(num_zero_copy_chunks + num_non_zero_copy_chunks); + + // zero-copy chunks come first + HPX_ASSERT(buffer.chunks_.size() == num_zero_copy_chunks); + for (std::size_t i = 0; i != num_zero_copy_chunks; ++i) + { + transmission_chunk_type& c = buffer.transmission_chunks_[i]; + auto const first = static_cast( + static_cast(c.first)); + [[maybe_unused]] auto second = static_cast( + static_cast(c.second)); + + HPX_ASSERT(buffer.chunks_[i].size_ == second); + + chunks[first] = buffer.chunks_[i]; + } + + // append non-zero-copy chunks as needed std::size_t index = 0; for (std::size_t i = num_zero_copy_chunks; i != num_zero_copy_chunks + num_non_zero_copy_chunks; ++i) @@ -99,13 +186,16 @@ namespace hpx::parcelset { // find next free entry while (chunks[index].size_ != 0) + { ++index; + } // place the index based chunk at the right spot chunks[index] = serialization::create_index_chunk(first, second); ++index; } + #if defined(HPX_DEBUG) // make sure that all spots have been populated for (std::size_t i = 0; @@ -119,15 +209,68 @@ namespace hpx::parcelset { return chunks; } + /////////////////////////////////////////////////////////////////////////// + inline void handle_received_parcels( + std::vector&& deferred_parcels, + std::size_t num_thread = -1) + { + if (HPX_LIKELY(deferred_parcels.empty())) + { + return; + } + + for (std::size_t i = 1; i != deferred_parcels.size(); ++i) + { + LPT_(debug).format("handle_received_parcels: received: {}", + deferred_parcels[i].parcel_id()); + + auto f = [num_thread](parcelset::parcel&& p) { + if (p.schedule_action(num_thread)) + { + // route this parcel as the object was + // migrated + agas::route(HPX_MOVE(p), + &parcelset::detail::parcel_route_handler, + threads::thread_priority::normal); + } + }; + + // schedule all but the first parcel on a new thread. + hpx::threads::thread_init_data init_data( + hpx::threads::make_thread_function_nullary(util::deferred_call( + HPX_MOVE(f), HPX_MOVE(deferred_parcels[i]))), + "schedule_parcel", threads::thread_priority::boost, + threads::thread_schedule_hint( + static_cast(num_thread)), + threads::thread_stacksize::default_, + threads::thread_schedule_state::pending, true); + hpx::threads::register_thread(init_data); + } + + // If we are the first deferred parcel, we don't need to spin + // up a new thread... + LPT_(debug).format("handle_received_parcels: received: {}", + deferred_parcels[0].parcel_id()); + + if (deferred_parcels[0].schedule_action(num_thread)) + { + // route this parcel as the object was migrated + agas::route(HPX_MOVE(deferred_parcels[0]), + &parcelset::detail::parcel_route_handler, + threads::thread_priority::normal); + } + } + /////////////////////////////////////////////////////////////////////////// template - void decode_message_with_chunks(Parcelport& pp, Buffer buffer, - std::size_t parcel_count, - std::vector& chunks, + std::vector decode_message_with_chunks( + serialization::input_archive& archive, [[maybe_unused]] Parcelport& pp, + [[maybe_unused]] Buffer& buffer, std::size_t parcel_count, std::size_t num_thread = -1) { - auto inbound_data_size = static_cast( - static_cast(buffer.data_size_)); + bool const allow_zero_copy_receive = + archive.try_get_extra_data< + serialization::detail::allow_zero_copy_receive>() != nullptr; // protect from unhandled exceptions bubbling up try @@ -140,154 +283,96 @@ namespace hpx::parcelset { std::int64_t overall_add_parcel_time = 0; parcelset::data_point& data = buffer.data_point_; #endif - { - std::vector deferred_parcels; - // De-serialize the parcel data - serialization::input_archive archive( - buffer.data_, inbound_data_size, &chunks); + std::vector deferred_parcels; - if (parcel_count == 0) - { - archive >> parcel_count; //-V128 - } - if (parcel_count > 1) - { - deferred_parcels.reserve(parcel_count); - } + // De-serialize the parcel data + if (parcel_count == 0) + { + archive >> parcel_count; //-V128 + } + if (parcel_count > 1 || allow_zero_copy_receive) + { + deferred_parcels.reserve(parcel_count); + } - for (std::size_t i = 0; i != parcel_count; ++i) - { - bool deferred_schedule = parcel_count > 1; + for (std::size_t i = 0; i != parcel_count; ++i) + { + bool deferred_schedule = parcel_count > 1; #if defined(HPX_HAVE_PARCELPORT_COUNTERS) && \ defined(HPX_HAVE_PARCELPORT_ACTION_COUNTERS) - std::size_t const archive_pos = archive.current_pos(); - std::int64_t const serialize_time = - timer.elapsed_nanoseconds(); + std::size_t const archive_pos = archive.current_pos(); + std::int64_t const serialize_time = + timer.elapsed_nanoseconds(); #endif - // de-serialize parcel and add it to incoming parcel queue - parcelset::parcel p; + // de-serialize parcel and add it to incoming parcel queue + parcelset::parcel p; - // deferred_schedule will be set to false if the action - // to be loaded is a non direct action. If we only got - // one parcel to decode, deferred_schedule will be - // preset to false and the direct action will be called - // directly - bool const migrated = p.load_schedule( - archive, num_thread, deferred_schedule); + // deferred_schedule will be set to false if the action to + // be loaded is a non direct action. If we only got one + // parcel to decode, deferred_schedule will be preset to + // false and the direct action will be called directly + bool const migrated = + p.load_schedule(archive, num_thread, deferred_schedule); #if defined(HPX_HAVE_PARCELPORT_COUNTERS) - std::int64_t const add_parcel_time = - timer.elapsed_nanoseconds(); + std::int64_t const add_parcel_time = + timer.elapsed_nanoseconds(); #endif #if defined(HPX_HAVE_PARCELPORT_COUNTERS) && \ defined(HPX_HAVE_PARCELPORT_ACTION_COUNTERS) - parcelset::data_point action_data; - action_data.bytes_ = - archive.current_pos() - archive_pos; - action_data.serialization_time_ = - add_parcel_time - serialize_time; - action_data.num_parcels_ = 1; - pp.add_received_data(p.get_action_name(), action_data); -#endif - // make sure this parcel ended up on the right locality - std::uint32_t const here = agas::get_locality_id(); - if (hpx::get_runtime_ptr() && - here != naming::invalid_locality_id && - (naming::get_locality_id_from_gid( - p.destination_locality()) != here)) - { - HPX_THROW_EXCEPTION(hpx::error::invalid_status, - "hpx::parcelset::decode_message", - "parcel destination does not match locality " - "which received the parcel ({}), {}", - here, p); - } - - if (migrated) - { - agas::route(HPX_MOVE(p), - &parcelset::detail::parcel_route_handler, - threads::thread_priority::normal); - } - else if (deferred_schedule) - { - // If we got a direct action - deferred_parcels.emplace_back(HPX_MOVE(p)); - } - - // be sure not to measure add_parcel as serialization time -#if defined(HPX_HAVE_PARCELPORT_COUNTERS) - overall_add_parcel_time += - timer.elapsed_nanoseconds() - add_parcel_time; + parcelset::data_point action_data; + action_data.bytes_ = archive.current_pos() - archive_pos; + action_data.serialization_time_ = + add_parcel_time - serialize_time; + action_data.num_parcels_ = 1; + pp.add_received_data(p.get_action_name(), action_data); #endif + // make sure this parcel ended up on the right locality + std::uint32_t const here = agas::get_locality_id(); + if (hpx::get_runtime_ptr() && + here != naming::invalid_locality_id && + (naming::get_locality_id_from_gid( + p.destination_locality()) != here)) + { + HPX_THROW_EXCEPTION(hpx::error::invalid_status, + "hpx::parcelset::decode_message", + "parcel destination does not match locality " + "which received the parcel ({}), {}", + here, p); } - // complete received data with parcel count -#if defined(HPX_HAVE_PARCELPORT_COUNTERS) - data.num_parcels_ = parcel_count; - data.raw_bytes_ = archive.bytes_read(); -#endif - if (!deferred_parcels.empty()) + if (migrated) { - for (std::size_t i = 1; i != deferred_parcels.size(); - ++i) - { - LPT_(debug).format( - "decode_message_with_chunks: received: {}", - deferred_parcels[i].parcel_id()); - - auto f = [num_thread](parcelset::parcel&& p) { - if (p.schedule_action(num_thread)) - { - // route this parcel as the object was - // migrated - agas::route(HPX_MOVE(p), - &parcelset::detail:: - parcel_route_handler, - threads::thread_priority::normal); - } - }; - - // schedule all but the first parcel on a new thread. - hpx::threads::thread_init_data init_data( - hpx::threads::make_thread_function_nullary( - util::deferred_call(HPX_MOVE(f), - HPX_MOVE(deferred_parcels[i]))), - "schedule_parcel", - threads::thread_priority::boost, - threads::thread_schedule_hint( - static_cast(num_thread)), - threads::thread_stacksize::default_, - threads::thread_schedule_state::pending, true); - hpx::threads::register_thread(init_data); - } - - // If we are the first deferred parcel, we don't need to spin - // up a new thread... - LPT_(debug).format( - "decode_message_with_chunks: received: {}", - deferred_parcels[0].parcel_id()); - - if (deferred_parcels[0].schedule_action(num_thread)) - { - // route this parcel as the object was migrated - agas::route(HPX_MOVE(deferred_parcels[0]), - &parcelset::detail::parcel_route_handler, - threads::thread_priority::normal); - } + agas::route(HPX_MOVE(p), + &parcelset::detail::parcel_route_handler, + threads::thread_priority::normal); } + else if (deferred_schedule || allow_zero_copy_receive) + { + // If we got a direct action + deferred_parcels.emplace_back(HPX_MOVE(p)); + } + +#if defined(HPX_HAVE_PARCELPORT_COUNTERS) + // be sure not to measure add_parcel as serialization time + overall_add_parcel_time += + timer.elapsed_nanoseconds() - add_parcel_time; +#endif } - // store the time required for serialization + // complete received data with parcel count #if defined(HPX_HAVE_PARCELPORT_COUNTERS) + data.num_parcels_ = parcel_count; + data.raw_bytes_ = archive.bytes_read(); + + // store the time required for serialization data.serialization_time_ = timer.elapsed_nanoseconds() - overall_add_parcel_time; pp.add_received_data(data); -#else - HPX_UNUSED(pp); #endif + return deferred_parcels; } catch (hpx::exception const& e) { @@ -322,31 +407,99 @@ namespace hpx::parcelset { LPT_(error).format("decode_message: caught unknown exception."); hpx::report_error(std::current_exception()); } + + return {}; } /////////////////////////////////////////////////////////////////////////// template - void decode_message(Parcelport& pp, Buffer buffer, std::size_t parcel_count, + std::vector decode_message_with_chunks( + [[maybe_unused]] Parcelport& pp, Buffer buffer, + std::size_t parcel_count, + std::vector& chunks, std::size_t num_thread = -1) + { + auto const inbound_data_size = static_cast( + static_cast(buffer.data_size_)); + serialization::input_archive archive( + buffer.data_, inbound_data_size, &chunks); + + return decode_message_with_chunks( + archive, pp, buffer, parcel_count, num_thread); + } + + template + std::vector decode_message(Parcelport& pp, Buffer buffer, + std::size_t parcel_count, std::size_t num_thread = -1) { std::vector chunks( decode_chunks(buffer)); - decode_message_with_chunks( + return decode_message_with_chunks( pp, HPX_MOVE(buffer), parcel_count, chunks, num_thread); } template - void decode_parcel( - Parcelport& parcelport, Buffer buffer, std::size_t num_thread) + std::vector decode_parcel( + Parcelport& parcelport, Buffer buffer, std::size_t num_thread = -1) + { + return decode_message(parcelport, HPX_MOVE(buffer), 1, num_thread); + } + + template + std::vector decode_parcels( + Parcelport& parcelport, Buffer buffer, std::size_t num_thread = -1) + { + return decode_message(parcelport, HPX_MOVE(buffer), 0, num_thread); + } + + /////////////////////////////////////////////////////////////////////////// + template + std::vector decode_message_with_chunks_zero_copy( + [[maybe_unused]] Parcelport& pp, Buffer& buffer, + std::size_t parcel_count, + std::vector& chunks, + std::size_t num_thread = -1) + { + auto const inbound_data_size = static_cast( + static_cast(buffer.data_size_)); + serialization::input_archive archive( + buffer.data_, inbound_data_size, &chunks); + + // tag the archive to allow for zero-copy receive operations + archive + .get_extra_data(); + + return decode_message_with_chunks( + archive, pp, buffer, parcel_count, num_thread); + } + + template + std::vector decode_message_zero_copy(Parcelport& pp, + Buffer& buffer, std::size_t parcel_count, std::size_t num_thread = -1) + { + std::vector chunks( + decode_chunks_zero_copy(buffer)); + + std::vector parcels = + decode_message_with_chunks_zero_copy( + pp, buffer, parcel_count, chunks, num_thread); + + buffer.chunks_ = HPX_MOVE(chunks); + return parcels; + } + + template + std::vector decode_parcel_zero_copy( + Parcelport& parcelport, Buffer& buffer, std::size_t num_thread = -1) { - decode_message(parcelport, HPX_MOVE(buffer), 1, num_thread); + return decode_message_zero_copy(parcelport, buffer, 1, num_thread); } template - void decode_parcels( - Parcelport& parcelport, Buffer buffer, std::size_t num_thread) + std::vector decode_parcels_zero_copy( + Parcelport& parcelport, Buffer& buffer, std::size_t num_thread = -1) { - decode_message(parcelport, HPX_MOVE(buffer), 0, num_thread); + return decode_message_zero_copy(parcelport, buffer, 0, num_thread); } } // namespace hpx::parcelset diff --git a/libs/full/parcelset/include/hpx/parcelset/parcel_buffer.hpp b/libs/full/parcelset/include/hpx/parcelset/parcel_buffer.hpp index 2c91bef58e8f..b505f639ec5a 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcel_buffer.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcel_buffer.hpp @@ -85,6 +85,7 @@ namespace hpx::parcelset { // non-zero-copy chunk size (data_.size()) std::uint64_t size_; + // how many bytes in total (including zero-copy and non-zero-copy chunks) std::uint64_t data_size_; std::uint64_t header_size_; diff --git a/libs/full/parcelset/src/parcel.cpp b/libs/full/parcelset/src/parcel.cpp index 929ad97043bc..97a244f24422 100644 --- a/libs/full/parcelset/src/parcel.cpp +++ b/libs/full/parcelset/src/parcel.cpp @@ -458,6 +458,14 @@ namespace hpx::parcelset::detail { return true; } + // schedule later if this is de-serialized with zero-copy semantics + if (ar.try_get_extra_data< + serialization::detail::allow_zero_copy_receive>() != nullptr) + { + action_->load(ar); + return false; + } + // continuation support, this is handled in the transfer action action_->load_schedule(ar, HPX_MOVE(data_.dest_), p.first, p.second, num_thread, deferred_schedule); @@ -474,7 +482,6 @@ namespace hpx::parcelset::detail { reinterpret_cast( action_->get_parent_thread_id().get())); #endif - return false; } diff --git a/libs/full/parcelset/tests/unit/CMakeLists.txt b/libs/full/parcelset/tests/unit/CMakeLists.txt index 4a070a414643..cd011d553c5f 100644 --- a/libs/full/parcelset/tests/unit/CMakeLists.txt +++ b/libs/full/parcelset/tests/unit/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT HPX_WITH_NETWORKING) return() endif() -set(tests put_parcels set_parcel_write_handler) +set(tests put_parcels set_parcel_write_handler zero_copy_parcel) set(put_parcels_PARAMETERS LOCALITIES 2) set(set_parcel_write_handler_PARAMETERS LOCALITIES 2) diff --git a/libs/full/parcelset/tests/unit/put_parcels.cpp b/libs/full/parcelset/tests/unit/put_parcels.cpp index f0146103843e..fcad0c0b88e7 100644 --- a/libs/full/parcelset/tests/unit/put_parcels.cpp +++ b/libs/full/parcelset/tests/unit/put_parcels.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2021 Hartmut Kaiser +// Copyright (c) 2016-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -20,8 +20,8 @@ #include /////////////////////////////////////////////////////////////////////////////// -std::size_t const vsize_default = 1024; -std::size_t const numparcels_default = 10; +constexpr std::size_t vsize_default = 1024; +constexpr std::size_t numparcels_default = 10; /////////////////////////////////////////////////////////////////////////////// template @@ -183,7 +183,7 @@ void test_mixed_arguments(hpx::id_type const& id) } /////////////////////////////////////////////////////////////////////////////// -hpx::id_type test3(std::shared_ptr tg) +hpx::id_type test3(std::shared_ptr const& tg) { tg->wait(); return hpx::find_here(); @@ -227,7 +227,7 @@ void test_task_group_argument(hpx::id_type const& id) std::move(parcels)); // now wait for task groups - for (auto& arg : args) + for (auto const& arg : args) { arg->wait(); } @@ -246,9 +246,7 @@ void print_counters(char const* name) { using namespace hpx::performance_counters; - std::vector counters = discover_counters(name); - - for (performance_counter const& c : counters) + for (performance_counter const& c : discover_counters(name)) { counter_value value = c.get_counter_value(hpx::launch::sync); std::cout << "counter: " << c.get_name(hpx::launch::sync) @@ -259,7 +257,7 @@ void print_counters(char const* name) /////////////////////////////////////////////////////////////////////////////// int hpx_main(hpx::program_options::variables_map& vm) { - unsigned int seed = (unsigned int) std::time(nullptr); + unsigned int seed = static_cast(std::time(nullptr)); if (vm.count("seed")) seed = vm["seed"].as(); @@ -274,7 +272,7 @@ int hpx_main(hpx::program_options::variables_map& vm) test_task_group_argument(id); } -#if defined(HPX_HAVE_NETWORKING) && defined(PX_HAVE_PARCELPORT_COUNTERS) +#if defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_COUNTERS) if (hpx::is_networking_enabled()) { // compare number of parcels with number of messages generated diff --git a/libs/full/parcelset/tests/unit/zero_copy_parcel.cpp b/libs/full/parcelset/tests/unit/zero_copy_parcel.cpp new file mode 100644 index 000000000000..b4235d0e6933 --- /dev/null +++ b/libs/full/parcelset/tests/unit/zero_copy_parcel.cpp @@ -0,0 +1,97 @@ +// Copyright (c) 2023 Hartmut Kaiser +// +// 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) + +#include + +#if !defined(HPX_COMPUTE_DEVICE_CODE) +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +constexpr std::size_t num_elements = 10000; + +std::vector test( + std::vector const& data1, std::vector const& data2) +{ + std::vector data = data1; + data.reserve(data1.size() + data2.size()); + for (auto c : data2) + { + data.push_back(c); + } + return data; +} + +HPX_PLAIN_ACTION(test) + +char fill_char() +{ + return static_cast(std::rand() % 255); +} + +void test_zero_copy_parcel(hpx::id_type const& id) +{ + std::vector data1(num_elements); + std::vector data2(num_elements); + + std::generate(data1.begin(), data1.end(), fill_char); + std::generate(data2.begin(), data2.end(), fill_char); + + auto f = hpx::async(test_action(), id, data1, data2); + + std::vector expected = data1; + expected.reserve(data1.size() + data2.size()); + for (auto c : data2) + { + expected.push_back(c); + } + + HPX_TEST(f.get() == expected); +} + +/////////////////////////////////////////////////////////////////////////////// +int hpx_main(hpx::program_options::variables_map& vm) +{ + unsigned int seed = static_cast(std::time(nullptr)); + if (vm.count("seed")) + seed = vm["seed"].as(); + + std::cout << "using seed: " << seed << std::endl; + std::srand(seed); + + for (hpx::id_type const& id : hpx::find_remote_localities()) + { + test_zero_copy_parcel(id); + } + return hpx::finalize(); +} + +int main(int argc, char* argv[]) +{ + // add command line option which controls the random number generator seed + using namespace hpx::program_options; + options_description desc_commandline( + "Usage: " HPX_APPLICATION_STRING " [options]"); + + // clang-format off + desc_commandline.add_options() + ("seed,s", value(), + "the random number generator seed to use for this run") + ; + // clang-format on + + // Initialize and run HPX + hpx::init_params init_args; + init_args.desc_cmdline = desc_commandline; + + HPX_TEST_EQ_MSG(hpx::init(argc, argv, init_args), 0, + "HPX main exited with non-zero status"); + + return hpx::util::report_errors(); +} + +#endif From 1fe0c46fdd5f262b042ff2e761ba46bfd584e0d1 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 1 May 2023 10:32:17 -0500 Subject: [PATCH 56/63] Adding support for MPI parcel-port - flyby: HPX_ASSERT_MSG() now takes arbitrary number of arguments to pass values to hpx::util::format --- libs/core/assertion/CMakeLists.txt | 2 +- .../include/hpx/modules/assertion.hpp | 26 ++--- libs/core/format/CMakeLists.txt | 2 +- libs/core/format/src/format.cpp | 30 +++--- .../hpx/serialization/serialization_chunk.hpp | 5 + .../parcelport_mpi/receiver_connection.hpp | 96 +++++++++++++++++-- .../include/hpx/parcelport_tcp/receiver.hpp | 34 ++++--- .../include/hpx/parcelset/decode_parcels.hpp | 6 +- 8 files changed, 145 insertions(+), 56 deletions(-) diff --git a/libs/core/assertion/CMakeLists.txt b/libs/core/assertion/CMakeLists.txt index 2795ddf8b1a4..51574fa2fb7c 100644 --- a/libs/core/assertion/CMakeLists.txt +++ b/libs/core/assertion/CMakeLists.txt @@ -30,6 +30,6 @@ add_hpx_module( SOURCES ${assertion_sources} HEADERS ${assertion_headers} COMPAT_HEADERS ${assertion_compat_headers} - MODULE_DEPENDENCIES hpx_config hpx_preprocessor + MODULE_DEPENDENCIES hpx_config hpx_format hpx_preprocessor CMAKE_SUBDIRS examples tests ) diff --git a/libs/core/assertion/include/hpx/modules/assertion.hpp b/libs/core/assertion/include/hpx/modules/assertion.hpp index 6efad0a0e304..79e575f6b1b5 100644 --- a/libs/core/assertion/include/hpx/modules/assertion.hpp +++ b/libs/core/assertion/include/hpx/modules/assertion.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #if defined(HPX_COMPUTE_DEVICE_CODE) @@ -59,36 +60,37 @@ namespace hpx::assertion { #define HPX_ASSERT_MSG(expr, msg) #else /// \cond NOINTERNAL -#define HPX_ASSERT_(expr, msg) \ +#define HPX_ASSERT_(expr, ...) \ (!!(expr) ? void() : \ ::hpx::assertion::detail::handle_assert( \ HPX_CURRENT_SOURCE_LOCATION(), HPX_PP_STRINGIZE(expr), \ - msg)) /**/ + hpx::util::format(__VA_ARGS__))) /**/ -#define HPX_ASSERT_LOCKED_(l, expr, msg) \ +#define HPX_ASSERT_LOCKED_(l, expr, ...) \ (!!(expr) ? void() : \ ((l).unlock(), \ ::hpx::assertion::detail::handle_assert( \ HPX_CURRENT_SOURCE_LOCATION(), HPX_PP_STRINGIZE(expr), \ - msg))) /**/ + hpx::util::format(__VA_ARGS__)))) /**/ #if defined(HPX_DEBUG) #if defined(HPX_COMPUTE_DEVICE_CODE) #define HPX_ASSERT(expr) assert(expr) -#define HPX_ASSERT_MSG(expr, msg) HPX_ASSERT(expr) +#define HPX_ASSERT_MSG(expr, ...) HPX_ASSERT(expr) #define HPX_ASSERT_LOCKED(l, expr) assert(expr) -#define HPX_ASSERT_LOCKED_MSG(l, expr, msg) HPX_ASSERT(expr) +#define HPX_ASSERT_LOCKED_MSG(l, expr, ...) HPX_ASSERT(expr) #else -#define HPX_ASSERT(expr) HPX_ASSERT_(expr, std::string()) -#define HPX_ASSERT_MSG(expr, msg) HPX_ASSERT_(expr, msg) -#define HPX_ASSERT_LOCKED(l, expr) HPX_ASSERT_LOCKED_(l, expr, std::string()) -#define HPX_ASSERT_LOCKED_MSG(l, expr, msg) HPX_ASSERT_LOCKED_(l, expr, msg) +#define HPX_ASSERT(expr) HPX_ASSERT_(expr, "") +#define HPX_ASSERT_MSG(expr, ...) HPX_ASSERT_(expr, __VA_ARGS__) +#define HPX_ASSERT_LOCKED(l, expr) HPX_ASSERT_LOCKED_(l, expr, "") +#define HPX_ASSERT_LOCKED_MSG(l, expr, ...) \ + HPX_ASSERT_LOCKED_(l, expr, __VA_ARGS__) #endif #else #define HPX_ASSERT(expr) -#define HPX_ASSERT_MSG(expr, msg) +#define HPX_ASSERT_MSG(expr, ...) #define HPX_ASSERT_LOCKED(l, expr) -#define HPX_ASSERT_LOCKED_MSG(l, expr, msg) +#define HPX_ASSERT_LOCKED_MSG(l, expr, ...) #endif #define HPX_UNREACHABLE \ diff --git a/libs/core/format/CMakeLists.txt b/libs/core/format/CMakeLists.txt index 101bd2e5c1f9..c1caaa506bfd 100644 --- a/libs/core/format/CMakeLists.txt +++ b/libs/core/format/CMakeLists.txt @@ -29,6 +29,6 @@ add_hpx_module( SOURCES ${format_sources} HEADERS ${format_headers} COMPAT_HEADERS ${format_compat_headers} - MODULE_DEPENDENCIES hpx_assertion hpx_config hpx_type_support + MODULE_DEPENDENCIES hpx_config CMAKE_SUBDIRS examples tests ) diff --git a/libs/core/format/src/format.cpp b/libs/core/format/src/format.cpp index 4a3bb1874574..7c091d2e2564 100644 --- a/libs/core/format/src/format.cpp +++ b/libs/core/format/src/format.cpp @@ -6,9 +6,7 @@ // 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) -#include #include -#include #include #include @@ -17,6 +15,7 @@ #include #include #include +#include #include #include @@ -34,7 +33,7 @@ namespace hpx::util::detail { char const* first = buffer; char* last = buffer; - std::size_t r = std::strtoull(first, &last, 10); + std::size_t const r = std::strtoull(first, &last, 10); if (pos != nullptr) *pos = last - first; return r; @@ -58,7 +57,7 @@ namespace hpx::util::detail { inline format_field parse_field(std::string_view field) noexcept { std::size_t const sep = field.find(':'); - if (sep != field.npos) + if (sep != std::string_view::npos) { std::string_view const arg_id = format_substr(field, 0, sep); std::string_view const spec = format_substr(field, sep + 1); @@ -87,17 +86,24 @@ namespace hpx::util::detail { } else { - HPX_ASSERT(format_str[0] != '}'); + if (format_str[0] == '}') + { + throw std::runtime_error("bad format string"); + } std::size_t const end = format_str.find('}'); - std::string_view field_str = + std::string_view const field_str = format_substr(format_str, 1, end); format_field const field = parse_field(field_str); format_str.remove_prefix(end - 1); std::size_t const id = field.arg_id ? field.arg_id - 1 : index; - HPX_ASSERT(id < count); - HPX_UNUSED(count); + if (id >= count) + { + throw std::runtime_error( + "bad format string (wrong number of arguments)"); + } + args[id](os, field.spec); ++index; } @@ -106,11 +112,11 @@ namespace hpx::util::detail { else { std::size_t const next = format_str.find_first_of("{}"); - std::size_t const count = - next != format_str.npos ? next : format_str.size(); + std::size_t const cnt = + next != std::string_view::npos ? next : format_str.size(); - os.write(format_str.data(), count); - format_str.remove_prefix(count); + os.write(format_str.data(), cnt); + format_str.remove_prefix(cnt); } } } diff --git a/libs/core/serialization/include/hpx/serialization/serialization_chunk.hpp b/libs/core/serialization/include/hpx/serialization/serialization_chunk.hpp index 1a145783284e..94beff17e26a 100644 --- a/libs/core/serialization/include/hpx/serialization/serialization_chunk.hpp +++ b/libs/core/serialization/include/hpx/serialization/serialization_chunk.hpp @@ -47,6 +47,11 @@ namespace hpx::serialization { HPX_ASSERT(type_ == chunk_type::chunk_type_pointer); return data_.cpos_; } + [[nodiscard]] constexpr void* data() noexcept + { + HPX_ASSERT(type_ == chunk_type::chunk_type_pointer); + return data_.pos_; + } [[nodiscard]] constexpr std::size_t size() const noexcept { return size_; diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp index ff3ecec4c2a4..11d306d8bf4b 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp @@ -41,7 +41,8 @@ namespace hpx::parcelset::policies::mpi { }; using data_type = std::vector; - using buffer_type = parcel_buffer; + using buffer_type = + parcel_buffer; public: receiver_connection(int src, header const& h, Parcelport& pp) noexcept @@ -52,6 +53,7 @@ namespace hpx::parcelset::policies::mpi { , request_(MPI_REQUEST_NULL) , request_ptr_(nullptr) , chunks_idx_(0) + , zero_copy_chunks_idx_(0) , pp_(pp) { header_.assert_valid(); @@ -152,30 +154,88 @@ namespace hpx::parcelset::policies::mpi { bool receive_chunks(std::size_t num_thread = -1) { - while (chunks_idx_ < buffer_.chunks_.size()) + if (!request_done()) + { + return false; + } + + // handle zero-copy receive, this should be done on the first entry + // to receive_chunks only + if (parcels_.empty()) + { + HPX_ASSERT(zero_copy_chunks_idx_ == 0); + + auto const num_zero_copy_chunks = static_cast( + static_cast(buffer_.num_chunks_.first)); + if (num_zero_copy_chunks != 0) + { + HPX_ASSERT(buffer_.chunks_.size() == num_zero_copy_chunks); + + // De-serialize the parcels such that all data but the + // zero-copy chunks are in place. This de-serialization also + // allocates all zero-chunk buffers and stores those in the + // chunks array for the subsequent networking to place the + // received data directly. + for (std::size_t i = 0; i != num_zero_copy_chunks; ++i) + { + auto const chunk_size = static_cast( + buffer_.transmission_chunks_[i].second); + buffer_.chunks_[i] = + serialization::create_pointer_chunk( + nullptr, chunk_size); + } + + parcels_ = + decode_parcels_zero_copy(pp_, buffer_, num_thread); + + // note that at this point, buffer_.chunks_ will have + // entries for all chunks, including the non-zero-copy ones + } + + // we should have received at least one parcel if there are + // zero-copy chunks to be received + HPX_ASSERT(parcels_.empty() || !buffer_.chunks_.empty()); + } + + while (chunks_idx_ != buffer_.chunks_.size()) { if (!request_done()) { return false; } - std::size_t const idx = chunks_idx_++; - std::size_t const chunk_size = - buffer_.transmission_chunks_[idx].second; + auto& c = buffer_.chunks_[chunks_idx_++]; + if (c.type_ == serialization::chunk_type::chunk_type_index) + { + continue; // skip non-zero-copy chunks + } + + // the zero-copy chunks come first in the transmission_chunks_ + // array + auto const chunk_size = static_cast( + buffer_.transmission_chunks_[zero_copy_chunks_idx_++] + .second); + + // the parcel de-serialization above should have allocated the + // correct amount of memory + HPX_ASSERT_MSG(c.data() != nullptr && c.size() == chunk_size, + "zero-copy chunk buffers should have been initialized " + "during de-serialization"); - data_type& c = buffer_.chunks_[idx]; - c.resize(chunk_size); { util::mpi_environment::scoped_lock l; [[maybe_unused]] int const ret = MPI_Irecv(c.data(), - static_cast(c.size()), MPI_BYTE, src_, tag_, + static_cast(chunk_size), MPI_BYTE, src_, tag_, util::mpi_environment::communicator(), &request_); HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); request_ptr_ = &request_; } } + HPX_ASSERT_MSG(zero_copy_chunks_idx_ == buffer_.num_chunks_.first, + "observed: {}, expected {}", zero_copy_chunks_idx_, + buffer_.num_chunks_.first); state_ = rcvd_chunks; @@ -203,8 +263,21 @@ namespace hpx::parcelset::policies::mpi { request_ptr_ = &request_; } - handle_received_parcels( - decode_parcels(pp_, HPX_MOVE(buffer_), num_thread), num_thread); + if (parcels_.empty()) + { + // decode and handle received data + HPX_ASSERT(buffer_.num_chunks_.first == 0); + handle_received_parcels( + decode_parcels(pp_, HPX_MOVE(buffer_), num_thread), + num_thread); + } + else + { + // handle the received zero-copy parcels. + HPX_ASSERT(buffer_.num_chunks_.first != 0); + handle_received_parcels(HPX_MOVE(parcels_)); + buffer_ = buffer_type{}; + } state_ = sent_release_tag; @@ -255,8 +328,11 @@ namespace hpx::parcelset::policies::mpi { MPI_Request request_; MPI_Request* request_ptr_; std::size_t chunks_idx_; + std::size_t zero_copy_chunks_idx_; Parcelport& pp_; + + std::vector parcels_; }; } // namespace hpx::parcelset::policies::mpi diff --git a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp index 8ba22f3eb15a..5cdcf75dd263 100644 --- a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp +++ b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp @@ -289,36 +289,34 @@ namespace hpx::parcelset::policies::tcp { parcels_ = decode_parcels_zero_copy(parcelport_, buffer_); - auto const num_non_zero_copy_chunks = static_cast( - static_cast(buffer_.num_chunks_.second)); + // note that at this point, buffer_.chunks_ will have + // entries for all chunks, including the non-zero-copy ones + + [[maybe_unused]] auto const num_non_zero_copy_chunks = + static_cast( + static_cast(buffer_.num_chunks_.second)); HPX_ASSERT(num_zero_copy_chunks + num_non_zero_copy_chunks == buffer_.chunks_.size()); std::size_t zero_copy_chunks = 0; - for (std::size_t all_chunks = 0; all_chunks != - num_zero_copy_chunks + num_non_zero_copy_chunks; - ++all_chunks) + for (auto& c : buffer_.chunks_) { - if (buffer_.chunks_[all_chunks].type_ == - serialization::chunk_type::chunk_type_index) + if (c.type_ == serialization::chunk_type::chunk_type_index) { - continue; + continue; // skip non-zero-copy chunks } - HPX_ASSERT_MSG( - buffer_.chunks_[all_chunks].data_.cpos_ != nullptr, - "zero-copy chunk buffer should have been initialized " - "during de-serialization"); - auto const chunk_size = static_cast( - buffer_.transmission_chunks_[zero_copy_chunks].second); + buffer_.transmission_chunks_[zero_copy_chunks++] + .second); - HPX_ASSERT(buffer_.chunks_[all_chunks].size_ == chunk_size); + HPX_ASSERT_MSG( + c.data() != nullptr && c.size() == chunk_size, + "zero-copy chunk buffers should have been initialized " + "during de-serialization"); - buffers.emplace_back( - buffer_.chunks_[all_chunks].data_.pos_, chunk_size); - ++zero_copy_chunks; + buffers.emplace_back(c.data(), chunk_size); } HPX_ASSERT(zero_copy_chunks == num_zero_copy_chunks); diff --git a/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp b/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp index f09559a8965f..95f667f3c5c4 100644 --- a/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/decode_parcels.hpp @@ -343,15 +343,17 @@ namespace hpx::parcelset { here, p); } - if (migrated) + if (migrated && !allow_zero_copy_receive) { + // route parcels to migrated targets, but only if we're + // not zero-copy receiving agas::route(HPX_MOVE(p), &parcelset::detail::parcel_route_handler, threads::thread_priority::normal); } else if (deferred_schedule || allow_zero_copy_receive) { - // If we got a direct action + // store parcel if needed deferred_parcels.emplace_back(HPX_MOVE(p)); } From 97c660d882169b78271b930ee64e3f96ee842dfe Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Tue, 2 May 2023 15:29:56 -0500 Subject: [PATCH 57/63] Adding hpx.parcels.zero_copy_receive_optimization configuration key - this can be used to disable the zero-copy serialization on the receiving end, this option is enabled by default - flyby: modernize parcelset code --- .cmake-format.py | 39 +++- ...ching_and_configuring_hpx_applications.rst | 20 +- .../hpx/serialization/basic_archive.hpp | 63 ++++--- .../hpx/serialization/input_archive.hpp | 5 +- .../hpx/serialization/output_archive.hpp | 13 +- .../performance/serialization_overhead.cpp | 19 ++ .../parcelport_mpi/receiver_connection.hpp | 177 +++++++++++------- .../include/hpx/parcelport_tcp/receiver.hpp | 101 ++++++---- .../include/hpx/parcelset/parcel.hpp | 1 - .../include/hpx/parcelset/parcelhandler.hpp | 3 +- .../include/hpx/parcelset/parcelport_impl.hpp | 25 ++- .../include/hpx/parcelset/parcelset_fwd.hpp | 2 +- .../parcelset/src/detail/parcel_await.cpp | 4 +- libs/full/parcelset/src/parcel.cpp | 4 +- libs/full/parcelset/src/parcelhandler.cpp | 3 + libs/full/parcelset/tests/unit/CMakeLists.txt | 25 ++- .../include/hpx/parcelset_base/locality.hpp | 12 +- .../hpx/parcelset_base/locality_interface.hpp | 3 - .../hpx/parcelset_base/parcel_interface.hpp | 18 +- .../include/hpx/parcelset_base/parcelport.hpp | 16 +- libs/full/parcelset_base/src/locality.cpp | 11 +- .../parcelset_base/src/locality_interface.cpp | 2 - .../parcelset_base/src/parcel_interface.cpp | 5 + libs/full/parcelset_base/src/parcelport.cpp | 38 ++-- .../parcelset_base/src/parcelset_base.cpp | 1 - .../plugin_factories/parcelport_factory.hpp | 4 + tests/regressions/util/CMakeLists.txt | 37 ++-- 27 files changed, 431 insertions(+), 220 deletions(-) diff --git a/.cmake-format.py b/.cmake-format.py index 8e44cf90089a..59592124237e 100644 --- a/.cmake-format.py +++ b/.cmake-format.py @@ -376,7 +376,24 @@ 'SOURCE_ROOT': 1}, 'pargs': { 'flags': ['FAILURE_EXPECTED', 'NOLIBS'], 'nargs': '2+'}}, - 'add_hpx_regression_test': {'pargs': {'nargs': 2}}, + 'add_hpx_regression_test': { 'kwargs': { 'COMPONENT_DEPENDENCIES': '+', + 'DEPENDENCIES': '+', + 'FOLDER': 1, + 'SOURCES': '+', + 'SOURCE_ROOT': 1, + 'ARGS': '+', + 'EXECUTABLE': 1, + 'PSEUDO_DEPS_NAME': 1, + 'LOCALITIES': 1, + 'PARCELPORTS': '+', + 'THREADS_PER_LOCALITY': 1}, + 'pargs': { 'flags': ['FAILURE_EXPECTED', + 'NOLIBS', + 'RUN_SERIAL', + 'NO_PARCELPORT_TCP', + 'NO_PARCELPORT_LCI', + 'NO_PARCELPORT_MPI'], + 'nargs': '2+'}}, 'add_hpx_source_group': { 'kwargs': { 'CLASS': 1, 'NAME': 1, 'ROOT': 1, @@ -386,10 +403,7 @@ 'EXECUTABLE': 1, 'LOCALITIES': 1, 'PARCELPORTS': '+', - 'THREADS_PER_LOCALITY': 1, - 'NO_PARCELPORT_TCP': 1, - 'NO_PARCELPORT_MPI': 1, - 'NO_PARCELPORT_LCI': 1}, + 'THREADS_PER_LOCALITY': 1}, 'pargs': {'flags': ['FAILURE_EXPECTED', 'RUN_SERIAL', 'NO_PARCELPORT_TCP', @@ -410,8 +424,19 @@ 'DEPENDENCIES': '+', 'FOLDER': 1, 'SOURCES': '+', - 'SOURCE_ROOT': 1}, - 'pargs': { 'flags': ['FAILURE_EXPECTED', 'NOLIBS'], + 'SOURCE_ROOT': 1, + 'ARGS': '+', + 'EXECUTABLE': 1, + 'PSEUDO_DEPS_NAME': 1, + 'LOCALITIES': 1, + 'PARCELPORTS': '+', + 'THREADS_PER_LOCALITY': 1}, + 'pargs': { 'flags': ['FAILURE_EXPECTED', + 'NOLIBS', + 'RUN_SERIAL', + 'NO_PARCELPORT_TCP', + 'NO_PARCELPORT_LCI', + 'NO_PARCELPORT_MPI'], 'nargs': '2+'}}, 'add_parcelport': { 'kwargs': { 'COMPILE_FLAGS': '+', 'DEPENDENCIES': '+', diff --git a/docs/sphinx/manual/launching_and_configuring_hpx_applications.rst b/docs/sphinx/manual/launching_and_configuring_hpx_applications.rst index e38ad01994e3..bc08a401b736 100644 --- a/docs/sphinx/manual/launching_and_configuring_hpx_applications.rst +++ b/docs/sphinx/manual/launching_and_configuring_hpx_applications.rst @@ -465,6 +465,7 @@ The ``hpx.parcel`` configuration section max_outbound_message_size = ${HPX_PARCEL_MAX_OUTBOUND_MESSAGE_SIZE:} array_optimization = ${HPX_PARCEL_ARRAY_OPTIMIZATION:1} zero_copy_optimization = ${HPX_PARCEL_ZERO_COPY_OPTIMIZATION:$[hpx.parcel.array_optimization]} + zero_copy_receive_optimization = ${HPX_PARCEL_ZERO_COPY_RECEIVE_OPTIMIZATION:$[hpx.parcel.array_optimization]} async_serialization = ${HPX_PARCEL_ASYNC_SERIALIZATION:1} message_handlers = ${HPX_PARCEL_MESSAGE_HANDLERS:0} @@ -520,6 +521,11 @@ The ``hpx.parcel`` configuration section * This property defines whether this :term:`locality` is allowed to utilize zero copy optimizations during serialization of :term:`parcel` data. The default is the same value as set for ``hpx.parcel.array_optimization``. + * * ``hpx.parcel.zero_copy_receive_optimization`` + * This property defines whether this :term:`locality` is allowed to utilize + zero copy optimizations on the receiving end during de-serialization of + :term:`parcel` data. The default is the same value as set for + ``hpx.parcel.zero_copy_optimization``. * * ``hpx.parcel.zero_copy_serialization_threshold`` * This property defines the threshold value (in bytes) starting at which the serialization layer will apply zero-copy optimizations for serialized @@ -544,6 +550,7 @@ The following settings relate to the TCP/IP parcelport. enable = ${HPX_HAVE_PARCELPORT_TCP:$[hpx.parcel.enabled]} array_optimization = ${HPX_PARCEL_TCP_ARRAY_OPTIMIZATION:$[hpx.parcel.array_optimization]} zero_copy_optimization = ${HPX_PARCEL_TCP_ZERO_COPY_OPTIMIZATION:$[hpx.parcel.zero_copy_optimization]} + zero_copy_receive_optimization = ${HPX_PARCEL_TCP_ZERO_COPY_RECEIVE_OPTIMIZATION:$[hpx.parcel.zero_copy_receive_optimization]} zero_copy_serialization_threshold = ${HPX_PARCEL_TCP_ZERO_COPY_SERIALIZATION_THRESHOLD:$[hpx.parcel.zero_copy_serialization_threshold]} async_serialization = ${HPX_PARCEL_TCP_ASYNC_SERIALIZATION:$[hpx.parcel.async_serialization]} parcel_pool_size = ${HPX_PARCEL_TCP_PARCEL_POOL_SIZE:$[hpx.threadpools.parcel_pool_size]} @@ -571,9 +578,14 @@ The following settings relate to the TCP/IP parcelport. ``hpx.parcel.array_optimization``. * * ``hpx.parcel.tcp.zero_copy_optimization`` * This property defines whether this :term:`locality` is allowed to utilize - zero copy optimizations in the TCP/IP parcelport during serialization of + zero copy optimizations during serialization of parcel data. The default is the same value as set for ``hpx.parcel.zero_copy_optimization``. + * * ``hpx.parcel.tcp.zero_copy_receive_optimization`` + * This property defines whether this :term:`locality` is allowed to utilize + zero copy optimizations on the receiving end in the TCP/IP parcelport during + de-serialization of :term:`parcel` data. The default is the same value as set + for ``hpx.parcel.zero_copy_optimization``. * * ``hpx.parcel.tcp.zero_copy_serialization_threshold`` * This property defines the threshold value (in bytes) starting at which the serialization layer will apply zero-copy optimizations for serialized @@ -623,6 +635,7 @@ equivalent CMake variable is ``HPX_WITH_PARCELPORT_MPI`` and has to be set to processor_name = array_optimization = ${HPX_HAVE_PARCEL_MPI_ARRAY_OPTIMIZATION:$[hpx.parcel.array_optimization]} zero_copy_optimization = ${HPX_HAVE_PARCEL_MPI_ZERO_COPY_OPTIMIZATION:$[hpx.parcel.zero_copy_optimization]} + zero_copy_receive_optimization = ${HPX_HAVE_PARCEL_MPI_ZERO_COPY_RECEIVE_OPTIMIZATION:$[hpx.parcel.zero_copy_receive_optimization]} zero_copy_serialization_threshold = ${HPX_PARCEL_MPI_ZERO_COPY_SERIALIZATION_THRESHOLD:$[hpx.parcel.zero_copy_serialization_threshold]} use_io_pool = ${HPX_HAVE_PARCEL_MPI_USE_IO_POOL:$1} async_serialization = ${HPX_HAVE_PARCEL_MPI_ASYNC_SERIALIZATION:$[hpx.parcel.async_serialization]} @@ -670,6 +683,11 @@ equivalent CMake variable is ``HPX_WITH_PARCELPORT_MPI`` and has to be set to zero copy optimizations in the MPI parcelport during serialization of parcel data. The default is the same value as set for ``hpx.parcel.zero_copy_optimization``. + * * ``hpx.parcel.mpi.zero_copy_receive_optimization`` + * This property defines whether this :term:`locality` is allowed to utilize + zero copy optimizations on the receiving end in the MPI parcelport during + de-serialization of :term:`parcel` data. The default is the same value as + set for ``hpx.parcel.zero_copy_optimization``. * * ``hpx.parcel.mpi.zero_copy_serialization_threshold`` * This property defines the threshold value (in bytes) starting at which the serialization layer will apply zero-copy optimizations for serialized diff --git a/libs/core/serialization/include/hpx/serialization/basic_archive.hpp b/libs/core/serialization/include/hpx/serialization/basic_archive.hpp index 680897a26721..25006c8de2ff 100644 --- a/libs/core/serialization/include/hpx/serialization/basic_archive.hpp +++ b/libs/core/serialization/include/hpx/serialization/basic_archive.hpp @@ -36,11 +36,29 @@ namespace hpx::serialization { endian_little = 0x00008000, disable_array_optimization = 0x00010000, disable_data_chunking = 0x00020000, - archive_is_saving = 0x00040000, - archive_is_preprocessing = 0x00080000, - all_archive_flags = 0x000fe000 // all of the above + disable_receive_data_chunking = 0x00040000, + archive_is_saving = 0x00080000, + archive_is_preprocessing = 0x00100000, + all_archive_flags = 0x001fe000 // all of the above }; + constexpr archive_flags operator|( + archive_flags lhs, archive_flags rhs) noexcept + { + return static_cast( + static_cast(lhs) | static_cast(rhs)); + } + constexpr std::uint32_t operator|( + std::uint32_t lhs, archive_flags rhs) noexcept + { + return lhs | static_cast(rhs); + } + constexpr std::uint32_t operator&( + std::uint32_t lhs, archive_flags rhs) noexcept + { + return lhs & static_cast(rhs); + } + #if defined(HPX_SERIALIZATION_HAVE_SUPPORTS_ENDIANESS) HPX_FORCEINLINE void reverse_bytes(std::size_t size, char* address) { @@ -74,26 +92,23 @@ namespace hpx::serialization { [[nodiscard]] constexpr bool archive_is_saving() const noexcept { - return static_cast(flags_ & - static_cast(archive_flags::archive_is_saving)); + return static_cast(flags_ & archive_flags::archive_is_saving); } [[nodiscard]] constexpr bool enable_compression() const noexcept { - return static_cast(flags_ & - static_cast(archive_flags::enable_compression)); + return static_cast( + flags_ & archive_flags::enable_compression); } [[nodiscard]] constexpr bool endian_big() const noexcept { - return static_cast( - flags_ & static_cast(archive_flags::endian_big)); + return static_cast(flags_ & archive_flags::endian_big); } [[nodiscard]] constexpr bool endian_little() const noexcept { - return static_cast(flags_ & - static_cast(archive_flags::endian_little)); + return static_cast(flags_ & archive_flags::endian_little); } #if defined(HPX_SERIALIZATION_HAVE_SUPPORTS_ENDIANESS) @@ -111,16 +126,23 @@ namespace hpx::serialization { [[nodiscard]] constexpr bool disable_array_optimization() const noexcept { - return static_cast(flags_ & - static_cast( - archive_flags::disable_array_optimization)); + return static_cast( + flags_ & archive_flags::disable_array_optimization); } [[nodiscard]] constexpr bool disable_data_chunking() const noexcept { - return static_cast(flags_ & - static_cast( - archive_flags::disable_data_chunking)); + return disable_array_optimization() || + static_cast( + flags_ & archive_flags::disable_data_chunking); + } + + [[nodiscard]] constexpr bool disable_receive_data_chunking() + const noexcept + { + return disable_data_chunking() || + static_cast( + flags_ & archive_flags::disable_receive_data_chunking); } [[nodiscard]] constexpr std::uint32_t flags() const noexcept @@ -133,9 +155,8 @@ namespace hpx::serialization { // during serialization/de-serialization. [[nodiscard]] constexpr bool is_preprocessing() const noexcept { - return static_cast(flags_ & - static_cast( - archive_flags::archive_is_preprocessing)); + return static_cast( + flags_ & archive_flags::archive_is_preprocessing); } [[nodiscard]] constexpr std::size_t current_pos() const noexcept @@ -168,7 +189,7 @@ namespace hpx::serialization { // try accessing extra data stored, might return nullptr template - T* try_get_extra_data() const noexcept + [[nodiscard]] T* try_get_extra_data() const noexcept { return extra_data_.try_get(); } diff --git a/libs/core/serialization/include/hpx/serialization/input_archive.hpp b/libs/core/serialization/include/hpx/serialization/input_archive.hpp index 36d67566691b..cca2db9b1991 100644 --- a/libs/core/serialization/include/hpx/serialization/input_archive.hpp +++ b/libs/core/serialization/include/hpx/serialization/input_archive.hpp @@ -276,8 +276,9 @@ namespace hpx::serialization { } else { - buffer_->load_binary_chunk( - address, count, allow_zero_copy_receive); + buffer_->load_binary_chunk(address, count, + allow_zero_copy_receive && + !disable_receive_data_chunking()); } size_ += count; diff --git a/libs/core/serialization/include/hpx/serialization/output_archive.hpp b/libs/core/serialization/include/hpx/serialization/output_archive.hpp index f07e8cb4744d..a6e0964b5011 100644 --- a/libs/core/serialization/include/hpx/serialization/output_archive.hpp +++ b/libs/core/serialization/include/hpx/serialization/output_archive.hpp @@ -98,10 +98,10 @@ namespace hpx::serialization { static constexpr std::uint32_t make_flags(std::uint32_t flags, std::vector const* chunks) noexcept { - return flags | - static_cast(archive_flags::archive_is_saving) | - static_cast(chunks == nullptr ? - archive_flags::disable_data_chunking : + return flags | archive_flags::archive_is_saving | + (chunks == nullptr ? + (archive_flags::disable_data_chunking | + archive_flags::disable_receive_data_chunking) : archive_flags::no_archive_flags); } @@ -123,9 +123,8 @@ namespace hpx::serialization { // the buffer repeatedly if (buffer_->is_preprocessing()) { - flags_ = flags_ | - static_cast( - archive_flags::archive_is_preprocessing); + flags_ = static_cast( + flags_ | archive_flags::archive_is_preprocessing); } // endianness needs to be saved separately as it is needed to diff --git a/libs/full/actions/tests/performance/serialization_overhead.cpp b/libs/full/actions/tests/performance/serialization_overhead.cpp index 8609089b7688..422366056581 100644 --- a/libs/full/actions/tests/performance/serialization_overhead.cpp +++ b/libs/full/actions/tests/performance/serialization_overhead.cpp @@ -78,6 +78,9 @@ double benchmark_serialization(std::size_t data_size, std::size_t iterations, int(hpx::serialization::archive_flags::disable_array_optimization); out_archive_flags = out_archive_flags | int(hpx::serialization::archive_flags::disable_data_chunking); + out_archive_flags = out_archive_flags | + int(hpx::serialization::archive_flags:: + disable_receive_data_chunking); } else { @@ -88,6 +91,22 @@ double benchmark_serialization(std::size_t data_size, std::size_t iterations, { out_archive_flags = out_archive_flags | int(hpx::serialization::archive_flags::disable_data_chunking); + out_archive_flags = out_archive_flags | + int(hpx::serialization::archive_flags:: + disable_receive_data_chunking); + } + else + { + std::string zero_copy_receive_optimization = hpx::get_config_entry( + "hpx.parcel.zero_copy_receive_optimization", "1"); + if (!zerocopy || + hpx::util::from_string(zero_copy_receive_optimization) == + 0) + { + out_archive_flags = out_archive_flags | + int(hpx::serialization::archive_flags:: + disable_receive_data_chunking); + } } } diff --git a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp index 11d306d8bf4b..18a9b172dec0 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver_connection.hpp @@ -103,6 +103,11 @@ namespace hpx::parcelset::policies::mpi { if (num_zero_copy_chunks != 0) { buffer_.chunks_.resize(num_zero_copy_chunks); + if (!pp_.allow_zero_copy_receive_optimizations()) + { + chunk_buffers_.resize(num_zero_copy_chunks); + } + { util::mpi_environment::scoped_lock l; @@ -154,89 +159,127 @@ namespace hpx::parcelset::policies::mpi { bool receive_chunks(std::size_t num_thread = -1) { - if (!request_done()) + if (pp_.allow_zero_copy_receive_optimizations()) { - return false; - } + if (!request_done()) + { + return false; + } - // handle zero-copy receive, this should be done on the first entry - // to receive_chunks only - if (parcels_.empty()) - { - HPX_ASSERT(zero_copy_chunks_idx_ == 0); + // handle zero-copy receive, this should be done on the first entry + // to receive_chunks only + if (parcels_.empty()) + { + HPX_ASSERT(zero_copy_chunks_idx_ == 0); + + auto const num_zero_copy_chunks = static_cast( + static_cast(buffer_.num_chunks_.first)); + if (num_zero_copy_chunks != 0) + { + HPX_ASSERT( + buffer_.chunks_.size() == num_zero_copy_chunks); + + // De-serialize the parcels such that all data but the + // zero-copy chunks are in place. This de-serialization also + // allocates all zero-chunk buffers and stores those in the + // chunks array for the subsequent networking to place the + // received data directly. + for (std::size_t i = 0; i != num_zero_copy_chunks; ++i) + { + auto const chunk_size = static_cast( + buffer_.transmission_chunks_[i].second); + buffer_.chunks_[i] = + serialization::create_pointer_chunk( + nullptr, chunk_size); + } + + parcels_ = + decode_parcels_zero_copy(pp_, buffer_, num_thread); + + // note that at this point, buffer_.chunks_ will have + // entries for all chunks, including the non-zero-copy ones + } - auto const num_zero_copy_chunks = static_cast( - static_cast(buffer_.num_chunks_.first)); - if (num_zero_copy_chunks != 0) + // we should have received at least one parcel if there are + // zero-copy chunks to be received + HPX_ASSERT(parcels_.empty() || !buffer_.chunks_.empty()); + } + + while (chunks_idx_ != buffer_.chunks_.size()) { - HPX_ASSERT(buffer_.chunks_.size() == num_zero_copy_chunks); - - // De-serialize the parcels such that all data but the - // zero-copy chunks are in place. This de-serialization also - // allocates all zero-chunk buffers and stores those in the - // chunks array for the subsequent networking to place the - // received data directly. - for (std::size_t i = 0; i != num_zero_copy_chunks; ++i) + if (!request_done()) { - auto const chunk_size = static_cast( - buffer_.transmission_chunks_[i].second); - buffer_.chunks_[i] = - serialization::create_pointer_chunk( - nullptr, chunk_size); + return false; } - parcels_ = - decode_parcels_zero_copy(pp_, buffer_, num_thread); + auto& c = buffer_.chunks_[chunks_idx_++]; + if (c.type_ == serialization::chunk_type::chunk_type_index) + { + continue; // skip non-zero-copy chunks + } - // note that at this point, buffer_.chunks_ will have - // entries for all chunks, including the non-zero-copy ones - } + // the zero-copy chunks come first in the transmission_chunks_ + // array + auto const chunk_size = static_cast( + buffer_.transmission_chunks_[zero_copy_chunks_idx_++] + .second); - // we should have received at least one parcel if there are - // zero-copy chunks to be received - HPX_ASSERT(parcels_.empty() || !buffer_.chunks_.empty()); - } + // the parcel de-serialization above should have allocated the + // correct amount of memory + HPX_ASSERT_MSG( + c.data() != nullptr && c.size() == chunk_size, + "zero-copy chunk buffers should have been initialized " + "during de-serialization"); - while (chunks_idx_ != buffer_.chunks_.size()) + { + util::mpi_environment::scoped_lock l; + + [[maybe_unused]] int const ret = MPI_Irecv(c.data(), + static_cast(chunk_size), MPI_BYTE, src_, tag_, + util::mpi_environment::communicator(), &request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + + request_ptr_ = &request_; + } + } + HPX_ASSERT_MSG( + zero_copy_chunks_idx_ == buffer_.num_chunks_.first, + "observed: {}, expected {}", zero_copy_chunks_idx_, + buffer_.num_chunks_.first); + } + else { - if (!request_done()) + HPX_ASSERT(chunk_buffers_.size() == buffer_.chunks_.size()); + while (chunks_idx_ < buffer_.chunks_.size()) { - return false; - } + if (!request_done()) + { + return false; + } - auto& c = buffer_.chunks_[chunks_idx_++]; - if (c.type_ == serialization::chunk_type::chunk_type_index) - { - continue; // skip non-zero-copy chunks - } + std::size_t const idx = chunks_idx_++; + std::size_t const chunk_size = + buffer_.transmission_chunks_[idx].second; - // the zero-copy chunks come first in the transmission_chunks_ - // array - auto const chunk_size = static_cast( - buffer_.transmission_chunks_[zero_copy_chunks_idx_++] - .second); + auto& c = chunk_buffers_[idx]; + c.resize(chunk_size); - // the parcel de-serialization above should have allocated the - // correct amount of memory - HPX_ASSERT_MSG(c.data() != nullptr && c.size() == chunk_size, - "zero-copy chunk buffers should have been initialized " - "during de-serialization"); + // store buffer for decode_parcels below + buffer_.chunks_[idx] = serialization::create_pointer_chunk( + c.data(), chunk_size); - { - util::mpi_environment::scoped_lock l; + { + util::mpi_environment::scoped_lock l; - [[maybe_unused]] int const ret = MPI_Irecv(c.data(), - static_cast(chunk_size), MPI_BYTE, src_, tag_, - util::mpi_environment::communicator(), &request_); - HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); + [[maybe_unused]] int const ret = MPI_Irecv(c.data(), + static_cast(c.size()), MPI_BYTE, src_, tag_, + util::mpi_environment::communicator(), &request_); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); - request_ptr_ = &request_; + request_ptr_ = &request_; + } } } - HPX_ASSERT_MSG(zero_copy_chunks_idx_ == buffer_.num_chunks_.first, - "observed: {}, expected {}", zero_copy_chunks_idx_, - buffer_.num_chunks_.first); - state_ = rcvd_chunks; return send_release_tag(num_thread); @@ -266,15 +309,18 @@ namespace hpx::parcelset::policies::mpi { if (parcels_.empty()) { // decode and handle received data - HPX_ASSERT(buffer_.num_chunks_.first == 0); + HPX_ASSERT(buffer_.num_chunks_.first == 0 || + !pp_.allow_zero_copy_receive_optimizations()); handle_received_parcels( decode_parcels(pp_, HPX_MOVE(buffer_), num_thread), num_thread); + chunk_buffers_.clear(); } else { // handle the received zero-copy parcels. - HPX_ASSERT(buffer_.num_chunks_.first != 0); + HPX_ASSERT(buffer_.num_chunks_.first != 0 && + pp_.allow_zero_copy_receive_optimizations()); handle_received_parcels(HPX_MOVE(parcels_)); buffer_ = buffer_type{}; } @@ -333,6 +379,7 @@ namespace hpx::parcelset::policies::mpi { Parcelport& pp_; std::vector parcels_; + std::vector> chunk_buffers_; }; } // namespace hpx::parcelset::policies::mpi diff --git a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp index 5cdcf75dd263..93be684ba45a 100644 --- a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp +++ b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp @@ -95,6 +95,7 @@ namespace hpx::parcelset::policies::tcp { data.num_parcels_ = 0; #endif parcels_.clear(); + chunk_buffers_.clear(); // Issue a read operation to read the message size. using asio::buffer; @@ -274,51 +275,74 @@ namespace hpx::parcelset::policies::tcp { buffer_.chunks_.resize(num_zero_copy_chunks); - // De-serialize the parcels such that all data but the zero-copy - // chunks are in place. This de-serialization also allocates all - // zero-chunk buffers and stores those in the chunks array for - // the subsequent networking to place the received data - // directly. - for (std::size_t i = 0; i != num_zero_copy_chunks; ++i) + if (parcelport_.allow_zero_copy_receive_optimizations()) { - auto const chunk_size = static_cast( - buffer_.transmission_chunks_[i].second); - buffer_.chunks_[i] = serialization::create_pointer_chunk( - nullptr, chunk_size); - } + // De-serialize the parcels such that all data but the + // zero-copy chunks are in place. This de-serialization also + // allocates all zero-chunk buffers and stores those in the + // chunks array for the subsequent networking to place the + // received data directly. + for (std::size_t i = 0; i != num_zero_copy_chunks; ++i) + { + auto const chunk_size = static_cast( + buffer_.transmission_chunks_[i].second); + buffer_.chunks_[i] = + serialization::create_pointer_chunk( + nullptr, chunk_size); + } - parcels_ = decode_parcels_zero_copy(parcelport_, buffer_); + parcels_ = decode_parcels_zero_copy(parcelport_, buffer_); - // note that at this point, buffer_.chunks_ will have - // entries for all chunks, including the non-zero-copy ones + // note that at this point, buffer_.chunks_ will have + // entries for all chunks, including the non-zero-copy ones - [[maybe_unused]] auto const num_non_zero_copy_chunks = - static_cast( - static_cast(buffer_.num_chunks_.second)); + [[maybe_unused]] auto const num_non_zero_copy_chunks = + static_cast(static_cast( + buffer_.num_chunks_.second)); - HPX_ASSERT(num_zero_copy_chunks + num_non_zero_copy_chunks == - buffer_.chunks_.size()); + HPX_ASSERT( + num_zero_copy_chunks + num_non_zero_copy_chunks == + buffer_.chunks_.size()); - std::size_t zero_copy_chunks = 0; - for (auto& c : buffer_.chunks_) - { - if (c.type_ == serialization::chunk_type::chunk_type_index) + std::size_t zero_copy_chunks = 0; + for (auto& c : buffer_.chunks_) { - continue; // skip non-zero-copy chunks + if (c.type_ == + serialization::chunk_type::chunk_type_index) + { + continue; // skip non-zero-copy chunks + } + + auto const chunk_size = static_cast( + buffer_.transmission_chunks_[zero_copy_chunks++] + .second); + + HPX_ASSERT_MSG( + c.data() != nullptr && c.size() == chunk_size, + "zero-copy chunk buffers should have been " + "initialized during de-serialization"); + + buffers.emplace_back(c.data(), chunk_size); } + HPX_ASSERT(zero_copy_chunks == num_zero_copy_chunks); + } + else + { + chunk_buffers_.resize(num_zero_copy_chunks); + for (std::size_t i = 0; i != num_zero_copy_chunks; ++i) + { + auto const chunk_size = static_cast( + buffer_.transmission_chunks_[i].second); - auto const chunk_size = static_cast( - buffer_.transmission_chunks_[zero_copy_chunks++] - .second); - - HPX_ASSERT_MSG( - c.data() != nullptr && c.size() == chunk_size, - "zero-copy chunk buffers should have been initialized " - "during de-serialization"); + chunk_buffers_[i].resize(chunk_size); + buffers.emplace_back( + chunk_buffers_[i].data(), chunk_size); - buffers.emplace_back(c.data(), chunk_size); + buffer_.chunks_[i] = + serialization::create_pointer_chunk( + chunk_buffers_[i].data(), chunk_size); + } } - HPX_ASSERT(zero_copy_chunks == num_zero_copy_chunks); // Start an asynchronous call to receive the zero-copy data. { @@ -360,6 +384,7 @@ namespace hpx::parcelset::policies::tcp { --operation_in_flight_; buffer_ = parcel_buffer_type(); parcels_.clear(); + chunk_buffers_.clear(); } else { @@ -375,14 +400,16 @@ namespace hpx::parcelset::policies::tcp { if (parcels_.empty()) { // decode and handle received data - HPX_ASSERT(buffer_.num_chunks_.first == 0); + HPX_ASSERT(buffer_.num_chunks_.first == 0 || + !parcelport_.allow_zero_copy_receive_optimizations()); handle_received_parcels( decode_parcels(parcelport_, HPX_MOVE(buffer_))); } else { // handle the received zero-copy parcels. - HPX_ASSERT(buffer_.num_chunks_.first != 0); + HPX_ASSERT(buffer_.num_chunks_.first != 0 && + parcelport_.allow_zero_copy_receive_optimizations()); handle_received_parcels(HPX_MOVE(parcels_)); } @@ -419,6 +446,7 @@ namespace hpx::parcelset::policies::tcp { buffer_ = parcel_buffer_type(); parcels_.clear(); + chunk_buffers_.clear(); // Issue a read operation to read the next parcel. if (!e) @@ -445,6 +473,7 @@ namespace hpx::parcelset::policies::tcp { hpx::util::atomic_count operation_in_flight_; std::vector parcels_; + std::vector> chunk_buffers_; }; } // namespace hpx::parcelset::policies::tcp diff --git a/libs/full/parcelset/include/hpx/parcelset/parcel.hpp b/libs/full/parcelset/include/hpx/parcelset/parcel.hpp index 31d99d56b110..8ad387b4ed32 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcel.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcel.hpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/libs/full/parcelset/include/hpx/parcelset/parcelhandler.hpp b/libs/full/parcelset/include/hpx/parcelset/parcelhandler.hpp index 3b09f86cd636..9f4971089b8b 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcelhandler.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcelhandler.hpp @@ -21,8 +21,7 @@ #include #include -#include -#include +#include #include #include #include diff --git a/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp b/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp index 2c7b632683e7..10e6d460cb59 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp @@ -151,13 +151,12 @@ namespace hpx::parcelset { if (endian_out == "little") { archive_flags_ = archive_flags_ | - static_cast( - serialization::archive_flags::endian_little); + serialization::archive_flags::endian_little; } else if (endian_out == "big") { - archive_flags_ = archive_flags_ | - static_cast(serialization::archive_flags::endian_big); + archive_flags_ = + archive_flags_ | serialization::archive_flags::endian_big; } else { @@ -167,17 +166,23 @@ namespace hpx::parcelset { if (!this->allow_array_optimizations()) { archive_flags_ = archive_flags_ | - static_cast(serialization::archive_flags:: - disable_array_optimization); + serialization::archive_flags::disable_array_optimization; + archive_flags_ = archive_flags_ | + serialization::archive_flags::disable_data_chunking; archive_flags_ = archive_flags_ | - static_cast( - serialization::archive_flags::disable_data_chunking); + serialization::archive_flags::disable_receive_data_chunking; } else if (!this->allow_zero_copy_optimizations()) { archive_flags_ = archive_flags_ | - static_cast( - serialization::archive_flags::disable_data_chunking); + serialization::archive_flags::disable_data_chunking; + archive_flags_ = archive_flags_ | + serialization::archive_flags::disable_receive_data_chunking; + } + else if (!this->allow_zero_copy_receive_optimizations()) + { + archive_flags_ = archive_flags_ | + serialization::archive_flags::disable_receive_data_chunking; } } diff --git a/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp b/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp index f061fd005258..8e5dfb98c5bd 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp @@ -62,7 +62,7 @@ namespace hpx::parcelset { HPX_EXPORT void sync_put_parcel(parcelset::parcel&& p); /// Return the maximally allowed size of an inbound message (in bytes) - HPX_EXPORT std::int64_t get_max_inbound_size(parcelport&); + HPX_EXPORT std::int64_t get_max_inbound_size(parcelport const&); } // namespace hpx::parcelset #endif diff --git a/libs/full/parcelset/src/detail/parcel_await.cpp b/libs/full/parcelset/src/detail/parcel_await.cpp index 783bd10dfddf..1df876f6732c 100644 --- a/libs/full/parcelset/src/detail/parcel_await.cpp +++ b/libs/full/parcelset/src/detail/parcel_await.cpp @@ -147,7 +147,7 @@ namespace hpx::parcelset::detail { void parcel_await_apply(parcelset::parcel&& p, write_handler_type&& f, std::uint32_t archive_flags, put_parcel_type pp) { - auto ptr = std::make_shared( + auto const ptr = std::make_shared( HPX_MOVE(p), HPX_MOVE(f), archive_flags, HPX_MOVE(pp)); ptr->apply(); } @@ -156,7 +156,7 @@ namespace hpx::parcelset::detail { std::vector&& f, std::uint32_t archive_flags, put_parcels_type pp) { - auto ptr = std::make_shared( + auto const ptr = std::make_shared( HPX_MOVE(p), HPX_MOVE(f), archive_flags, HPX_MOVE(pp)); ptr->apply(); } diff --git a/libs/full/parcelset/src/parcel.cpp b/libs/full/parcelset/src/parcel.cpp index 97a244f24422..8d385d23e0f5 100644 --- a/libs/full/parcelset/src/parcel.cpp +++ b/libs/full/parcelset/src/parcel.cpp @@ -178,9 +178,7 @@ namespace hpx::parcelset::detail { #endif parcel::parcel() - : data_() - , action_() - , size_(0) + : size_(0) , num_chunks_(0) { } diff --git a/libs/full/parcelset/src/parcelhandler.cpp b/libs/full/parcelset/src/parcelhandler.cpp index 79b0f2cab0eb..8e0659a6aacc 100644 --- a/libs/full/parcelset/src/parcelhandler.cpp +++ b/libs/full/parcelset/src/parcelhandler.cpp @@ -1368,6 +1368,9 @@ namespace hpx::parcelset { ini_defs.emplace_back( "zero_copy_optimization = ${HPX_PARCEL_ZERO_COPY_OPTIMIZATION:" "$[hpx.parcel.array_optimization]}"); + ini_defs.emplace_back("zero_copy_receive_optimization = " + "${HPX_PARCEL_ZERO_COPY_RECEIVE_OPTIMIZATION:" + "$[hpx.parcel.zero_copy_optimization]}"); ini_defs.emplace_back( "async_serialization = ${HPX_PARCEL_ASYNC_SERIALIZATION:1}"); #if defined(HPX_HAVE_PARCEL_COALESCING) diff --git a/libs/full/parcelset/tests/unit/CMakeLists.txt b/libs/full/parcelset/tests/unit/CMakeLists.txt index cd011d553c5f..7946dbc30c67 100644 --- a/libs/full/parcelset/tests/unit/CMakeLists.txt +++ b/libs/full/parcelset/tests/unit/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2021 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2014 Thomas Heller # Copyright (c) 2011-2012 Bryce Adelstein-Lelbach # @@ -14,6 +14,7 @@ set(tests put_parcels set_parcel_write_handler zero_copy_parcel) set(put_parcels_PARAMETERS LOCALITIES 2) set(set_parcel_write_handler_PARAMETERS LOCALITIES 2) +set(zero_copy_parcel_PARAMETERS LOCALITIES 2) foreach(test ${tests}) set(sources ${test}.cpp) @@ -33,3 +34,25 @@ foreach(test ${tests}) add_hpx_unit_test("modules.parcelset" ${test} ${${test}_PARAMETERS}) endforeach() + +# run zero_copy_parcel with three additional configurations +add_hpx_unit_test( + "modules.parcelset" zero_copy_parcel_no_array_optimization + EXECUTABLE zero_copy_parcel + PSEUDO_DEPS_NAME zero_copy_parcel ${zero_copy_parcel_PARAMETERS} + ARGS --hpx:ini=hpx.parcel.array_optimization=0 +) + +add_hpx_unit_test( + "modules.parcelset" zero_copy_parcel_no_zero_copy_optimization + EXECUTABLE zero_copy_parcel + PSEUDO_DEPS_NAME zero_copy_parcel ${zero_copy_parcel_PARAMETERS} + ARGS --hpx:ini=hpx.parcel.zero_copy_optimization=0 +) + +add_hpx_unit_test( + "modules.parcelset" zero_copy_parcel_no_zero_copy_receive_optimization + EXECUTABLE zero_copy_parcel + PSEUDO_DEPS_NAME zero_copy_parcel ${zero_copy_parcel_PARAMETERS} + ARGS --hpx:ini=hpx.parcel.zero_copy_receive_optimization=0 +) diff --git a/libs/full/parcelset_base/include/hpx/parcelset_base/locality.hpp b/libs/full/parcelset_base/include/hpx/parcelset_base/locality.hpp index 0429840ceba8..460478d4354b 100644 --- a/libs/full/parcelset_base/include/hpx/parcelset_base/locality.hpp +++ b/libs/full/parcelset_base/include/hpx/parcelset_base/locality.hpp @@ -26,7 +26,7 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace parcelset { +namespace hpx::parcelset { ////////////////////////////////////////////////////////////////////////// class locality @@ -123,12 +123,12 @@ namespace hpx { namespace parcelset { // serialization support friend class hpx::serialization::access; - void save(serialization::output_archive& ar, - const unsigned int version) const; + void save( + serialization::output_archive& ar, unsigned int version) const; - void load(serialization::input_archive& ar, const unsigned int version); + void load(serialization::input_archive& ar, unsigned int version); - HPX_SERIALIZATION_SPLIT_MEMBER(); + HPX_SERIALIZATION_SPLIT_MEMBER() std::unique_ptr impl_; @@ -202,6 +202,6 @@ namespace hpx { namespace parcelset { HPX_EXPORT std::ostream& operator<<( std::ostream& os, endpoints_type const& endpoints); -}} // namespace hpx::parcelset +} // namespace hpx::parcelset #include diff --git a/libs/full/parcelset_base/include/hpx/parcelset_base/locality_interface.hpp b/libs/full/parcelset_base/include/hpx/parcelset_base/locality_interface.hpp index 0bbef0e4abf4..8c8dccaebe63 100644 --- a/libs/full/parcelset_base/include/hpx/parcelset_base/locality_interface.hpp +++ b/libs/full/parcelset_base/include/hpx/parcelset_base/locality_interface.hpp @@ -12,9 +12,7 @@ #include #include -#include -#include #include /////////////////////////////////////////////////////////////////////////////// @@ -27,7 +25,6 @@ namespace hpx::parcelset { /////////////////////////////////////////////////////////////////////////// // initialize locality interface function wrappers struct locality_interface_functions& locality_init(); - } // namespace hpx::parcelset #endif diff --git a/libs/full/parcelset_base/include/hpx/parcelset_base/parcel_interface.hpp b/libs/full/parcelset_base/include/hpx/parcelset_base/parcel_interface.hpp index ae43e20c2b90..662e3404dd60 100644 --- a/libs/full/parcelset_base/include/hpx/parcelset_base/parcel_interface.hpp +++ b/libs/full/parcelset_base/include/hpx/parcelset_base/parcel_interface.hpp @@ -40,6 +40,13 @@ namespace hpx::parcelset::detail { using split_gids_type = std::map; + parcel_base() = default; + + parcel_base(parcel_base const&) = delete; + parcel_base(parcel_base&&) = delete; + parcel_base& operator=(parcel_base const&) = delete; + parcel_base& operator=(parcel_base&&) = delete; + virtual ~parcel_base() = default; virtual bool is_valid() const = 0; @@ -72,12 +79,10 @@ namespace hpx::parcelset::detail { virtual threads::thread_id_type get_parent_thread_id() const = 0; virtual std::uint64_t get_parent_thread_phase() const = 0; -#if defined(HPX_HAVE_NETWORKING) virtual serialization::binary_filter* get_serialization_filter() const = 0; virtual policies::message_handler* get_message_handler( locality const& loc) const = 0; -#endif virtual bool does_termination_detection() const = 0; @@ -104,7 +109,7 @@ namespace hpx::parcelset::detail { virtual naming::gid_type& parcel_id() = 0; #endif - HPX_SERIALIZATION_SPLIT_MEMBER(); + HPX_SERIALIZATION_SPLIT_MEMBER() }; } // namespace hpx::parcelset::detail @@ -121,6 +126,11 @@ namespace hpx::parcelset { parcel(); explicit parcel(detail::parcel_base* p); + parcel(parcel const&); + parcel(parcel&&) noexcept; + parcel& operator=(parcel const&); + parcel& operator=(parcel&&) noexcept; + ~parcel(); public: @@ -158,11 +168,9 @@ namespace hpx::parcelset { naming::gid_type& parcel_id(); #endif -#if defined(HPX_HAVE_NETWORKING) serialization::binary_filter* get_serialization_filter() const; policies::message_handler* get_message_handler( locality const& loc) const; -#endif [[nodiscard]] bool does_termination_detection() const; diff --git a/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp b/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp index eef8cd16336e..07a71c3d8228 100644 --- a/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp +++ b/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp @@ -29,10 +29,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -61,7 +59,7 @@ namespace hpx::parcelset { std::shared_ptr>, threads::thread_priority)>; /// Construct the parcelport on the given locality. - parcelport(util::runtime_configuration const& ini, locality const& here, + parcelport(util::runtime_configuration const& ini, locality here, std::string const& type, std::size_t zero_copy_serialization_threshold); @@ -118,6 +116,7 @@ namespace hpx::parcelset { /// function or function object gets invoked on completion of the send /// operation or on any error. /// + /// \param dest [in] Where should the parcel be sent to /// \param p [in] A reference to the parcel to send. /// \param f [in] A function object to be invoked on successful /// completion or on errors. The signature of this @@ -136,6 +135,7 @@ namespace hpx::parcelset { /// functions or function objects get invoked on completion of the send /// operation or on any error. /// + /// \param dest [in] Where should the parcels be sent to /// \param parcels [in] A reference to the list of parcels to send. /// \param handlers [in] A list of function objects to be invoked on /// successful completion or on errors. The signature of @@ -145,12 +145,13 @@ namespace hpx::parcelset { /// void handler(std::error_code const& err, /// std::size_t bytes_written); /// \endcode - virtual void put_parcels(locality const& dests, + virtual void put_parcels(locality const& dest, std::vector parcels, std::vector handlers) = 0; /// Send an early parcel through the TCP parcelport /// + /// \param dest [in] Where should the parcels be sent to /// \param p [in, out] A reference to the parcel to send. The /// parcel \a p will be modified in place, as it will /// get set the resolved destination address and parcel @@ -317,11 +318,15 @@ namespace hpx::parcelset { /// Return whether it is allowed to apply zero copy optimizations bool allow_zero_copy_optimizations() const noexcept; + /// Return whether it is allowed to apply zero copy optimizations on the + /// receiving end + bool allow_zero_copy_receive_optimizations() const noexcept; + bool async_serialization() const noexcept; // callback while bootstrap the parcel layer void early_pending_parcel_handler( - std::error_code const& ec, parcel const& p); + std::error_code const& ec, parcel const& p) const; protected: // mutex for all of the member data @@ -359,6 +364,7 @@ namespace hpx::parcelset { /// serialization is allowed to use array optimization bool allow_array_optimizations_; bool allow_zero_copy_optimizations_; + bool allow_zero_copy_receive_optimizations_; /// async serialization of parcels bool async_serialization_; diff --git a/libs/full/parcelset_base/src/locality.cpp b/libs/full/parcelset_base/src/locality.cpp index 4f4970984565..9ab26376e91b 100644 --- a/libs/full/parcelset_base/src/locality.cpp +++ b/libs/full/parcelset_base/src/locality.cpp @@ -19,7 +19,7 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace parcelset { +namespace hpx::parcelset { locality::locality(locality const& other) : impl_(other.impl_ ? other.impl_->clone() : nullptr) @@ -105,11 +105,10 @@ namespace hpx { namespace parcelset { } /////////////////////////////////////////////////////////////////////////// - void locality::save( - serialization::output_archive& ar, const unsigned int) const + void locality::save(serialization::output_archive& ar, unsigned int) const { #if defined(HPX_HAVE_NETWORKING) - std::string t = type(); + std::string const t = type(); ar << t; if (t.empty()) { @@ -124,7 +123,7 @@ namespace hpx { namespace parcelset { #endif } - void locality::load(serialization::input_archive& ar, const unsigned int) + void locality::load(serialization::input_archive& ar, unsigned int) { #if defined(HPX_HAVE_NETWORKING) std::string t; @@ -156,4 +155,4 @@ namespace hpx { namespace parcelset { return os; } -}} // namespace hpx::parcelset +} // namespace hpx::parcelset diff --git a/libs/full/parcelset_base/src/locality_interface.cpp b/libs/full/parcelset_base/src/locality_interface.cpp index 8101356f447b..6d9ad3a8d9e4 100644 --- a/libs/full/parcelset_base/src/locality_interface.cpp +++ b/libs/full/parcelset_base/src/locality_interface.cpp @@ -16,10 +16,8 @@ #include #include -#include #include #include -#include /////////////////////////////////////////////////////////////////////////////// namespace hpx::parcelset { diff --git a/libs/full/parcelset_base/src/parcel_interface.cpp b/libs/full/parcelset_base/src/parcel_interface.cpp index b1698252abcb..69c0998d58cf 100644 --- a/libs/full/parcelset_base/src/parcel_interface.cpp +++ b/libs/full/parcelset_base/src/parcel_interface.cpp @@ -43,6 +43,11 @@ namespace hpx::parcelset { parcel::~parcel() = default; + parcel::parcel(parcel const&) = default; + parcel::parcel(parcel&&) noexcept = default; + parcel& parcel::operator=(parcel const&) = default; + parcel& parcel::operator=(parcel&&) noexcept = default; + void parcel::reset() const { data_->reset(); diff --git a/libs/full/parcelset_base/src/parcelport.cpp b/libs/full/parcelset_base/src/parcelport.cpp index cd3b95dc6530..f664d2751f40 100644 --- a/libs/full/parcelset_base/src/parcelport.cpp +++ b/libs/full/parcelset_base/src/parcelport.cpp @@ -33,14 +33,17 @@ namespace hpx::parcelset { /////////////////////////////////////////////////////////////////////////// parcelport::parcelport(util::runtime_configuration const& ini, - locality const& here, std::string const& type, + locality here, std::string const& type, std::size_t zero_copy_serialization_threshold) : num_parcel_destinations_(0) - , here_(here) - , max_inbound_message_size_(ini.get_max_inbound_message_size()) - , max_outbound_message_size_(ini.get_max_outbound_message_size()) + , here_(HPX_MOVE(here)) + , max_inbound_message_size_( + static_cast(ini.get_max_inbound_message_size())) + , max_outbound_message_size_( + static_cast(ini.get_max_outbound_message_size())) , allow_array_optimizations_(true) , allow_zero_copy_optimizations_(true) + , allow_zero_copy_receive_optimizations_(true) , async_serialization_(false) , priority_(hpx::util::get_entry_as( ini, "hpx.parcel." + type + ".priority", 0)) @@ -55,14 +58,18 @@ namespace hpx::parcelset { { allow_array_optimizations_ = false; allow_zero_copy_optimizations_ = false; + allow_zero_copy_receive_optimizations_ = false; } - else + else if (hpx::util::get_entry_as( + ini, key + ".zero_copy_optimization", 1) == 0) { - if (hpx::util::get_entry_as( - ini, key + ".zero_copy_optimization", 1) == 0) - { - allow_zero_copy_optimizations_ = false; - } + allow_zero_copy_optimizations_ = false; + allow_zero_copy_receive_optimizations_ = false; + } + else if (hpx::util::get_entry_as( + ini, key + ".zero_copy_receive_optimization", 1) == 0) + { + allow_zero_copy_receive_optimizations_ = false; } if (hpx::util::get_entry_as( @@ -339,7 +346,7 @@ namespace hpx::parcelset { } /////////////////////////////////////////////////////////////////////////// - std::int64_t get_max_inbound_size(parcelport& pp) + std::int64_t get_max_inbound_size(parcelport const& pp) { return pp.get_max_inbound_message_size(); } @@ -364,6 +371,11 @@ namespace hpx::parcelset { return allow_zero_copy_optimizations_; } + bool parcelport::allow_zero_copy_receive_optimizations() const noexcept + { + return allow_zero_copy_receive_optimizations_; + } + bool parcelport::async_serialization() const noexcept { return async_serialization_; @@ -372,12 +384,12 @@ namespace hpx::parcelset { /////////////////////////////////////////////////////////////////////////// // the code below is needed to bootstrap the parcel layer void parcelport::early_pending_parcel_handler( - std::error_code const& ec, parcel const& p) + std::error_code const& ec, parcel const& p) const { if (ec) { // all errors during early parcel handling are fatal - std::exception_ptr exception = + std::exception_ptr const exception = HPX_GET_EXCEPTION(ec, "early_pending_parcel_handler", "error while handling early parcel: " + ec.message() + "(" + std::to_string(ec.value()) + ")" + diff --git a/libs/full/parcelset_base/src/parcelset_base.cpp b/libs/full/parcelset_base/src/parcelset_base.cpp index 137ed155196a..22f3344a859f 100644 --- a/libs/full/parcelset_base/src/parcelset_base.cpp +++ b/libs/full/parcelset_base/src/parcelset_base.cpp @@ -25,7 +25,6 @@ namespace hpx::parcelset { "parcelport_background_mode_all", }; // clang-format on - } // namespace strings char const* get_parcelport_background_mode_name( diff --git a/libs/full/plugin_factories/include/hpx/plugin_factories/parcelport_factory.hpp b/libs/full/plugin_factories/include/hpx/plugin_factories/parcelport_factory.hpp index d717fca9af94..f9180e864073 100644 --- a/libs/full/plugin_factories/include/hpx/plugin_factories/parcelport_factory.hpp +++ b/libs/full/plugin_factories/include/hpx/plugin_factories/parcelport_factory.hpp @@ -111,6 +111,10 @@ namespace hpx::plugins { name_uc + "_ZERO_COPY_OPTIMIZATION:" "$[hpx.parcel.zero_copy_optimization]}"); + fillini.emplace_back( + "zero_copy_receive_optimization = ${HPX_PARCEL_" + name_uc + + "_ZERO_COPY_RECEIVE_OPTIMIZATION:" + "$[hpx.parcel.zero_copy_receive_optimization]}"); fillini.emplace_back( "zero_copy_serialization_threshold = ${HPX_PARCEL_" + name_uc + "_ZERO_COPY_SERIALIZATION_THRESHOLD:" diff --git a/tests/regressions/util/CMakeLists.txt b/tests/regressions/util/CMakeLists.txt index cce8f57047c8..7ccda5d458b5 100644 --- a/tests/regressions/util/CMakeLists.txt +++ b/tests/regressions/util/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2007-2012 Hartmut Kaiser +# Copyright (c) 2007-2023 Hartmut Kaiser # Copyright (c) 2011 Bryce Adelstein-Lelbach # # SPDX-License-Identifier: BSL-1.0 @@ -40,28 +40,25 @@ foreach(test ${tests}) endforeach() if(HPX_WITH_NETWORKING) - # run zero_copy_parcels_1001 with two additional configurations + # run zero_copy_parcels_1001 with three additional configurations add_hpx_regression_test( - "util" - zero_copy_parcels_1001_no_array_optimization - EXECUTABLE - zero_copy_parcels_1001 - PSEUDO_DEPS_NAME - zero_copy_parcels_1001 - ${zero_copy_parcels_1001_PARAMETERS} - ARGS - --hpx:ini=hpx.parcel.array_optimization=0 + "util" zero_copy_parcels_1001_no_array_optimization + EXECUTABLE zero_copy_parcels_1001 + PSEUDO_DEPS_NAME zero_copy_parcels_1001 ${zero_copy_parcels_1001_PARAMETERS} + ARGS --hpx:ini=hpx.parcel.array_optimization=0 ) add_hpx_regression_test( - "util" - zero_copy_parcels_1001_no_zero_copy_optimization - EXECUTABLE - zero_copy_parcels_1001 - PSEUDO_DEPS_NAME - zero_copy_parcels_1001 - ${zero_copy_parcels_1001_PARAMETERS} - ARGS - --hpx:ini=hpx.parcel.zero_copy_optimization=0 + "util" zero_copy_parcels_1001_no_zero_copy_optimization + EXECUTABLE zero_copy_parcels_1001 + PSEUDO_DEPS_NAME zero_copy_parcels_1001 ${zero_copy_parcels_1001_PARAMETERS} + ARGS --hpx:ini=hpx.parcel.zero_copy_optimization=0 + ) + + add_hpx_regression_test( + "util" zero_copy_parcels_1001_no_zero_copy_receive_optimization + EXECUTABLE zero_copy_parcels_1001 + PSEUDO_DEPS_NAME zero_copy_parcels_1001 ${zero_copy_parcels_1001_PARAMETERS} + ARGS --hpx:ini=hpx.parcel.zero_copy_receive_optimization=0 ) endif() From 96db4129015affef5bc43f64cc9ab461d2cf5db8 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Fri, 5 May 2023 07:43:03 -0500 Subject: [PATCH 58/63] Merge changes from #5910 --- libs/core/mpi_base/CMakeLists.txt | 4 +- libs/core/mpi_base/src/mpi_environment.cpp | 52 ++++++++----- .../agas/tests/regressions/CMakeLists.txt | 12 +-- .../parcelport_mpi/src/parcelport_mpi.cpp | 56 ++++++++++++++ .../include/hpx/parcelset/parcelport_impl.hpp | 73 +++++++++++-------- libs/full/parcelset/src/parcel.cpp | 1 + .../include/hpx/parcelset_base/parcelport.hpp | 2 +- libs/full/parcelset_base/src/locality.cpp | 8 +- tests/regressions/build/CMakeLists.txt | 3 +- tests/regressions/lcos/CMakeLists.txt | 15 ++-- 10 files changed, 149 insertions(+), 77 deletions(-) diff --git a/libs/core/mpi_base/CMakeLists.txt b/libs/core/mpi_base/CMakeLists.txt index a9e3a671402f..cafd5d0ff5fe 100644 --- a/libs/core/mpi_base/CMakeLists.txt +++ b/libs/core/mpi_base/CMakeLists.txt @@ -35,8 +35,8 @@ add_hpx_module( SOURCES ${mpi_base_sources} HEADERS ${mpi_base_headers} COMPAT_HEADERS ${mpi_base_compat_headers} - MODULE_DEPENDENCIES hpx_logging hpx_runtime_configuration hpx_string_util - hpx_util + MODULE_DEPENDENCIES hpx_format hpx_logging hpx_runtime_configuration + hpx_string_util hpx_util DEPENDENCIES ${additional_dependencies} CMAKE_SUBDIRS examples tests ) diff --git a/libs/core/mpi_base/src/mpi_environment.cpp b/libs/core/mpi_base/src/mpi_environment.cpp index 3fe15d7a1d20..29ab87ba3896 100644 --- a/libs/core/mpi_base/src/mpi_environment.cpp +++ b/libs/core/mpi_base/src/mpi_environment.cpp @@ -1,13 +1,13 @@ // Copyright (c) 2013-2015 Thomas Heller // Copyright (c) 2020 Google // Copyright (c) 2022 Patrick Diehl +// Copyright (c) 2023 Hartmut Kaiser // // 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) #include - #include #include #include @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -108,8 +109,23 @@ namespace hpx::util { int mpi_environment::is_initialized_ = -1; /////////////////////////////////////////////////////////////////////////// + [[noreturn]] static void throw_wrong_mpi_mode(int required, int provided) + { + std::map levels = { + {MPI_THREAD_SINGLE, "MPI_THREAD_SINGLE"}, + {MPI_THREAD_FUNNELED, "MPI_THREAD_FUNNELED"}, + {MPI_THREAD_SERIALIZED, "MPI_THREAD_SERIALIZED"}, + {MPI_THREAD_MULTIPLE, "MPI_THREAD_MULTIPLE"}}; + + HPX_THROW_EXCEPTION(hpx::error::invalid_status, + "hpx::util::mpi_environment::init", + "MPI doesn't implement minimal requested thread level, required " + "{}, provided {}", + levels[required], levels[provided]); + } + int mpi_environment::init( - int*, char***, const int minimal, const int required, int& provided) + int*, char***, int const minimal, int const required, int& provided) { has_called_init_ = false; @@ -131,9 +147,7 @@ namespace hpx::util { if (provided < minimal) { - HPX_THROW_EXCEPTION(hpx::error::invalid_status, - "hpx::util::mpi_environment::init", - "MPI doesn't provide minimal requested thread level"); + throw_wrong_mpi_mode(required, provided); } has_called_init_ = true; } @@ -148,9 +162,7 @@ namespace hpx::util { if (provided < minimal) { - HPX_THROW_EXCEPTION(hpx::error::invalid_status, - "hpx::util::mpi_environment::init", - "MPI doesn't provide minimal requested thread level"); + throw_wrong_mpi_mode(required, provided); } } return retval; @@ -194,7 +206,6 @@ namespace hpx::util { if (required == MPI_THREAD_MULTIPLE) setenv("MPICH_MAX_THREAD_SAFETY", "multiple", 1); #endif - #endif int const retval = @@ -211,16 +222,16 @@ namespace hpx::util { MPI_Error_string(retval, message, &msglen); message[msglen] = '\0'; - std::string msg("mpi_environment::init: MPI_Init_thread failed: "); - msg = msg + message + "."; - throw std::runtime_error(msg.c_str()); + HPX_THROW_EXCEPTION(hpx::error::invalid_status, + "hpx::util::mpi_environment::init", + "MPI_Init_thread failed: {}.", message); } MPI_Comm_dup(MPI_COMM_WORLD, &communicator_); + // explicitly disable multi-threaded mpi if needed if (provided_threading_flag_ <= MPI_THREAD_SERIALIZED) { - // explicitly disable multi-threaded mpi if needed rtcfg.add_entry("hpx.parcel.mpi.multithreaded", "0"); } @@ -228,12 +239,13 @@ namespace hpx::util { { enabled_ = false; has_called_init_ = false; - throw std::runtime_error( - "mpi_environment::init: MPI_Init_thread: " - "The underlying MPI implementation only supports " - "MPI_THREAD_FUNNELED. This mode is not supported by HPX. " - "Please pass -hpx:ini=hpx.parcel.mpi.multithreaded=0 to " - "explicitly disable MPI multi-threading."); + HPX_THROW_EXCEPTION(hpx::error::invalid_status, + "hpx::util::mpi_environment::init", + "MPI_Init_thread: The underlying MPI implementation only " + "supports MPI_THREAD_FUNNELED. This mode is not supported " + "by HPX. Please pass " + "--hpx:ini=hpx.parcel.mpi.multithreaded=0 to explicitly " + "disable MPI multi-threading."); } this_rank = rank(); @@ -329,7 +341,9 @@ namespace hpx::util { : locked(true) { if (!multi_threaded()) + { mtx_.lock(); + } } mpi_environment::scoped_lock::~scoped_lock() diff --git a/libs/full/agas/tests/regressions/CMakeLists.txt b/libs/full/agas/tests/regressions/CMakeLists.txt index 0da57d3e6bf9..37300de25824 100644 --- a/libs/full/agas/tests/regressions/CMakeLists.txt +++ b/libs/full/agas/tests/regressions/CMakeLists.txt @@ -33,12 +33,8 @@ foreach(test ${tests}) endforeach() add_hpx_regression_test( - "" - id_type_ref_counting_1032_4 - EXECUTABLE - id_type_ref_counting_1032 - PSEUDO_DEPS_NAME - id_type_ref_counting_1032 - THREADS_PER_LOCALITY - 4 + "" id_type_ref_counting_1032_4 + EXECUTABLE id_type_ref_counting_1032 + PSEUDO_DEPS_NAME id_type_ref_counting_1032 + THREADS_PER_LOCALITY 4 ) diff --git a/libs/full/parcelport_mpi/src/parcelport_mpi.cpp b/libs/full/parcelport_mpi/src/parcelport_mpi.cpp index 632c1edd3f77..0d30f7fc6665 100644 --- a/libs/full/parcelport_mpi/src/parcelport_mpi.cpp +++ b/libs/full/parcelport_mpi/src/parcelport_mpi.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -103,11 +104,29 @@ namespace hpx::parcelset { static std::size_t background_threads( util::runtime_configuration const& ini) { + // limit the number of cores accessing MPI to one if + // multi-threading in MPI is disabled + if (!multi_threaded_mpi(ini)) + { + return 1; + } + return hpx::util::get_entry_as(ini, "hpx.parcel.mpi.background_threads", HPX_HAVE_PARCELPORT_MPI_BACKGROUND_THREADS); } + static bool multi_threaded_mpi( + util::runtime_configuration const& ini) + { + if (hpx::util::get_entry_as( + ini, "hpx.parcel.mpi.multithreaded", 1) != 0) + { + return true; + } + return false; + } + public: parcelport(util::runtime_configuration const& ini, threads::policies::callback_notifier const& notifier) @@ -115,6 +134,7 @@ namespace hpx::parcelset { , stopped_(false) , receiver_(*this) , background_threads_(background_threads(ini)) + , multi_threaded_mpi_(multi_threaded_mpi(ini)) { } @@ -212,6 +232,41 @@ namespace hpx::parcelset { return has_work; } + template + bool reschedule_on_thread(F&& f, + threads::thread_schedule_state state, char const* funcname) + { + // if MPI was initialized in serialized mode the new thread + // needs to be pinned to thread 0 + if (multi_threaded_mpi_) + { + return this->base_type::reschedule_on_thread( + HPX_FORWARD(F, f), state, funcname); + } + + error_code ec(throwmode::lightweight); + hpx::threads::thread_init_data data( + hpx::threads::make_thread_function_nullary( + HPX_FORWARD(F, f)), + funcname, threads::thread_priority::bound, + threads::thread_schedule_hint(static_cast(0)), + threads::thread_stacksize::default_, state, true); + + auto const id = hpx::threads::register_thread(data, ec); + if (!ec) + return false; + + if (state == threads::thread_schedule_state::suspended) + { + threads::set_thread_state(id.noref(), + std::chrono::milliseconds(100), + threads::thread_schedule_state::pending, + threads::thread_restart_state::signaled, + threads::thread_priority::bound, true, ec); + } + return true; + } + private: std::atomic stopped_; @@ -242,6 +297,7 @@ namespace hpx::parcelset { } std::size_t background_threads_; + bool multi_threaded_mpi_; }; } // namespace policies::mpi } // namespace hpx::parcelset diff --git a/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp b/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp index 10e6d460cb59..85e29ae738ba 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcelport_impl.hpp @@ -348,26 +348,50 @@ namespace hpx::parcelset { parcelset::parcelport::shared_from_this()); } - /// Cache specific functionality + protected: + template + bool reschedule_on_thread( + F&& f, threads::thread_schedule_state state, char const* funcname) + { + error_code ec(throwmode::lightweight); + hpx::threads::thread_init_data data( + hpx::threads::make_thread_function_nullary(HPX_FORWARD(F, f)), + funcname, threads::thread_priority::normal, + threads::thread_schedule_hint( + static_cast(get_next_num_thread())), + threads::thread_stacksize::default_, state, true); + + auto id = hpx::threads::register_thread(data, ec); + if (!ec) + return false; + + if (state == threads::thread_schedule_state::suspended) + { + threads::set_thread_state(id.noref(), + std::chrono::milliseconds(100), + threads::thread_schedule_state::pending, + threads::thread_restart_state::signaled, + threads::thread_priority::boost, true, ec); + } + + return true; + } + + public: + // Cache specific functionality void remove_from_connection_cache_delayed(locality const& loc) { if (operations_in_flight_ != 0) { - error_code ec(throwmode::lightweight); - hpx::threads::thread_init_data data( - hpx::threads::make_thread_function_nullary( + if (!connection_handler().reschedule_on_thread( util::deferred_call( &parcelport_impl::remove_from_connection_cache, - this, loc)), - "remove_from_connection_cache_delayed", - threads::thread_priority::normal, - threads::thread_schedule_hint( - static_cast(get_next_num_thread())), - threads::thread_stacksize::default_, - threads::thread_schedule_state::pending, true); - hpx::threads::register_thread(data, ec); - if (!ec) + this, loc), + threads::thread_schedule_state::pending, + "remove_from_connection_cache_delayed")) + { return; + } } connection_cache_.clear(loc); @@ -375,27 +399,12 @@ namespace hpx::parcelset { void remove_from_connection_cache(locality const& loc) override { - error_code ec(throwmode::lightweight); - hpx::threads::thread_init_data data( - hpx::threads::make_thread_function_nullary(util::deferred_call( + connection_handler().reschedule_on_thread( + util::deferred_call( &parcelport_impl::remove_from_connection_cache_delayed, - this, loc)), - "remove_from_connection_cache", - threads::thread_priority::normal, - threads::thread_schedule_hint( - static_cast(get_next_num_thread())), - threads::thread_stacksize::default_, - threads::thread_schedule_state::suspended, true); - threads::thread_id_ref_type const id = - hpx::threads::register_thread(data, ec); - if (ec) - return; - - threads::set_thread_state(id.noref(), - std::chrono::milliseconds(100), + this, loc), threads::thread_schedule_state::pending, - threads::thread_restart_state::signaled, - threads::thread_priority::boost, true, ec); + "remove_from_connection_cache_delayed"); } /// Return the name of this locality diff --git a/libs/full/parcelset/src/parcel.cpp b/libs/full/parcelset/src/parcel.cpp index 8d385d23e0f5..5dff726b9cca 100644 --- a/libs/full/parcelset/src/parcel.cpp +++ b/libs/full/parcelset/src/parcel.cpp @@ -480,6 +480,7 @@ namespace hpx::parcelset::detail { reinterpret_cast( action_->get_parent_thread_id().get())); #endif + return false; } diff --git a/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp b/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp index 07a71c3d8228..37427c6a76eb 100644 --- a/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp +++ b/libs/full/parcelset_base/include/hpx/parcelset_base/parcelport.hpp @@ -135,7 +135,7 @@ namespace hpx::parcelset { /// functions or function objects get invoked on completion of the send /// operation or on any error. /// - /// \param dest [in] Where should the parcels be sent to + /// \param dest [in] Where should the parcels be sent to /// \param parcels [in] A reference to the list of parcels to send. /// \param handlers [in] A list of function objects to be invoked on /// successful completion or on errors. The signature of diff --git a/libs/full/parcelset_base/src/locality.cpp b/libs/full/parcelset_base/src/locality.cpp index 9ab26376e91b..fb5813a8ddfd 100644 --- a/libs/full/parcelset_base/src/locality.cpp +++ b/libs/full/parcelset_base/src/locality.cpp @@ -105,7 +105,8 @@ namespace hpx::parcelset { } /////////////////////////////////////////////////////////////////////////// - void locality::save(serialization::output_archive& ar, unsigned int) const + void locality::save( + [[maybe_unused]] serialization::output_archive& ar, unsigned int) const { #if defined(HPX_HAVE_NETWORKING) std::string const t = type(); @@ -119,11 +120,11 @@ namespace hpx::parcelset { #else HPX_THROW_EXCEPTION(hpx::error::invalid_status, "locality::save", "this shouldn't be called if networking is disabled"); - HPX_UNUSED(ar); #endif } - void locality::load(serialization::input_archive& ar, unsigned int) + void locality::load( + [[maybe_unused]] serialization::input_archive& ar, unsigned int) { #if defined(HPX_HAVE_NETWORKING) std::string t; @@ -139,7 +140,6 @@ namespace hpx::parcelset { #else HPX_THROW_EXCEPTION(hpx::error::invalid_status, "locality::load", "this shouldn't be called if networking is disabled"); - HPX_UNUSED(ar); #endif } diff --git a/tests/regressions/build/CMakeLists.txt b/tests/regressions/build/CMakeLists.txt index 7ec1137553c1..e199f4a83e13 100644 --- a/tests/regressions/build/CMakeLists.txt +++ b/tests/regressions/build/CMakeLists.txt @@ -31,7 +31,8 @@ if(NOT HPX_WITH_STATIC_LINKING) ) add_hpx_regression_test( - "build" test_client_1950 EXECUTABLE "$" + "build" test_client_1950 + EXECUTABLE "$" PSEUDO_DEPS_NAME test_client_1950 ) endif() diff --git a/tests/regressions/lcos/CMakeLists.txt b/tests/regressions/lcos/CMakeLists.txt index 377548063278..56fa47273c8f 100644 --- a/tests/regressions/lcos/CMakeLists.txt +++ b/tests/regressions/lcos/CMakeLists.txt @@ -48,15 +48,10 @@ endforeach() if(HPX_WITH_DISTRIBUTED_RUNTIME) add_hpx_regression_test( - "lcos" - after_588_4 - EXECUTABLE - after_588 - PSEUDO_DEPS_NAME - after_588 - LOCALITIES - 2 - THREADS_PER_LOCALITY - 4 + "lcos" after_588_4 + EXECUTABLE after_588 + PSEUDO_DEPS_NAME after_588 + LOCALITIES 2 + THREADS_PER_LOCALITY 4 ) endif() From 058c8b74cda77a1a413a57e3e6e6c53cd229363f Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Sat, 6 May 2023 16:44:11 -0500 Subject: [PATCH 59/63] Fixing use-after-move --- .../parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp | 1 + libs/full/parcelset/src/parcelhandler.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp index 93be684ba45a..e22841a77458 100644 --- a/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp +++ b/libs/full/parcelport_tcp/include/hpx/parcelport_tcp/receiver.hpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include diff --git a/libs/full/parcelset/src/parcelhandler.cpp b/libs/full/parcelset/src/parcelhandler.cpp index 8e0659a6aacc..1501c90942b0 100644 --- a/libs/full/parcelset/src/parcelhandler.cpp +++ b/libs/full/parcelset/src/parcelhandler.cpp @@ -764,6 +764,7 @@ namespace hpx::parcelset { nonresolved_parcels.reserve(num_parcels); nonresolved_handlers.reserve(num_parcels); + naming::gid_type dest_locality; for (std::size_t i = 0; i != num_parcels; ++i) { parcel& p = parcels[i]; @@ -783,7 +784,11 @@ namespace hpx::parcelset { &detail::parcel_sent_handler, HPX_MOVE(handlers[i])); // make sure all parcels go to the same locality - if (parcels[0].destination_locality() != p.destination_locality()) + if (i == 0) + { + dest_locality = p.destination_locality(); + } + else if (dest_locality != p.destination_locality()) { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "parcelhandler::put_parcels", From dbc51cb1ffed4d5afa92ef47dc0e4be56c5e9335 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 10 Apr 2023 15:51:24 -0500 Subject: [PATCH 60/63] Cleaning up #includes in hpx/ folder - unifying `` and `` --- .clang-tidy | 1 + cmake/templates/HPXConfig.cmake.in | 7 ++ .../coalescing/src/performance_counters.cpp | 3 - examples/1d_stencil/1d_stencil_1.cpp | 4 +- examples/1d_stencil/1d_stencil_2.cpp | 6 +- examples/1d_stencil/1d_stencil_3.cpp | 6 +- examples/1d_stencil/1d_stencil_4.cpp | 8 +- examples/1d_stencil/1d_stencil_4_parallel.cpp | 8 +- examples/1d_stencil/1d_stencil_channel.cpp | 10 +- examples/1d_stencil/stencil.hpp | 4 +- examples/balancing/hpx_thread_phase.cpp | 10 +- examples/balancing/os_thread_num.cpp | 10 +- examples/future_reduce/rnd_future_reduce.cpp | 8 +- .../hello_world_client.cpp | 2 +- examples/jacobi/jacobi.cpp | 2 +- examples/jacobi_smp/jacobi.cpp | 4 +- examples/jacobi_smp/jacobi_hpx.cpp | 4 +- examples/jacobi_smp/jacobi_nonuniform.cpp | 4 +- examples/jacobi_smp/jacobi_nonuniform_hpx.cpp | 6 +- examples/jacobi_smp/jacobi_nonuniform_omp.hpp | 2 +- examples/jacobi_smp/jacobi_omp.hpp | 2 +- examples/qt/qt.cpp | 2 +- examples/quickstart/barrier_docs.cpp | 6 +- examples/quickstart/composable_guard.cpp | 2 +- .../quickstart/condition_variable_docs.cpp | 8 +- .../quickstart/counting_semaphore_docs.cpp | 6 +- examples/quickstart/customize_async.cpp | 6 +- examples/quickstart/enumerate_threads.cpp | 6 +- examples/quickstart/event_synchronization.cpp | 4 +- examples/quickstart/fibonacci_await.cpp | 8 +- examples/quickstart/fibonacci_dataflow.cpp | 8 +- examples/quickstart/fibonacci_futures.cpp | 8 +- examples/quickstart/fibonacci_local.cpp | 8 +- examples/quickstart/file_serialization.cpp | 2 +- examples/quickstart/for_each_docs.cpp | 6 +- examples/quickstart/hello_world_2.cpp | 2 +- examples/quickstart/hello_world_3.cpp | 4 +- examples/quickstart/init_globally.cpp | 11 +- examples/quickstart/interval_timer.cpp | 4 +- examples/quickstart/latch_local.cpp | 6 +- examples/quickstart/local_channel.cpp | 6 +- examples/quickstart/local_channel_docs.cpp | 4 +- examples/quickstart/matrix_multiplication.cpp | 6 +- examples/quickstart/mutex_docs.cpp | 6 +- examples/quickstart/pipeline1.cpp | 4 +- examples/quickstart/potpourri.cpp | 6 +- examples/quickstart/safe_object.cpp | 8 +- examples/quickstart/shared_mutex.cpp | 8 +- .../quickstart/simple_future_continuation.cpp | 10 +- examples/quickstart/sort_by_key_demo.cpp | 4 +- examples/quickstart/task_group_docs.cpp | 5 +- examples/quickstart/timed_futures.cpp | 6 +- examples/quickstart/timed_wake.cpp | 6 +- examples/quickstart/use_main_thread.cpp | 2 +- .../quickstart/vector_counting_dotproduct.cpp | 6 +- examples/quickstart/vector_zip_dotproduct.cpp | 8 +- examples/quickstart/wait_composition.cpp | 6 +- examples/transpose/transpose_serial.cpp | 4 +- examples/transpose/transpose_serial_block.cpp | 4 +- .../transpose/transpose_serial_vector.cpp | 2 +- examples/transpose/transpose_smp.cpp | 6 +- examples/transpose/transpose_smp_block.cpp | 6 +- init/CMakeLists.txt | 1 + init/src/hpx_init.cpp | 26 ++++ init/src/hpx_main.cpp | 38 +++--- init/src/hpx_main_argc_argv.cpp | 4 +- init/src/hpx_main_variables_map.cpp | 5 +- .../tests/unit/parse_affinity_options.cpp | 4 +- .../hpx/parallel/container_numeric.hpp | 1 + .../hpx/parallel/unseq/reduce_helpers.hpp | 4 +- .../performance/benchmark_inplace_merge.cpp | 13 +- .../tests/performance/benchmark_is_heap.cpp | 11 +- .../performance/benchmark_is_heap_until.cpp | 11 +- .../tests/performance/benchmark_merge.cpp | 12 +- .../performance/benchmark_nth_element.cpp | 10 +- .../benchmark_nth_element_parallel.cpp | 10 +- .../performance/benchmark_partial_sort.cpp | 6 +- .../benchmark_partial_sort_parallel.cpp | 6 +- .../tests/performance/benchmark_partition.cpp | 12 +- .../performance/benchmark_partition_copy.cpp | 11 +- .../tests/performance/benchmark_remove.cpp | 12 +- .../tests/performance/benchmark_remove_if.cpp | 12 +- .../performance/benchmark_scan_algorithms.cpp | 12 +- .../tests/performance/benchmark_unique.cpp | 12 +- .../performance/benchmark_unique_copy.cpp | 11 +- .../tests/performance/foreach_report.cpp | 10 +- .../tests/performance/foreach_scaling.cpp | 8 +- .../performance/foreach_scaling_helpers.hpp | 12 +- .../performance/transform_reduce_scaling.cpp | 6 +- .../tests/regressions/count_3646.cpp | 4 +- .../tests/regressions/fill_executor_5016.cpp | 6 +- .../for_each_annotated_function.cpp | 6 +- .../tests/regressions/for_each_datapar.cpp | 6 +- .../tests/regressions/for_loop_2281.cpp | 6 +- .../tests/regressions/for_loop_5735.cpp | 6 +- .../for_loop_with_auto_chunk_size.cpp | 6 +- .../tests/regressions/minimal_findend.cpp | 4 +- .../tests/regressions/reduce_3641.cpp | 4 +- .../regressions/scan_different_inits.cpp | 8 +- .../regressions/scan_non_commutative.cpp | 6 +- .../tests/regressions/scan_shortlength.cpp | 6 +- .../tests/regressions/search_zerolength.cpp | 4 +- .../tests/regressions/set_operations_3442.cpp | 5 +- .../tests/regressions/stable_merge_2964.cpp | 6 +- .../tests/regressions/static_chunker_2282.cpp | 4 +- .../transform_inclusive_scan_4786.cpp | 5 +- .../transform_inclusive_scan_4787.cpp | 5 +- .../unit/algorithms/adjacentdifference.cpp | 5 +- .../adjacentdifference_bad_alloc.cpp | 5 +- .../adjacentdifference_exception.cpp | 5 +- .../algorithms/adjacentdifference_sender.cpp | 2 +- .../algorithms/adjacentdifference_tests.hpp | 5 +- .../tests/unit/algorithms/adjacentfind.cpp | 2 +- .../algorithms/adjacentfind_bad_alloc.cpp | 4 +- .../unit/algorithms/adjacentfind_binary.cpp | 2 +- .../adjacentfind_binary_bad_alloc.cpp | 4 +- .../adjacentfind_binary_exception.cpp | 4 +- .../algorithms/adjacentfind_binary_tests.hpp | 4 +- .../algorithms/adjacentfind_exception.cpp | 4 +- .../unit/algorithms/adjacentfind_tests.hpp | 4 +- .../tests/unit/algorithms/all_of.cpp | 2 +- .../tests/unit/algorithms/any_of.cpp | 2 +- .../tests/unit/algorithms/any_of_tests.hpp | 5 +- .../algorithms/tests/unit/algorithms/copy.cpp | 2 +- .../unit/algorithms/copyif_bad_alloc.cpp | 4 +- .../unit/algorithms/copyif_exception.cpp | 4 +- .../tests/unit/algorithms/copyif_forward.cpp | 4 +- .../tests/unit/algorithms/copyif_random.cpp | 4 +- .../tests/unit/algorithms/copyn.cpp | 2 +- .../tests/unit/algorithms/copyn_tests.hpp | 4 +- .../tests/unit/algorithms/count.cpp | 2 +- .../tests/unit/algorithms/countif.cpp | 2 +- .../tests/unit/algorithms/destroy.cpp | 2 +- .../tests/unit/algorithms/destroy_tests.hpp | 5 +- .../tests/unit/algorithms/destroyn.cpp | 5 +- .../algorithms/detail/test_insertion_sort.cpp | 4 +- .../detail/test_parallel_stable_sort.cpp | 7 +- .../algorithms/detail/test_sample_sort.cpp | 7 +- .../unit/algorithms/detail/test_spin_sort.cpp | 4 +- .../tests/unit/algorithms/ends_with.cpp | 5 +- .../tests/unit/algorithms/equal.cpp | 2 +- .../tests/unit/algorithms/equal_binary.cpp | 2 +- .../tests/unit/algorithms/exclusive_scan.cpp | 5 +- .../tests/unit/algorithms/exclusive_scan2.cpp | 5 +- .../algorithms/exclusive_scan_bad_alloc.cpp | 5 +- .../algorithms/exclusive_scan_exception.cpp | 5 +- .../algorithms/exclusive_scan_validate.cpp | 5 +- .../algorithms/tests/unit/algorithms/fill.cpp | 2 +- .../tests/unit/algorithms/filln.cpp | 2 +- .../algorithms/tests/unit/algorithms/find.cpp | 2 +- .../tests/unit/algorithms/find_sender.cpp | 2 +- .../tests/unit/algorithms/find_tests.hpp | 6 +- .../tests/unit/algorithms/findend.cpp | 2 +- .../tests/unit/algorithms/findfirstof.cpp | 2 +- .../unit/algorithms/findfirstof_binary.cpp | 5 +- .../tests/unit/algorithms/findif.cpp | 2 +- .../tests/unit/algorithms/findifnot.cpp | 2 +- .../unit/algorithms/findifnot_bad_alloc.cpp | 4 +- .../unit/algorithms/findifnot_exception.cpp | 4 +- .../tests/unit/algorithms/for_loop.cpp | 4 +- .../unit/algorithms/for_loop_exception.cpp | 4 +- .../unit/algorithms/for_loop_induction.cpp | 4 +- .../algorithms/for_loop_induction_async.cpp | 4 +- .../tests/unit/algorithms/for_loop_n.cpp | 4 +- .../unit/algorithms/for_loop_n_strided.cpp | 4 +- .../unit/algorithms/for_loop_reduction.cpp | 4 +- .../algorithms/for_loop_reduction_async.cpp | 4 +- .../tests/unit/algorithms/for_loop_sender.cpp | 4 +- .../unit/algorithms/for_loop_strided.cpp | 4 +- .../tests/unit/algorithms/foreach.cpp | 4 +- .../unit/algorithms/foreach_executors.cpp | 3 +- .../unit/algorithms/foreach_prefetching.cpp | 2 +- .../unit/algorithms/foreach_scheduler.cpp | 8 +- .../tests/unit/algorithms/foreach_sender.cpp | 8 +- .../unit/algorithms/foreach_std_policies.cpp | 2 +- .../tests/unit/algorithms/foreach_tests.hpp | 4 +- .../algorithms/foreach_tests_prefetching.hpp | 4 +- .../tests/unit/algorithms/foreachn.cpp | 2 +- .../unit/algorithms/foreachn_bad_alloc.cpp | 4 +- .../unit/algorithms/foreachn_exception.cpp | 4 +- .../tests/unit/algorithms/generate.cpp | 2 +- .../tests/unit/algorithms/generate_tests.hpp | 4 +- .../tests/unit/algorithms/generaten.cpp | 2 +- .../tests/unit/algorithms/generaten_tests.hpp | 4 +- .../tests/unit/algorithms/includes.cpp | 4 +- .../tests/unit/algorithms/inclusive_scan.cpp | 2 +- .../unit/algorithms/inclusive_scan_tests.hpp | 5 +- .../tests/unit/algorithms/inplace_merge.cpp | 2 +- .../tests/unit/algorithms/is_heap.cpp | 2 +- .../tests/unit/algorithms/is_heap_until.cpp | 2 +- .../tests/unit/algorithms/is_partitioned.cpp | 4 +- .../tests/unit/algorithms/is_sorted.cpp | 2 +- .../tests/unit/algorithms/is_sorted_tests.hpp | 4 +- .../tests/unit/algorithms/is_sorted_until.cpp | 4 +- .../algorithms/lexicographical_compare.cpp | 4 +- .../tests/unit/algorithms/make_heap.cpp | 4 +- .../tests/unit/algorithms/max_element.cpp | 4 +- .../tests/unit/algorithms/merge.cpp | 2 +- .../tests/unit/algorithms/min_element.cpp | 4 +- .../tests/unit/algorithms/minmax_element.cpp | 4 +- .../tests/unit/algorithms/mismatch.cpp | 2 +- .../tests/unit/algorithms/mismatch_binary.cpp | 2 +- .../algorithms/tests/unit/algorithms/move.cpp | 4 +- .../tests/unit/algorithms/none_of.cpp | 2 +- .../tests/unit/algorithms/none_of_tests.hpp | 5 +- .../tests/unit/algorithms/nth_element.cpp | 4 +- .../tests/unit/algorithms/parallel_sort.cpp | 4 +- .../tests/unit/algorithms/partial_sort.cpp | 6 +- .../unit/algorithms/partial_sort_copy.cpp | 6 +- .../tests/unit/algorithms/partition.cpp | 2 +- .../tests/unit/algorithms/partition_copy.cpp | 2 +- .../tests/unit/algorithms/reduce_.cpp | 2 +- .../tests/unit/algorithms/reduce_by_key.cpp | 7 +- .../tests/unit/algorithms/remove.cpp | 2 +- .../tests/unit/algorithms/remove1.cpp | 2 +- .../tests/unit/algorithms/remove2.cpp | 2 +- .../tests/unit/algorithms/remove_copy.cpp | 4 +- .../tests/unit/algorithms/remove_copy_if.cpp | 4 +- .../tests/unit/algorithms/remove_if.cpp | 2 +- .../tests/unit/algorithms/remove_if1.cpp | 2 +- .../tests/unit/algorithms/replace.cpp | 4 +- .../tests/unit/algorithms/replace_copy.cpp | 4 +- .../tests/unit/algorithms/replace_copy_if.cpp | 4 +- .../tests/unit/algorithms/replace_if.cpp | 4 +- .../tests/unit/algorithms/reverse.cpp | 4 +- .../tests/unit/algorithms/reverse_copy.cpp | 4 +- .../tests/unit/algorithms/reverse_sender.cpp | 8 +- .../tests/unit/algorithms/rotate.cpp | 6 +- .../tests/unit/algorithms/rotate_copy.cpp | 6 +- .../tests/unit/algorithms/rotate_sender.cpp | 8 +- .../tests/unit/algorithms/search.cpp | 4 +- .../tests/unit/algorithms/searchn.cpp | 4 +- .../tests/unit/algorithms/set_difference.cpp | 4 +- .../unit/algorithms/set_intersection.cpp | 4 +- .../algorithms/set_symmetric_difference.cpp | 4 +- .../tests/unit/algorithms/set_union.cpp | 4 +- .../tests/unit/algorithms/shift_left.cpp | 4 +- .../tests/unit/algorithms/shift_right.cpp | 4 +- .../algorithms/tests/unit/algorithms/sort.cpp | 2 +- .../tests/unit/algorithms/sort_by_key.cpp | 8 +- .../tests/unit/algorithms/sort_exceptions.cpp | 2 +- .../unit/algorithms/stable_partition.cpp | 2 +- .../tests/unit/algorithms/stable_sort.cpp | 2 +- .../algorithms/stable_sort_exceptions.cpp | 2 +- .../unit/algorithms/stable_sort_tests.hpp | 6 +- .../tests/unit/algorithms/starts_with.cpp | 5 +- .../tests/unit/algorithms/swapranges.cpp | 4 +- .../tests/unit/algorithms/test_utils.hpp | 4 +- .../tests/unit/algorithms/transform.cpp | 2 +- .../unit/algorithms/transform_binary.cpp | 2 +- .../unit/algorithms/transform_binary2.cpp | 2 +- .../algorithms/transform_exclusive_scan.cpp | 5 +- .../algorithms/transform_inclusive_scan.cpp | 5 +- .../unit/algorithms/transform_reduce.cpp | 5 +- .../algorithms/transform_reduce_binary.cpp | 2 +- .../transform_reduce_binary_bad_alloc.cpp | 5 +- .../transform_reduce_binary_exception.cpp | 5 +- .../transform_reduce_binary_tests.hpp | 2 + .../unit/algorithms/uninitialized_copy.cpp | 2 +- .../algorithms/uninitialized_copy_tests.hpp | 5 +- .../unit/algorithms/uninitialized_copyn.cpp | 5 +- .../uninitialized_default_construct.cpp | 2 +- .../uninitialized_default_construct_tests.hpp | 5 +- .../uninitialized_default_constructn.cpp | 5 +- .../unit/algorithms/uninitialized_fill.cpp | 5 +- .../unit/algorithms/uninitialized_filln.cpp | 5 +- .../unit/algorithms/uninitialized_move.cpp | 2 +- .../algorithms/uninitialized_move_tests.hpp | 5 +- .../unit/algorithms/uninitialized_moven.cpp | 5 +- .../uninitialized_value_construct.cpp | 2 +- .../uninitialized_value_construct_tests.hpp | 5 +- .../uninitialized_value_constructn.cpp | 5 +- .../tests/unit/algorithms/unique.cpp | 2 +- .../tests/unit/algorithms/unique_copy.cpp | 2 +- .../tests/unit/block/spmd_block.cpp | 4 +- .../tests/unit/block/task_block.cpp | 6 +- .../tests/unit/block/task_block_executor.cpp | 6 +- .../tests/unit/block/task_block_par.cpp | 6 +- .../tests/unit/block/task_group.cpp | 4 +- .../adjacentdifference_range.cpp | 5 +- .../adjacentdifference_range_sender.cpp | 6 +- .../adjacentfind_bad_alloc_range.cpp | 4 +- .../adjacentfind_binary_bad_alloc_range.cpp | 4 +- .../adjacentfind_binary_exception_range.cpp | 4 +- .../adjacentfind_binary_projection_range.cpp | 4 +- .../adjacentfind_binary_range.cpp | 4 +- .../adjacentfind_exception_range.cpp | 4 +- .../adjacentfind_range.cpp | 4 +- .../container_algorithms/all_of_range.cpp | 4 +- .../container_algorithms/any_of_range.cpp | 4 +- .../unit/container_algorithms/copy_range.cpp | 4 +- .../container_algorithms/copyif_range.cpp | 4 +- .../unit/container_algorithms/copyn_range.cpp | 4 +- .../unit/container_algorithms/count_range.cpp | 4 +- .../container_algorithms/countif_range.cpp | 4 +- .../container_algorithms/destroy_range.cpp | 2 +- .../destroy_range_tests.hpp | 5 +- .../container_algorithms/destroyn_range.cpp | 5 +- .../container_algorithms/ends_with_range.cpp | 4 +- .../equal_binary_range.cpp | 4 +- .../unit/container_algorithms/equal_range.cpp | 4 +- .../exclusive_scan_range.cpp | 5 +- .../unit/container_algorithms/fill_range.cpp | 4 +- .../unit/container_algorithms/filln_range.cpp | 4 +- .../container_algorithms/find_end_range.cpp | 4 +- .../container_algorithms/find_end_range2.cpp | 4 +- .../find_first_of_range.cpp | 4 +- .../find_first_of_range2.cpp | 4 +- .../find_if_not_exception_range.cpp | 4 +- .../find_if_not_range.cpp | 4 +- .../container_algorithms/find_if_range.cpp | 4 +- .../unit/container_algorithms/find_range.cpp | 4 +- .../for_loop_exception_range.cpp | 4 +- .../for_loop_induction_async_range.cpp | 4 +- .../for_loop_induction_range.cpp | 4 +- .../container_algorithms/for_loop_range.cpp | 4 +- .../for_loop_range_generator.cpp | 6 +- .../for_loop_reduction_async_range.cpp | 4 +- .../for_loop_reduction_range.cpp | 4 +- .../for_loop_strided_range.cpp | 4 +- .../container_algorithms/foreach_adapt.cpp | 4 +- .../container_algorithms/foreach_range.cpp | 4 +- .../foreach_range_projection.cpp | 4 +- .../foreach_range_sender.cpp | 8 +- .../container_algorithms/generate_range.cpp | 4 +- .../container_algorithms/includes_range.cpp | 4 +- .../inclusive_scan_range.cpp | 5 +- .../inplace_merge_range.cpp | 4 +- .../container_algorithms/is_heap_range.cpp | 4 +- .../is_heap_until_range.cpp | 4 +- .../is_partitioned_projection_range.cpp | 4 +- .../is_partitioned_range.cpp | 4 +- .../container_algorithms/is_sorted_range.cpp | 2 +- .../is_sorted_range_tests.hpp | 4 +- .../is_sorted_until_range.cpp | 4 +- .../lexicographical_compare_range.cpp | 4 +- .../container_algorithms/make_heap_range.cpp | 4 +- .../max_element_range.cpp | 4 +- .../unit/container_algorithms/merge_range.cpp | 4 +- .../min_element_range.cpp | 4 +- .../minmax_element_range.cpp | 4 +- .../mismatch_binary_range.cpp | 4 +- .../container_algorithms/mismatch_range.cpp | 4 +- .../unit/container_algorithms/move_range.cpp | 4 +- .../container_algorithms/none_of_range.cpp | 4 +- .../nth_element_range.cpp | 4 +- .../partial_sort_copy_range.cpp | 6 +- .../partial_sort_range.cpp | 6 +- .../partition_copy_range.cpp | 4 +- .../container_algorithms/partition_range.cpp | 4 +- .../container_algorithms/reduce_range.cpp | 4 +- .../remove_copy_if_range.cpp | 4 +- .../remove_copy_range.cpp | 4 +- .../container_algorithms/remove_if_range.cpp | 4 +- .../container_algorithms/remove_range.cpp | 4 +- .../replace_copy_if_range.cpp | 4 +- .../replace_copy_range.cpp | 4 +- .../container_algorithms/replace_if_range.cpp | 4 +- .../container_algorithms/replace_range.cpp | 4 +- .../reverse_copy_range.cpp | 4 +- .../container_algorithms/reverse_range.cpp | 4 +- .../rotate_copy_range.cpp | 6 +- .../container_algorithms/rotate_range.cpp | 6 +- .../container_algorithms/search_range.cpp | 6 +- .../container_algorithms/searchn_range.cpp | 4 +- .../set_difference_range.cpp | 4 +- .../set_intersection_range.cpp | 4 +- .../set_symmetric_difference_range.cpp | 4 +- .../container_algorithms/set_union_range.cpp | 4 +- .../container_algorithms/shift_left_range.cpp | 4 +- .../shift_right_range.cpp | 4 +- .../unit/container_algorithms/sort_range.cpp | 2 +- .../stable_partition_range.cpp | 5 +- .../stable_sort_range.cpp | 2 +- .../starts_with_range.cpp | 4 +- .../swap_ranges_range.cpp | 4 +- .../unit/container_algorithms/test_utils.hpp | 5 +- .../transform_exclusive_scan_range.cpp | 5 +- .../transform_inclusive_scan_range.cpp | 5 +- .../container_algorithms/transform_range.cpp | 4 +- .../container_algorithms/transform_range2.cpp | 4 +- .../transform_range_binary.cpp | 4 +- .../transform_range_binary2.cpp | 4 +- ...ransform_reduce_binary_bad_alloc_range.cpp | 5 +- ...ransform_reduce_binary_exception_range.cpp | 5 +- .../transform_reduce_binary_range.cpp | 2 +- .../transform_reduce_binary_tests_range.hpp | 2 +- .../transform_reduce_range.cpp | 5 +- .../uninitialized_copy_n_range.cpp | 5 +- .../uninitialized_copy_range.cpp | 5 +- .../uninitialized_default_construct_range.cpp | 5 +- ...uninitialized_default_constructn_range.cpp | 5 +- .../uninitialized_fill_range.cpp | 5 +- .../uninitialized_filln_range.cpp | 5 +- .../uninitialized_move_n_range.cpp | 5 +- .../uninitialized_move_range.cpp | 5 +- .../uninitialized_value_construct_range.cpp | 5 +- .../uninitialized_value_constructn_range.cpp | 5 +- .../unique_copy_range.cpp | 4 +- .../container_algorithms/unique_range.cpp | 4 +- .../adjacentdifference_datapar.cpp | 4 +- .../adjacentfind_datapar.cpp | 4 +- .../datapar_algorithms/all_of_datapar.cpp | 4 +- .../datapar_algorithms/any_of_datapar.cpp | 4 +- .../unit/datapar_algorithms/copy_datapar.cpp | 4 +- .../unit/datapar_algorithms/copyn_datapar.cpp | 4 +- .../unit/datapar_algorithms/count_datapar.cpp | 4 +- .../datapar_algorithms/countif_datapar.cpp | 4 +- .../equal_binary_datapar.cpp | 4 +- .../unit/datapar_algorithms/equal_datapar.cpp | 4 +- .../unit/datapar_algorithms/fill_datapar.cpp | 4 +- .../unit/datapar_algorithms/filln_datapar.cpp | 4 +- .../unit/datapar_algorithms/find_datapar.cpp | 4 +- .../datapar_algorithms/findend_datapar.cpp | 4 +- .../findfirstof_datapar.cpp | 4 +- .../datapar_algorithms/findif_datapar.cpp | 4 +- .../datapar_algorithms/findifnot_datapar.cpp | 4 +- .../datapar_algorithms/foreach_datapar.cpp | 4 +- .../foreach_datapar_zipiter.cpp | 6 +- .../datapar_algorithms/foreachn_datapar.cpp | 4 +- .../datapar_algorithms/generate_datapar.cpp | 4 +- .../datapar_algorithms/generate_tests.hpp | 8 +- .../datapar_algorithms/generaten_datapar.cpp | 4 +- .../datapar_algorithms/generaten_tests.hpp | 8 +- .../mismatch_binary_datapar.cpp | 4 +- .../datapar_algorithms/mismatch_datapar.cpp | 4 +- .../datapar_algorithms/none_of_datapar.cpp | 4 +- .../datapar_algorithms/reduce_datapar.cpp | 4 +- .../replace_copy_datapar.cpp | 6 +- .../replace_copy_if_datapar.cpp | 6 +- .../datapar_algorithms/replace_datapar.cpp | 6 +- .../datapar_algorithms/replace_if_datapar.cpp | 6 +- .../transform_binary2_datapar.cpp | 4 +- .../transform_binary_datapar.cpp | 4 +- .../datapar_algorithms/transform_datapar.cpp | 4 +- .../transform_reduce_binary_datapar.cpp | 4 +- .../transform_reduce_datapar.cpp | 6 +- .../unit/unseq_algorithms/foreach_unseq.cpp | 4 +- .../foreach_unseq_zipiter.cpp | 4 +- .../unit/unseq_algorithms/foreachn_unseq.cpp | 4 +- .../unit/unseq_algorithms/reduce_unseq.cpp | 4 +- .../transform_binary2_unseq.cpp | 4 +- .../transform_binary_unseq.cpp | 4 +- .../transform_reduce_binary_unseq.cpp | 4 +- .../transform_reduce_unseq.cpp | 6 +- .../unit/unseq_algorithms/transform_unseq.cpp | 4 +- .../tests/regressions/split_future_2246.cpp | 4 +- .../regressions/wait_all_std_array_2035.cpp | 4 +- .../regressions/when_all_vectors_1623.cpp | 4 +- .../tests/unit/split_shared_future.cpp | 6 +- .../async_combinators/tests/unit/wait_all.cpp | 6 +- .../tests/unit/wait_all_std_array.cpp | 6 +- .../async_combinators/tests/unit/wait_any.cpp | 6 +- .../tests/unit/wait_any_std_array.cpp | 6 +- .../tests/unit/wait_each.cpp | 6 +- .../tests/unit/wait_some.cpp | 6 +- .../tests/unit/wait_some_std_array.cpp | 6 +- .../async_combinators/tests/unit/when_all.cpp | 6 +- .../tests/unit/when_all_std_array.cpp | 8 +- .../async_combinators/tests/unit/when_any.cpp | 6 +- .../tests/unit/when_any_std_array.cpp | 8 +- .../tests/unit/when_each.cpp | 6 +- .../tests/unit/when_some.cpp | 6 +- .../tests/unit/when_some_std_array.cpp | 8 +- .../performance/cuda_executor_throughput.cpp | 11 +- .../tests/performance/synchronize.cu | 6 +- .../async_cuda/tests/unit/cublas_matmul.cpp | 12 +- .../async_cuda/tests/unit/cuda_future.cpp | 8 +- libs/core/async_cuda/tests/unit/saxpy.cu | 2 +- .../async_cuda/tests/unit/transform_stream.cu | 5 +- .../async_local/tests/unit/apply_local.cpp | 8 +- .../tests/unit/apply_local_executor.cpp | 10 +- .../async_local/tests/unit/async_local.cpp | 5 +- .../tests/unit/async_local_executor.cpp | 6 +- ...nc_local_executor_additional_arguments.cpp | 11 +- .../tests/unit/algorithm_transform_mpi.cpp | 8 +- .../tests/unit/mpi_ring_async_executor.cpp | 6 +- .../async_sycl/tests/unit/sycl_stream.cpp | 21 ++-- .../sycl_vector_add_concurrent_executors.cpp | 20 +-- .../tests/unit/sycl_vector_add_executor.cpp | 21 ++-- .../tests/unit/sycl_vector_add_get_future.cpp | 19 +-- .../src/command_line_handling_local.cpp | 1 - .../regressions/ignore_aliases_local.cpp | 2 +- libs/core/compute_local/CMakeLists.txt | 8 +- .../regressions/for_each_value_proxy.cpp | 6 +- .../tests/regressions/parallel_fill_4132.cpp | 4 +- .../tests/unit/block_fork_join_executor.cpp | 12 +- .../tests/unit/numa_allocator.cpp | 12 +- .../tests/unit/contiguous_index_queue.cpp | 8 +- libs/core/concurrency/tests/unit/freelist.cpp | 7 +- .../tests/unit/non_contiguous_index_queue.cpp | 8 +- .../concurrency/tests/unit/queue_stress.cpp | 2 +- .../concurrency/tests/unit/stack_stress.cpp | 2 +- ...routine_function_destructor_yield_4800.cpp | 7 +- .../include/hpx/datastructures/tuple.hpp | 1 + .../performance/small_vector_benchmark.cpp | 6 +- .../non_default_constructible_tuple_5886.cpp | 2 +- .../tests/unit/any_serialization.cpp | 10 +- .../unit/serialization_raw_pointer_tuple.cpp | 5 +- .../hpx/execution/algorithms/sync_wait.hpp | 2 + .../regressions/annotated_minmax_2593.cpp | 6 +- .../tests/regressions/chunk_size_4118.cpp | 10 +- .../tests/regressions/fibonacci_sr.cpp | 4 +- .../tests/regressions/is_executor_1691.cpp | 10 +- .../regressions/lambda_arguments_2403.cpp | 6 +- .../regressions/lambda_return_type_2402.cpp | 6 +- .../tests/regressions/rebind_par_simd.cpp | 4 +- .../tests/unit/algorithm_as_sender.cpp | 4 +- .../tests/unit/algorithm_run_loop.cpp | 12 +- .../tests/unit/algorithm_sync_wait.cpp | 4 +- .../unit/algorithm_sync_wait_with_variant.cpp | 2 +- .../execution/tests/unit/algorithm_then.cpp | 8 +- libs/core/execution/tests/unit/bulk_async.cpp | 6 +- .../tests/unit/executor_parameters.cpp | 8 +- .../unit/executor_parameters_dispatching.cpp | 54 ++++----- .../unit/executor_parameters_timer_hooks.cpp | 8 +- .../execution/tests/unit/foreach_tests.hpp | 4 +- .../tests/unit/future_then_executor.cpp | 8 +- .../tests/unit/minimal_async_executor.cpp | 26 ++-- .../tests/unit/minimal_sync_executor.cpp | 16 +-- .../unit/persistent_executor_parameters.cpp | 6 +- libs/core/execution/tests/unit/test_utils.hpp | 2 +- .../execution_base/tests/unit/any_sender.cpp | 7 +- .../disable_thread_stealing_executor.cpp | 10 +- .../examples/executor_with_thread_hooks.cpp | 10 +- .../tests/regressions/bulk_sync_wait.cpp | 4 +- .../regressions/bulk_then_execute_3182.cpp | 6 +- .../future_then_async_executor.cpp | 10 +- .../regressions/parallel_executor_1781.cpp | 7 +- .../tests/regressions/pu_count_6184.cpp | 4 +- .../tests/regressions/wrapping_executor.cpp | 10 +- .../tests/unit/annotating_executor.cpp | 14 +-- .../tests/unit/annotation_property.cpp | 10 +- .../executors/tests/unit/created_executor.cpp | 14 +-- .../tests/unit/execution_policy_mappings.cpp | 10 +- .../unit/explicit_scheduler_executor.cpp | 10 +- .../tests/unit/fork_join_executor.cpp | 10 +- .../tests/unit/limiting_executor.cpp | 7 +- .../tests/unit/parallel_executor.cpp | 6 +- .../unit/parallel_executor_parameters.cpp | 6 +- .../tests/unit/parallel_fork_executor.cpp | 8 +- .../tests/unit/parallel_policy_executor.cpp | 6 +- .../tests/unit/polymorphic_executor.cpp | 9 +- .../tests/unit/scheduler_executor.cpp | 10 +- .../tests/unit/sequenced_executor.cpp | 8 +- .../tests/unit/service_executors.cpp | 8 +- .../tests/unit/shared_parallel_executor.cpp | 10 +- .../unit/standalone_thread_pool_executor.cpp | 6 +- .../tests/unit/std_execution_policies.cpp | 4 +- .../tests/unit/thread_pool_scheduler.cpp | 12 +- .../format/include/hpx/modules/format.hpp | 26 ++-- .../hpx/functional/detail/basic_function.hpp | 4 +- .../regressions/protect_with_nullary_pfo.cpp | 8 +- .../futures/include/hpx/futures/future.hpp | 3 - .../exception_from_continuation_1613.cpp | 4 +- .../tests/regressions/fail_future_2667.cpp | 4 +- .../futures/tests/regressions/future_2667.cpp | 6 +- .../futures/tests/regressions/future_790.cpp | 4 +- .../future_range_ambiguity_2032.cpp | 2 +- .../tests/regressions/future_unwrap_1182.cpp | 4 +- .../tests/regressions/future_unwrap_878.cpp | 4 +- .../tests/regressions/set_hpx_limit_798.cpp | 6 +- .../shared_future_continuation_order.cpp | 4 +- .../regressions/shared_future_then_2166.cpp | 4 +- .../tests/regressions/wait_for_1751.cpp | 4 +- libs/core/futures/tests/unit/await.cpp | 6 +- libs/core/futures/tests/unit/future.cpp | 6 +- libs/core/futures/tests/unit/future_ref.cpp | 4 +- libs/core/futures/tests/unit/future_then.cpp | 6 +- .../tests/unit/local_promise_allocator.cpp | 4 +- .../tests/unit/local_use_allocator.cpp | 2 +- libs/core/futures/tests/unit/make_future.cpp | 6 +- .../futures/tests/unit/make_ready_future.cpp | 4 +- .../core/futures/tests/unit/shared_future.cpp | 6 +- libs/core/include_local/CMakeLists.txt | 114 +++++++++++++----- .../include/hpx/{local => }/algorithm.hpp | 0 .../include_local}/include/hpx/any.hpp | 2 +- .../include/hpx/{local => }/barrier.hpp | 0 libs/core/include_local/include/hpx/bit.hpp | 10 ++ .../include/hpx/{local => }/channel.hpp | 5 - .../include_local}/include/hpx/chrono.hpp | 2 +- .../include_local/include/hpx/compute.hpp} | 4 +- .../hpx/{local => }/condition_variable.hpp | 0 .../include/hpx/{local => }/datapar.hpp | 0 .../include/hpx/{local => }/exception.hpp | 0 .../include/hpx/{local => }/execution.hpp | 2 + .../any.hpp => experimental/task_group.hpp} | 2 +- .../include_local/include/hpx/format.hpp} | 2 +- .../include/hpx/{local => }/functional.hpp | 0 .../include/hpx/{local => }/future.hpp | 0 .../include/hpx/{local => }/generator.hpp | 0 .../include/hpx/{local => }/latch.hpp | 0 .../include/hpx/local/chrono.hpp | 11 -- .../include/hpx/local/compute.hpp | 12 -- .../include/hpx/{local => }/memory.hpp | 2 + .../include/hpx/{local => }/mutex.hpp | 5 +- .../include/hpx/{local => }/numeric.hpp | 0 .../include/hpx/{local => }/optional.hpp | 0 .../include/hpx/{local => }/runtime.hpp | 0 .../include/hpx/{local => }/semaphore.hpp | 0 .../include/hpx/{local => }/shared_mutex.hpp | 0 .../hpx/{local => }/source_location.hpp | 0 .../include/hpx/{local => }/stop_token.hpp | 0 .../include/hpx/{local => }/system_error.hpp | 0 .../include/hpx/{local => }/task_block.hpp | 0 .../include_local}/include/hpx/thread.hpp | 3 +- .../include/hpx/{local => }/tuple.hpp | 1 + .../include/hpx/{local => }/type_traits.hpp | 0 .../include/hpx/{local => }/unwrap.hpp | 0 libs/core/init_runtime_local/CMakeLists.txt | 17 ++- .../include/hpx/{local => }/init.hpp | 0 .../unit/shutdown_suspended_thread_local.cpp | 7 +- .../tests/performance/stencil3_iterators.cpp | 22 ++-- .../tests/unit/counting_iterator.cpp | 4 +- .../tests/unit/stencil3_iterator.cpp | 4 +- .../tests/unit/transform_iterator.cpp | 2 +- .../include/hpx/lcos_local/channel.hpp | 5 + .../safely_destroy_promise_1481.cpp | 6 +- .../lcos_local/tests/unit/channel_local.cpp | 4 +- .../lcos_local/tests/unit/local_dataflow.cpp | 8 +- .../tests/unit/local_dataflow_executor.cpp | 10 +- ...dataflow_executor_additional_arguments.cpp | 14 +-- .../unit/local_dataflow_external_future.cpp | 18 +-- .../unit/local_dataflow_small_vector.cpp | 12 +- .../tests/unit/local_dataflow_std_array.cpp | 10 +- .../lcos_local/tests/unit/run_guarded.cpp | 4 +- .../lcos_local/tests/unit/split_future.cpp | 6 +- .../logging/include/hpx/modules/logging.hpp | 1 - .../core/pack_traversal/tests/unit/unwrap.cpp | 10 +- .../command_line_arguments_706.cpp | 2 +- .../command_line_required_arguments_2990.cpp | 2 +- .../regressions/commandline_options_1437.cpp | 2 +- .../examples/1d_stencil_replay_exception.cpp | 4 +- .../examples/1d_stencil_replay_validate.cpp | 4 +- .../core/resiliency/examples/async_replay.cpp | 8 +- .../resiliency/examples/async_replicate.cpp | 4 +- .../examples/async_replicate_vote.cpp | 6 +- .../examples/dataflow_replicate.cpp | 2 +- libs/core/resiliency/examples/version.cpp | 2 +- .../tests/performance/replay/1d_stencil.cpp | 5 +- .../replay/1d_stencil_checksum.cpp | 4 +- .../performance/replay/1d_stencil_replay.cpp | 4 +- .../tests/performance/replay/async_replay.cpp | 6 +- .../replay/async_replay_validate.cpp | 6 +- .../performance/replay/dataflow_replay.cpp | 4 +- .../replay/dataflow_replay_validate.cpp | 4 +- .../replay/pure_async_for_replay.cpp | 6 +- .../performance/replay/pure_dataflow.cpp | 6 +- .../replicate/1d_stencil_replicate.cpp | 4 +- .../1d_stencil_replicate_checksum.cpp | 4 +- .../performance/replicate/async_replicate.cpp | 6 +- .../replicate/async_replicate_validate.cpp | 6 +- .../replicate/async_replicate_vote.cpp | 6 +- .../async_replicate_vote_validate.cpp | 6 +- .../replicate/pure_async_for_replicate.cpp | 6 +- .../tests/unit/async_replay_executor.cpp | 6 +- .../tests/unit/async_replay_plain.cpp | 4 +- .../tests/unit/async_replicate_executor.cpp | 6 +- .../tests/unit/async_replicate_plain.cpp | 4 +- .../unit/async_replicate_vote_executor.cpp | 6 +- .../tests/unit/async_replicate_vote_plain.cpp | 4 +- .../tests/unit/dataflow_replay_executor.cpp | 6 +- .../tests/unit/dataflow_replay_plain.cpp | 4 +- .../unit/dataflow_replicate_executor.cpp | 6 +- .../tests/unit/dataflow_replicate_plain.cpp | 4 +- .../resiliency/tests/unit/replay_executor.cpp | 8 +- .../tests/unit/replicate_executor.cpp | 8 +- .../examples/async_customization.cpp | 20 +-- .../examples/guided_pool_test.cpp | 14 +-- .../oversubscribing_resource_partitioner.cpp | 14 +-- .../examples/simple_resource_partitioner.cpp | 8 +- .../simplest_resource_partitioner_1.cpp | 2 +- .../simplest_resource_partitioner_2.cpp | 2 +- .../examples/system_characteristics.hpp | 2 +- .../tests/regressions/help_exit_4317_1.cpp | 2 +- .../tests/regressions/help_exit_4317_2.cpp | 2 +- .../tests/unit/background_scheduler.cpp | 2 +- .../tests/unit/cross_pool_injection.cpp | 10 +- .../tests/unit/named_pool_executor.cpp | 8 +- .../tests/unit/resource_partitioner_info.cpp | 4 +- .../tests/unit/scheduler_binding_check.cpp | 10 +- .../tests/unit/scheduler_priority_check.cpp | 9 +- .../tests/unit/shutdown_suspended_pus.cpp | 10 +- .../tests/unit/suspend_disabled.cpp | 6 +- .../tests/unit/suspend_pool.cpp | 16 ++- .../tests/unit/suspend_pool_external.cpp | 14 +-- .../tests/unit/suspend_runtime.cpp | 10 +- .../tests/unit/suspend_thread.cpp | 11 +- .../tests/unit/suspend_thread_external.cpp | 11 +- .../tests/unit/suspend_thread_timed.cpp | 11 +- .../tests/unit/used_pus.cpp | 4 +- .../tests/unit/thread_mapper.cpp | 4 +- .../schedulers/tests/unit/schedule_last.cpp | 7 +- .../include/hpx/serialization/array.hpp | 1 - .../tests/regressions/buffer_overrun_2839.cpp | 2 +- .../non_default_constructible_5886.cpp | 2 +- .../not_bitwise_shared_ptr_serialization.cpp | 2 +- .../tests/unit/serialization_raw_pointer.cpp | 2 +- .../static_reinit/reinitializable_static.hpp | 2 +- .../performance/channel_mpmc_throughput.cpp | 8 +- .../performance/channel_mpsc_throughput.cpp | 8 +- .../performance/channel_spsc_throughput.cpp | 8 +- .../regressions/ignore_while_locked_1485.cpp | 4 +- .../tests/regressions/shared_mutex_1702.cpp | 4 +- .../tests/unit/async_rw_mutex.cpp | 10 +- .../tests/unit/barrier_cpp20.cpp | 4 +- .../tests/unit/binary_semaphore_cpp20.cpp | 6 +- .../tests/unit/channel_mpmc_fib.cpp | 8 +- .../tests/unit/channel_mpmc_shift.cpp | 8 +- .../tests/unit/channel_mpsc_fib.cpp | 8 +- .../tests/unit/channel_mpsc_shift.cpp | 8 +- .../tests/unit/channel_spsc_fib.cpp | 8 +- .../tests/unit/channel_spsc_shift.cpp | 8 +- .../tests/unit/condition_variable.cpp | 8 +- .../tests/unit/counting_semaphore.cpp | 10 +- .../tests/unit/counting_semaphore_cpp20.cpp | 6 +- .../tests/unit/in_place_stop_token.cpp | 2 +- .../tests/unit/in_place_stop_token_cb2.cpp | 2 +- .../tests/unit/latch_cpp20.cpp | 4 +- .../tests/unit/local_barrier.cpp | 8 +- .../tests/unit/local_barrier_count_up.cpp | 10 +- .../tests/unit/local_barrier_reset.cpp | 10 +- .../tests/unit/local_event.cpp | 6 +- .../tests/unit/local_latch.cpp | 8 +- .../tests/unit/local_mutex.cpp | 10 +- .../tests/unit/shared_mutex/shared_mutex1.cpp | 10 +- .../tests/unit/shared_mutex/shared_mutex2.cpp | 8 +- .../tests/unit/sliding_semaphore.cpp | 6 +- .../synchronization/tests/unit/stop_token.cpp | 2 +- .../tests/unit/stop_token_cb2.cpp | 2 +- .../tests/unit/condition_variable2.cpp | 6 +- .../tests/unit/condition_variable3.cpp | 4 +- .../tests/unit/condition_variable4.cpp | 4 +- .../tests/unit/condition_variable_race.cpp | 4 +- .../threading/tests/unit/error_callback.cpp | 4 +- .../tests/unit/in_place_stop_token_cb1.cpp | 8 +- .../tests/unit/in_place_stop_token_race.cpp | 6 +- .../tests/unit/in_place_stop_token_race2.cpp | 4 +- libs/core/threading/tests/unit/jthread1.cpp | 4 +- libs/core/threading/tests/unit/jthread2.cpp | 4 +- .../core/threading/tests/unit/stack_check.cpp | 4 +- .../threading/tests/unit/stop_token_cb1.cpp | 8 +- .../threading/tests/unit/stop_token_race.cpp | 6 +- .../threading/tests/unit/stop_token_race2.cpp | 4 +- libs/core/threading/tests/unit/thread.cpp | 8 +- libs/core/threading/tests/unit/thread_id.cpp | 8 +- .../threading/tests/unit/thread_launching.cpp | 4 +- libs/core/threading/tests/unit/thread_mf.cpp | 6 +- .../threading/tests/unit/thread_yield.cpp | 6 +- libs/core/threading/tests/unit/tss.cpp | 6 +- .../core/threading_base/src/create_thread.cpp | 1 - .../threading_base/src/set_thread_state.cpp | 8 -- .../src/set_thread_state_timed.cpp | 1 - .../tests/regressions/thread_local_data.cpp | 4 +- .../regressions/thread_stacksize_current.cpp | 5 +- .../unit/minimal_timed_async_executor.cpp | 18 ++- .../unit/minimal_timed_sync_executor.cpp | 13 +- .../tests/unit/timed_parallel_executor.cpp | 5 +- .../type_support/tests/unit/generator.cpp | 2 +- .../async_unwrap_result_implementations.hpp | 1 - .../tests/regressions/configuration_1572.cpp | 3 +- .../late_commandline_options_5257.cpp | 2 +- .../regressions/options_as_config_3339.cpp | 2 +- .../tests/regressions/use_all_cores_2262.cpp | 4 +- libs/full/compute/CMakeLists.txt | 5 +- libs/full/include/CMakeLists.txt | 29 +---- libs/full/include/include/hpx/algorithm.hpp | 8 +- libs/full/include/include/hpx/barrier.hpp | 2 +- libs/full/include/include/hpx/channel.hpp | 6 +- .../include/include/hpx/compute.hpp} | 6 +- libs/full/include/include/hpx/exception.hpp | 9 -- libs/full/include/include/hpx/execution.hpp | 9 -- libs/full/include/include/hpx/functional.hpp | 9 -- libs/full/include/include/hpx/future.hpp | 15 +-- libs/full/include/include/hpx/hpx.hpp | 4 +- libs/full/include/include/hpx/latch.hpp | 2 +- libs/full/include/include/hpx/memory.hpp | 9 -- libs/full/include/include/hpx/mutex.hpp | 9 -- libs/full/include/include/hpx/numeric.hpp | 9 -- libs/full/include/include/hpx/optional.hpp | 9 -- libs/full/include/include/hpx/runtime.hpp | 3 +- libs/full/include/include/hpx/semaphore.hpp | 9 -- .../full/include/include/hpx/shared_mutex.hpp | 9 -- .../include/include/hpx/source_location.hpp | 9 -- libs/full/include/include/hpx/stop_token.hpp | 9 -- .../full/include/include/hpx/system_error.hpp | 9 -- libs/full/include/include/hpx/task_block.hpp | 9 -- libs/full/include/include/hpx/tuple.hpp | 9 -- libs/full/include/include/hpx/type_traits.hpp | 9 -- libs/full/include/include/hpx/unwrap.hpp | 9 -- .../init_runtime/include/hpx/hpx_init.hpp | 6 +- .../include/hpx/hpx_init_impl.hpp | 66 +++------- .../include/hpx/hpx_init_params.hpp | 9 +- .../init_runtime/include/hpx/hpx_start.hpp | 6 +- .../include/hpx/hpx_start_impl.hpp | 64 +++------- libs/full/init_runtime/include/hpx/init.hpp | 2 + .../hpx/init_runtime/detail/run_or_start.hpp | 11 ++ libs/full/init_runtime/src/hpx_init.cpp | 75 +++++++++++- .../init_runtime/tests/unit/parcel_pool.cpp | 6 +- .../init_runtime/tests/unit/runtime_type.cpp | 6 +- .../tests/unit/shutdown_suspended_thread.cpp | 7 +- .../tests/unit/start_stop_callbacks.cpp | 2 +- .../include/hpx/lcos_distributed/channel.hpp | 10 +- .../full/parcelset/tests/unit/put_parcels.cpp | 2 +- .../src/runtime_distributed.cpp | 13 +- .../regressions/unhandled_exception_582.cpp | 2 +- .../tests/unit/partitioned_vector_target.cpp | 2 +- tests/performance/local/async_overheads.cpp | 4 +- tests/performance/local/future_overhead.cpp | 20 ++- .../local/future_overhead_report.cpp | 8 +- .../hpx_heterogeneous_timed_task_spawn.cpp | 8 +- tests/performance/local/htts_v2/htts2_hpx.cpp | 10 +- .../local/parent_vs_child_stealing.cpp | 10 +- tests/performance/local/resume_suspend.cpp | 9 +- tests/performance/local/skynet.cpp | 6 +- tests/performance/local/start_stop.cpp | 8 +- tests/performance/local/stream.cpp | 8 +- tests/performance/local/stream_report.cpp | 8 +- .../local/transform_reduce_binary_scaling.cpp | 10 +- tests/performance/local/wait_all_timings.cpp | 10 +- tests/regressions/stack_size_config_4543.cpp | 2 +- .../threads/block_os_threads_1036.cpp | 8 +- .../run_as_hpx_thread_exceptions_3304.cpp | 8 +- .../threads/stackless_self_4155.cpp | 2 +- .../regressions/threads/thread_data_1111.cpp | 2 +- .../threads/thread_rescheduling.cpp | 6 +- .../threads/thread_suspend_duration.cpp | 6 +- .../threads/thread_suspend_pending.cpp | 6 +- .../regressions/threads/threads_all_1422.cpp | 4 +- 829 files changed, 2402 insertions(+), 2472 deletions(-) create mode 100644 init/src/hpx_init.cpp rename libs/core/include_local/include/hpx/{local => }/algorithm.hpp (100%) rename libs/{full/include => core/include_local}/include/hpx/any.hpp (89%) rename libs/core/include_local/include/hpx/{local => }/barrier.hpp (100%) create mode 100644 libs/core/include_local/include/hpx/bit.hpp rename libs/core/include_local/include/hpx/{local => }/channel.hpp (77%) rename libs/{full/include => core/include_local}/include/hpx/chrono.hpp (87%) rename libs/{full/include/include/hpx/condition_variable.hpp => core/include_local/include/hpx/compute.hpp} (71%) rename libs/core/include_local/include/hpx/{local => }/condition_variable.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/datapar.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/exception.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/execution.hpp (78%) rename libs/core/include_local/include/hpx/{local/any.hpp => experimental/task_group.hpp} (86%) rename libs/{full/include/include/hpx/generator.hpp => core/include_local/include/hpx/format.hpp} (87%) rename libs/core/include_local/include/hpx/{local => }/functional.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/future.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/generator.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/latch.hpp (100%) delete mode 100644 libs/core/include_local/include/hpx/local/chrono.hpp delete mode 100644 libs/core/include_local/include/hpx/local/compute.hpp rename libs/core/include_local/include/hpx/{local => }/memory.hpp (80%) rename libs/core/include_local/include/hpx/{local => }/mutex.hpp (62%) rename libs/core/include_local/include/hpx/{local => }/numeric.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/optional.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/runtime.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/semaphore.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/shared_mutex.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/source_location.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/stop_token.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/system_error.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/task_block.hpp (100%) rename libs/{full/include => core/include_local}/include/hpx/thread.hpp (75%) rename libs/core/include_local/include/hpx/{local => }/tuple.hpp (84%) rename libs/core/include_local/include/hpx/{local => }/type_traits.hpp (100%) rename libs/core/include_local/include/hpx/{local => }/unwrap.hpp (100%) rename libs/core/init_runtime_local/include/hpx/{local => }/init.hpp (100%) rename libs/{core/include_local/include/hpx/local/thread.hpp => full/include/include/hpx/compute.hpp} (64%) delete mode 100644 libs/full/include/include/hpx/exception.hpp delete mode 100644 libs/full/include/include/hpx/execution.hpp delete mode 100644 libs/full/include/include/hpx/functional.hpp delete mode 100644 libs/full/include/include/hpx/memory.hpp delete mode 100644 libs/full/include/include/hpx/mutex.hpp delete mode 100644 libs/full/include/include/hpx/numeric.hpp delete mode 100644 libs/full/include/include/hpx/optional.hpp delete mode 100644 libs/full/include/include/hpx/semaphore.hpp delete mode 100644 libs/full/include/include/hpx/shared_mutex.hpp delete mode 100644 libs/full/include/include/hpx/source_location.hpp delete mode 100644 libs/full/include/include/hpx/stop_token.hpp delete mode 100644 libs/full/include/include/hpx/system_error.hpp delete mode 100644 libs/full/include/include/hpx/task_block.hpp delete mode 100644 libs/full/include/include/hpx/tuple.hpp delete mode 100644 libs/full/include/include/hpx/type_traits.hpp delete mode 100644 libs/full/include/include/hpx/unwrap.hpp diff --git a/.clang-tidy b/.clang-tidy index a41fa60a21e5..4a01e6c89116 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -11,6 +11,7 @@ Checks: > -bugprone-exception-escape, -bugprone-forward-declaration-namespace, -bugprone-macro-parentheses, + -bugprone-branch-clone, modernize-use-nullptr, misc-assert-side-effect misc-dangling-handle diff --git a/cmake/templates/HPXConfig.cmake.in b/cmake/templates/HPXConfig.cmake.in index d97e32388089..81ab41a40b07 100644 --- a/cmake/templates/HPXConfig.cmake.in +++ b/cmake/templates/HPXConfig.cmake.in @@ -104,6 +104,13 @@ set(HPX_CXX_COMPILER_VERSION # ############################################################################## # Setup the imported libraries (publicly linked) # +# Propagate Amplifier settings, if needed +if(HPX_WITH_ITTNOTIFY) + set(AMPLIFIER_INCLUDE_DIR "@AMPLIFIER_INCLUDE_DIR@") + set(AMPLIFIER_LIBRARY "@AMPLIFIER_LIBRARY@") + set(AMPLIFIER_ROOT "@AMPLIFIER_ROOT@") +endif() + # Allocator set(HPX_JEMALLOC_ROOT "@JEMALLOC_ROOT@") set(HPX_TCMALLOC_ROOT "@TCMALLOC_ROOT@") diff --git a/components/parcel_plugins/coalescing/src/performance_counters.cpp b/components/parcel_plugins/coalescing/src/performance_counters.cpp index 91b31970ed19..722367e78075 100644 --- a/components/parcel_plugins/coalescing/src/performance_counters.cpp +++ b/components/parcel_plugins/coalescing/src/performance_counters.cpp @@ -92,7 +92,6 @@ namespace hpx::plugins::parcel { { switch (info.type_) { - // NOLINTNEXTLINE(bugprone-branch-clone) case performance_counters::counter_type::monotonically_increasing: { performance_counters::counter_path_elements paths; @@ -176,7 +175,6 @@ namespace hpx::plugins::parcel { { switch (info.type_) { - // NOLINTNEXTLINE(bugprone-branch-clone) case performance_counters::counter_type::monotonically_increasing: { performance_counters::counter_path_elements paths; @@ -261,7 +259,6 @@ namespace hpx::plugins::parcel { { switch (info.type_) { - // NOLINTNEXTLINE(bugprone-branch-clone) case performance_counters::counter_type::average_count: { performance_counters::counter_path_elements paths; diff --git a/examples/1d_stencil/1d_stencil_1.cpp b/examples/1d_stencil/1d_stencil_1.cpp index a026498c447d..0837a5967322 100644 --- a/examples/1d_stencil/1d_stencil_1.cpp +++ b/examples/1d_stencil/1d_stencil_1.cpp @@ -11,8 +11,8 @@ // This example provides a serial base line implementation. No parallelization // is performed. -#include -#include +#include +#include #include #include diff --git a/examples/1d_stencil/1d_stencil_2.cpp b/examples/1d_stencil/1d_stencil_2.cpp index 2cd9e8c01662..f4738d506cba 100644 --- a/examples/1d_stencil/1d_stencil_2.cpp +++ b/examples/1d_stencil/1d_stencil_2.cpp @@ -19,9 +19,9 @@ // overheads. #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/1d_stencil/1d_stencil_3.cpp b/examples/1d_stencil/1d_stencil_3.cpp index f7308f67f0f6..c9cdd05f490f 100644 --- a/examples/1d_stencil/1d_stencil_3.cpp +++ b/examples/1d_stencil/1d_stencil_3.cpp @@ -14,9 +14,9 @@ // example is still fully serial, no parallelization is performed. #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/1d_stencil/1d_stencil_4.cpp b/examples/1d_stencil/1d_stencil_4.cpp index f80e4a57a2cd..de59844927af 100644 --- a/examples/1d_stencil/1d_stencil_4.cpp +++ b/examples/1d_stencil/1d_stencil_4.cpp @@ -15,11 +15,11 @@ // computation. This example is still fully local but demonstrates nice // scalability on SMP machines. +#include #include -#include -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/1d_stencil/1d_stencil_4_parallel.cpp b/examples/1d_stencil/1d_stencil_4_parallel.cpp index df8b697035e6..eb8c102255a6 100644 --- a/examples/1d_stencil/1d_stencil_4_parallel.cpp +++ b/examples/1d_stencil/1d_stencil_4_parallel.cpp @@ -14,10 +14,10 @@ // computation. This example is still fully local but demonstrates nice // scalability on SMP machines. -#include -#include -#include -#include +#include +#include +#include +#include #include #if !defined(HPX_HAVE_CXX17_SHARED_PTR_ARRAY) diff --git a/examples/1d_stencil/1d_stencil_channel.cpp b/examples/1d_stencil/1d_stencil_channel.cpp index 7997b2e0c5d2..2d460386cf62 100644 --- a/examples/1d_stencil/1d_stencil_channel.cpp +++ b/examples/1d_stencil/1d_stencil_channel.cpp @@ -12,18 +12,15 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include "communicator.hpp" -#include "stencil.hpp" - #include +#include #include #include #include -#include #include #include #include -#include +#include #include #include @@ -32,6 +29,9 @@ #include #include +#include "communicator.hpp" +#include "stencil.hpp" + using communication_type = double; HPX_REGISTER_CHANNEL_DECLARATION(communication_type, stencil_communication) diff --git a/examples/1d_stencil/stencil.hpp b/examples/1d_stencil/stencil.hpp index f4c9fcb2e0da..665bd679ceb6 100644 --- a/examples/1d_stencil/stencil.hpp +++ b/examples/1d_stencil/stencil.hpp @@ -6,11 +6,11 @@ #pragma once +#include +#include #include #include -#include #include -#include #include #include diff --git a/examples/balancing/hpx_thread_phase.cpp b/examples/balancing/hpx_thread_phase.cpp index 0ae7bed2ab6d..78e26058d838 100644 --- a/examples/balancing/hpx_thread_phase.cpp +++ b/examples/balancing/hpx_thread_phase.cpp @@ -5,12 +5,12 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include #include +#include +#include #include #include diff --git a/examples/balancing/os_thread_num.cpp b/examples/balancing/os_thread_num.cpp index 947e3cb524a4..de24c628042b 100644 --- a/examples/balancing/os_thread_num.cpp +++ b/examples/balancing/os_thread_num.cpp @@ -4,13 +4,13 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include #include -#include +#include +#include #include #include diff --git a/examples/future_reduce/rnd_future_reduce.cpp b/examples/future_reduce/rnd_future_reduce.cpp index 39a820f59ee9..fbc0dac57487 100644 --- a/examples/future_reduce/rnd_future_reduce.cpp +++ b/examples/future_reduce/rnd_future_reduce.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include -#include +#include +#include +#include +#include // #include #include diff --git a/examples/hello_world_component/hello_world_client.cpp b/examples/hello_world_component/hello_world_client.cpp index b07efdbaeb5e..990ad72df960 100644 --- a/examples/hello_world_component/hello_world_client.cpp +++ b/examples/hello_world_component/hello_world_client.cpp @@ -33,7 +33,7 @@ int main() #endif //] #else -#include +#include #include #include diff --git a/examples/jacobi/jacobi.cpp b/examples/jacobi/jacobi.cpp index 6cb6d77661d9..fa6d1545084e 100644 --- a/examples/jacobi/jacobi.cpp +++ b/examples/jacobi/jacobi.cpp @@ -7,8 +7,8 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) +#include #include -#include #include "jacobi_component/grid.hpp" #include "jacobi_component/solver.hpp" diff --git a/examples/jacobi_smp/jacobi.cpp b/examples/jacobi_smp/jacobi.cpp index 9a0a40ca2e2b..951b7f5b7020 100644 --- a/examples/jacobi_smp/jacobi.cpp +++ b/examples/jacobi_smp/jacobi.cpp @@ -6,10 +6,10 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if !defined(JACOBI_SMP_NO_HPX) -#include +#include #endif -#include +#include #include #include diff --git a/examples/jacobi_smp/jacobi_hpx.cpp b/examples/jacobi_smp/jacobi_hpx.cpp index 603cb1181ddf..ce8172fe5eac 100644 --- a/examples/jacobi_smp/jacobi_hpx.cpp +++ b/examples/jacobi_smp/jacobi_hpx.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include "jacobi.hpp" diff --git a/examples/jacobi_smp/jacobi_nonuniform.cpp b/examples/jacobi_smp/jacobi_nonuniform.cpp index a6819a776344..497d78a0b7d9 100644 --- a/examples/jacobi_smp/jacobi_nonuniform.cpp +++ b/examples/jacobi_smp/jacobi_nonuniform.cpp @@ -6,10 +6,10 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if !defined(JACOBI_SMP_NO_HPX) -#include +#include #endif -#include +#include #include #include diff --git a/examples/jacobi_smp/jacobi_nonuniform_hpx.cpp b/examples/jacobi_smp/jacobi_nonuniform_hpx.cpp index d40043f4c801..c9437857ef65 100644 --- a/examples/jacobi_smp/jacobi_nonuniform_hpx.cpp +++ b/examples/jacobi_smp/jacobi_nonuniform_hpx.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include "jacobi_nonuniform.hpp" diff --git a/examples/jacobi_smp/jacobi_nonuniform_omp.hpp b/examples/jacobi_smp/jacobi_nonuniform_omp.hpp index 8d8f559d9fcd..70028035b7cf 100644 --- a/examples/jacobi_smp/jacobi_nonuniform_omp.hpp +++ b/examples/jacobi_smp/jacobi_nonuniform_omp.hpp @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/examples/jacobi_smp/jacobi_omp.hpp b/examples/jacobi_smp/jacobi_omp.hpp index c56c54a0caef..19cfa0567ecd 100644 --- a/examples/jacobi_smp/jacobi_omp.hpp +++ b/examples/jacobi_smp/jacobi_omp.hpp @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include diff --git a/examples/qt/qt.cpp b/examples/qt/qt.cpp index 59d2e9fed4db..b9ec0114492c 100644 --- a/examples/qt/qt.cpp +++ b/examples/qt/qt.cpp @@ -55,7 +55,7 @@ void qt_main(int argc, char** argv) app.exec(); } -int hpx_main(int argc, char** argv) +int hpx_main(int argc, char* argv[]) { { // Get a reference to one of the main thread diff --git a/examples/quickstart/barrier_docs.cpp b/examples/quickstart/barrier_docs.cpp index 967bfe68ddf3..f89fb05aa165 100644 --- a/examples/quickstart/barrier_docs.cpp +++ b/examples/quickstart/barrier_docs.cpp @@ -7,9 +7,9 @@ // This example is meant for inclusion in the documentation. //[barrier_docs -#include -#include -#include +#include +#include +#include #include diff --git a/examples/quickstart/composable_guard.cpp b/examples/quickstart/composable_guard.cpp index ff66fddee1ae..2dc80f8a3ab4 100644 --- a/examples/quickstart/composable_guard.cpp +++ b/examples/quickstart/composable_guard.cpp @@ -3,7 +3,7 @@ // 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) -#include +#include #include #include diff --git a/examples/quickstart/condition_variable_docs.cpp b/examples/quickstart/condition_variable_docs.cpp index 0b382037c635..ffe1677a3044 100644 --- a/examples/quickstart/condition_variable_docs.cpp +++ b/examples/quickstart/condition_variable_docs.cpp @@ -7,10 +7,10 @@ // This example is meant for inclusion in the documentation. //[condition_variable_docs -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/quickstart/counting_semaphore_docs.cpp b/examples/quickstart/counting_semaphore_docs.cpp index 09adda9c246f..488771f52872 100644 --- a/examples/quickstart/counting_semaphore_docs.cpp +++ b/examples/quickstart/counting_semaphore_docs.cpp @@ -7,9 +7,9 @@ // This example is meant for inclusion in the documentation. //[counting_semaphore_docs -#include -#include -#include +#include +#include +#include #include diff --git a/examples/quickstart/customize_async.cpp b/examples/quickstart/customize_async.cpp index 0346de7d4c54..1b466e0ea36a 100644 --- a/examples/quickstart/customize_async.cpp +++ b/examples/quickstart/customize_async.cpp @@ -9,9 +9,9 @@ // processing unit) for a thread which is created by calling hpx::post() or // hpx::async(). -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/enumerate_threads.cpp b/examples/quickstart/enumerate_threads.cpp index 01c1ea74e856..51cc39bf12a8 100644 --- a/examples/quickstart/enumerate_threads.cpp +++ b/examples/quickstart/enumerate_threads.cpp @@ -6,9 +6,9 @@ //[threads_docs -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/event_synchronization.cpp b/examples/quickstart/event_synchronization.cpp index 5147e44b3d40..c610fee9d060 100644 --- a/examples/quickstart/event_synchronization.cpp +++ b/examples/quickstart/event_synchronization.cpp @@ -7,8 +7,8 @@ //////////////////////////////////////////////////////////////////////////////// #include -#include -#include +#include +#include #include #include diff --git a/examples/quickstart/fibonacci_await.cpp b/examples/quickstart/fibonacci_await.cpp index 90eb0a7f1d3d..c6d5fe42883e 100644 --- a/examples/quickstart/fibonacci_await.cpp +++ b/examples/quickstart/fibonacci_await.cpp @@ -9,10 +9,10 @@ // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3564.pdf). The // necessary transformations are performed by hand. -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/quickstart/fibonacci_dataflow.cpp b/examples/quickstart/fibonacci_dataflow.cpp index ef4cdbefb861..cdd63e0c37a8 100644 --- a/examples/quickstart/fibonacci_dataflow.cpp +++ b/examples/quickstart/fibonacci_dataflow.cpp @@ -10,10 +10,10 @@ // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3564.pdf). The // necessary transformations are performed by hand. -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/quickstart/fibonacci_futures.cpp b/examples/quickstart/fibonacci_futures.cpp index b70288b3df07..9897948b532e 100644 --- a/examples/quickstart/fibonacci_futures.cpp +++ b/examples/quickstart/fibonacci_futures.cpp @@ -7,10 +7,10 @@ // This is a purely local version demonstrating different versions of making // the calculation of a fibonacci asynchronous. -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/quickstart/fibonacci_local.cpp b/examples/quickstart/fibonacci_local.cpp index f1beb42307f9..910a6f5285ab 100644 --- a/examples/quickstart/fibonacci_local.cpp +++ b/examples/quickstart/fibonacci_local.cpp @@ -11,10 +11,10 @@ // fibonacci_futures.cpp. This example is mainly intended to demonstrate async, // futures and get for the documentation. -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/quickstart/file_serialization.cpp b/examples/quickstart/file_serialization.cpp index 47db3b5303dc..1f9437e43d12 100644 --- a/examples/quickstart/file_serialization.cpp +++ b/examples/quickstart/file_serialization.cpp @@ -7,7 +7,7 @@ // This example demonstrates how the HPX serialization archives could be used // to directly store/load to/from a file. -#include +#include #include #include diff --git a/examples/quickstart/for_each_docs.cpp b/examples/quickstart/for_each_docs.cpp index 9e1c76512704..78f06b388fb9 100644 --- a/examples/quickstart/for_each_docs.cpp +++ b/examples/quickstart/for_each_docs.cpp @@ -7,9 +7,9 @@ // This example is meant for inclusion in the documentation. //[for_each_docs -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/hello_world_2.cpp b/examples/quickstart/hello_world_2.cpp index d919db9b1390..a13bac6dfb35 100644 --- a/examples/quickstart/hello_world_2.cpp +++ b/examples/quickstart/hello_world_2.cpp @@ -12,7 +12,7 @@ #include #include -int hpx_main(int, char**) +int hpx_main(int, char*[]) { // Say hello to the world! hpx::cout << "Hello World!\n" << std::flush; diff --git a/examples/quickstart/hello_world_3.cpp b/examples/quickstart/hello_world_3.cpp index 76afe9b7337f..eaf71c68bd34 100644 --- a/examples/quickstart/hello_world_3.cpp +++ b/examples/quickstart/hello_world_3.cpp @@ -9,11 +9,11 @@ // explicitly and execute a HPX-thread printing "Hello World!" once. That's all. //[hello_world_3_getting_started -#include +#include #include -int hpx_main(int, char**) +int hpx_main(int, char*[]) { // Say hello to the world! std::cout << "Hello World!\n" << std::flush; diff --git a/examples/quickstart/init_globally.cpp b/examples/quickstart/init_globally.cpp index 3c42d6159af1..75d941b581e7 100644 --- a/examples/quickstart/init_globally.cpp +++ b/examples/quickstart/init_globally.cpp @@ -17,13 +17,12 @@ // This scheme is generally useful if HPX should be initialized from a shared // library and the main executable might not even be aware of this. +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/interval_timer.cpp b/examples/quickstart/interval_timer.cpp index 6030f1fdb249..40504c31b948 100644 --- a/examples/quickstart/interval_timer.cpp +++ b/examples/quickstart/interval_timer.cpp @@ -8,9 +8,9 @@ // make_ready_future_after to orchestrate timed operations with 'normal' // asynchronous work. -#include -#include +#include #include +#include #include #include diff --git a/examples/quickstart/latch_local.cpp b/examples/quickstart/latch_local.cpp index ba0a40617949..8ee34046da9c 100644 --- a/examples/quickstart/latch_local.cpp +++ b/examples/quickstart/latch_local.cpp @@ -6,9 +6,9 @@ // Demonstrate the use of hpx::latch -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/local_channel.cpp b/examples/quickstart/local_channel.cpp index b3bf87707155..2e18a6241ed7 100644 --- a/examples/quickstart/local_channel.cpp +++ b/examples/quickstart/local_channel.cpp @@ -7,9 +7,9 @@ // This example demonstrates the use of a channel which is very similar to the // equally named feature in the Go language. -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/local_channel_docs.cpp b/examples/quickstart/local_channel_docs.cpp index 39cd8ef358df..76f5ee7af6eb 100644 --- a/examples/quickstart/local_channel_docs.cpp +++ b/examples/quickstart/local_channel_docs.cpp @@ -7,8 +7,8 @@ // This example is meant for inclusion in the documentation. #include -#include -#include +#include +#include #include #include diff --git a/examples/quickstart/matrix_multiplication.cpp b/examples/quickstart/matrix_multiplication.cpp index 5ff70e6fd734..3453286d1788 100644 --- a/examples/quickstart/matrix_multiplication.cpp +++ b/examples/quickstart/matrix_multiplication.cpp @@ -8,9 +8,9 @@ // Parallel implementation of matrix multiplication -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/mutex_docs.cpp b/examples/quickstart/mutex_docs.cpp index 34e6d315b71f..e3ff72bf3ed9 100644 --- a/examples/quickstart/mutex_docs.cpp +++ b/examples/quickstart/mutex_docs.cpp @@ -7,9 +7,9 @@ // This example is meant for inclusion in the documentation. //[mutex_docs -#include -#include -#include +#include +#include +#include #include diff --git a/examples/quickstart/pipeline1.cpp b/examples/quickstart/pipeline1.cpp index 2e7ec1f578af..84ad47d260c5 100644 --- a/examples/quickstart/pipeline1.cpp +++ b/examples/quickstart/pipeline1.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/examples/quickstart/potpourri.cpp b/examples/quickstart/potpourri.cpp index de178e7073e4..325c1fb7a6d4 100644 --- a/examples/quickstart/potpourri.cpp +++ b/examples/quickstart/potpourri.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/safe_object.cpp b/examples/quickstart/safe_object.cpp index e7d4a7994448..6f7dba27e2d1 100644 --- a/examples/quickstart/safe_object.cpp +++ b/examples/quickstart/safe_object.cpp @@ -4,11 +4,11 @@ // 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) +#include #include -#include -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/shared_mutex.cpp b/examples/quickstart/shared_mutex.cpp index 55cb9f4d51dd..86125e40156d 100644 --- a/examples/quickstart/shared_mutex.cpp +++ b/examples/quickstart/shared_mutex.cpp @@ -7,10 +7,10 @@ // This example was released to the public domain by Stephan T. Lavavej // (see: https://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-40-Updated-STL-in-VS-2015-feat-STL) -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/quickstart/simple_future_continuation.cpp b/examples/quickstart/simple_future_continuation.cpp index ccbab0a4db0f..2926b5f22e7c 100644 --- a/examples/quickstart/simple_future_continuation.cpp +++ b/examples/quickstart/simple_future_continuation.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/examples/quickstart/sort_by_key_demo.cpp b/examples/quickstart/sort_by_key_demo.cpp index 3098cc0f4ef2..ac8c747be7cb 100644 --- a/examples/quickstart/sort_by_key_demo.cpp +++ b/examples/quickstart/sort_by_key_demo.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/examples/quickstart/task_group_docs.cpp b/examples/quickstart/task_group_docs.cpp index aca5357ff301..28526bd01b47 100644 --- a/examples/quickstart/task_group_docs.cpp +++ b/examples/quickstart/task_group_docs.cpp @@ -8,8 +8,9 @@ //[task_group_docs -#include -#include +#include +#include + #include void task1() diff --git a/examples/quickstart/timed_futures.cpp b/examples/quickstart/timed_futures.cpp index a55ab694f4ad..f754ed7cf4cc 100644 --- a/examples/quickstart/timed_futures.cpp +++ b/examples/quickstart/timed_futures.cpp @@ -8,9 +8,9 @@ // make_ready_future_after to orchestrate timed operations with 'normal' // asynchronous work. -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/timed_wake.cpp b/examples/quickstart/timed_wake.cpp index 2ddc0d9bd2ee..3f4bbfc18d69 100644 --- a/examples/quickstart/timed_wake.cpp +++ b/examples/quickstart/timed_wake.cpp @@ -5,9 +5,9 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/examples/quickstart/use_main_thread.cpp b/examples/quickstart/use_main_thread.cpp index 58a62fc8eea3..8a8cfa40bb2e 100644 --- a/examples/quickstart/use_main_thread.cpp +++ b/examples/quickstart/use_main_thread.cpp @@ -7,7 +7,7 @@ // The purpose of this demo is to show how it is possible to start HPX without // blocking the main thread. -#include +#include #include diff --git a/examples/quickstart/vector_counting_dotproduct.cpp b/examples/quickstart/vector_counting_dotproduct.cpp index a7c6c761a95b..b854cdbabfaf 100644 --- a/examples/quickstart/vector_counting_dotproduct.cpp +++ b/examples/quickstart/vector_counting_dotproduct.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/examples/quickstart/vector_zip_dotproduct.cpp b/examples/quickstart/vector_zip_dotproduct.cpp index 334425ec2b0f..5cfc7ffb827a 100644 --- a/examples/quickstart/vector_zip_dotproduct.cpp +++ b/examples/quickstart/vector_zip_dotproduct.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include -#include -#include +#include +#include #include +#include +#include #include #include diff --git a/examples/quickstart/wait_composition.cpp b/examples/quickstart/wait_composition.cpp index c1db2de20b66..30cd6e1e487f 100644 --- a/examples/quickstart/wait_composition.cpp +++ b/examples/quickstart/wait_composition.cpp @@ -6,9 +6,9 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include #include diff --git a/examples/transpose/transpose_serial.cpp b/examples/transpose/transpose_serial.cpp index a1927b20f559..7beab1125e5c 100644 --- a/examples/transpose/transpose_serial.cpp +++ b/examples/transpose/transpose_serial.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/examples/transpose/transpose_serial_block.cpp b/examples/transpose/transpose_serial_block.cpp index e8ee6614b116..220e6db0920e 100644 --- a/examples/transpose/transpose_serial_block.cpp +++ b/examples/transpose/transpose_serial_block.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/examples/transpose/transpose_serial_vector.cpp b/examples/transpose/transpose_serial_vector.cpp index 4fd1c1540455..40d0d0559468 100644 --- a/examples/transpose/transpose_serial_vector.cpp +++ b/examples/transpose/transpose_serial_vector.cpp @@ -8,9 +8,9 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) +#include #include #include -#include #include #include diff --git a/examples/transpose/transpose_smp.cpp b/examples/transpose/transpose_smp.cpp index d92afeb4200e..d2ee25167451 100644 --- a/examples/transpose/transpose_smp.cpp +++ b/examples/transpose/transpose_smp.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/examples/transpose/transpose_smp_block.cpp b/examples/transpose/transpose_smp_block.cpp index 05f8016af145..eb5258620cd0 100644 --- a/examples/transpose/transpose_smp_block.cpp +++ b/examples/transpose/transpose_smp_block.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/init/CMakeLists.txt b/init/CMakeLists.txt index 159b6c356c1b..a7d08a65e0eb 100644 --- a/init/CMakeLists.txt +++ b/init/CMakeLists.txt @@ -18,6 +18,7 @@ set(hpx_init_SOURCES list( APPEND hpx_init_SOURCES + hpx_init.cpp hpx_main.cpp hpx_main_argc_argv.cpp hpx_main_variables_map.cpp diff --git a/init/src/hpx_init.cpp b/init/src/hpx_init.cpp new file mode 100644 index 000000000000..9f66e5004e19 --- /dev/null +++ b/init/src/hpx_init.cpp @@ -0,0 +1,26 @@ +// Copyright (c) 2023 Hartmut Kaiser +// +// 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) + +#include +#include + +#include + +/////////////////////////////////////////////////////////////////////////////// +int hpx_main(hpx::program_options::variables_map& vm); + +/////////////////////////////////////////////////////////////////////////////// +namespace hpx_startup { + + std::function const& + get_main_func() + { + static std::function main_f( + static_cast(::hpx_main)); + + return main_f; + } +} // namespace hpx_startup diff --git a/init/src/hpx_main.cpp b/init/src/hpx_main.cpp index 4eef547c3189..2fa3e540ebd5 100644 --- a/init/src/hpx_main.cpp +++ b/init/src/hpx_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2012 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -15,12 +15,16 @@ #include /////////////////////////////////////////////////////////////////////////////// +int hpx_main(int argc, char* argv[]); + +////////////////////////////////////////////////////////////////////////////// // Forwarding of hpx_main, if necessary. This has to be in a separate // translation unit to ensure the linker can pick or ignore this function, // depending on whether the main executable defines this symbol or not. HPX_WEAK_SYMBOL int hpx_main() { - std::string cmdline(hpx::get_config_entry("hpx.reconstructed_cmd_line", "")); + std::string cmdline( + hpx::get_config_entry("hpx.reconstructed_cmd_line", "")); using namespace hpx::program_options; #if defined(HPX_WINDOWS) @@ -29,30 +33,30 @@ HPX_WEAK_SYMBOL int hpx_main() std::vector args = split_unix(cmdline); #endif - constexpr char const hpx_prefix[] = "--hpx:"; - constexpr char const hpx_prefix_len = - (sizeof(hpx_prefix) / sizeof(hpx_prefix[0])) - 1; + constexpr char hpx_prefix[] = "--hpx:"; + constexpr std::size_t hpx_prefix_len = std::size(hpx_prefix) - 1; - constexpr char const hpx_positional[] = "positional"; - constexpr char const hpx_positional_len = - (sizeof(hpx_positional) / sizeof(hpx_positional[0])) - 1; + constexpr char hpx_positional[] = "positional"; + constexpr std::size_t hpx_positional_len = std::size(hpx_positional) - 1; // Copy all arguments which are not hpx related to a temporary array - std::vector argv(args.size()+1); + std::vector argv(args.size() + 1); std::size_t argcount = 0; - for (auto& arg : args) + for (auto& argument : args) { - if (0 != arg.compare(0, hpx_prefix_len, hpx_prefix)) + if (0 != argument.compare(0, hpx_prefix_len, hpx_prefix)) { - argv[argcount++] = const_cast(arg.data()); + argv[argcount++] = const_cast(argument.data()); } else if (0 == - arg.compare(hpx_prefix_len, hpx_positional_len, hpx_positional)) + argument.compare( + hpx_prefix_len, hpx_positional_len, hpx_positional)) { - std::string::size_type p = arg.find_first_of("="); - if (p != std::string::npos) { - arg = arg.substr(p+1); - argv[argcount++] = const_cast(arg.data()); + std::string::size_type const p = argument.find_first_of('='); + if (p != std::string::npos) + { + argument = argument.substr(p + 1); + argv[argcount++] = const_cast(argument.data()); } } } diff --git a/init/src/hpx_main_argc_argv.cpp b/init/src/hpx_main_argc_argv.cpp index 7308109a4d30..c8ea4a421f37 100644 --- a/init/src/hpx_main_argc_argv.cpp +++ b/init/src/hpx_main_argc_argv.cpp @@ -11,10 +11,10 @@ // Forwarding of hpx_main, if necessary. This has to be in a separate // translation unit to ensure the linker can pick or ignore this function, // depending on whether the main executable defines this symbol or not. -int hpx_main(int argc, char** argv) +int hpx_main(int argc, char* argv[]) { // Invoke hpx_startup::user_main - int result = hpx_startup::user_main(argc, argv); + int const result = hpx_startup::user_main(argc, argv); hpx::finalize(); return result; } diff --git a/init/src/hpx_main_variables_map.cpp b/init/src/hpx_main_variables_map.cpp index a74edc25b09e..b950ae11389d 100644 --- a/init/src/hpx_main_variables_map.cpp +++ b/init/src/hpx_main_variables_map.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2012 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -8,6 +8,9 @@ #include +/////////////////////////////////////////////////////////////////////////////// +int hpx_main(); + /////////////////////////////////////////////////////////////////////////////// // Forwarding of hpx_main, if necessary. This has to be in a separate // translation unit to ensure the linker can pick or ignore this function, diff --git a/libs/core/affinity/tests/unit/parse_affinity_options.cpp b/libs/core/affinity/tests/unit/parse_affinity_options.cpp index 1d2186707579..3265afe00482 100644 --- a/libs/core/affinity/tests/unit/parse_affinity_options.cpp +++ b/libs/core/affinity/tests/unit/parse_affinity_options.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include +#include #include +#include #include #include diff --git a/libs/core/algorithms/include/hpx/parallel/container_numeric.hpp b/libs/core/algorithms/include/hpx/parallel/container_numeric.hpp index d224525a30da..5257d8a445af 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_numeric.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_numeric.hpp @@ -13,4 +13,5 @@ #include #include #include +#include #include diff --git a/libs/core/algorithms/include/hpx/parallel/unseq/reduce_helpers.hpp b/libs/core/algorithms/include/hpx/parallel/unseq/reduce_helpers.hpp index c1a4707a8b5b..4f89171ee642 100644 --- a/libs/core/algorithms/include/hpx/parallel/unseq/reduce_helpers.hpp +++ b/libs/core/algorithms/include/hpx/parallel/unseq/reduce_helpers.hpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -406,7 +407,8 @@ namespace hpx::parallel::util::detail { reduce(Iter1 it1, Iter2 it2, std::size_t count, T init, Reduce r, Convert conv) { - constexpr std::size_t block_size = HPX_LANE_SIZE / (sizeof(T) * 8); + constexpr std::size_t block_size = (std::max)( + HPX_LANE_SIZE / (sizeof(T) * 8), static_cast(1)); // To small, just run sequential if (count <= 2 * block_size) diff --git a/libs/core/algorithms/tests/performance/benchmark_inplace_merge.cpp b/libs/core/algorithms/tests/performance/benchmark_inplace_merge.cpp index 8dc4be7631ba..9fbdcc93b27a 100644 --- a/libs/core/algorithms/tests/performance/benchmark_inplace_merge.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_inplace_merge.cpp @@ -6,15 +6,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_is_heap.cpp b/libs/core/algorithms/tests/performance/benchmark_is_heap.cpp index d77f15c42a35..8083e506637d 100644 --- a/libs/core/algorithms/tests/performance/benchmark_is_heap.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_is_heap.cpp @@ -6,13 +6,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_is_heap_until.cpp b/libs/core/algorithms/tests/performance/benchmark_is_heap_until.cpp index 217abdd29414..be347a6d384e 100644 --- a/libs/core/algorithms/tests/performance/benchmark_is_heap_until.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_is_heap_until.cpp @@ -6,13 +6,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_merge.cpp b/libs/core/algorithms/tests/performance/benchmark_merge.cpp index 9318669ee64c..af8b609f921b 100644 --- a/libs/core/algorithms/tests/performance/benchmark_merge.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_merge.cpp @@ -6,14 +6,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_nth_element.cpp b/libs/core/algorithms/tests/performance/benchmark_nth_element.cpp index 9e9923bc7602..08388a0f5a8a 100644 --- a/libs/core/algorithms/tests/performance/benchmark_nth_element.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_nth_element.cpp @@ -8,15 +8,15 @@ // 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) //----------------------------------------------------------------------------- +#include #include -#include -#include +#include #include -#include -#include +#include -#include #include +#include +#include #include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_nth_element_parallel.cpp b/libs/core/algorithms/tests/performance/benchmark_nth_element_parallel.cpp index 8a08807f29f2..37279a760188 100644 --- a/libs/core/algorithms/tests/performance/benchmark_nth_element_parallel.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_nth_element_parallel.cpp @@ -8,15 +8,15 @@ // 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) //----------------------------------------------------------------------------- +#include #include -#include -#include +#include #include -#include -#include +#include -#include #include +#include +#include #include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_partial_sort.cpp b/libs/core/algorithms/tests/performance/benchmark_partial_sort.cpp index d613cae0f94b..6556dadeb8cf 100644 --- a/libs/core/algorithms/tests/performance/benchmark_partial_sort.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_partial_sort.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_partial_sort_parallel.cpp b/libs/core/algorithms/tests/performance/benchmark_partial_sort_parallel.cpp index fb8a1bbfed1e..78c2e5ff8553 100644 --- a/libs/core/algorithms/tests/performance/benchmark_partial_sort_parallel.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_partial_sort_parallel.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_partition.cpp b/libs/core/algorithms/tests/performance/benchmark_partition.cpp index bec05ae5c8f5..b471e315c84a 100644 --- a/libs/core/algorithms/tests/performance/benchmark_partition.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_partition.cpp @@ -6,14 +6,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_partition_copy.cpp b/libs/core/algorithms/tests/performance/benchmark_partition_copy.cpp index bc55a3cf51d8..0dfe31c3e926 100644 --- a/libs/core/algorithms/tests/performance/benchmark_partition_copy.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_partition_copy.cpp @@ -6,13 +6,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_remove.cpp b/libs/core/algorithms/tests/performance/benchmark_remove.cpp index 07f56db005f6..2b9479c7a5e7 100644 --- a/libs/core/algorithms/tests/performance/benchmark_remove.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_remove.cpp @@ -6,14 +6,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_remove_if.cpp b/libs/core/algorithms/tests/performance/benchmark_remove_if.cpp index d2f662676305..6ea46a9f5a32 100644 --- a/libs/core/algorithms/tests/performance/benchmark_remove_if.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_remove_if.cpp @@ -6,14 +6,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_scan_algorithms.cpp b/libs/core/algorithms/tests/performance/benchmark_scan_algorithms.cpp index efd6578fc477..21a94efc1651 100644 --- a/libs/core/algorithms/tests/performance/benchmark_scan_algorithms.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_scan_algorithms.cpp @@ -4,15 +4,11 @@ // 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) -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_unique.cpp b/libs/core/algorithms/tests/performance/benchmark_unique.cpp index b1c81059bd39..8b469a17a139 100644 --- a/libs/core/algorithms/tests/performance/benchmark_unique.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_unique.cpp @@ -6,14 +6,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/benchmark_unique_copy.cpp b/libs/core/algorithms/tests/performance/benchmark_unique_copy.cpp index f6c71a71887c..20efa151e4a2 100644 --- a/libs/core/algorithms/tests/performance/benchmark_unique_copy.cpp +++ b/libs/core/algorithms/tests/performance/benchmark_unique_copy.cpp @@ -6,13 +6,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/performance/foreach_report.cpp b/libs/core/algorithms/tests/performance/foreach_report.cpp index 24c07a0c42ad..9d91491271ec 100644 --- a/libs/core/algorithms/tests/performance/foreach_report.cpp +++ b/libs/core/algorithms/tests/performance/foreach_report.cpp @@ -9,11 +9,11 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include "foreach_scaling_helpers.hpp" diff --git a/libs/core/algorithms/tests/performance/foreach_scaling.cpp b/libs/core/algorithms/tests/performance/foreach_scaling.cpp index dff47968af19..1a98161d0ada 100644 --- a/libs/core/algorithms/tests/performance/foreach_scaling.cpp +++ b/libs/core/algorithms/tests/performance/foreach_scaling.cpp @@ -8,10 +8,10 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include -#include -#include +#include +#include +#include +#include #include "foreach_scaling_helpers.hpp" diff --git a/libs/core/algorithms/tests/performance/foreach_scaling_helpers.hpp b/libs/core/algorithms/tests/performance/foreach_scaling_helpers.hpp index 02bd18949327..6c218c333fa3 100644 --- a/libs/core/algorithms/tests/performance/foreach_scaling_helpers.hpp +++ b/libs/core/algorithms/tests/performance/foreach_scaling_helpers.hpp @@ -10,10 +10,10 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include -#include -#include +#include +#include +#include +#include #include "worker_timed.hpp" @@ -66,12 +66,12 @@ struct disable_stealing_parameter } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_executor_parameters : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// void measure_plain_for(std::vector const& data_representation) diff --git a/libs/core/algorithms/tests/performance/transform_reduce_scaling.cpp b/libs/core/algorithms/tests/performance/transform_reduce_scaling.cpp index f60823764b58..734aed1ffc95 100644 --- a/libs/core/algorithms/tests/performance/transform_reduce_scaling.cpp +++ b/libs/core/algorithms/tests/performance/transform_reduce_scaling.cpp @@ -5,9 +5,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include "worker_timed.hpp" diff --git a/libs/core/algorithms/tests/regressions/count_3646.cpp b/libs/core/algorithms/tests/regressions/count_3646.cpp index 1282591f928d..53871c8a59bb 100644 --- a/libs/core/algorithms/tests/regressions/count_3646.cpp +++ b/libs/core/algorithms/tests/regressions/count_3646.cpp @@ -6,10 +6,10 @@ // #3646: Parallel algorithms should accept iterator/sentinel pairs +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/regressions/fill_executor_5016.cpp b/libs/core/algorithms/tests/regressions/fill_executor_5016.cpp index bc77c02b46e8..a4c92314939b 100644 --- a/libs/core/algorithms/tests/regressions/fill_executor_5016.cpp +++ b/libs/core/algorithms/tests/regressions/fill_executor_5016.cpp @@ -9,10 +9,10 @@ // suppress deprecation warnings for algorithms #define HPX_HAVE_DEPRECATION_WARNINGS_V1_6 0 -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/regressions/for_each_annotated_function.cpp b/libs/core/algorithms/tests/regressions/for_each_annotated_function.cpp index 7cc1201724c5..564d3c0b8635 100644 --- a/libs/core/algorithms/tests/regressions/for_each_annotated_function.cpp +++ b/libs/core/algorithms/tests/regressions/for_each_annotated_function.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/regressions/for_each_datapar.cpp b/libs/core/algorithms/tests/regressions/for_each_datapar.cpp index 0b3262bc7560..88b0c51564f0 100644 --- a/libs/core/algorithms/tests/regressions/for_each_datapar.cpp +++ b/libs/core/algorithms/tests/regressions/for_each_datapar.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/regressions/for_loop_2281.cpp b/libs/core/algorithms/tests/regressions/for_loop_2281.cpp index 9ab21efe8cda..d52ae4dcab7a 100644 --- a/libs/core/algorithms/tests/regressions/for_loop_2281.cpp +++ b/libs/core/algorithms/tests/regressions/for_loop_2281.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/regressions/for_loop_5735.cpp b/libs/core/algorithms/tests/regressions/for_loop_5735.cpp index a2b7f30e0192..0bf4da2d3c62 100644 --- a/libs/core/algorithms/tests/regressions/for_loop_5735.cpp +++ b/libs/core/algorithms/tests/regressions/for_loop_5735.cpp @@ -6,9 +6,9 @@ // fixes #5735: hpx::for_loop executes without checking start and end bounds -#include -#include -#include +#include +#include +#include #include diff --git a/libs/core/algorithms/tests/regressions/for_loop_with_auto_chunk_size.cpp b/libs/core/algorithms/tests/regressions/for_loop_with_auto_chunk_size.cpp index ea3daadabf42..8ba9b380fc9f 100644 --- a/libs/core/algorithms/tests/regressions/for_loop_with_auto_chunk_size.cpp +++ b/libs/core/algorithms/tests/regressions/for_loop_with_auto_chunk_size.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include diff --git a/libs/core/algorithms/tests/regressions/minimal_findend.cpp b/libs/core/algorithms/tests/regressions/minimal_findend.cpp index 54d158cdda6a..2512610611cb 100644 --- a/libs/core/algorithms/tests/regressions/minimal_findend.cpp +++ b/libs/core/algorithms/tests/regressions/minimal_findend.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/regressions/reduce_3641.cpp b/libs/core/algorithms/tests/regressions/reduce_3641.cpp index 97b77502f2fe..bae24964b7e5 100644 --- a/libs/core/algorithms/tests/regressions/reduce_3641.cpp +++ b/libs/core/algorithms/tests/regressions/reduce_3641.cpp @@ -8,10 +8,10 @@ // #3641: Trouble with using ranges-v3 and hpx::parallel::reduce // #3646: Parallel algorithms should accept iterator/sentinel pairs +#include +#include #include -#include #include -#include #include diff --git a/libs/core/algorithms/tests/regressions/scan_different_inits.cpp b/libs/core/algorithms/tests/regressions/scan_different_inits.cpp index 94ab7646e276..47b5a949361d 100644 --- a/libs/core/algorithms/tests/regressions/scan_different_inits.cpp +++ b/libs/core/algorithms/tests/regressions/scan_different_inits.cpp @@ -4,12 +4,10 @@ // 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) -#include +#include +#include #include -#include -#include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/regressions/scan_non_commutative.cpp b/libs/core/algorithms/tests/regressions/scan_non_commutative.cpp index 2fc5d07285cc..2b5227162241 100644 --- a/libs/core/algorithms/tests/regressions/scan_non_commutative.cpp +++ b/libs/core/algorithms/tests/regressions/scan_non_commutative.cpp @@ -5,10 +5,10 @@ // 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) -#include +#include +#include #include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/regressions/scan_shortlength.cpp b/libs/core/algorithms/tests/regressions/scan_shortlength.cpp index f57960f78949..30e90eceba64 100644 --- a/libs/core/algorithms/tests/regressions/scan_shortlength.cpp +++ b/libs/core/algorithms/tests/regressions/scan_shortlength.cpp @@ -4,10 +4,10 @@ // 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) -#include +#include +#include #include -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/regressions/search_zerolength.cpp b/libs/core/algorithms/tests/regressions/search_zerolength.cpp index 6111a21195b4..979813b07b3f 100644 --- a/libs/core/algorithms/tests/regressions/search_zerolength.cpp +++ b/libs/core/algorithms/tests/regressions/search_zerolength.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp index a579d55679d9..67e86f9b43c5 100644 --- a/libs/core/algorithms/tests/regressions/set_operations_3442.cpp +++ b/libs/core/algorithms/tests/regressions/set_operations_3442.cpp @@ -4,10 +4,9 @@ // 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) -#include +#include +#include #include -#include -#include #include #include diff --git a/libs/core/algorithms/tests/regressions/stable_merge_2964.cpp b/libs/core/algorithms/tests/regressions/stable_merge_2964.cpp index 853f10c96ce3..50c3331876f7 100644 --- a/libs/core/algorithms/tests/regressions/stable_merge_2964.cpp +++ b/libs/core/algorithms/tests/regressions/stable_merge_2964.cpp @@ -5,9 +5,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/regressions/static_chunker_2282.cpp b/libs/core/algorithms/tests/regressions/static_chunker_2282.cpp index efa7e4100dcc..772d026db97b 100644 --- a/libs/core/algorithms/tests/regressions/static_chunker_2282.cpp +++ b/libs/core/algorithms/tests/regressions/static_chunker_2282.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include int main() { diff --git a/libs/core/algorithms/tests/regressions/transform_inclusive_scan_4786.cpp b/libs/core/algorithms/tests/regressions/transform_inclusive_scan_4786.cpp index d771a137b6ce..c5735e84f2ae 100644 --- a/libs/core/algorithms/tests/regressions/transform_inclusive_scan_4786.cpp +++ b/libs/core/algorithms/tests/regressions/transform_inclusive_scan_4786.cpp @@ -7,9 +7,10 @@ // see #4786: transform_inclusive_scan tries to implicitly convert between // types, instead of using the provided `conv` function -#include +#include +#include #include -#include +#include #include diff --git a/libs/core/algorithms/tests/regressions/transform_inclusive_scan_4787.cpp b/libs/core/algorithms/tests/regressions/transform_inclusive_scan_4787.cpp index 41ba7ee6b546..78b3bf392f95 100644 --- a/libs/core/algorithms/tests/regressions/transform_inclusive_scan_4787.cpp +++ b/libs/core/algorithms/tests/regressions/transform_inclusive_scan_4787.cpp @@ -7,9 +7,10 @@ // see #4787: `transform_inclusive_scan` gives incorrect results for // non-commutative operator -#include +#include +#include #include -#include +#include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentdifference.cpp b/libs/core/algorithms/tests/unit/algorithms/adjacentdifference.cpp index 4767e59e0f6a..ba9768b7c8e3 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentdifference.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentdifference.cpp @@ -6,8 +6,9 @@ // 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) -#include -#include +#include +#include + #include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_bad_alloc.cpp b/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_bad_alloc.cpp index a9b48effdf3e..69b75cd53abf 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_bad_alloc.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_bad_alloc.cpp @@ -4,10 +4,9 @@ // 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) -#include -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_exception.cpp b/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_exception.cpp index a6bfc40b5d7f..b1867ee99284 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_exception.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_exception.cpp @@ -4,10 +4,9 @@ // 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) -#include -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_sender.cpp b/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_sender.cpp index c89f03cffea1..f884e64a0df7 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_sender.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_sender.cpp @@ -7,7 +7,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_tests.hpp index af1cea2e2085..d6469ec8d497 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentdifference_tests.hpp @@ -7,10 +7,9 @@ #pragma once -#include -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentfind.cpp b/libs/core/algorithms/tests/unit/algorithms/adjacentfind.cpp index 2b0fc1427b03..5c542f213d3c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentfind.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentfind.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_bad_alloc.cpp b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_bad_alloc.cpp index 34bcae822954..d11f62d3145b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_bad_alloc.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_bad_alloc.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary.cpp b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary.cpp index 4e72adf97811..c957d07c370d 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_bad_alloc.cpp b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_bad_alloc.cpp index 40627f18393c..fe02f49c94ca 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_bad_alloc.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_bad_alloc.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_exception.cpp b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_exception.cpp index 5bbd8db54c3e..a56138e914be 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_exception.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_exception.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_tests.hpp index ae54258a3424..5c57e0e62754 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_binary_tests.hpp @@ -6,9 +6,9 @@ #pragma once -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_exception.cpp b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_exception.cpp index 1b905e685668..f436f8b3443c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_exception.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_exception.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_tests.hpp index d4f870967c3a..ff5f6fd11b21 100644 --- a/libs/core/algorithms/tests/unit/algorithms/adjacentfind_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/adjacentfind_tests.hpp @@ -6,9 +6,9 @@ #pragma once -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/all_of.cpp b/libs/core/algorithms/tests/unit/algorithms/all_of.cpp index 20e5ae39f2c5..eb4f2b8b2042 100644 --- a/libs/core/algorithms/tests/unit/algorithms/all_of.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/all_of.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/any_of.cpp b/libs/core/algorithms/tests/unit/algorithms/any_of.cpp index d07006a48f0b..87cf477b5cb0 100644 --- a/libs/core/algorithms/tests/unit/algorithms/any_of.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/any_of.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/any_of_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/any_of_tests.hpp index 436d4ce0693f..25308ce6be04 100644 --- a/libs/core/algorithms/tests/unit/algorithms/any_of_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/any_of_tests.hpp @@ -6,10 +6,9 @@ #pragma once -#include +#include +#include #include -#include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/copy.cpp b/libs/core/algorithms/tests/unit/algorithms/copy.cpp index 4c364d9aee48..793f0162d53c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/copy.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/copy.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/copyif_bad_alloc.cpp b/libs/core/algorithms/tests/unit/algorithms/copyif_bad_alloc.cpp index d803e940ed4c..ee0f3677dedb 100644 --- a/libs/core/algorithms/tests/unit/algorithms/copyif_bad_alloc.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/copyif_bad_alloc.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/copyif_exception.cpp b/libs/core/algorithms/tests/unit/algorithms/copyif_exception.cpp index 1f2f6feeb62e..6156e31b9d2f 100644 --- a/libs/core/algorithms/tests/unit/algorithms/copyif_exception.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/copyif_exception.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/copyif_forward.cpp b/libs/core/algorithms/tests/unit/algorithms/copyif_forward.cpp index 80d37167c60e..1729a53eb29b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/copyif_forward.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/copyif_forward.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/copyif_random.cpp b/libs/core/algorithms/tests/unit/algorithms/copyif_random.cpp index 33b65577c7d2..9d82f35bd7b9 100644 --- a/libs/core/algorithms/tests/unit/algorithms/copyif_random.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/copyif_random.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/copyn.cpp b/libs/core/algorithms/tests/unit/algorithms/copyn.cpp index cdb857d2e461..36f1d1d852ca 100644 --- a/libs/core/algorithms/tests/unit/algorithms/copyn.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/copyn.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/copyn_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/copyn_tests.hpp index 70800b3aa0af..cf00cbe47e43 100644 --- a/libs/core/algorithms/tests/unit/algorithms/copyn_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/copyn_tests.hpp @@ -7,9 +7,9 @@ #pragma once -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/count.cpp b/libs/core/algorithms/tests/unit/algorithms/count.cpp index 58a80ebafe4b..439753820b3a 100644 --- a/libs/core/algorithms/tests/unit/algorithms/count.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/count.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/countif.cpp b/libs/core/algorithms/tests/unit/algorithms/countif.cpp index e50faa357fc8..34f4b700112c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/countif.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/countif.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/destroy.cpp b/libs/core/algorithms/tests/unit/algorithms/destroy.cpp index a6174aee05fb..0643bbe1af80 100644 --- a/libs/core/algorithms/tests/unit/algorithms/destroy.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/destroy.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/destroy_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/destroy_tests.hpp index 242a26445607..984ca68bfb36 100644 --- a/libs/core/algorithms/tests/unit/algorithms/destroy_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/destroy_tests.hpp @@ -6,9 +6,10 @@ #pragma once -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/destroyn.cpp b/libs/core/algorithms/tests/unit/algorithms/destroyn.cpp index 526d946ac194..e4ad12ff63f6 100644 --- a/libs/core/algorithms/tests/unit/algorithms/destroyn.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/destroyn.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/detail/test_insertion_sort.cpp b/libs/core/algorithms/tests/unit/algorithms/detail/test_insertion_sort.cpp index 5e3e4b059f7b..7413399e5635 100644 --- a/libs/core/algorithms/tests/unit/algorithms/detail/test_insertion_sort.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/detail/test_insertion_sort.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/detail/test_parallel_stable_sort.cpp b/libs/core/algorithms/tests/unit/algorithms/detail/test_parallel_stable_sort.cpp index 0f589bfcbccc..213ed291fc1f 100644 --- a/libs/core/algorithms/tests/unit/algorithms/detail/test_parallel_stable_sort.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/detail/test_parallel_stable_sort.cpp @@ -5,11 +5,10 @@ // 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) -#include - -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/detail/test_sample_sort.cpp b/libs/core/algorithms/tests/unit/algorithms/detail/test_sample_sort.cpp index 0dfc27c8ac31..d92bf14c880d 100644 --- a/libs/core/algorithms/tests/unit/algorithms/detail/test_sample_sort.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/detail/test_sample_sort.cpp @@ -5,11 +5,10 @@ // 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) -#include - -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/detail/test_spin_sort.cpp b/libs/core/algorithms/tests/unit/algorithms/detail/test_spin_sort.cpp index 798bc152d468..d33354d1d486 100644 --- a/libs/core/algorithms/tests/unit/algorithms/detail/test_spin_sort.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/detail/test_spin_sort.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/ends_with.cpp b/libs/core/algorithms/tests/unit/algorithms/ends_with.cpp index 51ca3a0d27a6..96251adfe739 100644 --- a/libs/core/algorithms/tests/unit/algorithms/ends_with.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/ends_with.cpp @@ -5,10 +5,9 @@ // 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) -#include +#include +#include #include -#include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/equal.cpp b/libs/core/algorithms/tests/unit/algorithms/equal.cpp index 7cc6ec754980..ca8f7e3b76cf 100644 --- a/libs/core/algorithms/tests/unit/algorithms/equal.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/equal.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/equal_binary.cpp b/libs/core/algorithms/tests/unit/algorithms/equal_binary.cpp index 9b0efa8b67b0..cf2f64421f99 100644 --- a/libs/core/algorithms/tests/unit/algorithms/equal_binary.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/equal_binary.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/exclusive_scan.cpp b/libs/core/algorithms/tests/unit/algorithms/exclusive_scan.cpp index 1731211f1310..1bd2e25a3d68 100644 --- a/libs/core/algorithms/tests/unit/algorithms/exclusive_scan.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/exclusive_scan.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/exclusive_scan2.cpp b/libs/core/algorithms/tests/unit/algorithms/exclusive_scan2.cpp index ef37c3928fb6..9702bd545baf 100644 --- a/libs/core/algorithms/tests/unit/algorithms/exclusive_scan2.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/exclusive_scan2.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_bad_alloc.cpp b/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_bad_alloc.cpp index 339619760d79..9c41a954a2a6 100644 --- a/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_bad_alloc.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_bad_alloc.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_exception.cpp b/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_exception.cpp index 385845690523..52dba2048815 100644 --- a/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_exception.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_exception.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_validate.cpp b/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_validate.cpp index a23e38f540b2..f210780f9ab3 100644 --- a/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_validate.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/exclusive_scan_validate.cpp @@ -4,10 +4,11 @@ // 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) -#include +#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/fill.cpp b/libs/core/algorithms/tests/unit/algorithms/fill.cpp index 72c736c0cbcc..0fd81f82db62 100644 --- a/libs/core/algorithms/tests/unit/algorithms/fill.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/fill.cpp @@ -6,7 +6,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/filln.cpp b/libs/core/algorithms/tests/unit/algorithms/filln.cpp index dab0edbe7969..b44c473be2d8 100644 --- a/libs/core/algorithms/tests/unit/algorithms/filln.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/filln.cpp @@ -6,7 +6,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/find.cpp b/libs/core/algorithms/tests/unit/algorithms/find.cpp index c6561a105eda..dc321f3563b7 100644 --- a/libs/core/algorithms/tests/unit/algorithms/find.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/find.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/find_sender.cpp b/libs/core/algorithms/tests/unit/algorithms/find_sender.cpp index 3b60aa1e2418..3d0edd8cd6ad 100644 --- a/libs/core/algorithms/tests/unit/algorithms/find_sender.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/find_sender.cpp @@ -6,7 +6,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/find_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/find_tests.hpp index c4df47a08916..b4a78427d482 100644 --- a/libs/core/algorithms/tests/unit/algorithms/find_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/find_tests.hpp @@ -8,10 +8,10 @@ #pragma once -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/findend.cpp b/libs/core/algorithms/tests/unit/algorithms/findend.cpp index 8279db6d6fc9..8f7d59044469 100644 --- a/libs/core/algorithms/tests/unit/algorithms/findend.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/findend.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/findfirstof.cpp b/libs/core/algorithms/tests/unit/algorithms/findfirstof.cpp index 0dd11284c8df..1bc0d4ce4d3e 100644 --- a/libs/core/algorithms/tests/unit/algorithms/findfirstof.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/findfirstof.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/findfirstof_binary.cpp b/libs/core/algorithms/tests/unit/algorithms/findfirstof_binary.cpp index 42959384a4b5..dc119b7d3d09 100644 --- a/libs/core/algorithms/tests/unit/algorithms/findfirstof_binary.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/findfirstof_binary.cpp @@ -4,10 +4,9 @@ // 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) -#include +#include +#include #include -#include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/findif.cpp b/libs/core/algorithms/tests/unit/algorithms/findif.cpp index 20f04f42727e..965a0530ac12 100644 --- a/libs/core/algorithms/tests/unit/algorithms/findif.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/findif.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/findifnot.cpp b/libs/core/algorithms/tests/unit/algorithms/findifnot.cpp index b728215e40aa..1835150d97a3 100644 --- a/libs/core/algorithms/tests/unit/algorithms/findifnot.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/findifnot.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/findifnot_bad_alloc.cpp b/libs/core/algorithms/tests/unit/algorithms/findifnot_bad_alloc.cpp index de2c07556b24..c6137d51367e 100644 --- a/libs/core/algorithms/tests/unit/algorithms/findifnot_bad_alloc.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/findifnot_bad_alloc.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/findifnot_exception.cpp b/libs/core/algorithms/tests/unit/algorithms/findifnot_exception.cpp index 7ca2269c634a..91d94136b203 100644 --- a/libs/core/algorithms/tests/unit/algorithms/findifnot_exception.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/findifnot_exception.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/for_loop.cpp b/libs/core/algorithms/tests/unit/algorithms/for_loop.cpp index d39f710a92ca..0c45462a834b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/for_loop.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/for_loop.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/for_loop_exception.cpp b/libs/core/algorithms/tests/unit/algorithms/for_loop_exception.cpp index b6a4ab818367..1a66c4b547b1 100644 --- a/libs/core/algorithms/tests/unit/algorithms/for_loop_exception.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/for_loop_exception.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/for_loop_induction.cpp b/libs/core/algorithms/tests/unit/algorithms/for_loop_induction.cpp index 62fdde5fe9ce..f54e8bcc3df8 100644 --- a/libs/core/algorithms/tests/unit/algorithms/for_loop_induction.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/for_loop_induction.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/for_loop_induction_async.cpp b/libs/core/algorithms/tests/unit/algorithms/for_loop_induction_async.cpp index 870eed8b7641..45bc96115975 100644 --- a/libs/core/algorithms/tests/unit/algorithms/for_loop_induction_async.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/for_loop_induction_async.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/for_loop_n.cpp b/libs/core/algorithms/tests/unit/algorithms/for_loop_n.cpp index 1f7b90d17ee4..e2e5113cb8fd 100644 --- a/libs/core/algorithms/tests/unit/algorithms/for_loop_n.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/for_loop_n.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/for_loop_n_strided.cpp b/libs/core/algorithms/tests/unit/algorithms/for_loop_n_strided.cpp index 97e4ea05dea2..d5b166e555e9 100644 --- a/libs/core/algorithms/tests/unit/algorithms/for_loop_n_strided.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/for_loop_n_strided.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/for_loop_reduction.cpp b/libs/core/algorithms/tests/unit/algorithms/for_loop_reduction.cpp index a89bd468b413..be73ce5e6641 100644 --- a/libs/core/algorithms/tests/unit/algorithms/for_loop_reduction.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/for_loop_reduction.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/for_loop_reduction_async.cpp b/libs/core/algorithms/tests/unit/algorithms/for_loop_reduction_async.cpp index 95ee104b18b7..bf7b6530af14 100644 --- a/libs/core/algorithms/tests/unit/algorithms/for_loop_reduction_async.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/for_loop_reduction_async.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/for_loop_sender.cpp b/libs/core/algorithms/tests/unit/algorithms/for_loop_sender.cpp index 5c9a5c018e6e..c09defd81c9f 100644 --- a/libs/core/algorithms/tests/unit/algorithms/for_loop_sender.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/for_loop_sender.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/for_loop_strided.cpp b/libs/core/algorithms/tests/unit/algorithms/for_loop_strided.cpp index be488e152389..de8e8faaa4c2 100644 --- a/libs/core/algorithms/tests/unit/algorithms/for_loop_strided.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/for_loop_strided.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreach.cpp b/libs/core/algorithms/tests/unit/algorithms/foreach.cpp index 3bf220b58501..a68b0e433a10 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreach.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreach.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreach_executors.cpp b/libs/core/algorithms/tests/unit/algorithms/foreach_executors.cpp index 74451ecd845a..f9372940b045 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreach_executors.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreach_executors.cpp @@ -4,8 +4,7 @@ // 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) -#include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreach_prefetching.cpp b/libs/core/algorithms/tests/unit/algorithms/foreach_prefetching.cpp index a504d541349b..b68c225847ff 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreach_prefetching.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreach_prefetching.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreach_scheduler.cpp b/libs/core/algorithms/tests/unit/algorithms/foreach_scheduler.cpp index f92736fb4737..b5976d912eaf 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreach_scheduler.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreach_scheduler.cpp @@ -4,13 +4,13 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreach_sender.cpp b/libs/core/algorithms/tests/unit/algorithms/foreach_sender.cpp index 8685e651edaa..a85c7991fccd 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreach_sender.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreach_sender.cpp @@ -4,13 +4,13 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreach_std_policies.cpp b/libs/core/algorithms/tests/unit/algorithms/foreach_std_policies.cpp index 2d19743e00a4..9116d4c34b70 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreach_std_policies.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreach_std_policies.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreach_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/foreach_tests.hpp index 13b4056a9098..3c02b4873327 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreach_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreach_tests.hpp @@ -6,9 +6,9 @@ #pragma once -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreach_tests_prefetching.hpp b/libs/core/algorithms/tests/unit/algorithms/foreach_tests_prefetching.hpp index dd4da030c79c..9ba9544a8fc8 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreach_tests_prefetching.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreach_tests_prefetching.hpp @@ -7,9 +7,9 @@ #pragma once -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreachn.cpp b/libs/core/algorithms/tests/unit/algorithms/foreachn.cpp index 868c59cb260b..99d939cc5ad5 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreachn.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreachn.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreachn_bad_alloc.cpp b/libs/core/algorithms/tests/unit/algorithms/foreachn_bad_alloc.cpp index bdc67eb8cec9..e4854ba8a30c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreachn_bad_alloc.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreachn_bad_alloc.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/foreachn_exception.cpp b/libs/core/algorithms/tests/unit/algorithms/foreachn_exception.cpp index 19e4175937a1..9678ab46392a 100644 --- a/libs/core/algorithms/tests/unit/algorithms/foreachn_exception.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/foreachn_exception.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/generate.cpp b/libs/core/algorithms/tests/unit/algorithms/generate.cpp index 2fbe729b2197..574689ed6752 100644 --- a/libs/core/algorithms/tests/unit/algorithms/generate.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/generate.cpp @@ -6,7 +6,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/generate_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/generate_tests.hpp index 1417d259eb64..e88f041e68d7 100644 --- a/libs/core/algorithms/tests/unit/algorithms/generate_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/generate_tests.hpp @@ -8,9 +8,9 @@ #pragma once -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/generaten.cpp b/libs/core/algorithms/tests/unit/algorithms/generaten.cpp index 4d69b227125d..ff6646f3739f 100644 --- a/libs/core/algorithms/tests/unit/algorithms/generaten.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/generaten.cpp @@ -6,7 +6,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/generaten_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/generaten_tests.hpp index c29ba6f982ba..d88109baf641 100644 --- a/libs/core/algorithms/tests/unit/algorithms/generaten_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/generaten_tests.hpp @@ -7,9 +7,9 @@ #pragma once -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/includes.cpp b/libs/core/algorithms/tests/unit/algorithms/includes.cpp index 5804089402ee..d98e692bf08e 100644 --- a/libs/core/algorithms/tests/unit/algorithms/includes.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/includes.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/inclusive_scan.cpp b/libs/core/algorithms/tests/unit/algorithms/inclusive_scan.cpp index c2b1c7088643..f3600c6225f2 100644 --- a/libs/core/algorithms/tests/unit/algorithms/inclusive_scan.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/inclusive_scan.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/inclusive_scan_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/inclusive_scan_tests.hpp index 141b775110ec..02f43230127e 100644 --- a/libs/core/algorithms/tests/unit/algorithms/inclusive_scan_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/inclusive_scan_tests.hpp @@ -6,10 +6,11 @@ #pragma once -#include +#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/inplace_merge.cpp b/libs/core/algorithms/tests/unit/algorithms/inplace_merge.cpp index 586db5a105be..474e610eea4d 100644 --- a/libs/core/algorithms/tests/unit/algorithms/inplace_merge.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/inplace_merge.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/is_heap.cpp b/libs/core/algorithms/tests/unit/algorithms/is_heap.cpp index 8e53ea065e3e..d7eccfee3a06 100644 --- a/libs/core/algorithms/tests/unit/algorithms/is_heap.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/is_heap.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/is_heap_until.cpp b/libs/core/algorithms/tests/unit/algorithms/is_heap_until.cpp index 1288bb7fda3d..3b779cc13533 100644 --- a/libs/core/algorithms/tests/unit/algorithms/is_heap_until.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/is_heap_until.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/is_partitioned.cpp b/libs/core/algorithms/tests/unit/algorithms/is_partitioned.cpp index 273645df3034..3e025e0f6ca8 100644 --- a/libs/core/algorithms/tests/unit/algorithms/is_partitioned.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/is_partitioned.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/is_sorted.cpp b/libs/core/algorithms/tests/unit/algorithms/is_sorted.cpp index cb8277984dab..4040d566203b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/is_sorted.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/is_sorted.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/is_sorted_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/is_sorted_tests.hpp index 379753147c03..605e7b032216 100644 --- a/libs/core/algorithms/tests/unit/algorithms/is_sorted_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/is_sorted_tests.hpp @@ -6,9 +6,9 @@ #pragma once -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/is_sorted_until.cpp b/libs/core/algorithms/tests/unit/algorithms/is_sorted_until.cpp index e848a92a8ae9..00b168d93cd2 100644 --- a/libs/core/algorithms/tests/unit/algorithms/is_sorted_until.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/is_sorted_until.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/lexicographical_compare.cpp b/libs/core/algorithms/tests/unit/algorithms/lexicographical_compare.cpp index 1e602b433faa..42fd07a04bf2 100644 --- a/libs/core/algorithms/tests/unit/algorithms/lexicographical_compare.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/lexicographical_compare.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp b/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp index 6feeff74165c..92316353cf49 100644 --- a/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/make_heap.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/max_element.cpp b/libs/core/algorithms/tests/unit/algorithms/max_element.cpp index 09a8afee482d..ea32980a7deb 100644 --- a/libs/core/algorithms/tests/unit/algorithms/max_element.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/max_element.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/merge.cpp b/libs/core/algorithms/tests/unit/algorithms/merge.cpp index 711a48bfc578..a3f06fb1a249 100644 --- a/libs/core/algorithms/tests/unit/algorithms/merge.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/merge.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/min_element.cpp b/libs/core/algorithms/tests/unit/algorithms/min_element.cpp index 228b2b869431..88f2c6d395c4 100644 --- a/libs/core/algorithms/tests/unit/algorithms/min_element.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/min_element.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/minmax_element.cpp b/libs/core/algorithms/tests/unit/algorithms/minmax_element.cpp index 74d3b7b8d0d9..f4cd68ad6a63 100644 --- a/libs/core/algorithms/tests/unit/algorithms/minmax_element.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/minmax_element.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/mismatch.cpp b/libs/core/algorithms/tests/unit/algorithms/mismatch.cpp index 398918df1859..930c75df8013 100644 --- a/libs/core/algorithms/tests/unit/algorithms/mismatch.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/mismatch.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/mismatch_binary.cpp b/libs/core/algorithms/tests/unit/algorithms/mismatch_binary.cpp index a1cfd9bc4df2..1e55a5c61580 100644 --- a/libs/core/algorithms/tests/unit/algorithms/mismatch_binary.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/mismatch_binary.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/move.cpp b/libs/core/algorithms/tests/unit/algorithms/move.cpp index 22545f57bfb9..e1e8b6d1aea6 100644 --- a/libs/core/algorithms/tests/unit/algorithms/move.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/move.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/none_of.cpp b/libs/core/algorithms/tests/unit/algorithms/none_of.cpp index 813ebfa0580d..b9e498127bc0 100644 --- a/libs/core/algorithms/tests/unit/algorithms/none_of.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/none_of.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/none_of_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/none_of_tests.hpp index f05f4215f9b7..6dd8b6431446 100644 --- a/libs/core/algorithms/tests/unit/algorithms/none_of_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/none_of_tests.hpp @@ -6,10 +6,9 @@ #pragma once -#include +#include +#include #include -#include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/nth_element.cpp b/libs/core/algorithms/tests/unit/algorithms/nth_element.cpp index 5f04750275cc..09edfa1c533c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/nth_element.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/nth_element.cpp @@ -6,9 +6,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/parallel_sort.cpp b/libs/core/algorithms/tests/unit/algorithms/parallel_sort.cpp index 855c174560e7..66c8f82255fb 100644 --- a/libs/core/algorithms/tests/unit/algorithms/parallel_sort.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/parallel_sort.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/partial_sort.cpp b/libs/core/algorithms/tests/unit/algorithms/partial_sort.cpp index d366939cb7e3..a45a336396a4 100644 --- a/libs/core/algorithms/tests/unit/algorithms/partial_sort.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/partial_sort.cpp @@ -5,10 +5,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/partial_sort_copy.cpp b/libs/core/algorithms/tests/unit/algorithms/partial_sort_copy.cpp index 0519e8de748b..972011b936db 100644 --- a/libs/core/algorithms/tests/unit/algorithms/partial_sort_copy.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/partial_sort_copy.cpp @@ -8,11 +8,11 @@ // 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) //----------------------------------------------------------------------------- +#include #include -#include -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/partition.cpp b/libs/core/algorithms/tests/unit/algorithms/partition.cpp index 876b0977866c..10dfd9d490f1 100644 --- a/libs/core/algorithms/tests/unit/algorithms/partition.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/partition.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/partition_copy.cpp b/libs/core/algorithms/tests/unit/algorithms/partition_copy.cpp index d37abca3d35f..26220da83c3a 100644 --- a/libs/core/algorithms/tests/unit/algorithms/partition_copy.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/partition_copy.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/reduce_.cpp b/libs/core/algorithms/tests/unit/algorithms/reduce_.cpp index 2ddd71535c93..e88eb540f061 100644 --- a/libs/core/algorithms/tests/unit/algorithms/reduce_.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/reduce_.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/reduce_by_key.cpp b/libs/core/algorithms/tests/unit/algorithms/reduce_by_key.cpp index 1ecd4e17edf4..cc2a0d46a9a2 100644 --- a/libs/core/algorithms/tests/unit/algorithms/reduce_by_key.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/reduce_by_key.cpp @@ -4,12 +4,11 @@ // 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) -#include +#include +#include #include -#include -#include #include -// + #include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/remove.cpp b/libs/core/algorithms/tests/unit/algorithms/remove.cpp index 4c4d0ea54caa..c9ee10a61e78 100644 --- a/libs/core/algorithms/tests/unit/algorithms/remove.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/remove.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/remove1.cpp b/libs/core/algorithms/tests/unit/algorithms/remove1.cpp index d45fcd44de38..297c7874ff1c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/remove1.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/remove1.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/remove2.cpp b/libs/core/algorithms/tests/unit/algorithms/remove2.cpp index 8bc26afa7bae..d556a08e01a0 100644 --- a/libs/core/algorithms/tests/unit/algorithms/remove2.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/remove2.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/remove_copy.cpp b/libs/core/algorithms/tests/unit/algorithms/remove_copy.cpp index 51581e736877..8dca5045c9ab 100644 --- a/libs/core/algorithms/tests/unit/algorithms/remove_copy.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/remove_copy.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/remove_copy_if.cpp b/libs/core/algorithms/tests/unit/algorithms/remove_copy_if.cpp index 140c80cdb5f9..1b61c2c9105e 100644 --- a/libs/core/algorithms/tests/unit/algorithms/remove_copy_if.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/remove_copy_if.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/remove_if.cpp b/libs/core/algorithms/tests/unit/algorithms/remove_if.cpp index 04250b57ca5c..2ee33ff8f5b8 100644 --- a/libs/core/algorithms/tests/unit/algorithms/remove_if.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/remove_if.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/remove_if1.cpp b/libs/core/algorithms/tests/unit/algorithms/remove_if1.cpp index 9a4a522768d8..316b18b0546b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/remove_if1.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/remove_if1.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/replace.cpp b/libs/core/algorithms/tests/unit/algorithms/replace.cpp index d0f2d0928064..7abec26eab21 100644 --- a/libs/core/algorithms/tests/unit/algorithms/replace.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/replace.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/replace_copy.cpp b/libs/core/algorithms/tests/unit/algorithms/replace_copy.cpp index 0581a8694bab..d9259ee8aa74 100644 --- a/libs/core/algorithms/tests/unit/algorithms/replace_copy.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/replace_copy.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/replace_copy_if.cpp b/libs/core/algorithms/tests/unit/algorithms/replace_copy_if.cpp index 4e4e7577c8e6..06f909db7086 100644 --- a/libs/core/algorithms/tests/unit/algorithms/replace_copy_if.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/replace_copy_if.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/replace_if.cpp b/libs/core/algorithms/tests/unit/algorithms/replace_if.cpp index f22bd3c979d8..0799cb82814a 100644 --- a/libs/core/algorithms/tests/unit/algorithms/replace_if.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/replace_if.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/reverse.cpp b/libs/core/algorithms/tests/unit/algorithms/reverse.cpp index c6fa3ac04738..9fb76eb63305 100644 --- a/libs/core/algorithms/tests/unit/algorithms/reverse.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/reverse.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/reverse_copy.cpp b/libs/core/algorithms/tests/unit/algorithms/reverse_copy.cpp index 2c9bd4b8e99c..cb2352bc1948 100644 --- a/libs/core/algorithms/tests/unit/algorithms/reverse_copy.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/reverse_copy.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/reverse_sender.cpp b/libs/core/algorithms/tests/unit/algorithms/reverse_sender.cpp index 932262cec63a..177fedf82337 100644 --- a/libs/core/algorithms/tests/unit/algorithms/reverse_sender.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/reverse_sender.cpp @@ -5,12 +5,12 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/rotate.cpp b/libs/core/algorithms/tests/unit/algorithms/rotate.cpp index 66f35abbbd46..c6607e349d2f 100644 --- a/libs/core/algorithms/tests/unit/algorithms/rotate.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/rotate.cpp @@ -5,10 +5,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/rotate_copy.cpp b/libs/core/algorithms/tests/unit/algorithms/rotate_copy.cpp index 3388f3bb2bd1..15bb74cc4663 100644 --- a/libs/core/algorithms/tests/unit/algorithms/rotate_copy.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/rotate_copy.cpp @@ -5,10 +5,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/rotate_sender.cpp b/libs/core/algorithms/tests/unit/algorithms/rotate_sender.cpp index 235b3f6a07d6..3c52d08828a2 100644 --- a/libs/core/algorithms/tests/unit/algorithms/rotate_sender.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/rotate_sender.cpp @@ -10,13 +10,13 @@ // Clang V11 ICE's on this test #if !defined(HPX_CLANG_VERSION) || (HPX_CLANG_VERSION / 10000) != 11 -#include -#include -#include +#include +#include +#include #include #include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/search.cpp b/libs/core/algorithms/tests/unit/algorithms/search.cpp index 3ed0e29f6175..8c57de4b9ae3 100644 --- a/libs/core/algorithms/tests/unit/algorithms/search.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/search.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/searchn.cpp b/libs/core/algorithms/tests/unit/algorithms/searchn.cpp index ddef96c73dce..ac8ece39b5af 100644 --- a/libs/core/algorithms/tests/unit/algorithms/searchn.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/searchn.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/set_difference.cpp b/libs/core/algorithms/tests/unit/algorithms/set_difference.cpp index 74e1d3709e7a..415cb259f91a 100644 --- a/libs/core/algorithms/tests/unit/algorithms/set_difference.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/set_difference.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/set_intersection.cpp b/libs/core/algorithms/tests/unit/algorithms/set_intersection.cpp index eabf10abf540..4fa5ccb8e583 100644 --- a/libs/core/algorithms/tests/unit/algorithms/set_intersection.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/set_intersection.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/set_symmetric_difference.cpp b/libs/core/algorithms/tests/unit/algorithms/set_symmetric_difference.cpp index d1081eb0a030..64214882fc0b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/set_symmetric_difference.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/set_symmetric_difference.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/set_union.cpp b/libs/core/algorithms/tests/unit/algorithms/set_union.cpp index 2ea6e5d7e693..27bd169878ad 100644 --- a/libs/core/algorithms/tests/unit/algorithms/set_union.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/set_union.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/shift_left.cpp b/libs/core/algorithms/tests/unit/algorithms/shift_left.cpp index 3dd1ee177b1a..96c0e582cb9c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/shift_left.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/shift_left.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/shift_right.cpp b/libs/core/algorithms/tests/unit/algorithms/shift_right.cpp index 8002100d3de4..0bb671c14562 100644 --- a/libs/core/algorithms/tests/unit/algorithms/shift_right.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/shift_right.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/sort.cpp b/libs/core/algorithms/tests/unit/algorithms/sort.cpp index 01d758dec14a..eb195fe42d7b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/sort.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/sort.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/sort_by_key.cpp b/libs/core/algorithms/tests/unit/algorithms/sort_by_key.cpp index af382de05478..725fcdabb93c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/sort_by_key.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/sort_by_key.cpp @@ -4,13 +4,11 @@ // 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) -#include +#include +#include #include -#include -#include #include -#include -// + #include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/sort_exceptions.cpp b/libs/core/algorithms/tests/unit/algorithms/sort_exceptions.cpp index fa7507c2bae5..85e974a6dab0 100644 --- a/libs/core/algorithms/tests/unit/algorithms/sort_exceptions.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/sort_exceptions.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/stable_partition.cpp b/libs/core/algorithms/tests/unit/algorithms/stable_partition.cpp index a73ba342e37a..b2413e044d79 100644 --- a/libs/core/algorithms/tests/unit/algorithms/stable_partition.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/stable_partition.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/stable_sort.cpp b/libs/core/algorithms/tests/unit/algorithms/stable_sort.cpp index 68d92ee2860d..b48a9254b5e2 100644 --- a/libs/core/algorithms/tests/unit/algorithms/stable_sort.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/stable_sort.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/stable_sort_exceptions.cpp b/libs/core/algorithms/tests/unit/algorithms/stable_sort_exceptions.cpp index f0a09ca3de77..0386d7bacd7b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/stable_sort_exceptions.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/stable_sort_exceptions.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/stable_sort_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/stable_sort_tests.hpp index 0002392b8226..64597d2eebd0 100644 --- a/libs/core/algorithms/tests/unit/algorithms/stable_sort_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/stable_sort_tests.hpp @@ -7,10 +7,10 @@ #pragma once -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/starts_with.cpp b/libs/core/algorithms/tests/unit/algorithms/starts_with.cpp index bc6d390e203e..e2d8ce80f316 100644 --- a/libs/core/algorithms/tests/unit/algorithms/starts_with.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/starts_with.cpp @@ -5,10 +5,9 @@ // 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) -#include +#include +#include #include -#include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/swapranges.cpp b/libs/core/algorithms/tests/unit/algorithms/swapranges.cpp index 48ceff54691f..7383551f5ffa 100644 --- a/libs/core/algorithms/tests/unit/algorithms/swapranges.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/swapranges.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/test_utils.hpp b/libs/core/algorithms/tests/unit/algorithms/test_utils.hpp index 001062b0ca4b..1befa9bde1ea 100644 --- a/libs/core/algorithms/tests/unit/algorithms/test_utils.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/test_utils.hpp @@ -7,8 +7,8 @@ #pragma once -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/transform.cpp b/libs/core/algorithms/tests/unit/algorithms/transform.cpp index e12cebe744d5..481b4fd5e8f4 100644 --- a/libs/core/algorithms/tests/unit/algorithms/transform.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/transform.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/transform_binary.cpp b/libs/core/algorithms/tests/unit/algorithms/transform_binary.cpp index c22be7158e79..af1d5979cc80 100644 --- a/libs/core/algorithms/tests/unit/algorithms/transform_binary.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/transform_binary.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/transform_binary2.cpp b/libs/core/algorithms/tests/unit/algorithms/transform_binary2.cpp index dafc19b97ba6..7dcca0a64723 100644 --- a/libs/core/algorithms/tests/unit/algorithms/transform_binary2.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/transform_binary2.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/transform_exclusive_scan.cpp b/libs/core/algorithms/tests/unit/algorithms/transform_exclusive_scan.cpp index 3866bf7959cc..14300ea9e429 100644 --- a/libs/core/algorithms/tests/unit/algorithms/transform_exclusive_scan.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/transform_exclusive_scan.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/transform_inclusive_scan.cpp b/libs/core/algorithms/tests/unit/algorithms/transform_inclusive_scan.cpp index 0cbf05a10cff..51ed7faea640 100644 --- a/libs/core/algorithms/tests/unit/algorithms/transform_inclusive_scan.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/transform_inclusive_scan.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/transform_reduce.cpp b/libs/core/algorithms/tests/unit/algorithms/transform_reduce.cpp index 764c4213831c..61b5f7946198 100644 --- a/libs/core/algorithms/tests/unit/algorithms/transform_reduce.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/transform_reduce.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary.cpp b/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary.cpp index 67c0855e7b58..0bd1e764efb2 100644 --- a/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_bad_alloc.cpp b/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_bad_alloc.cpp index 7cfd67c0afd0..ab81117f8015 100644 --- a/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_bad_alloc.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_bad_alloc.cpp @@ -5,9 +5,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_exception.cpp b/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_exception.cpp index 11c8711bbb21..2f9377e8a306 100644 --- a/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_exception.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_exception.cpp @@ -5,9 +5,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_tests.hpp index 6709c6049073..e22be56bfa8e 100644 --- a/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/transform_reduce_binary_tests.hpp @@ -6,7 +6,9 @@ #pragma once +#include #include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_copy.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_copy.cpp index f76bc4e46f25..4c8f2d7ce3f9 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_copy.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_copy.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_copy_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_copy_tests.hpp index 89fd129e0bc5..4d711d2dc252 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_copy_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_copy_tests.hpp @@ -6,9 +6,10 @@ #pragma once -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_copyn.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_copyn.cpp index 4484cf98250a..bae46dfe5b9a 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_copyn.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_copyn.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_construct.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_construct.cpp index 7c2e215fab02..20a57c70d89f 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_construct.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_construct.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_construct_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_construct_tests.hpp index 4a22e3e4670a..07115b812f0e 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_construct_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_construct_tests.hpp @@ -6,9 +6,10 @@ #pragma once -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_constructn.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_constructn.cpp index 8238b5ceb069..30c94beada1c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_constructn.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_default_constructn.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_fill.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_fill.cpp index 9bebf26ee427..bd78e8b3941f 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_fill.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_fill.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_filln.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_filln.cpp index 838f0f7538c9..84916542367b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_filln.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_filln.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_move.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_move.cpp index e308f66e243c..aa981b9361db 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_move.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_move.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_move_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_move_tests.hpp index aa94c2ed7b08..536e4e5c0e0b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_move_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_move_tests.hpp @@ -6,9 +6,10 @@ #pragma once -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_moven.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_moven.cpp index 3449fa827245..6e8a569b4d54 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_moven.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_moven.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_construct.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_construct.cpp index 094cab24ba2f..434379f1924b 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_construct.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_construct.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_construct_tests.hpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_construct_tests.hpp index c89b2fac9ed0..1fe7aa108d42 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_construct_tests.hpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_construct_tests.hpp @@ -6,9 +6,10 @@ #pragma once -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_constructn.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_constructn.cpp index 43f96b0b1078..84d2bff216ac 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_constructn.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_value_constructn.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/unique.cpp b/libs/core/algorithms/tests/unit/algorithms/unique.cpp index c9d89eafd5fa..ffb235dce683 100644 --- a/libs/core/algorithms/tests/unit/algorithms/unique.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/unique.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/algorithms/unique_copy.cpp b/libs/core/algorithms/tests/unit/algorithms/unique_copy.cpp index 21b2442605cd..86ac4b13ab2f 100644 --- a/libs/core/algorithms/tests/unit/algorithms/unique_copy.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/unique_copy.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/block/spmd_block.cpp b/libs/core/algorithms/tests/unit/block/spmd_block.cpp index a35fb2fcbdee..6500c0fedb54 100644 --- a/libs/core/algorithms/tests/unit/block/spmd_block.cpp +++ b/libs/core/algorithms/tests/unit/block/spmd_block.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/block/task_block.cpp b/libs/core/algorithms/tests/unit/block/task_block.cpp index 2213b4a0e931..65d1a9649242 100644 --- a/libs/core/algorithms/tests/unit/block/task_block.cpp +++ b/libs/core/algorithms/tests/unit/block/task_block.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/block/task_block_executor.cpp b/libs/core/algorithms/tests/unit/block/task_block_executor.cpp index 530cc34314a9..5b30f037eacd 100644 --- a/libs/core/algorithms/tests/unit/block/task_block_executor.cpp +++ b/libs/core/algorithms/tests/unit/block/task_block_executor.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include -#include +#include +#include #include #include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/block/task_block_par.cpp b/libs/core/algorithms/tests/unit/block/task_block_par.cpp index 1ab0b2583e7f..53c88e46a147 100644 --- a/libs/core/algorithms/tests/unit/block/task_block_par.cpp +++ b/libs/core/algorithms/tests/unit/block/task_block_par.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/block/task_group.cpp b/libs/core/algorithms/tests/unit/block/task_group.cpp index 79e56199b2b0..c32e936697cc 100644 --- a/libs/core/algorithms/tests/unit/block/task_group.cpp +++ b/libs/core/algorithms/tests/unit/block/task_group.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/adjacentdifference_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/adjacentdifference_range.cpp index 78312ccd14e4..8cd67ecd9de1 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/adjacentdifference_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/adjacentdifference_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include #include -#include + #include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/adjacentdifference_range_sender.cpp b/libs/core/algorithms/tests/unit/container_algorithms/adjacentdifference_range_sender.cpp index 007e536da0cb..efc9df553e8a 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/adjacentdifference_range_sender.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/adjacentdifference_range_sender.cpp @@ -6,11 +6,11 @@ // 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) +#include +#include +#include #include -#include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_bad_alloc_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_bad_alloc_range.cpp index 15a6b24e7a32..b5d21506bd39 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_bad_alloc_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_bad_alloc_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_bad_alloc_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_bad_alloc_range.cpp index c08f67e3345c..2baa67a95c80 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_bad_alloc_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_bad_alloc_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_exception_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_exception_range.cpp index a9956fc2265a..31ecc19f1c85 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_exception_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_exception_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_projection_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_projection_range.cpp index 24856aa4aef9..3e7c9520b114 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_projection_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_projection_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_range.cpp index 35f9df92f4d8..706e1827d507 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_binary_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_exception_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_exception_range.cpp index 2fd2ac36a22a..c188bc536acd 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_exception_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_exception_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_range.cpp index 64de288a3e40..724b18f22c02 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/adjacentfind_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/all_of_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/all_of_range.cpp index 93691fa22d61..36273a7f85d7 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/all_of_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/all_of_range.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/any_of_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/any_of_range.cpp index b743da4e40e3..4668c186a543 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/any_of_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/any_of_range.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/copy_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/copy_range.cpp index 1bf6eb0662c5..0d070ef4eda8 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/copy_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/copy_range.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/copyif_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/copyif_range.cpp index be36239b9040..9ab01acf344a 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/copyif_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/copyif_range.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/copyn_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/copyn_range.cpp index bef3119096ba..482e9b538835 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/copyn_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/copyn_range.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/count_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/count_range.cpp index d6ff8914d144..cf6192b08ef8 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/count_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/count_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/countif_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/countif_range.cpp index 6d9912ce9c7d..0f7c6297ab86 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/countif_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/countif_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/destroy_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/destroy_range.cpp index 7fd06b55fa46..7281fefbc5d0 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/destroy_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/destroy_range.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/destroy_range_tests.hpp b/libs/core/algorithms/tests/unit/container_algorithms/destroy_range_tests.hpp index 6c66964cb9c5..aca0946ae038 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/destroy_range_tests.hpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/destroy_range_tests.hpp @@ -6,9 +6,10 @@ #pragma once -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/destroyn_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/destroyn_range.cpp index fab18de25101..8e9a229cf172 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/destroyn_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/destroyn_range.cpp @@ -4,9 +4,10 @@ // 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) -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/ends_with_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/ends_with_range.cpp index 50d28837ee35..4224c38180bb 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/ends_with_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/ends_with_range.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/equal_binary_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/equal_binary_range.cpp index bb692805de34..b2207165bb02 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/equal_binary_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/equal_binary_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/equal_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/equal_range.cpp index 9cd020050e75..96c10fa1da45 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/equal_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/equal_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/exclusive_scan_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/exclusive_scan_range.cpp index 2e3c5111b99d..229948ba8cf8 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/exclusive_scan_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/exclusive_scan_range.cpp @@ -6,10 +6,11 @@ // 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) +#include +#include #include -#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/fill_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/fill_range.cpp index 052d5fe20aca..52d466c578de 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/fill_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/fill_range.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/filln_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/filln_range.cpp index 9f52b164b720..350d5aa3f466 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/filln_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/filln_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/find_end_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/find_end_range.cpp index 609c7f43cf79..c5134d363400 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/find_end_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/find_end_range.cpp @@ -6,9 +6,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/find_end_range2.cpp b/libs/core/algorithms/tests/unit/container_algorithms/find_end_range2.cpp index 40afb81c5917..563e140297b8 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/find_end_range2.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/find_end_range2.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/find_first_of_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/find_first_of_range.cpp index 90f04972cb13..99465aff3e88 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/find_first_of_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/find_first_of_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/find_first_of_range2.cpp b/libs/core/algorithms/tests/unit/container_algorithms/find_first_of_range2.cpp index 3aa288c39196..308c6ff95fff 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/find_first_of_range2.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/find_first_of_range2.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/find_if_not_exception_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/find_if_not_exception_range.cpp index 87c06841d127..be5241ac3375 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/find_if_not_exception_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/find_if_not_exception_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/find_if_not_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/find_if_not_range.cpp index 9b19717d9b2f..60f8c83db4f2 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/find_if_not_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/find_if_not_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/find_if_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/find_if_range.cpp index f5e9ebcd8262..f97f169e250f 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/find_if_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/find_if_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/find_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/find_range.cpp index 2f86fb46f843..e0da69f910b4 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/find_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/find_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_exception_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_exception_range.cpp index 3adc0008d79d..54ef4c841a3d 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_exception_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_exception_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_induction_async_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_induction_async_range.cpp index ea9a0d062ce4..a99448c95d8c 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_induction_async_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_induction_async_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_induction_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_induction_range.cpp index d66137520351..0f4b6bad4c61 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_induction_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_induction_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_range.cpp index c781b7c9c288..889b4a6cd443 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_range_generator.cpp b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_range_generator.cpp index 7e5e7a905cf7..43e8ea48ba24 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_range_generator.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_range_generator.cpp @@ -10,9 +10,9 @@ #if defined(HPX_HAVE_CXX20_COROUTINES) && \ (!defined(HPX_CLANG_VERSION) || HPX_CLANG_VERSION >= 130000) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_reduction_async_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_reduction_async_range.cpp index 065dd4b1a574..d3bcf93fa001 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_reduction_async_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_reduction_async_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_reduction_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_reduction_range.cpp index 6e4174f90423..0546e39b1987 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_reduction_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_reduction_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_strided_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_strided_range.cpp index f50c744d9da8..6120649131f7 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/for_loop_strided_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/for_loop_strided_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/foreach_adapt.cpp b/libs/core/algorithms/tests/unit/container_algorithms/foreach_adapt.cpp index 972c8fb9dc17..23e807c2b5a8 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/foreach_adapt.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/foreach_adapt.cpp @@ -4,10 +4,10 @@ // 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) +#include +#include #include -#include #include -#include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/foreach_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/foreach_range.cpp index 174a2aa2df72..8551cb97a7ec 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/foreach_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/foreach_range.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/foreach_range_projection.cpp b/libs/core/algorithms/tests/unit/container_algorithms/foreach_range_projection.cpp index 4fdd2f6f0f71..5019d6a7662f 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/foreach_range_projection.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/foreach_range_projection.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/foreach_range_sender.cpp b/libs/core/algorithms/tests/unit/container_algorithms/foreach_range_sender.cpp index 78ab46b2a06a..f39f60d1a7fd 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/foreach_range_sender.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/foreach_range_sender.cpp @@ -4,12 +4,12 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/generate_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/generate_range.cpp index d994bec43cbb..455dcd5c1189 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/generate_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/generate_range.cpp @@ -4,11 +4,11 @@ // 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) +#include +#include #include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/includes_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/includes_range.cpp index 61fa0e1ad086..ec78ac6874d5 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/includes_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/includes_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/inclusive_scan_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/inclusive_scan_range.cpp index 8ea9e328f48c..de8cc4e23faa 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/inclusive_scan_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/inclusive_scan_range.cpp @@ -6,10 +6,11 @@ // 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) +#include +#include #include -#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/inplace_merge_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/inplace_merge_range.cpp index b754f4f3ab45..97fd05e54a1f 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/inplace_merge_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/inplace_merge_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/is_heap_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/is_heap_range.cpp index fbb2fb6c39c3..2bf285d6ad34 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/is_heap_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/is_heap_range.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/is_heap_until_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/is_heap_until_range.cpp index 304f3889c8d6..34b822e5b623 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/is_heap_until_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/is_heap_until_range.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/is_partitioned_projection_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/is_partitioned_projection_range.cpp index 6bb382b4741c..d4230610c215 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/is_partitioned_projection_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/is_partitioned_projection_range.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/is_partitioned_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/is_partitioned_range.cpp index 5abf2699b16f..e6c75b988c84 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/is_partitioned_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/is_partitioned_range.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_range.cpp index 5e01611955e0..b8409b225e87 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_range.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_range_tests.hpp b/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_range_tests.hpp index ef4ae37d98d6..d9e7ad300788 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_range_tests.hpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_range_tests.hpp @@ -7,9 +7,9 @@ #pragma once -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_until_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_until_range.cpp index 10df84eecc01..bb40a007a334 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_until_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/is_sorted_until_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/lexicographical_compare_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/lexicographical_compare_range.cpp index b4bb9f446262..5a5d2f7330c9 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/lexicographical_compare_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/lexicographical_compare_range.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/make_heap_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/make_heap_range.cpp index ffbc0d755462..dd9f362268a3 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/make_heap_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/make_heap_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/max_element_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/max_element_range.cpp index d78c7f7fb72d..3f902566d41c 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/max_element_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/max_element_range.cpp @@ -4,10 +4,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/merge_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/merge_range.cpp index e90cb0a5636a..ac8c86c802bd 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/merge_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/merge_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/min_element_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/min_element_range.cpp index 2901802bcdec..7882a9428867 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/min_element_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/min_element_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/minmax_element_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/minmax_element_range.cpp index b29f466ef4b5..7e054a1eb5c1 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/minmax_element_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/minmax_element_range.cpp @@ -4,10 +4,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/mismatch_binary_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/mismatch_binary_range.cpp index b6b11c2b6e36..80973e704878 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/mismatch_binary_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/mismatch_binary_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/mismatch_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/mismatch_range.cpp index ed5f40b1d999..6eead3adc0f7 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/mismatch_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/mismatch_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/move_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/move_range.cpp index dcd123dc2412..8ac49bcc1dec 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/move_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/move_range.cpp @@ -6,10 +6,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/none_of_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/none_of_range.cpp index 027acb3458d6..58b6d287494b 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/none_of_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/none_of_range.cpp @@ -5,9 +5,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/nth_element_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/nth_element_range.cpp index 1027dc5183f3..51f0809a59ed 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/nth_element_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/nth_element_range.cpp @@ -7,10 +7,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/partial_sort_copy_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/partial_sort_copy_range.cpp index 5fe7d9a92c8d..4bd0a4b12ff0 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/partial_sort_copy_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/partial_sort_copy_range.cpp @@ -5,12 +5,12 @@ // 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) +#include #include +#include +#include #include -#include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/partial_sort_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/partial_sort_range.cpp index 8eeaeebde3e3..f1b0cc3217f1 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/partial_sort_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/partial_sort_range.cpp @@ -5,11 +5,11 @@ // 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) +#include +#include +#include #include -#include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/partition_copy_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/partition_copy_range.cpp index fd6a6ddd8e2d..12f130fce536 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/partition_copy_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/partition_copy_range.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/partition_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/partition_range.cpp index 1cdabcb878b6..d9f2ef3c1ade 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/partition_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/partition_range.cpp @@ -4,10 +4,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/reduce_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/reduce_range.cpp index 4348f144a18f..40333397b4ac 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/reduce_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/reduce_range.cpp @@ -4,10 +4,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/remove_copy_if_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/remove_copy_if_range.cpp index 2da0ddae56a7..bba044a42073 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/remove_copy_if_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/remove_copy_if_range.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/remove_copy_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/remove_copy_range.cpp index 38d3a87794d9..ae575cc647e1 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/remove_copy_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/remove_copy_range.cpp @@ -5,11 +5,11 @@ // 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) +#include +#include #include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/remove_if_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/remove_if_range.cpp index 155bb44dd378..ebfb9bbd7b7d 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/remove_if_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/remove_if_range.cpp @@ -4,10 +4,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/remove_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/remove_range.cpp index 7a12caeb9248..45196f9431b3 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/remove_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/remove_range.cpp @@ -4,10 +4,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/replace_copy_if_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/replace_copy_if_range.cpp index b1745d17dc0d..baaf1e952dfa 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/replace_copy_if_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/replace_copy_if_range.cpp @@ -5,11 +5,11 @@ // 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) +#include +#include #include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/replace_copy_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/replace_copy_range.cpp index 1547e7ec2323..a79165f1e851 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/replace_copy_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/replace_copy_range.cpp @@ -5,11 +5,11 @@ // 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) +#include +#include #include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/replace_if_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/replace_if_range.cpp index a7c86bf443c0..ddd8ba2c0a44 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/replace_if_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/replace_if_range.cpp @@ -5,11 +5,11 @@ // 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) +#include +#include #include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/replace_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/replace_range.cpp index 5aa8c864b9ca..a4ab638db646 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/replace_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/replace_range.cpp @@ -5,11 +5,11 @@ // 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) +#include +#include #include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/reverse_copy_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/reverse_copy_range.cpp index 0a0dff6418e6..c31191cc8e6a 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/reverse_copy_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/reverse_copy_range.cpp @@ -5,11 +5,11 @@ // 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) +#include +#include #include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/reverse_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/reverse_range.cpp index 0eae9483d2f8..447ad533f93f 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/reverse_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/reverse_range.cpp @@ -5,11 +5,11 @@ // 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) +#include +#include #include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/rotate_copy_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/rotate_copy_range.cpp index 1fffb02f2fbb..d2ba973d4ca2 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/rotate_copy_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/rotate_copy_range.cpp @@ -5,12 +5,12 @@ // 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) -#include +#include +#include +#include #include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/rotate_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/rotate_range.cpp index 5440f5627a26..337e5c7a0bbb 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/rotate_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/rotate_range.cpp @@ -5,12 +5,12 @@ // 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) -#include +#include +#include +#include #include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/search_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/search_range.cpp index 2a483dd7bb06..02f2aa7383d9 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/search_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/search_range.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/searchn_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/searchn_range.cpp index 760c7f464d66..d4821e3239e8 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/searchn_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/searchn_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/set_difference_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/set_difference_range.cpp index f3706b465b44..445db386f07e 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/set_difference_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/set_difference_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/set_intersection_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/set_intersection_range.cpp index 60928f2356d4..8cdfe7971ded 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/set_intersection_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/set_intersection_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/set_symmetric_difference_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/set_symmetric_difference_range.cpp index f41e8f4b536b..867847cf1149 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/set_symmetric_difference_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/set_symmetric_difference_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/set_union_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/set_union_range.cpp index 13792f38eab3..e645423f3723 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/set_union_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/set_union_range.cpp @@ -4,9 +4,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/shift_left_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/shift_left_range.cpp index b1f80eb5253b..208e60994737 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/shift_left_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/shift_left_range.cpp @@ -6,10 +6,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/shift_right_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/shift_right_range.cpp index 98d918e70a4a..d7bb96d2a137 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/shift_right_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/shift_right_range.cpp @@ -6,10 +6,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/sort_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/sort_range.cpp index c49f9ae17475..60b6e18e1e94 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/sort_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/sort_range.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/stable_partition_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/stable_partition_range.cpp index e7d16123f582..fd4aae02f89a 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/stable_partition_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/stable_partition_range.cpp @@ -5,11 +5,10 @@ // 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) +#include +#include #include -#include #include -#include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/stable_sort_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/stable_sort_range.cpp index 971c518a68b1..ddbc31c9ddbd 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/stable_sort_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/stable_sort_range.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/starts_with_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/starts_with_range.cpp index fec628c89a9d..97143f626253 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/starts_with_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/starts_with_range.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/swap_ranges_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/swap_ranges_range.cpp index f3dde6884047..4515dd176b7c 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/swap_ranges_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/swap_ranges_range.cpp @@ -6,10 +6,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/test_utils.hpp b/libs/core/algorithms/tests/unit/container_algorithms/test_utils.hpp index ea4d63cd97da..e99a71befb1f 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/test_utils.hpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/test_utils.hpp @@ -9,13 +9,12 @@ #pragma once #include -#include -#include +#include #include +#include #include #include -#include #include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_exclusive_scan_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_exclusive_scan_range.cpp index 5261bcf7f3a5..b6d2bb75fb8f 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_exclusive_scan_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_exclusive_scan_range.cpp @@ -6,10 +6,11 @@ // 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) +#include +#include #include -#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_inclusive_scan_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_inclusive_scan_range.cpp index d104523a51d6..ee8f69b8815c 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_inclusive_scan_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_inclusive_scan_range.cpp @@ -6,10 +6,11 @@ // 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) +#include +#include #include -#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_range.cpp index f79ee46b64d3..fbe5c118b18d 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_range.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_range2.cpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_range2.cpp index c9c767cf23a8..11b081c8f645 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_range2.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_range2.cpp @@ -4,10 +4,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_range_binary.cpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_range_binary.cpp index f06bf30065d0..e83e793005a5 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_range_binary.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_range_binary.cpp @@ -4,10 +4,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_range_binary2.cpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_range_binary2.cpp index 182d514b6c77..673c5c7e26cf 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_range_binary2.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_range_binary2.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_bad_alloc_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_bad_alloc_range.cpp index be1137046fbe..6138432d0a99 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_bad_alloc_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_bad_alloc_range.cpp @@ -5,9 +5,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_exception_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_exception_range.cpp index 5db3cab1166a..69315f0a3e2e 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_exception_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_exception_range.cpp @@ -5,9 +5,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_range.cpp index d08302802eda..91c8c15a1630 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_range.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_tests_range.hpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_tests_range.hpp index 2a1be4a8c014..38ac441e0d32 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_tests_range.hpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_binary_tests_range.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_range.cpp index e8104e2b402a..83fc2f654771 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/transform_reduce_range.cpp @@ -5,9 +5,10 @@ // 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) -#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_copy_n_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_copy_n_range.cpp index d1f5aed33c40..373ba643b44c 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_copy_n_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_copy_n_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_copy_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_copy_range.cpp index cb7a0fd2e63c..261bf1bd3a27 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_copy_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_copy_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_default_construct_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_default_construct_range.cpp index eeae277a9ace..ce8757462407 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_default_construct_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_default_construct_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_default_constructn_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_default_constructn_range.cpp index 02d60512d3c6..a7f6bf2cd0ea 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_default_constructn_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_default_constructn_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_fill_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_fill_range.cpp index da5a7528990e..2962a0ed84da 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_fill_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_fill_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_filln_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_filln_range.cpp index 455298ab0b3e..148a1f8412f5 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_filln_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_filln_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_move_n_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_move_n_range.cpp index fae0b0549ce7..7056916ea93e 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_move_n_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_move_n_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_move_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_move_range.cpp index 5dc4d934bed7..71abbfc9fbcd 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_move_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_move_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_value_construct_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_value_construct_range.cpp index ee2608b1e256..6c03eda3dc4c 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_value_construct_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_value_construct_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_value_constructn_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_value_constructn_range.cpp index b3e7d60ae3d1..9165e8ef40f3 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_value_constructn_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/uninitialized_value_constructn_range.cpp @@ -5,10 +5,11 @@ // 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) +#include +#include #include -#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/unique_copy_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/unique_copy_range.cpp index fba3128d1880..ef2d45eaee9a 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/unique_copy_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/unique_copy_range.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/container_algorithms/unique_range.cpp b/libs/core/algorithms/tests/unit/container_algorithms/unique_range.cpp index da2f7ec19cd0..b0f17a473ea1 100644 --- a/libs/core/algorithms/tests/unit/container_algorithms/unique_range.cpp +++ b/libs/core/algorithms/tests/unit/container_algorithms/unique_range.cpp @@ -5,10 +5,10 @@ // 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) +#include +#include #include -#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/adjacentdifference_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/adjacentdifference_datapar.cpp index ff12c7a77832..2187bbb796a6 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/adjacentdifference_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/adjacentdifference_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/adjacentfind_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/adjacentfind_datapar.cpp index e8da18f1202d..c66a49180e3b 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/adjacentfind_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/adjacentfind_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/all_of_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/all_of_datapar.cpp index 266ee5219fc0..c4b904d9f967 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/all_of_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/all_of_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/any_of_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/any_of_datapar.cpp index b0673af4699e..97a8b119ed10 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/any_of_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/any_of_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/copy_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/copy_datapar.cpp index bbfbee1a3d00..129847c4d5b5 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/copy_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/copy_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/copyn_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/copyn_datapar.cpp index d90e48a0dffe..dd7589f27873 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/copyn_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/copyn_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/count_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/count_datapar.cpp index a9e2793499fa..ac09d2b91754 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/count_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/count_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/countif_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/countif_datapar.cpp index ebc987ff832e..472a7e77d4b4 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/countif_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/countif_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/equal_binary_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/equal_binary_datapar.cpp index 1047bc66c49c..2fdc24ebbd77 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/equal_binary_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/equal_binary_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/equal_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/equal_datapar.cpp index 7dcfa00842a5..a30bdaf91aea 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/equal_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/equal_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/fill_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/fill_datapar.cpp index 4b15b673110f..35d12a44099c 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/fill_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/fill_datapar.cpp @@ -6,8 +6,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/filln_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/filln_datapar.cpp index f1ece454349c..9b9f72c6a26c 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/filln_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/filln_datapar.cpp @@ -6,8 +6,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/find_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/find_datapar.cpp index 57200fbe4dd3..c5aab6ebc87d 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/find_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/find_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/findend_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/findend_datapar.cpp index f81219d24506..d5eeeebe8d91 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/findend_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/findend_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/findfirstof_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/findfirstof_datapar.cpp index c5f6726d6480..d007d08a2cc0 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/findfirstof_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/findfirstof_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/findif_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/findif_datapar.cpp index bffc9b5936c0..78b0c1c91ce9 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/findif_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/findif_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/findifnot_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/findifnot_datapar.cpp index 4e2926fd8405..6ea8f7cffb17 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/findifnot_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/findifnot_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/foreach_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/foreach_datapar.cpp index f58d8d57419f..a99d01046a30 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/foreach_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/foreach_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/foreach_datapar_zipiter.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/foreach_datapar_zipiter.cpp index ca39116083ac..0e0f15772065 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/foreach_datapar_zipiter.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/foreach_datapar_zipiter.cpp @@ -4,10 +4,10 @@ // 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) -#include +#include +#include +#include #include -#include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/foreachn_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/foreachn_datapar.cpp index ccb7c95a6b21..41ac2e746368 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/foreachn_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/foreachn_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/generate_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/generate_datapar.cpp index a7a7675c3bb6..27921d481632 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/generate_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/generate_datapar.cpp @@ -6,8 +6,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/generate_tests.hpp b/libs/core/algorithms/tests/unit/datapar_algorithms/generate_tests.hpp index 15f7a551b2ed..6ef9124bf013 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/generate_tests.hpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/generate_tests.hpp @@ -8,11 +8,11 @@ #pragma once -#include -#include -#include +#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/generaten_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/generaten_datapar.cpp index 61ca3cab939d..cffc78fe6f0d 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/generaten_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/generaten_datapar.cpp @@ -6,8 +6,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/generaten_tests.hpp b/libs/core/algorithms/tests/unit/datapar_algorithms/generaten_tests.hpp index b0e7dc0f5eb8..6ffa03861d89 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/generaten_tests.hpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/generaten_tests.hpp @@ -7,11 +7,11 @@ #pragma once -#include -#include -#include +#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/mismatch_binary_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/mismatch_binary_datapar.cpp index faa1dddaaf62..959158d592b3 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/mismatch_binary_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/mismatch_binary_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/mismatch_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/mismatch_datapar.cpp index ea31e307bd85..02576c030a0f 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/mismatch_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/mismatch_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/none_of_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/none_of_datapar.cpp index 8138f9d3190d..2232d24022c9 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/none_of_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/none_of_datapar.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/reduce_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/reduce_datapar.cpp index a0ea3456efbc..45b38f2f3b41 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/reduce_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/reduce_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/replace_copy_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/replace_copy_datapar.cpp index 03fdd259cc6f..9c416b5cf5cd 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/replace_copy_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/replace_copy_datapar.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/replace_copy_if_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/replace_copy_if_datapar.cpp index 5410e0c8b011..992842515ab9 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/replace_copy_if_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/replace_copy_if_datapar.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/replace_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/replace_datapar.cpp index 4c462be731d2..c26e06f83137 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/replace_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/replace_datapar.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/replace_if_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/replace_if_datapar.cpp index d93e57178a0f..17fa2c8a260b 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/replace_if_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/replace_if_datapar.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/transform_binary2_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/transform_binary2_datapar.cpp index e66879abad00..5826df0ed6f9 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/transform_binary2_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/transform_binary2_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/transform_binary_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/transform_binary_datapar.cpp index 0fac4c9c912a..9b6173317ef0 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/transform_binary_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/transform_binary_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/transform_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/transform_datapar.cpp index 35da5418bf14..091ba032141c 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/transform_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/transform_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/transform_reduce_binary_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/transform_reduce_binary_datapar.cpp index d4f5839ee2b2..23639d2ed958 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/transform_reduce_binary_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/transform_reduce_binary_datapar.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/datapar_algorithms/transform_reduce_datapar.cpp b/libs/core/algorithms/tests/unit/datapar_algorithms/transform_reduce_datapar.cpp index 5b090fa0c9a7..01a6e3b798e6 100644 --- a/libs/core/algorithms/tests/unit/datapar_algorithms/transform_reduce_datapar.cpp +++ b/libs/core/algorithms/tests/unit/datapar_algorithms/transform_reduce_datapar.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/algorithms/tests/unit/unseq_algorithms/foreach_unseq.cpp b/libs/core/algorithms/tests/unit/unseq_algorithms/foreach_unseq.cpp index 13cf1348ada5..3d1f325b3312 100644 --- a/libs/core/algorithms/tests/unit/unseq_algorithms/foreach_unseq.cpp +++ b/libs/core/algorithms/tests/unit/unseq_algorithms/foreach_unseq.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/unseq_algorithms/foreach_unseq_zipiter.cpp b/libs/core/algorithms/tests/unit/unseq_algorithms/foreach_unseq_zipiter.cpp index af8495ff4252..266d5f135ee3 100644 --- a/libs/core/algorithms/tests/unit/unseq_algorithms/foreach_unseq_zipiter.cpp +++ b/libs/core/algorithms/tests/unit/unseq_algorithms/foreach_unseq_zipiter.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/unseq_algorithms/foreachn_unseq.cpp b/libs/core/algorithms/tests/unit/unseq_algorithms/foreachn_unseq.cpp index eefe10ba5356..c30b4e74f18c 100644 --- a/libs/core/algorithms/tests/unit/unseq_algorithms/foreachn_unseq.cpp +++ b/libs/core/algorithms/tests/unit/unseq_algorithms/foreachn_unseq.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/unseq_algorithms/reduce_unseq.cpp b/libs/core/algorithms/tests/unit/unseq_algorithms/reduce_unseq.cpp index 10f9c0c4a3fc..e94547d0f107 100644 --- a/libs/core/algorithms/tests/unit/unseq_algorithms/reduce_unseq.cpp +++ b/libs/core/algorithms/tests/unit/unseq_algorithms/reduce_unseq.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/unseq_algorithms/transform_binary2_unseq.cpp b/libs/core/algorithms/tests/unit/unseq_algorithms/transform_binary2_unseq.cpp index 3c567fac8c62..0b42c4c04faa 100644 --- a/libs/core/algorithms/tests/unit/unseq_algorithms/transform_binary2_unseq.cpp +++ b/libs/core/algorithms/tests/unit/unseq_algorithms/transform_binary2_unseq.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/unseq_algorithms/transform_binary_unseq.cpp b/libs/core/algorithms/tests/unit/unseq_algorithms/transform_binary_unseq.cpp index a0e6bf9d7a4c..a5316de8c778 100644 --- a/libs/core/algorithms/tests/unit/unseq_algorithms/transform_binary_unseq.cpp +++ b/libs/core/algorithms/tests/unit/unseq_algorithms/transform_binary_unseq.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/unseq_algorithms/transform_reduce_binary_unseq.cpp b/libs/core/algorithms/tests/unit/unseq_algorithms/transform_reduce_binary_unseq.cpp index 13009b1e2d3c..b50b12006e7d 100644 --- a/libs/core/algorithms/tests/unit/unseq_algorithms/transform_reduce_binary_unseq.cpp +++ b/libs/core/algorithms/tests/unit/unseq_algorithms/transform_reduce_binary_unseq.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/unseq_algorithms/transform_reduce_unseq.cpp b/libs/core/algorithms/tests/unit/unseq_algorithms/transform_reduce_unseq.cpp index b3ef77e40940..e529a02c05db 100644 --- a/libs/core/algorithms/tests/unit/unseq_algorithms/transform_reduce_unseq.cpp +++ b/libs/core/algorithms/tests/unit/unseq_algorithms/transform_reduce_unseq.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/algorithms/tests/unit/unseq_algorithms/transform_unseq.cpp b/libs/core/algorithms/tests/unit/unseq_algorithms/transform_unseq.cpp index f73ace788aca..3ddb2617d954 100644 --- a/libs/core/algorithms/tests/unit/unseq_algorithms/transform_unseq.cpp +++ b/libs/core/algorithms/tests/unit/unseq_algorithms/transform_unseq.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/async_combinators/tests/regressions/split_future_2246.cpp b/libs/core/async_combinators/tests/regressions/split_future_2246.cpp index 58ee983999ac..97d691757daf 100644 --- a/libs/core/async_combinators/tests/regressions/split_future_2246.cpp +++ b/libs/core/async_combinators/tests/regressions/split_future_2246.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/async_combinators/tests/regressions/wait_all_std_array_2035.cpp b/libs/core/async_combinators/tests/regressions/wait_all_std_array_2035.cpp index 00f84ca6839c..db60eeaf4b79 100644 --- a/libs/core/async_combinators/tests/regressions/wait_all_std_array_2035.cpp +++ b/libs/core/async_combinators/tests/regressions/wait_all_std_array_2035.cpp @@ -6,8 +6,8 @@ // This compile-only test case verifies that #2035 remains fixed -#include -#include +#include +#include #include #include diff --git a/libs/core/async_combinators/tests/regressions/when_all_vectors_1623.cpp b/libs/core/async_combinators/tests/regressions/when_all_vectors_1623.cpp index bca975785d83..67aa7b24ae29 100644 --- a/libs/core/async_combinators/tests/regressions/when_all_vectors_1623.cpp +++ b/libs/core/async_combinators/tests/regressions/when_all_vectors_1623.cpp @@ -7,8 +7,8 @@ // This test case demonstrates the issue described in #1623: hpx::wait_all() // invoked with two vector> fails -#include -#include +#include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/split_shared_future.cpp b/libs/core/async_combinators/tests/unit/split_shared_future.cpp index 94a4ecc99641..e7409c0e9b86 100644 --- a/libs/core/async_combinators/tests/unit/split_shared_future.cpp +++ b/libs/core/async_combinators/tests/unit/split_shared_future.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/wait_all.cpp b/libs/core/async_combinators/tests/unit/wait_all.cpp index 26c67eb39dc1..8726fb0fd0a2 100644 --- a/libs/core/async_combinators/tests/unit/wait_all.cpp +++ b/libs/core/async_combinators/tests/unit/wait_all.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/wait_all_std_array.cpp b/libs/core/async_combinators/tests/unit/wait_all_std_array.cpp index 636bb1cce67e..807b09dcffec 100644 --- a/libs/core/async_combinators/tests/unit/wait_all_std_array.cpp +++ b/libs/core/async_combinators/tests/unit/wait_all_std_array.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/wait_any.cpp b/libs/core/async_combinators/tests/unit/wait_any.cpp index c044857d0113..59b1bf821d78 100644 --- a/libs/core/async_combinators/tests/unit/wait_any.cpp +++ b/libs/core/async_combinators/tests/unit/wait_any.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/wait_any_std_array.cpp b/libs/core/async_combinators/tests/unit/wait_any_std_array.cpp index 4e6a44fa27a5..064374ded7a6 100644 --- a/libs/core/async_combinators/tests/unit/wait_any_std_array.cpp +++ b/libs/core/async_combinators/tests/unit/wait_any_std_array.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/wait_each.cpp b/libs/core/async_combinators/tests/unit/wait_each.cpp index 24a1687363cb..2dc050edb2e6 100644 --- a/libs/core/async_combinators/tests/unit/wait_each.cpp +++ b/libs/core/async_combinators/tests/unit/wait_each.cpp @@ -6,10 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/wait_some.cpp b/libs/core/async_combinators/tests/unit/wait_some.cpp index f4ae165db33d..f03852cc51e4 100644 --- a/libs/core/async_combinators/tests/unit/wait_some.cpp +++ b/libs/core/async_combinators/tests/unit/wait_some.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/wait_some_std_array.cpp b/libs/core/async_combinators/tests/unit/wait_some_std_array.cpp index 07ed066bb97a..9f8b73bdcbff 100644 --- a/libs/core/async_combinators/tests/unit/wait_some_std_array.cpp +++ b/libs/core/async_combinators/tests/unit/wait_some_std_array.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/when_all.cpp b/libs/core/async_combinators/tests/unit/when_all.cpp index 6e916b636ec0..88f20ff5724f 100644 --- a/libs/core/async_combinators/tests/unit/when_all.cpp +++ b/libs/core/async_combinators/tests/unit/when_all.cpp @@ -6,10 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/when_all_std_array.cpp b/libs/core/async_combinators/tests/unit/when_all_std_array.cpp index 405c4e045c3f..82655b77eb68 100644 --- a/libs/core/async_combinators/tests/unit/when_all_std_array.cpp +++ b/libs/core/async_combinators/tests/unit/when_all_std_array.cpp @@ -6,12 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include - -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/when_any.cpp b/libs/core/async_combinators/tests/unit/when_any.cpp index 24397cd3bdce..5f7851bd885f 100644 --- a/libs/core/async_combinators/tests/unit/when_any.cpp +++ b/libs/core/async_combinators/tests/unit/when_any.cpp @@ -6,10 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/when_any_std_array.cpp b/libs/core/async_combinators/tests/unit/when_any_std_array.cpp index ce4bc4c6efc4..2edff5be3636 100644 --- a/libs/core/async_combinators/tests/unit/when_any_std_array.cpp +++ b/libs/core/async_combinators/tests/unit/when_any_std_array.cpp @@ -6,12 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include - -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/when_each.cpp b/libs/core/async_combinators/tests/unit/when_each.cpp index 93c22d5e5e92..da79d31c4a6e 100644 --- a/libs/core/async_combinators/tests/unit/when_each.cpp +++ b/libs/core/async_combinators/tests/unit/when_each.cpp @@ -5,10 +5,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/when_some.cpp b/libs/core/async_combinators/tests/unit/when_some.cpp index ca5aa1dc338d..c4eb62e35dcc 100644 --- a/libs/core/async_combinators/tests/unit/when_some.cpp +++ b/libs/core/async_combinators/tests/unit/when_some.cpp @@ -6,10 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_combinators/tests/unit/when_some_std_array.cpp b/libs/core/async_combinators/tests/unit/when_some_std_array.cpp index c60cfa51153a..d584ae25523b 100644 --- a/libs/core/async_combinators/tests/unit/when_some_std_array.cpp +++ b/libs/core/async_combinators/tests/unit/when_some_std_array.cpp @@ -6,12 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include - -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_cuda/tests/performance/cuda_executor_throughput.cpp b/libs/core/async_cuda/tests/performance/cuda_executor_throughput.cpp index e93304cff21e..f20a83e2bfe6 100644 --- a/libs/core/async_cuda/tests/performance/cuda_executor_throughput.cpp +++ b/libs/core/async_cuda/tests/performance/cuda_executor_throughput.cpp @@ -25,15 +25,12 @@ // Currently, nvcc does not handle lambda functions properly and it is simpler to use // cudaMalloc/cudaMemcpy etc, so we do not #define HPX_CUBLAS_DEMO_WITH_ALLOCATOR -#include -#include -#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include #include #include diff --git a/libs/core/async_cuda/tests/performance/synchronize.cu b/libs/core/async_cuda/tests/performance/synchronize.cu index bfbbc26e84b5..359a59568f42 100644 --- a/libs/core/async_cuda/tests/performance/synchronize.cu +++ b/libs/core/async_cuda/tests/performance/synchronize.cu @@ -9,9 +9,9 @@ // NVCC fails unceremoniously with this test at least until V11.5 #if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION > 1105) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/async_cuda/tests/unit/cublas_matmul.cpp b/libs/core/async_cuda/tests/unit/cublas_matmul.cpp index 4338a971bbda..f989b46728d1 100644 --- a/libs/core/async_cuda/tests/unit/cublas_matmul.cpp +++ b/libs/core/async_cuda/tests/unit/cublas_matmul.cpp @@ -25,14 +25,12 @@ // Currently, nvcc does not handle lambda functions properly and it is simpler to use // cudaMalloc/cudaMemcpy etc, so we do not #define HPX_CUBLAS_DEMO_WITH_ALLOCATOR +#include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/libs/core/async_cuda/tests/unit/cuda_future.cpp b/libs/core/async_cuda/tests/unit/cuda_future.cpp index bb3c4d77ada6..2f3077718c27 100644 --- a/libs/core/async_cuda/tests/unit/cuda_future.cpp +++ b/libs/core/async_cuda/tests/unit/cuda_future.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/libs/core/async_cuda/tests/unit/saxpy.cu b/libs/core/async_cuda/tests/unit/saxpy.cu index 9972bfbdb0dd..347c494a18c9 100644 --- a/libs/core/async_cuda/tests/unit/saxpy.cu +++ b/libs/core/async_cuda/tests/unit/saxpy.cu @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/async_cuda/tests/unit/transform_stream.cu b/libs/core/async_cuda/tests/unit/transform_stream.cu index 65dcf730cba8..b27f197822c6 100644 --- a/libs/core/async_cuda/tests/unit/transform_stream.cu +++ b/libs/core/async_cuda/tests/unit/transform_stream.cu @@ -9,10 +9,9 @@ // NVCC fails unceremoniously with this test at least until V11.5 #if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION > 1105) -#include +#include +#include #include -#include -#include #include #include diff --git a/libs/core/async_local/tests/unit/apply_local.cpp b/libs/core/async_local/tests/unit/apply_local.cpp index 5ae6bbdbb98e..a4f5d0a92b8f 100644 --- a/libs/core/async_local/tests/unit/apply_local.cpp +++ b/libs/core/async_local/tests/unit/apply_local.cpp @@ -5,11 +5,11 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include -#include -#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_local/tests/unit/apply_local_executor.cpp b/libs/core/async_local/tests/unit/apply_local_executor.cpp index 103ec16782c6..41b514933a75 100644 --- a/libs/core/async_local/tests/unit/apply_local_executor.cpp +++ b/libs/core/async_local/tests/unit/apply_local_executor.cpp @@ -5,12 +5,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/async_local/tests/unit/async_local.cpp b/libs/core/async_local/tests/unit/async_local.cpp index 55aa7a56ac22..943c651be600 100644 --- a/libs/core/async_local/tests/unit/async_local.cpp +++ b/libs/core/async_local/tests/unit/async_local.cpp @@ -4,9 +4,8 @@ // 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) -#include -#include -#include +#include +#include #include #include diff --git a/libs/core/async_local/tests/unit/async_local_executor.cpp b/libs/core/async_local/tests/unit/async_local_executor.cpp index b3c0c25ea522..a31a0a5e8a75 100644 --- a/libs/core/async_local/tests/unit/async_local_executor.cpp +++ b/libs/core/async_local/tests/unit/async_local_executor.cpp @@ -5,9 +5,9 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/async_local/tests/unit/async_local_executor_additional_arguments.cpp b/libs/core/async_local/tests/unit/async_local_executor_additional_arguments.cpp index 7ca813a52644..91c3283c5a48 100644 --- a/libs/core/async_local/tests/unit/async_local_executor_additional_arguments.cpp +++ b/libs/core/async_local/tests/unit/async_local_executor_additional_arguments.cpp @@ -5,10 +5,9 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include #include @@ -43,12 +42,12 @@ struct additional_argument_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// std::int32_t increment(additional_argument, std::int32_t i) diff --git a/libs/core/async_mpi/tests/unit/algorithm_transform_mpi.cpp b/libs/core/async_mpi/tests/unit/algorithm_transform_mpi.cpp index a1c3a4851582..f8e5de1ba41b 100644 --- a/libs/core/async_mpi/tests/unit/algorithm_transform_mpi.cpp +++ b/libs/core/async_mpi/tests/unit/algorithm_transform_mpi.cpp @@ -4,14 +4,12 @@ // 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) -#include -#include -#include +#include +#include #include #include -#include -#include #include +#include #include "algorithm_test_utils.hpp" diff --git a/libs/core/async_mpi/tests/unit/mpi_ring_async_executor.cpp b/libs/core/async_mpi/tests/unit/mpi_ring_async_executor.cpp index ef92a5afc1b0..d059e184a76c 100644 --- a/libs/core/async_mpi/tests/unit/mpi_ring_async_executor.cpp +++ b/libs/core/async_mpi/tests/unit/mpi_ring_async_executor.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/libs/core/async_sycl/tests/unit/sycl_stream.cpp b/libs/core/async_sycl/tests/unit/sycl_stream.cpp index 07bf8762c7bb..65a3b69893e1 100644 --- a/libs/core/async_sycl/tests/unit/sycl_stream.cpp +++ b/libs/core/async_sycl/tests/unit/sycl_stream.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Gregor Daiß +// Copyright (c) 2022 Gregor Daiß // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,6 +6,14 @@ // // hpxinspect:noascii +#include +#include +#include + +#if defined(HPX_HAVE_SYCL) +#include +#include + #include #include #include @@ -13,13 +21,6 @@ #include #include -#include -#include -#include -#if defined(HPX_HAVE_SYCL) -#include -#include - #include "common/sycl_vector_add_test_utils.hpp" #include @@ -27,7 +28,7 @@ constexpr size_t vectorsize = 200000000; constexpr size_t num_bytes = vectorsize * sizeof(float); -int hpx_main(int, char**) +int hpx_main(int, char*[]) { // Enable polling for the future hpx::sycl::experimental::detail::register_polling( @@ -144,6 +145,8 @@ int main(int argc, char* argv[]) return hpx::init(argc, argv); } #else +#include + // Handle none-sycl builds int main() { diff --git a/libs/core/async_sycl/tests/unit/sycl_vector_add_concurrent_executors.cpp b/libs/core/async_sycl/tests/unit/sycl_vector_add_concurrent_executors.cpp index 7a47ec3accb3..0296d46cfa82 100644 --- a/libs/core/async_sycl/tests/unit/sycl_vector_add_concurrent_executors.cpp +++ b/libs/core/async_sycl/tests/unit/sycl_vector_add_concurrent_executors.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Gregor Daiß +// Copyright (c) 2022 Gregor Daiß // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,18 +6,20 @@ // // hpxinspect:noascii +#include +#include +#include + +#if defined(HPX_HAVE_SYCL) +#include +#include + #include #include #include #include #include -#include -#include -#include -#if defined(HPX_HAVE_SYCL) -#include -#include #include #include "common/sycl_vector_add_test_utils.hpp" @@ -111,7 +113,7 @@ void VectorAdd(std::vector const& a_vector, } } -int hpx_main(int, char**) +int hpx_main(int, char*[]) { // Enable polling for the future hpx::sycl::experimental::detail::register_polling( @@ -142,6 +144,8 @@ int main(int argc, char* argv[]) return hpx::init(argc, argv); } #else +#include + // Handle none-sycl builds int main() { diff --git a/libs/core/async_sycl/tests/unit/sycl_vector_add_executor.cpp b/libs/core/async_sycl/tests/unit/sycl_vector_add_executor.cpp index 41f86d5d2458..686d843a86a5 100644 --- a/libs/core/async_sycl/tests/unit/sycl_vector_add_executor.cpp +++ b/libs/core/async_sycl/tests/unit/sycl_vector_add_executor.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Gregor Daiß +// Copyright (c) 2022 Gregor Daiß // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,19 +6,20 @@ // // hpxinspect:noascii +#include +#include +#include + +#if defined(HPX_HAVE_SYCL) +#include +#include + #include #include #include #include #include -#include -#include -#include -#if defined(HPX_HAVE_SYCL) -#include -#include - #include "common/sycl_vector_add_test_utils.hpp" #include @@ -249,7 +250,7 @@ void VectorAdd_test4(std::vector const& a_vector, my_manual_fut.get(); } -int hpx_main(int, char**) +int hpx_main(int, char*[]) { static_assert(vector_size >= 6, "vector_size unreasonably small"); // Enable polling for the future @@ -303,6 +304,8 @@ int main(int argc, char* argv[]) return hpx::init(argc, argv); } #else +#include + // Handle none-sycl builds int main() { diff --git a/libs/core/async_sycl/tests/unit/sycl_vector_add_get_future.cpp b/libs/core/async_sycl/tests/unit/sycl_vector_add_get_future.cpp index ff6a5ca7a06b..326a0e3e14cb 100644 --- a/libs/core/async_sycl/tests/unit/sycl_vector_add_get_future.cpp +++ b/libs/core/async_sycl/tests/unit/sycl_vector_add_get_future.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Gregor Daiß +// Copyright (c) 2022 Gregor Daiß // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,18 +6,19 @@ // // hpxinspect:noascii +#include +#include +#include + +#if defined(HPX_HAVE_SYCL) +#include + #include #include #include #include #include -#include -#include -#include -#if defined(HPX_HAVE_SYCL) -#include - #include "common/sycl_vector_add_test_utils.hpp" #include @@ -153,7 +154,7 @@ void VectorAdd(cl::sycl::queue& q, std::vector const& a_vector, } } -int hpx_main(int, char**) +int hpx_main(int, char*[]) { // Enable polling for the future hpx::sycl::experimental::detail::register_polling( @@ -210,6 +211,8 @@ int main(int argc, char* argv[]) return hpx::init(argc, argv); } #else +#include + // Handle none-sycl builds int main() { diff --git a/libs/core/command_line_handling_local/src/command_line_handling_local.cpp b/libs/core/command_line_handling_local/src/command_line_handling_local.cpp index 6dab0322fed0..9a7c15f81bf4 100644 --- a/libs/core/command_line_handling_local/src/command_line_handling_local.cpp +++ b/libs/core/command_line_handling_local/src/command_line_handling_local.cpp @@ -562,7 +562,6 @@ namespace hpx::local::detail { pu_offset_ = detail::handle_pu_offset(cfgmap, vm, static_cast(-1)); - // NOLINTNEXTLINE(bugprone-branch-clone) if (pu_offset_ != static_cast(-1)) { #if defined(__APPLE__) diff --git a/libs/core/command_line_handling_local/tests/regressions/ignore_aliases_local.cpp b/libs/core/command_line_handling_local/tests/regressions/ignore_aliases_local.cpp index 155ed476e247..73593df5d58d 100644 --- a/libs/core/command_line_handling_local/tests/regressions/ignore_aliases_local.cpp +++ b/libs/core/command_line_handling_local/tests/regressions/ignore_aliases_local.cpp @@ -5,7 +5,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include diff --git a/libs/core/compute_local/CMakeLists.txt b/libs/core/compute_local/CMakeLists.txt index 5fff3e86b037..b4c112efb880 100644 --- a/libs/core/compute_local/CMakeLists.txt +++ b/libs/core/compute_local/CMakeLists.txt @@ -28,10 +28,10 @@ set(compute_local_headers # cmake-format: off set(compute_local_compat_headers - hpx/compute/vector.hpp => hpx/modules/compute_local.hpp - hpx/compute/traits/allocator_traits.hpp => hpx/modules/compute_local.hpp - hpx/compute/host/numa_allocator.hpp => hpx/local/compute.hpp - hpx/compute/host/numa_binding_allocator.hpp => hpx/local/compute.hpp + hpx/compute/vector.hpp => hpx/compute.hpp + hpx/compute/traits/allocator_traits.hpp => hpx/compute.hpp + hpx/compute/host/numa_allocator.hpp => hpx/compute.hpp + hpx/compute/host/numa_binding_allocator.hpp => hpx/compute.hpp ) # cmake-format: on diff --git a/libs/core/compute_local/tests/regressions/for_each_value_proxy.cpp b/libs/core/compute_local/tests/regressions/for_each_value_proxy.cpp index 100640b96553..51dc5f61b867 100644 --- a/libs/core/compute_local/tests/regressions/for_each_value_proxy.cpp +++ b/libs/core/compute_local/tests/regressions/for_each_value_proxy.cpp @@ -4,9 +4,9 @@ // 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) +#include #include #include -#include #include #include @@ -55,7 +55,7 @@ class test_value_proxy T* p_; }; -namespace hpx { namespace traits { +namespace hpx::traits { template struct is_value_proxy> : std::true_type { @@ -66,7 +66,7 @@ namespace hpx { namespace traits { { using type = T; }; -}} // namespace hpx::traits +} // namespace hpx::traits template struct test_allocator diff --git a/libs/core/compute_local/tests/regressions/parallel_fill_4132.cpp b/libs/core/compute_local/tests/regressions/parallel_fill_4132.cpp index 0171c21aae0e..215d1332201d 100644 --- a/libs/core/compute_local/tests/regressions/parallel_fill_4132.cpp +++ b/libs/core/compute_local/tests/regressions/parallel_fill_4132.cpp @@ -5,9 +5,9 @@ // 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) +#include +#include #include -#include -#include #include #include diff --git a/libs/core/compute_local/tests/unit/block_fork_join_executor.cpp b/libs/core/compute_local/tests/unit/block_fork_join_executor.cpp index 810464277826..3d97c68369dc 100644 --- a/libs/core/compute_local/tests/unit/block_fork_join_executor.cpp +++ b/libs/core/compute_local/tests/unit/block_fork_join_executor.cpp @@ -5,13 +5,13 @@ // 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) -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/compute_local/tests/unit/numa_allocator.cpp b/libs/core/compute_local/tests/unit/numa_allocator.cpp index 5afb52e41c2e..5435f8d51f42 100644 --- a/libs/core/compute_local/tests/unit/numa_allocator.cpp +++ b/libs/core/compute_local/tests/unit/numa_allocator.cpp @@ -12,13 +12,13 @@ #define NUMA_BINDING_ALLOCATOR_DEBUG true #define NUMA_BINDING_ALLOCATOR_INIT_MEMORY true -#include -#include -#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/concurrency/tests/unit/contiguous_index_queue.cpp b/libs/core/concurrency/tests/unit/contiguous_index_queue.cpp index 1440ceb1921f..3bda97b432e5 100644 --- a/libs/core/concurrency/tests/unit/contiguous_index_queue.cpp +++ b/libs/core/concurrency/tests/unit/contiguous_index_queue.cpp @@ -7,12 +7,12 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include -#include -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/concurrency/tests/unit/freelist.cpp b/libs/core/concurrency/tests/unit/freelist.cpp index c9fb1fde8724..fd3fae75b986 100644 --- a/libs/core/concurrency/tests/unit/freelist.cpp +++ b/libs/core/concurrency/tests/unit/freelist.cpp @@ -5,12 +5,13 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include #include +#include #include #include diff --git a/libs/core/concurrency/tests/unit/non_contiguous_index_queue.cpp b/libs/core/concurrency/tests/unit/non_contiguous_index_queue.cpp index 434de073ed6a..0f3280bca64e 100644 --- a/libs/core/concurrency/tests/unit/non_contiguous_index_queue.cpp +++ b/libs/core/concurrency/tests/unit/non_contiguous_index_queue.cpp @@ -5,12 +5,12 @@ // 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) +#include #include -#include -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/concurrency/tests/unit/queue_stress.cpp b/libs/core/concurrency/tests/unit/queue_stress.cpp index 8b45e65bac53..fd9aaa1a1d97 100644 --- a/libs/core/concurrency/tests/unit/queue_stress.cpp +++ b/libs/core/concurrency/tests/unit/queue_stress.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include #include diff --git a/libs/core/concurrency/tests/unit/stack_stress.cpp b/libs/core/concurrency/tests/unit/stack_stress.cpp index 5e2eeef83b14..adcd2d95ec6a 100644 --- a/libs/core/concurrency/tests/unit/stack_stress.cpp +++ b/libs/core/concurrency/tests/unit/stack_stress.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include #include diff --git a/libs/core/coroutines/tests/regressions/coroutine_function_destructor_yield_4800.cpp b/libs/core/coroutines/tests/regressions/coroutine_function_destructor_yield_4800.cpp index b892bee4666b..4bf9d34e8897 100644 --- a/libs/core/coroutines/tests/regressions/coroutine_function_destructor_yield_4800.cpp +++ b/libs/core/coroutines/tests/regressions/coroutine_function_destructor_yield_4800.cpp @@ -6,11 +6,10 @@ // This test verifies that the destructor of a thread function may yield. -#include -#include -#include +#include +#include #include -#include +#include #include diff --git a/libs/core/datastructures/include/hpx/datastructures/tuple.hpp b/libs/core/datastructures/include/hpx/datastructures/tuple.hpp index f9dd126b1621..5b8ef33d0c23 100644 --- a/libs/core/datastructures/include/hpx/datastructures/tuple.hpp +++ b/libs/core/datastructures/include/hpx/datastructures/tuple.hpp @@ -401,6 +401,7 @@ namespace hpx { std::enable_if_t>>, typename EnableCompatible = std::enable_if_t< hpx::detail::are_tuples_compatible::value>> + // NOLINTNEXTLINE(bugprone-forwarding-reference-overload) constexpr HPX_HOST_DEVICE tuple(UTuple&& other) : tuple(index_pack{}, HPX_FORWARD(UTuple, other)) { diff --git a/libs/core/datastructures/tests/performance/small_vector_benchmark.cpp b/libs/core/datastructures/tests/performance/small_vector_benchmark.cpp index 3bc02538d002..964a3aa75c0a 100644 --- a/libs/core/datastructures/tests/performance/small_vector_benchmark.cpp +++ b/libs/core/datastructures/tests/performance/small_vector_benchmark.cpp @@ -5,10 +5,10 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include +#include #include -#include -#include -#include +#include +#include #include #include diff --git a/libs/core/datastructures/tests/regressions/non_default_constructible_tuple_5886.cpp b/libs/core/datastructures/tests/regressions/non_default_constructible_tuple_5886.cpp index c2797603d984..bdb41fac4044 100644 --- a/libs/core/datastructures/tests/regressions/non_default_constructible_tuple_5886.cpp +++ b/libs/core/datastructures/tests/regressions/non_default_constructible_tuple_5886.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/datastructures/tests/unit/any_serialization.cpp b/libs/core/datastructures/tests/unit/any_serialization.cpp index adc96ce0ae31..b3b3b28070d7 100644 --- a/libs/core/datastructures/tests/unit/any_serialization.cpp +++ b/libs/core/datastructures/tests/unit/any_serialization.cpp @@ -6,7 +6,10 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#include +#include +#include +#include +#include #include #include // remove @@ -14,11 +17,6 @@ #include #include -#include -#include -#include -#include - #include "small_big_object.hpp" using hpx::program_options::options_description; diff --git a/libs/core/datastructures/tests/unit/serialization_raw_pointer_tuple.cpp b/libs/core/datastructures/tests/unit/serialization_raw_pointer_tuple.cpp index 38ca2bea54c2..07bb2df4c66e 100644 --- a/libs/core/datastructures/tests/unit/serialization_raw_pointer_tuple.cpp +++ b/libs/core/datastructures/tests/unit/serialization_raw_pointer_tuple.cpp @@ -11,12 +11,11 @@ #define HPX_SERIALIZATION_HAVE_ALLOW_CONST_TUPLE_MEMBERS #include -#include -#include -#include +#include #include #include #include +#include #include diff --git a/libs/core/execution/include/hpx/execution/algorithms/sync_wait.hpp b/libs/core/execution/include/hpx/execution/algorithms/sync_wait.hpp index eb061e809a93..8c44918b155e 100644 --- a/libs/core/execution/include/hpx/execution/algorithms/sync_wait.hpp +++ b/libs/core/execution/include/hpx/execution/algorithms/sync_wait.hpp @@ -192,6 +192,7 @@ namespace hpx::execution::experimental::detail { // this means that none of set_value/set_error/set_stopped was // called. HPX_ASSERT(hpx::holds_alternative(value)); + if constexpr (Type == sync_wait_type::single) { using single_result_type = make_decayed_pack_t< @@ -214,6 +215,7 @@ namespace hpx::execution::experimental::detail { set_error_t, type&& r, Error&& error) noexcept { using error_t = std::decay_t; + if constexpr (std::is_same_v) { r.state.value.template emplace( diff --git a/libs/core/execution/tests/regressions/annotated_minmax_2593.cpp b/libs/core/execution/tests/regressions/annotated_minmax_2593.cpp index 86bd8df443b7..b9e1c4449cc9 100644 --- a/libs/core/execution/tests/regressions/annotated_minmax_2593.cpp +++ b/libs/core/execution/tests/regressions/annotated_minmax_2593.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/execution/tests/regressions/chunk_size_4118.cpp b/libs/core/execution/tests/regressions/chunk_size_4118.cpp index d2c26e591ad5..f3f8bbad1d6b 100644 --- a/libs/core/execution/tests/regressions/chunk_size_4118.cpp +++ b/libs/core/execution/tests/regressions/chunk_size_4118.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include @@ -33,12 +33,12 @@ struct test_async_executor : hpx::execution::parallel_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution int hpx_main() { diff --git a/libs/core/execution/tests/regressions/fibonacci_sr.cpp b/libs/core/execution/tests/regressions/fibonacci_sr.cpp index dd91d654d386..b58408fd4292 100644 --- a/libs/core/execution/tests/regressions/fibonacci_sr.cpp +++ b/libs/core/execution/tests/regressions/fibonacci_sr.cpp @@ -9,8 +9,8 @@ // Clang V11 ICE's on this test #if !defined(HPX_CLANG_VERSION) || (HPX_CLANG_VERSION / 10000) != 11 -#include -#include +#include +#include #include namespace ex = hpx::execution::experimental; diff --git a/libs/core/execution/tests/regressions/is_executor_1691.cpp b/libs/core/execution/tests/regressions/is_executor_1691.cpp index 5263580baeb2..3184f83b7721 100644 --- a/libs/core/execution/tests/regressions/is_executor_1691.cpp +++ b/libs/core/execution/tests/regressions/is_executor_1691.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include @@ -16,7 +16,7 @@ struct my_executor : hpx::execution::parallel_executor { }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_one_way_executor : std::true_type { @@ -31,7 +31,7 @@ namespace hpx { namespace parallel { namespace execution { struct is_bulk_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// int hpx_main() diff --git a/libs/core/execution/tests/regressions/lambda_arguments_2403.cpp b/libs/core/execution/tests/regressions/lambda_arguments_2403.cpp index 3f06a781c771..09e0a4d9b4c5 100644 --- a/libs/core/execution/tests/regressions/lambda_arguments_2403.cpp +++ b/libs/core/execution/tests/regressions/lambda_arguments_2403.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include +#include +#include +#include #include #include -#include #include #include diff --git a/libs/core/execution/tests/regressions/lambda_return_type_2402.cpp b/libs/core/execution/tests/regressions/lambda_return_type_2402.cpp index b9019060107a..24dcb5e76196 100644 --- a/libs/core/execution/tests/regressions/lambda_return_type_2402.cpp +++ b/libs/core/execution/tests/regressions/lambda_return_type_2402.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include +#include +#include +#include #include #include -#include #include #include diff --git a/libs/core/execution/tests/regressions/rebind_par_simd.cpp b/libs/core/execution/tests/regressions/rebind_par_simd.cpp index 269a891ce8d5..4fd2d65aecfd 100644 --- a/libs/core/execution/tests/regressions/rebind_par_simd.cpp +++ b/libs/core/execution/tests/regressions/rebind_par_simd.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include /////////////////////////////////////////////////////////////////////////////// diff --git a/libs/core/execution/tests/unit/algorithm_as_sender.cpp b/libs/core/execution/tests/unit/algorithm_as_sender.cpp index 23761b9ace82..a84293884ed5 100644 --- a/libs/core/execution/tests/unit/algorithm_as_sender.cpp +++ b/libs/core/execution/tests/unit/algorithm_as_sender.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include "algorithm_test_utils.hpp" diff --git a/libs/core/execution/tests/unit/algorithm_run_loop.cpp b/libs/core/execution/tests/unit/algorithm_run_loop.cpp index c369a00e0581..b35851d69e33 100644 --- a/libs/core/execution/tests/unit/algorithm_run_loop.cpp +++ b/libs/core/execution/tests/unit/algorithm_run_loop.cpp @@ -10,14 +10,14 @@ // Clang V11 ICE's on this test #if !defined(HPX_CLANG_VERSION) || (HPX_CLANG_VERSION / 10000) != 11 -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include +#include +#include #include "algorithm_test_utils.hpp" diff --git a/libs/core/execution/tests/unit/algorithm_sync_wait.cpp b/libs/core/execution/tests/unit/algorithm_sync_wait.cpp index e5e4f5a860a3..5157b4e73988 100644 --- a/libs/core/execution/tests/unit/algorithm_sync_wait.cpp +++ b/libs/core/execution/tests/unit/algorithm_sync_wait.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include "algorithm_test_utils.hpp" diff --git a/libs/core/execution/tests/unit/algorithm_sync_wait_with_variant.cpp b/libs/core/execution/tests/unit/algorithm_sync_wait_with_variant.cpp index 232a64217549..99d7d02c2fb1 100644 --- a/libs/core/execution/tests/unit/algorithm_sync_wait_with_variant.cpp +++ b/libs/core/execution/tests/unit/algorithm_sync_wait_with_variant.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/execution/tests/unit/algorithm_then.cpp b/libs/core/execution/tests/unit/algorithm_then.cpp index 43288868dd78..17ddb1cb0d27 100644 --- a/libs/core/execution/tests/unit/algorithm_then.cpp +++ b/libs/core/execution/tests/unit/algorithm_then.cpp @@ -5,11 +5,11 @@ // 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) -#include -#include -#include +#include +#include +#include #include -#include +#include #include "algorithm_test_utils.hpp" diff --git a/libs/core/execution/tests/unit/bulk_async.cpp b/libs/core/execution/tests/unit/bulk_async.cpp index 8484ac6a6c5a..ee5e54cd876d 100644 --- a/libs/core/execution/tests/unit/bulk_async.cpp +++ b/libs/core/execution/tests/unit/bulk_async.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/execution/tests/unit/executor_parameters.cpp b/libs/core/execution/tests/unit/executor_parameters.cpp index 403f18bb11f3..2187d1fd2072 100644 --- a/libs/core/execution/tests/unit/executor_parameters.cpp +++ b/libs/core/execution/tests/unit/executor_parameters.cpp @@ -4,9 +4,9 @@ // 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) +#include +#include #include -#include -#include #include #include @@ -181,12 +181,12 @@ struct timer_hooks_parameters std::string name_; }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_executor_parameters : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution void test_combined_hooks() { diff --git a/libs/core/execution/tests/unit/executor_parameters_dispatching.cpp b/libs/core/execution/tests/unit/executor_parameters_dispatching.cpp index 066e2c0dc2b2..0947189d345f 100644 --- a/libs/core/execution/tests/unit/executor_parameters_dispatching.cpp +++ b/libs/core/execution/tests/unit/executor_parameters_dispatching.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include @@ -42,12 +42,12 @@ struct test_executor_get_chunk_size : hpx::execution::parallel_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_chunk_size { @@ -61,14 +61,14 @@ struct test_chunk_size } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { /// \cond NOINTERNAL template <> struct is_executor_parameters : std::true_type { }; /// \endcond -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// void test_get_chunk_size() @@ -136,12 +136,12 @@ struct test_executor_measure_iteration : hpx::execution::parallel_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_measure_iteration { @@ -153,14 +153,14 @@ struct test_measure_iteration } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { /// \cond NOINTERNAL template <> struct is_executor_parameters : std::true_type { }; /// \endcond -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// void test_get_measure_iteration() @@ -210,13 +210,13 @@ struct test_executor_maximal_number_of_chunks } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_number_of_chunks { @@ -229,12 +229,12 @@ struct test_number_of_chunks } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_executor_parameters : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// void test_maximal_number_of_chunks() @@ -281,13 +281,13 @@ struct test_executor_reset_thread_distribution } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_thread_distribution { @@ -298,12 +298,12 @@ struct test_thread_distribution } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_executor_parameters : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// void test_reset_thread_distribution() @@ -351,13 +351,13 @@ struct test_executor_processing_units_count : hpx::execution::parallel_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_processing_units { @@ -370,12 +370,12 @@ struct test_processing_units } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_executor_parameters : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// void test_processing_units_count() @@ -471,12 +471,12 @@ struct test_executor_begin_end : hpx::execution::parallel_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_begin_end { @@ -499,12 +499,12 @@ struct test_begin_end } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_executor_parameters : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// void test_mark_begin_execution() diff --git a/libs/core/execution/tests/unit/executor_parameters_timer_hooks.cpp b/libs/core/execution/tests/unit/executor_parameters_timer_hooks.cpp index a513344444b2..f863266398fd 100644 --- a/libs/core/execution/tests/unit/executor_parameters_timer_hooks.cpp +++ b/libs/core/execution/tests/unit/executor_parameters_timer_hooks.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include @@ -89,12 +89,12 @@ struct timer_hooks_parameters std::atomic count_; }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_executor_parameters : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution void test_timer_hooks() { diff --git a/libs/core/execution/tests/unit/foreach_tests.hpp b/libs/core/execution/tests/unit/foreach_tests.hpp index e28e5760ea4c..5b4ed48c992a 100644 --- a/libs/core/execution/tests/unit/foreach_tests.hpp +++ b/libs/core/execution/tests/unit/foreach_tests.hpp @@ -6,8 +6,8 @@ #pragma once -#include -#include +#include +#include #include #include diff --git a/libs/core/execution/tests/unit/future_then_executor.cpp b/libs/core/execution/tests/unit/future_then_executor.cpp index 34ce8b31b05d..6560d6994f90 100644 --- a/libs/core/execution/tests/unit/future_then_executor.cpp +++ b/libs/core/execution/tests/unit/future_then_executor.cpp @@ -7,11 +7,11 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include -#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/execution/tests/unit/minimal_async_executor.cpp b/libs/core/execution/tests/unit/minimal_async_executor.cpp index e46df137dc52..f9c5db8453a0 100644 --- a/libs/core/execution/tests/unit/minimal_async_executor.cpp +++ b/libs/core/execution/tests/unit/minimal_async_executor.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include @@ -158,12 +158,12 @@ struct test_async_executor1 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_async_executor2 : test_async_executor1 { @@ -180,12 +180,12 @@ struct test_async_executor2 : test_async_executor1 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_async_executor3 : test_async_executor1 { @@ -206,12 +206,12 @@ struct test_async_executor3 : test_async_executor1 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_async_executor4 : test_async_executor1 { @@ -232,7 +232,7 @@ struct test_async_executor4 : test_async_executor1 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { @@ -242,7 +242,7 @@ namespace hpx { namespace parallel { namespace execution { struct is_bulk_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_async_executor5 : test_async_executor1 { @@ -257,12 +257,12 @@ struct test_async_executor5 : test_async_executor1 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// int hpx_main() diff --git a/libs/core/execution/tests/unit/minimal_sync_executor.cpp b/libs/core/execution/tests/unit/minimal_sync_executor.cpp index f7ef5b90211a..d910a8725a7f 100644 --- a/libs/core/execution/tests/unit/minimal_sync_executor.cpp +++ b/libs/core/execution/tests/unit/minimal_sync_executor.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include +#include #include #include @@ -252,12 +252,12 @@ struct test_sync_executor1 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_one_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_sync_executor2 : test_sync_executor1 { @@ -292,7 +292,7 @@ struct test_sync_executor2 : test_sync_executor1 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_one_way_executor : std::true_type { @@ -302,7 +302,7 @@ namespace hpx { namespace parallel { namespace execution { struct is_bulk_one_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// int hpx_main() diff --git a/libs/core/execution/tests/unit/persistent_executor_parameters.cpp b/libs/core/execution/tests/unit/persistent_executor_parameters.cpp index 5d419e48460f..05ebd03b8b42 100644 --- a/libs/core/execution/tests/unit/persistent_executor_parameters.cpp +++ b/libs/core/execution/tests/unit/persistent_executor_parameters.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/execution/tests/unit/test_utils.hpp b/libs/core/execution/tests/unit/test_utils.hpp index 39093f3f4036..ff4accd28b2f 100644 --- a/libs/core/execution/tests/unit/test_utils.hpp +++ b/libs/core/execution/tests/unit/test_utils.hpp @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include diff --git a/libs/core/execution_base/tests/unit/any_sender.cpp b/libs/core/execution_base/tests/unit/any_sender.cpp index ce0e24a5ed63..bb705cb41a12 100644 --- a/libs/core/execution_base/tests/unit/any_sender.cpp +++ b/libs/core/execution_base/tests/unit/any_sender.cpp @@ -4,11 +4,8 @@ // 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) -#include -#include -#include -#include -#include +#include +#include #include #include diff --git a/libs/core/executors/examples/disable_thread_stealing_executor.cpp b/libs/core/executors/examples/disable_thread_stealing_executor.cpp index c09ee6799a86..4a3e952a40df 100644 --- a/libs/core/executors/examples/disable_thread_stealing_executor.cpp +++ b/libs/core/executors/examples/disable_thread_stealing_executor.cpp @@ -9,10 +9,10 @@ // thread stealing for the duration of the execution of a parallel algorithm // it is used with. +#include #include -#include -#include -#include +#include +#include #include #include @@ -76,7 +76,7 @@ namespace executor_example { /////////////////////////////////////////////////////////////////////////////// // simple forwarding implementations of executor traits -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template struct is_one_way_executor< @@ -112,7 +112,7 @@ namespace hpx { namespace parallel { namespace execution { : is_bulk_two_way_executor> { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution int hpx_main() { diff --git a/libs/core/executors/examples/executor_with_thread_hooks.cpp b/libs/core/executors/examples/executor_with_thread_hooks.cpp index 50fdb6d80e2b..19a5db048b82 100644 --- a/libs/core/executors/examples/executor_with_thread_hooks.cpp +++ b/libs/core/executors/examples/executor_with_thread_hooks.cpp @@ -10,10 +10,10 @@ // to associate custom thread data with the tasks that are created by the // underlying executor. +#include #include -#include -#include -#include +#include +#include #include #include @@ -183,7 +183,7 @@ namespace executor_example { /////////////////////////////////////////////////////////////////////////////// // simple forwarding implementations of executor traits -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template struct is_one_way_executor< @@ -219,7 +219,7 @@ namespace hpx { namespace parallel { namespace execution { : is_bulk_two_way_executor> { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution int hpx_main() { diff --git a/libs/core/executors/tests/regressions/bulk_sync_wait.cpp b/libs/core/executors/tests/regressions/bulk_sync_wait.cpp index 0860560ca110..1b1fb595ae0a 100644 --- a/libs/core/executors/tests/regressions/bulk_sync_wait.cpp +++ b/libs/core/executors/tests/regressions/bulk_sync_wait.cpp @@ -6,8 +6,8 @@ // sync_wait() did not compile when used with an lvalue sender involving bulk -#include -#include +#include +#include #include #include diff --git a/libs/core/executors/tests/regressions/bulk_then_execute_3182.cpp b/libs/core/executors/tests/regressions/bulk_then_execute_3182.cpp index dc728a063c9d..fd13e3c9a6da 100644 --- a/libs/core/executors/tests/regressions/bulk_then_execute_3182.cpp +++ b/libs/core/executors/tests/regressions/bulk_then_execute_3182.cpp @@ -6,9 +6,9 @@ // #3182: bulk_then_execute has unexpected return type/does not compile -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/executors/tests/regressions/future_then_async_executor.cpp b/libs/core/executors/tests/regressions/future_then_async_executor.cpp index b3d23f56da4d..649c85f60bce 100644 --- a/libs/core/executors/tests/regressions/future_then_async_executor.cpp +++ b/libs/core/executors/tests/regressions/future_then_async_executor.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include @@ -25,12 +25,12 @@ struct test_async_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution int hpx_main() { diff --git a/libs/core/executors/tests/regressions/parallel_executor_1781.cpp b/libs/core/executors/tests/regressions/parallel_executor_1781.cpp index 07518c5f87f1..31a3452e128e 100644 --- a/libs/core/executors/tests/regressions/parallel_executor_1781.cpp +++ b/libs/core/executors/tests/regressions/parallel_executor_1781.cpp @@ -4,10 +4,9 @@ // 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) -#include - -#include -#include +#include +#include +#include #include diff --git a/libs/core/executors/tests/regressions/pu_count_6184.cpp b/libs/core/executors/tests/regressions/pu_count_6184.cpp index d08380e97709..825e4a65b959 100644 --- a/libs/core/executors/tests/regressions/pu_count_6184.cpp +++ b/libs/core/executors/tests/regressions/pu_count_6184.cpp @@ -6,8 +6,8 @@ // #6184: Wrong processing_units_count of restricted_thread_pool_executor -#include -#include +#include +#include #include #include diff --git a/libs/core/executors/tests/regressions/wrapping_executor.cpp b/libs/core/executors/tests/regressions/wrapping_executor.cpp index 0d3d6f4c74f9..c5ae72964cf7 100644 --- a/libs/core/executors/tests/regressions/wrapping_executor.cpp +++ b/libs/core/executors/tests/regressions/wrapping_executor.cpp @@ -8,10 +8,10 @@ // Verify that a wrapping executor does not go out of scope prematurely when // used with a seq(task) execution policy. +#include #include -#include -#include -#include +#include +#include #include #include @@ -137,7 +137,7 @@ namespace test { /////////////////////////////////////////////////////////////////////////////// // simple forwarding implementations of executor traits -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template struct is_one_way_executor> @@ -169,7 +169,7 @@ namespace hpx { namespace parallel { namespace execution { : is_bulk_two_way_executor> { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution int hpx_main() { diff --git a/libs/core/executors/tests/unit/annotating_executor.cpp b/libs/core/executors/tests/unit/annotating_executor.cpp index 1e159b8afdff..529b090e8e07 100644 --- a/libs/core/executors/tests/unit/annotating_executor.cpp +++ b/libs/core/executors/tests/unit/annotating_executor.cpp @@ -7,13 +7,13 @@ #include #if defined(HPX_HAVE_THREAD_DESCRIPTION) -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include +#include #include #include @@ -466,12 +466,12 @@ struct test_async_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution int hpx_main() { diff --git a/libs/core/executors/tests/unit/annotation_property.cpp b/libs/core/executors/tests/unit/annotation_property.cpp index 91065fc5eeda..f9b043a957b2 100644 --- a/libs/core/executors/tests/unit/annotation_property.cpp +++ b/libs/core/executors/tests/unit/annotation_property.cpp @@ -7,13 +7,13 @@ #include #if defined(HPX_HAVE_THREAD_DESCRIPTION) -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include +#include #include #include diff --git a/libs/core/executors/tests/unit/created_executor.cpp b/libs/core/executors/tests/unit/created_executor.cpp index 756b54e6b902..910bdf399399 100644 --- a/libs/core/executors/tests/unit/created_executor.cpp +++ b/libs/core/executors/tests/unit/created_executor.cpp @@ -5,11 +5,11 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -57,7 +57,7 @@ struct void_parallel_executor : hpx::execution::parallel_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_bulk_one_way_executor : std::true_type { @@ -67,7 +67,7 @@ namespace hpx { namespace parallel { namespace execution { struct is_bulk_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution //////////////////////////////////////////////////////////////////////////////// // Tests to void_parallel_executor behavior for the bulk executes diff --git a/libs/core/executors/tests/unit/execution_policy_mappings.cpp b/libs/core/executors/tests/unit/execution_policy_mappings.cpp index 857d9d882162..b2c4be42e9de 100644 --- a/libs/core/executors/tests/unit/execution_policy_mappings.cpp +++ b/libs/core/executors/tests/unit/execution_policy_mappings.cpp @@ -4,13 +4,11 @@ // 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) -#include -#if defined(HPX_HAVE_DATAPAR) -#include -#endif -#include -#include +#include +#include +#include #include +#include #include diff --git a/libs/core/executors/tests/unit/explicit_scheduler_executor.cpp b/libs/core/executors/tests/unit/explicit_scheduler_executor.cpp index 66199a6b73f0..1db990fab81b 100644 --- a/libs/core/executors/tests/unit/explicit_scheduler_executor.cpp +++ b/libs/core/executors/tests/unit/explicit_scheduler_executor.cpp @@ -10,12 +10,12 @@ #if !defined(HPX_CLANG_VERSION) || \ ((HPX_CLANG_VERSION / 10000) != 11 && (HPX_CLANG_VERSION / 10000) != 8) -#include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/executors/tests/unit/fork_join_executor.cpp b/libs/core/executors/tests/unit/fork_join_executor.cpp index c572643f42f3..4d1d9baa80e6 100644 --- a/libs/core/executors/tests/unit/fork_join_executor.cpp +++ b/libs/core/executors/tests/unit/fork_join_executor.cpp @@ -5,12 +5,12 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/executors/tests/unit/limiting_executor.cpp b/libs/core/executors/tests/unit/limiting_executor.cpp index c09d75460e78..cbd9a88bc690 100644 --- a/libs/core/executors/tests/unit/limiting_executor.cpp +++ b/libs/core/executors/tests/unit/limiting_executor.cpp @@ -4,10 +4,9 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/executors/tests/unit/parallel_executor.cpp b/libs/core/executors/tests/unit/parallel_executor.cpp index 49ab699e561c..5912b9ee154f 100644 --- a/libs/core/executors/tests/unit/parallel_executor.cpp +++ b/libs/core/executors/tests/unit/parallel_executor.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/executors/tests/unit/parallel_executor_parameters.cpp b/libs/core/executors/tests/unit/parallel_executor_parameters.cpp index ff25c0704307..7822d93193a0 100644 --- a/libs/core/executors/tests/unit/parallel_executor_parameters.cpp +++ b/libs/core/executors/tests/unit/parallel_executor_parameters.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/executors/tests/unit/parallel_fork_executor.cpp b/libs/core/executors/tests/unit/parallel_fork_executor.cpp index c85dca008c90..9ebb07cd1e17 100644 --- a/libs/core/executors/tests/unit/parallel_fork_executor.cpp +++ b/libs/core/executors/tests/unit/parallel_fork_executor.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/executors/tests/unit/parallel_policy_executor.cpp b/libs/core/executors/tests/unit/parallel_policy_executor.cpp index 390a4c04c069..c3f1ed7c04f2 100644 --- a/libs/core/executors/tests/unit/parallel_policy_executor.cpp +++ b/libs/core/executors/tests/unit/parallel_policy_executor.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/executors/tests/unit/polymorphic_executor.cpp b/libs/core/executors/tests/unit/polymorphic_executor.cpp index afe2c2457ead..ed6bc6cbd9d0 100644 --- a/libs/core/executors/tests/unit/polymorphic_executor.cpp +++ b/libs/core/executors/tests/unit/polymorphic_executor.cpp @@ -4,11 +4,10 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/libs/core/executors/tests/unit/scheduler_executor.cpp b/libs/core/executors/tests/unit/scheduler_executor.cpp index b5c1056606bd..2767502c3785 100644 --- a/libs/core/executors/tests/unit/scheduler_executor.cpp +++ b/libs/core/executors/tests/unit/scheduler_executor.cpp @@ -10,12 +10,12 @@ #if !defined(HPX_CLANG_VERSION) || \ ((HPX_CLANG_VERSION / 10000) != 11 && (HPX_CLANG_VERSION / 10000) != 8) -#include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/executors/tests/unit/sequenced_executor.cpp b/libs/core/executors/tests/unit/sequenced_executor.cpp index a5d44362beb7..a3b6c099cda6 100644 --- a/libs/core/executors/tests/unit/sequenced_executor.cpp +++ b/libs/core/executors/tests/unit/sequenced_executor.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/executors/tests/unit/service_executors.cpp b/libs/core/executors/tests/unit/service_executors.cpp index 471f59acdbb9..0b267df79833 100644 --- a/libs/core/executors/tests/unit/service_executors.cpp +++ b/libs/core/executors/tests/unit/service_executors.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/executors/tests/unit/shared_parallel_executor.cpp b/libs/core/executors/tests/unit/shared_parallel_executor.cpp index 2c76fc745fd7..35d55dee611b 100644 --- a/libs/core/executors/tests/unit/shared_parallel_executor.cpp +++ b/libs/core/executors/tests/unit/shared_parallel_executor.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include @@ -31,12 +31,12 @@ struct shared_parallel_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// hpx::thread::id test(int passed_through) diff --git a/libs/core/executors/tests/unit/standalone_thread_pool_executor.cpp b/libs/core/executors/tests/unit/standalone_thread_pool_executor.cpp index c76692490308..29233111906e 100644 --- a/libs/core/executors/tests/unit/standalone_thread_pool_executor.cpp +++ b/libs/core/executors/tests/unit/standalone_thread_pool_executor.cpp @@ -11,12 +11,12 @@ // HPX runtime*. This test fails if thread pools, schedulers etc. assume that // the global runtime (configuration, thread manager, etc.) always exists. -#include -#include -#include +#include +#include #include #include #include +#include #include #include diff --git a/libs/core/executors/tests/unit/std_execution_policies.cpp b/libs/core/executors/tests/unit/std_execution_policies.cpp index ed7bb894261e..21e08e8ca0b8 100644 --- a/libs/core/executors/tests/unit/std_execution_policies.cpp +++ b/libs/core/executors/tests/unit/std_execution_policies.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include /////////////////////////////////////////////////////////////////////////////// diff --git a/libs/core/executors/tests/unit/thread_pool_scheduler.cpp b/libs/core/executors/tests/unit/thread_pool_scheduler.cpp index 85567b34e5af..0d1fa4d9121c 100644 --- a/libs/core/executors/tests/unit/thread_pool_scheduler.cpp +++ b/libs/core/executors/tests/unit/thread_pool_scheduler.cpp @@ -11,13 +11,13 @@ #if !defined(HPX_CLANG_VERSION) || \ ((HPX_CLANG_VERSION / 10000) != 11 && (HPX_CLANG_VERSION / 10000) != 8) -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include +#include #include #include diff --git a/libs/core/format/include/hpx/modules/format.hpp b/libs/core/format/include/hpx/modules/format.hpp index 5d7dfc9fe302..73427ee3c115 100644 --- a/libs/core/format/include/hpx/modules/format.hpp +++ b/libs/core/format/include/hpx/modules/format.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -28,7 +29,7 @@ namespace hpx::util { template struct type_specifier { - static char const* value() noexcept; + static char const* value() noexcept = delete; }; #define DECL_TYPE_SPECIFIER(Type, Spec) \ @@ -81,8 +82,13 @@ namespace hpx::util { // copy spec to a null terminated buffer char format[16]; - std::sprintf(format, "%%%.*s%s", static_cast(spec.size()), - spec.data(), conv_spec); + int const len = + std::snprintf(format, sizeof(format), "%%%.*s%s", + static_cast(spec.size()), spec.data(), conv_spec); + if (len < 0 || len >= static_cast(sizeof(format))) + { + throw std::runtime_error("Not a valid format specifier"); + } T const& value = *static_cast(ptr); //-V206 std::size_t length = std::snprintf(nullptr, 0, format, value); @@ -138,8 +144,13 @@ namespace hpx::util { { // copy spec to a null terminated buffer char format[16]; - std::sprintf(format, "%%%.*ss", - static_cast(spec.size()), spec.data()); + int const len = std::snprintf(format, sizeof(format), + "%%%.*ss", static_cast(spec.size()), spec.data()); + if (len <= 0 || len >= static_cast(sizeof(format))) + { + throw std::runtime_error( + "Not a valid format specifier"); + } std::size_t length = std::snprintf(nullptr, 0, format, value); @@ -165,7 +176,8 @@ namespace hpx::util { if (spec.empty() || spec == "s") { - os.write(value.data(), value.size()); + os.write(value.data(), + static_cast(value.size())); } else { @@ -189,7 +201,7 @@ namespace hpx::util { // copy spec to a null terminated buffer std::string const format(spec); - std::size_t length = 0; + std::size_t length; std::vector buffer(1); buffer.resize(buffer.capacity()); do diff --git a/libs/core/functional/include/hpx/functional/detail/basic_function.hpp b/libs/core/functional/include/hpx/functional/detail/basic_function.hpp index 6f7fb98f80c4..842f8eb57387 100644 --- a/libs/core/functional/include/hpx/functional/detail/basic_function.hpp +++ b/libs/core/functional/include/hpx/functional/detail/basic_function.hpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include @@ -186,8 +185,7 @@ namespace hpx::util::detail { buffer = vtable::template allocate( storage, function_storage_size); } - object = hpx::construct_at( - static_cast(buffer), HPX_FORWARD(F, f)); + object = ::new (buffer) T(HPX_FORWARD(F, f)); } else { diff --git a/libs/core/functional/tests/regressions/protect_with_nullary_pfo.cpp b/libs/core/functional/tests/regressions/protect_with_nullary_pfo.cpp index 56247e19e494..42e39936f416 100644 --- a/libs/core/functional/tests/regressions/protect_with_nullary_pfo.cpp +++ b/libs/core/functional/tests/regressions/protect_with_nullary_pfo.cpp @@ -5,12 +5,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include +#include +#include +#include #include -#include -#include #include #include diff --git a/libs/core/futures/include/hpx/futures/future.hpp b/libs/core/futures/include/hpx/futures/future.hpp index 8cdec07b98cd..297a302362ae 100644 --- a/libs/core/futures/include/hpx/futures/future.hpp +++ b/libs/core/futures/include/hpx/futures/future.hpp @@ -63,7 +63,6 @@ namespace hpx::lcos::detail { future_state state = future_state::invalid; ar >> state; - // NOLINTNEXTLINE(bugprone-branch-clone) if (state == future_state::has_value) { if constexpr (std::is_default_constructible_v) @@ -92,7 +91,6 @@ namespace hpx::lcos::detail { f = hpx::traits::future_access::create(HPX_MOVE(p)); } } - // NOLINTNEXTLINE(bugprone-branch-clone) else if (state == future_state::has_exception) { std::exception_ptr exception; @@ -103,7 +101,6 @@ namespace hpx::lcos::detail { f = hpx::traits::future_access::create(HPX_MOVE(p)); } - // NOLINTNEXTLINE(bugprone-branch-clone) else if (state == future_state::invalid) { f = Future(); diff --git a/libs/core/futures/tests/regressions/exception_from_continuation_1613.cpp b/libs/core/futures/tests/regressions/exception_from_continuation_1613.cpp index 3e97a9e892a7..0bc75910588f 100644 --- a/libs/core/futures/tests/regressions/exception_from_continuation_1613.cpp +++ b/libs/core/futures/tests/regressions/exception_from_continuation_1613.cpp @@ -7,8 +7,8 @@ // This test case demonstrates the issue described in #1613: Dataflow causes // stack overflow -#include -#include +#include +#include #include #include diff --git a/libs/core/futures/tests/regressions/fail_future_2667.cpp b/libs/core/futures/tests/regressions/fail_future_2667.cpp index 15eec8f1ad27..a5ea5f6509b6 100644 --- a/libs/core/futures/tests/regressions/fail_future_2667.cpp +++ b/libs/core/futures/tests/regressions/fail_future_2667.cpp @@ -9,8 +9,8 @@ // // This test is supposed to fail compiling. -#include -#include +#include +#include #include #include diff --git a/libs/core/futures/tests/regressions/future_2667.cpp b/libs/core/futures/tests/regressions/future_2667.cpp index 56a0b6c7d72e..ee16467c893c 100644 --- a/libs/core/futures/tests/regressions/future_2667.cpp +++ b/libs/core/futures/tests/regressions/future_2667.cpp @@ -7,10 +7,10 @@ // This test case demonstrates the issue described in #2667: Ambiguity of // nested hpx::future's -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/futures/tests/regressions/future_790.cpp b/libs/core/futures/tests/regressions/future_790.cpp index 1bd7c7bc5aaf..880a8805fb07 100644 --- a/libs/core/futures/tests/regressions/future_790.cpp +++ b/libs/core/futures/tests/regressions/future_790.cpp @@ -7,8 +7,8 @@ // This test case demonstrates the issue described in #790: wait_for() doesn't // compile -#include -#include +#include +#include #include #include diff --git a/libs/core/futures/tests/regressions/future_range_ambiguity_2032.cpp b/libs/core/futures/tests/regressions/future_range_ambiguity_2032.cpp index 1a51f14741e1..ee0ce33bbaaa 100644 --- a/libs/core/futures/tests/regressions/future_range_ambiguity_2032.cpp +++ b/libs/core/futures/tests/regressions/future_range_ambiguity_2032.cpp @@ -6,8 +6,8 @@ // This tests verifies that #2032 remains fixed +#include #include -#include #include diff --git a/libs/core/futures/tests/regressions/future_unwrap_1182.cpp b/libs/core/futures/tests/regressions/future_unwrap_1182.cpp index e53bd739f15d..601a03c06ca1 100644 --- a/libs/core/futures/tests/regressions/future_unwrap_1182.cpp +++ b/libs/core/futures/tests/regressions/future_unwrap_1182.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/futures/tests/regressions/future_unwrap_878.cpp b/libs/core/futures/tests/regressions/future_unwrap_878.cpp index 12d4ab0a291e..389e3b6fe672 100644 --- a/libs/core/futures/tests/regressions/future_unwrap_878.cpp +++ b/libs/core/futures/tests/regressions/future_unwrap_878.cpp @@ -7,8 +7,8 @@ // This test case demonstrates the issue described in #878: `future::unwrap` // triggers assertion -#include -#include +#include +#include #include #include diff --git a/libs/core/futures/tests/regressions/set_hpx_limit_798.cpp b/libs/core/futures/tests/regressions/set_hpx_limit_798.cpp index 5b83997c01c5..04a541561e07 100644 --- a/libs/core/futures/tests/regressions/set_hpx_limit_798.cpp +++ b/libs/core/futures/tests/regressions/set_hpx_limit_798.cpp @@ -9,10 +9,10 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include +#include +#include #include -#include +#include // define large action double func(double x1, double, double, double, double, double, double) diff --git a/libs/core/futures/tests/regressions/shared_future_continuation_order.cpp b/libs/core/futures/tests/regressions/shared_future_continuation_order.cpp index c2731fdf52d7..1fe2b34c27f6 100644 --- a/libs/core/futures/tests/regressions/shared_future_continuation_order.cpp +++ b/libs/core/futures/tests/regressions/shared_future_continuation_order.cpp @@ -7,8 +7,8 @@ // Making sure the continuations of a shared_future are invoked in the same // order as they have been attached. -#include -#include +#include +#include #include #include diff --git a/libs/core/futures/tests/regressions/shared_future_then_2166.cpp b/libs/core/futures/tests/regressions/shared_future_then_2166.cpp index 30f6fbdafb88..b9eebabb22c6 100644 --- a/libs/core/futures/tests/regressions/shared_future_then_2166.cpp +++ b/libs/core/futures/tests/regressions/shared_future_then_2166.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include /////////////////////////////////////////////////////////////////////////////// diff --git a/libs/core/futures/tests/regressions/wait_for_1751.cpp b/libs/core/futures/tests/regressions/wait_for_1751.cpp index 5912a7c5b7d8..b1460ebb764e 100644 --- a/libs/core/futures/tests/regressions/wait_for_1751.cpp +++ b/libs/core/futures/tests/regressions/wait_for_1751.cpp @@ -7,8 +7,8 @@ // This test case demonstrates the issue described in #1751: // hpx::future::wait_for fails a simple test -#include -#include +#include +#include #include #include diff --git a/libs/core/futures/tests/unit/await.cpp b/libs/core/futures/tests/unit/await.cpp index fde1b70147ff..30de297e421b 100644 --- a/libs/core/futures/tests/unit/await.cpp +++ b/libs/core/futures/tests/unit/await.cpp @@ -10,10 +10,10 @@ #error "This test requires compiler support for C++20 coroutines" #endif -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/futures/tests/unit/future.cpp b/libs/core/futures/tests/unit/future.cpp index f54e41b3e27b..e0bdf9732d3b 100644 --- a/libs/core/futures/tests/unit/future.cpp +++ b/libs/core/futures/tests/unit/future.cpp @@ -6,10 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/futures/tests/unit/future_ref.cpp b/libs/core/futures/tests/unit/future_ref.cpp index 35cc14f17ba1..bfc36f7134dc 100644 --- a/libs/core/futures/tests/unit/future_ref.cpp +++ b/libs/core/futures/tests/unit/future_ref.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/futures/tests/unit/future_then.cpp b/libs/core/futures/tests/unit/future_then.cpp index c62b2740582e..276a485f0aa2 100644 --- a/libs/core/futures/tests/unit/future_then.cpp +++ b/libs/core/futures/tests/unit/future_then.cpp @@ -6,10 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/futures/tests/unit/local_promise_allocator.cpp b/libs/core/futures/tests/unit/local_promise_allocator.cpp index 32ab18782c17..b249a4c41666 100644 --- a/libs/core/futures/tests/unit/local_promise_allocator.cpp +++ b/libs/core/futures/tests/unit/local_promise_allocator.cpp @@ -5,8 +5,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/futures/tests/unit/local_use_allocator.cpp b/libs/core/futures/tests/unit/local_use_allocator.cpp index e7fc81061cde..ee28e7fb5c25 100644 --- a/libs/core/futures/tests/unit/local_use_allocator.cpp +++ b/libs/core/futures/tests/unit/local_use_allocator.cpp @@ -5,7 +5,7 @@ // 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) -#include +#include #include diff --git a/libs/core/futures/tests/unit/make_future.cpp b/libs/core/futures/tests/unit/make_future.cpp index 66da47bddefb..6efdfcf3db2d 100644 --- a/libs/core/futures/tests/unit/make_future.cpp +++ b/libs/core/futures/tests/unit/make_future.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/futures/tests/unit/make_ready_future.cpp b/libs/core/futures/tests/unit/make_ready_future.cpp index 6ff7e023dd5d..cb7d48662462 100644 --- a/libs/core/futures/tests/unit/make_ready_future.cpp +++ b/libs/core/futures/tests/unit/make_ready_future.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/futures/tests/unit/shared_future.cpp b/libs/core/futures/tests/unit/shared_future.cpp index 8ea0ae385a56..477e27a3d3eb 100644 --- a/libs/core/futures/tests/unit/shared_future.cpp +++ b/libs/core/futures/tests/unit/shared_future.cpp @@ -6,10 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/include_local/CMakeLists.txt b/libs/core/include_local/CMakeLists.txt index 48c64f220fcf..6ff50767efd4 100644 --- a/libs/core/include_local/CMakeLists.txt +++ b/libs/core/include_local/CMakeLists.txt @@ -1,46 +1,92 @@ -# Copyright (c) 2019-2021 The STE||AR-Group +# Copyright (c) 2019-2023 The STE||AR-Group # # 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) set(include_local_headers - hpx/local/algorithm.hpp - hpx/local/any.hpp - hpx/local/barrier.hpp - hpx/local/channel.hpp - hpx/local/chrono.hpp - hpx/local/compute.hpp - hpx/local/condition_variable.hpp - hpx/local/datapar.hpp - hpx/local/exception.hpp - hpx/local/execution.hpp - hpx/local/functional.hpp - hpx/local/future.hpp - hpx/local/generator.hpp - hpx/local/latch.hpp - hpx/local/memory.hpp - hpx/local/mutex.hpp - hpx/local/numeric.hpp - hpx/local/optional.hpp - hpx/local/runtime.hpp - hpx/local/semaphore.hpp - hpx/local/shared_mutex.hpp - hpx/local/source_location.hpp - hpx/local/stop_token.hpp - hpx/local/system_error.hpp - hpx/local/task_block.hpp - hpx/local/thread.hpp - hpx/local/tuple.hpp - hpx/local/type_traits.hpp - hpx/local/unwrap.hpp + hpx/any.hpp + hpx/bit.hpp + hpx/channel.hpp + hpx/chrono.hpp + hpx/condition_variable.hpp + hpx/datapar.hpp + hpx/exception.hpp + hpx/execution.hpp + hpx/format.hpp + hpx/functional.hpp + hpx/generator.hpp + hpx/memory.hpp + hpx/mutex.hpp + hpx/numeric.hpp + hpx/optional.hpp + hpx/semaphore.hpp + hpx/shared_mutex.hpp + hpx/source_location.hpp + hpx/stop_token.hpp + hpx/system_error.hpp + hpx/task_block.hpp + hpx/thread.hpp + hpx/tuple.hpp + hpx/type_traits.hpp + hpx/unwrap.hpp + hpx/experimental/task_group.hpp ) +if(NOT HPX_WITH_DISTRIBUTED_RUNTIME) + set(include_local_headers + ${include_local_headers} + hpx/algorithm.hpp + hpx/barrier.hpp + hpx/channel.hpp + hpx/compute.hpp + hpx/future.hpp + hpx/latch.hpp + hpx/runtime.hpp + ) +endif() + +# The headers in hpx/local/ were deprecated in HPX V1.9.0 +# cmake-format: off +set(include_local_compat_headers + hpx/local/algorithm.hpp => hpx/algorithm.hpp + hpx/local/any.hpp => hpx/any.hpp + hpx/local/barrier.hpp => hpx/barrier.hpp + hpx/local/channel.hpp => hpx/channel.hpp + hpx/local/chrono.hpp => hpx/chrono.hpp + hpx/local/compute.hpp => hpx/compute.hpp + hpx/local/condition_variable.hpp => hpx/condition_variable.hpp + hpx/local/datapar.hpp => hpx/datapar.hpp + hpx/local/exception.hpp => hpx/exception.hpp + hpx/local/execution.hpp => hpx/execution.hpp + hpx/local/functional.hpp => hpx/functional.hpp + hpx/local/future.hpp => hpx/future.hpp + hpx/local/generator.hpp => hpx/generator.hpp + hpx/local/latch.hpp => hpx/latch.hpp + hpx/local/memory.hpp => hpx/memory.hpp + hpx/local/mutex.hpp => hpx/mutex.hpp + hpx/local/numeric.hpp => hpx/numeric.hpp + hpx/local/optional.hpp => hpx/optional.hpp + hpx/local/runtime.hpp => hpx/runtime.hpp + hpx/local/semaphore.hpp => hpx/semaphore.hpp + hpx/local/shared_mutex.hpp => hpx/shared_mutex.hpp + hpx/local/source_location.hpp => hpx/source_location.hpp + hpx/local/stop_token.hpp => hpx/stop_token.hpp + hpx/local/system_error.hpp => hpx/system_error.hpp + hpx/local/task_block.hpp => hpx/task_block.hpp + hpx/local/thread.hpp => hpx/thread.hpp + hpx/local/tuple.hpp => hpx/tuple.hpp + hpx/local/type_traits.hpp => hpx/type_traits.hpp + hpx/local/unwrap.hpp => hpx/unwrap.hpp +) +# cmake-format: on + include(HPX_AddModule) add_hpx_module( core include_local GLOBAL_HEADER_GEN OFF HEADERS ${include_local_headers} + COMPAT_HEADERS ${include_local_compat_headers} MODULE_DEPENDENCIES hpx_algorithms hpx_async_base @@ -49,9 +95,17 @@ add_hpx_module( hpx_compute_local hpx_errors hpx_execution + hpx_execution_base hpx_executors + hpx_format hpx_futures hpx_lcos_local + hpx_memory hpx_runtime_local + hpx_synchronization + hpx_threading + hpx_threading_base + hpx_timed_execution + hpx_timing CMAKE_SUBDIRS examples tests ) diff --git a/libs/core/include_local/include/hpx/local/algorithm.hpp b/libs/core/include_local/include/hpx/algorithm.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/algorithm.hpp rename to libs/core/include_local/include/hpx/algorithm.hpp diff --git a/libs/full/include/include/hpx/any.hpp b/libs/core/include_local/include/hpx/any.hpp similarity index 89% rename from libs/full/include/include/hpx/any.hpp rename to libs/core/include_local/include/hpx/any.hpp index de6ac18abb34..b84b39e9c622 100644 --- a/libs/full/include/include/hpx/any.hpp +++ b/libs/core/include_local/include/hpx/any.hpp @@ -6,5 +6,5 @@ #pragma once +#include #include -#include diff --git a/libs/core/include_local/include/hpx/local/barrier.hpp b/libs/core/include_local/include/hpx/barrier.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/barrier.hpp rename to libs/core/include_local/include/hpx/barrier.hpp diff --git a/libs/core/include_local/include/hpx/bit.hpp b/libs/core/include_local/include/hpx/bit.hpp new file mode 100644 index 000000000000..dc3ece8b06b7 --- /dev/null +++ b/libs/core/include_local/include/hpx/bit.hpp @@ -0,0 +1,10 @@ +// Copyright (c) 2023 Hartmut Kaiser +// +// 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) + +#pragma once + +#include // for endian support +#include diff --git a/libs/core/include_local/include/hpx/local/channel.hpp b/libs/core/include_local/include/hpx/channel.hpp similarity index 77% rename from libs/core/include_local/include/hpx/local/channel.hpp rename to libs/core/include_local/include/hpx/channel.hpp index cb41eb22cc38..a046618eb911 100644 --- a/libs/core/include_local/include/hpx/local/channel.hpp +++ b/libs/core/include_local/include/hpx/channel.hpp @@ -6,9 +6,4 @@ #pragma once -#include #include - -namespace hpx { - using hpx::lcos::local::channel; -} diff --git a/libs/full/include/include/hpx/chrono.hpp b/libs/core/include_local/include/hpx/chrono.hpp similarity index 87% rename from libs/full/include/include/hpx/chrono.hpp rename to libs/core/include_local/include/hpx/chrono.hpp index 02503c0706fc..8199df0acb11 100644 --- a/libs/full/include/include/hpx/chrono.hpp +++ b/libs/core/include_local/include/hpx/chrono.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/condition_variable.hpp b/libs/core/include_local/include/hpx/compute.hpp similarity index 71% rename from libs/full/include/include/hpx/condition_variable.hpp rename to libs/core/include_local/include/hpx/compute.hpp index 9e52b7a0097a..be44276499cf 100644 --- a/libs/full/include/include/hpx/condition_variable.hpp +++ b/libs/core/include_local/include/hpx/compute.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2021 ETH Zurich +// Copyright (c) 2016-2022 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/core/include_local/include/hpx/local/condition_variable.hpp b/libs/core/include_local/include/hpx/condition_variable.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/condition_variable.hpp rename to libs/core/include_local/include/hpx/condition_variable.hpp diff --git a/libs/core/include_local/include/hpx/local/datapar.hpp b/libs/core/include_local/include/hpx/datapar.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/datapar.hpp rename to libs/core/include_local/include/hpx/datapar.hpp diff --git a/libs/core/include_local/include/hpx/local/exception.hpp b/libs/core/include_local/include/hpx/exception.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/exception.hpp rename to libs/core/include_local/include/hpx/exception.hpp diff --git a/libs/core/include_local/include/hpx/local/execution.hpp b/libs/core/include_local/include/hpx/execution.hpp similarity index 78% rename from libs/core/include_local/include/hpx/local/execution.hpp rename to libs/core/include_local/include/hpx/execution.hpp index 41236ea88f5d..26b504c25efa 100644 --- a/libs/core/include_local/include/hpx/local/execution.hpp +++ b/libs/core/include_local/include/hpx/execution.hpp @@ -7,4 +7,6 @@ #pragma once #include +#include #include +#include diff --git a/libs/core/include_local/include/hpx/local/any.hpp b/libs/core/include_local/include/hpx/experimental/task_group.hpp similarity index 86% rename from libs/core/include_local/include/hpx/local/any.hpp rename to libs/core/include_local/include/hpx/experimental/task_group.hpp index ce1f6c25d2c9..dfcefff952a6 100644 --- a/libs/core/include_local/include/hpx/local/any.hpp +++ b/libs/core/include_local/include/hpx/experimental/task_group.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/generator.hpp b/libs/core/include_local/include/hpx/format.hpp similarity index 87% rename from libs/full/include/include/hpx/generator.hpp rename to libs/core/include_local/include/hpx/format.hpp index f88747f9b5a9..0cad59b9f37d 100644 --- a/libs/full/include/include/hpx/generator.hpp +++ b/libs/core/include_local/include/hpx/format.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/core/include_local/include/hpx/local/functional.hpp b/libs/core/include_local/include/hpx/functional.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/functional.hpp rename to libs/core/include_local/include/hpx/functional.hpp diff --git a/libs/core/include_local/include/hpx/local/future.hpp b/libs/core/include_local/include/hpx/future.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/future.hpp rename to libs/core/include_local/include/hpx/future.hpp diff --git a/libs/core/include_local/include/hpx/local/generator.hpp b/libs/core/include_local/include/hpx/generator.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/generator.hpp rename to libs/core/include_local/include/hpx/generator.hpp diff --git a/libs/core/include_local/include/hpx/local/latch.hpp b/libs/core/include_local/include/hpx/latch.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/latch.hpp rename to libs/core/include_local/include/hpx/latch.hpp diff --git a/libs/core/include_local/include/hpx/local/chrono.hpp b/libs/core/include_local/include/hpx/local/chrono.hpp deleted file mode 100644 index b16ed32e397f..000000000000 --- a/libs/core/include_local/include/hpx/local/chrono.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include -#include -#include diff --git a/libs/core/include_local/include/hpx/local/compute.hpp b/libs/core/include_local/include/hpx/local/compute.hpp deleted file mode 100644 index f7d021832794..000000000000 --- a/libs/core/include_local/include/hpx/local/compute.hpp +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2016-2022 Hartmut Kaiser -// -// 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) - -#pragma once - -#include -#include -#include -#include diff --git a/libs/core/include_local/include/hpx/local/memory.hpp b/libs/core/include_local/include/hpx/memory.hpp similarity index 80% rename from libs/core/include_local/include/hpx/local/memory.hpp rename to libs/core/include_local/include/hpx/memory.hpp index 083f20fe0063..0893bf15ce84 100644 --- a/libs/core/include_local/include/hpx/local/memory.hpp +++ b/libs/core/include_local/include/hpx/memory.hpp @@ -6,5 +6,7 @@ #pragma once +#include #include #include +#include diff --git a/libs/core/include_local/include/hpx/local/mutex.hpp b/libs/core/include_local/include/hpx/mutex.hpp similarity index 62% rename from libs/core/include_local/include/hpx/local/mutex.hpp rename to libs/core/include_local/include/hpx/mutex.hpp index 876d018e2d00..fd6d42e0c07b 100644 --- a/libs/core/include_local/include/hpx/local/mutex.hpp +++ b/libs/core/include_local/include/hpx/mutex.hpp @@ -6,8 +6,5 @@ #pragma once -#include -#include -#include -#include +#include #include diff --git a/libs/core/include_local/include/hpx/local/numeric.hpp b/libs/core/include_local/include/hpx/numeric.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/numeric.hpp rename to libs/core/include_local/include/hpx/numeric.hpp diff --git a/libs/core/include_local/include/hpx/local/optional.hpp b/libs/core/include_local/include/hpx/optional.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/optional.hpp rename to libs/core/include_local/include/hpx/optional.hpp diff --git a/libs/core/include_local/include/hpx/local/runtime.hpp b/libs/core/include_local/include/hpx/runtime.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/runtime.hpp rename to libs/core/include_local/include/hpx/runtime.hpp diff --git a/libs/core/include_local/include/hpx/local/semaphore.hpp b/libs/core/include_local/include/hpx/semaphore.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/semaphore.hpp rename to libs/core/include_local/include/hpx/semaphore.hpp diff --git a/libs/core/include_local/include/hpx/local/shared_mutex.hpp b/libs/core/include_local/include/hpx/shared_mutex.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/shared_mutex.hpp rename to libs/core/include_local/include/hpx/shared_mutex.hpp diff --git a/libs/core/include_local/include/hpx/local/source_location.hpp b/libs/core/include_local/include/hpx/source_location.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/source_location.hpp rename to libs/core/include_local/include/hpx/source_location.hpp diff --git a/libs/core/include_local/include/hpx/local/stop_token.hpp b/libs/core/include_local/include/hpx/stop_token.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/stop_token.hpp rename to libs/core/include_local/include/hpx/stop_token.hpp diff --git a/libs/core/include_local/include/hpx/local/system_error.hpp b/libs/core/include_local/include/hpx/system_error.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/system_error.hpp rename to libs/core/include_local/include/hpx/system_error.hpp diff --git a/libs/core/include_local/include/hpx/local/task_block.hpp b/libs/core/include_local/include/hpx/task_block.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/task_block.hpp rename to libs/core/include_local/include/hpx/task_block.hpp diff --git a/libs/full/include/include/hpx/thread.hpp b/libs/core/include_local/include/hpx/thread.hpp similarity index 75% rename from libs/full/include/include/hpx/thread.hpp rename to libs/core/include_local/include/hpx/thread.hpp index 69218c294e82..1d4155bbd6ff 100644 --- a/libs/full/include/include/hpx/thread.hpp +++ b/libs/core/include_local/include/hpx/thread.hpp @@ -6,4 +6,5 @@ #pragma once -#include +#include +#include diff --git a/libs/core/include_local/include/hpx/local/tuple.hpp b/libs/core/include_local/include/hpx/tuple.hpp similarity index 84% rename from libs/core/include_local/include/hpx/local/tuple.hpp rename to libs/core/include_local/include/hpx/tuple.hpp index f556acb90380..5bf55c0b4fb5 100644 --- a/libs/core/include_local/include/hpx/local/tuple.hpp +++ b/libs/core/include_local/include/hpx/tuple.hpp @@ -6,4 +6,5 @@ #pragma once +#include #include diff --git a/libs/core/include_local/include/hpx/local/type_traits.hpp b/libs/core/include_local/include/hpx/type_traits.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/type_traits.hpp rename to libs/core/include_local/include/hpx/type_traits.hpp diff --git a/libs/core/include_local/include/hpx/local/unwrap.hpp b/libs/core/include_local/include/hpx/unwrap.hpp similarity index 100% rename from libs/core/include_local/include/hpx/local/unwrap.hpp rename to libs/core/include_local/include/hpx/unwrap.hpp diff --git a/libs/core/init_runtime_local/CMakeLists.txt b/libs/core/init_runtime_local/CMakeLists.txt index c8048795cbca..13609da7cafa 100644 --- a/libs/core/init_runtime_local/CMakeLists.txt +++ b/libs/core/init_runtime_local/CMakeLists.txt @@ -8,19 +8,30 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -set(init_runtime_local_headers - hpx/init_runtime_local/detail/init_logging.hpp - hpx/init_runtime_local/init_runtime_local.hpp hpx/local/init.hpp +set(init_runtime_local_headers hpx/init_runtime_local/detail/init_logging.hpp + hpx/init_runtime_local/init_runtime_local.hpp ) +if(NOT HPX_WITH_DISTRIBUTED_RUNTIME) + set(init_runtime_local_headers ${init_runtime_local_headers} hpx/init.hpp) +endif() + set(init_runtime_local_sources init_logging.cpp init_runtime_local.cpp) +# The headers in hpx/local/ were deprecated in HPX V1.9.0 +# cmake-format: off +set(init_runtime_local_compat_headers + hpx/local/init.hpp => hpx/init.hpp +) +# cmake-format: on + include(HPX_AddModule) add_hpx_module( core init_runtime_local GLOBAL_HEADER_GEN ON SOURCES ${init_runtime_local_sources} HEADERS ${init_runtime_local_headers} + COMPAT_HEADERS ${init_runtime_local_compat_headers} MODULE_DEPENDENCIES hpx_algorithms hpx_command_line_handling_local diff --git a/libs/core/init_runtime_local/include/hpx/local/init.hpp b/libs/core/init_runtime_local/include/hpx/init.hpp similarity index 100% rename from libs/core/init_runtime_local/include/hpx/local/init.hpp rename to libs/core/init_runtime_local/include/hpx/init.hpp diff --git a/libs/core/init_runtime_local/tests/unit/shutdown_suspended_thread_local.cpp b/libs/core/init_runtime_local/tests/unit/shutdown_suspended_thread_local.cpp index 4244c979b68b..e74ddb25c8e4 100644 --- a/libs/core/init_runtime_local/tests/unit/shutdown_suspended_thread_local.cpp +++ b/libs/core/init_runtime_local/tests/unit/shutdown_suspended_thread_local.cpp @@ -7,11 +7,10 @@ // This test checks that the runtime takes into account suspended threads before // initiating full shutdown. -#include -#include -#include -#include +#include +#include #include +#include #include diff --git a/libs/core/iterator_support/tests/performance/stencil3_iterators.cpp b/libs/core/iterator_support/tests/performance/stencil3_iterators.cpp index e7ef6dc19989..413450e30006 100644 --- a/libs/core/iterator_support/tests/performance/stencil3_iterators.cpp +++ b/libs/core/iterator_support/tests/performance/stencil3_iterators.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include +#include +#include #include #include -#include +#include #include #include @@ -24,7 +24,7 @@ int test_count = 100; int partition_size = 10000; /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace experimental { namespace detail { +namespace hpx::experimental::detail { template HPX_FORCEINLINE Iterator previous(Iterator it, std::false_type) { @@ -60,11 +60,11 @@ namespace hpx { namespace experimental { namespace detail { { return next(it, hpx::traits::is_random_access_iterator()); } -}}} // namespace hpx::experimental::detail +} // namespace hpx::experimental::detail /////////////////////////////////////////////////////////////////////////////// // Version of stencil3_iterator which handles boundary elements internally -namespace hpx { namespace experimental { +namespace hpx::experimental { /////////////////////////////////////////////////////////////////////////// template (end)); } -}} // namespace hpx::experimental +} // namespace hpx::experimental std::uint64_t bench_stencil3_iterator_full() { @@ -281,7 +281,7 @@ std::uint64_t bench_stencil3_iterator_full() /////////////////////////////////////////////////////////////////////////////// // compare with unchecked stencil3_iterator (version 1) -namespace hpx { namespace experimental { +namespace hpx::experimental { template class stencil3_iterator_v1 : public util::detail::zip_iterator_base< @@ -328,7 +328,7 @@ namespace hpx { namespace experimental { return std::make_pair( make_stencil3_iterator_v1(begin), make_stencil3_iterator_v1(end)); } -}} // namespace hpx::experimental +} // namespace hpx::experimental std::uint64_t bench_stencil3_iterator_v1() { @@ -358,7 +358,7 @@ std::uint64_t bench_stencil3_iterator_v1() /////////////////////////////////////////////////////////////////////////////// // compare with unchecked stencil3_iterator (version 2) -namespace hpx { namespace experimental { +namespace hpx::experimental { namespace detail { struct stencil_transformer_v2 { @@ -437,7 +437,7 @@ namespace hpx { namespace experimental { return std::make_pair( make_stencil3_iterator_v2(begin), make_stencil3_iterator_v2(end)); } -}} // namespace hpx::experimental +} // namespace hpx::experimental std::uint64_t bench_stencil3_iterator_v2() { diff --git a/libs/core/iterator_support/tests/unit/counting_iterator.cpp b/libs/core/iterator_support/tests/unit/counting_iterator.cpp index 8484fc410f15..9a6d09c27dc1 100644 --- a/libs/core/iterator_support/tests/unit/counting_iterator.cpp +++ b/libs/core/iterator_support/tests/unit/counting_iterator.cpp @@ -7,11 +7,11 @@ // This code is based on boost::iterators::counting_iterator // (C) Copyright David Abrahams 2001. +#include #include -#include #include -#include #include +#include #include #include diff --git a/libs/core/iterator_support/tests/unit/stencil3_iterator.cpp b/libs/core/iterator_support/tests/unit/stencil3_iterator.cpp index f2d7e91d574a..8da3da4c1cef 100644 --- a/libs/core/iterator_support/tests/unit/stencil3_iterator.cpp +++ b/libs/core/iterator_support/tests/unit/stencil3_iterator.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include +#include #include #include +#include #include #include diff --git a/libs/core/iterator_support/tests/unit/transform_iterator.cpp b/libs/core/iterator_support/tests/unit/transform_iterator.cpp index 2ccd7274f745..cf7161226875 100644 --- a/libs/core/iterator_support/tests/unit/transform_iterator.cpp +++ b/libs/core/iterator_support/tests/unit/transform_iterator.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/lcos_local/include/hpx/lcos_local/channel.hpp b/libs/core/lcos_local/include/hpx/lcos_local/channel.hpp index 56a5836d9778..a92c7a685223 100644 --- a/libs/core/lcos_local/include/hpx/lcos_local/channel.hpp +++ b/libs/core/lcos_local/include/hpx/lcos_local/channel.hpp @@ -1197,3 +1197,8 @@ namespace hpx::lcos::local { { } } // namespace hpx::lcos::local + +namespace hpx { + + using hpx::lcos::local::channel; +} diff --git a/libs/core/lcos_local/tests/regressions/safely_destroy_promise_1481.cpp b/libs/core/lcos_local/tests/regressions/safely_destroy_promise_1481.cpp index 69249a93bfe0..9d9f734e4bfe 100644 --- a/libs/core/lcos_local/tests/regressions/safely_destroy_promise_1481.cpp +++ b/libs/core/lcos_local/tests/regressions/safely_destroy_promise_1481.cpp @@ -7,10 +7,10 @@ // This test case demonstrates the issue described in #1481: // Sync primitives safe destruction -#include -#include -#include +#include +#include #include +#include #include diff --git a/libs/core/lcos_local/tests/unit/channel_local.cpp b/libs/core/lcos_local/tests/unit/channel_local.cpp index 7fb243b87ad6..96e7582b268f 100644 --- a/libs/core/lcos_local/tests/unit/channel_local.cpp +++ b/libs/core/lcos_local/tests/unit/channel_local.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/lcos_local/tests/unit/local_dataflow.cpp b/libs/core/lcos_local/tests/unit/local_dataflow.cpp index 6d0feb7f196e..080bb92fd2f8 100644 --- a/libs/core/lcos_local/tests/unit/local_dataflow.cpp +++ b/libs/core/lcos_local/tests/unit/local_dataflow.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include -#include +#include +#include #include -#include +#include +#include #include #include diff --git a/libs/core/lcos_local/tests/unit/local_dataflow_executor.cpp b/libs/core/lcos_local/tests/unit/local_dataflow_executor.cpp index 240d7e94728c..217feab66a84 100644 --- a/libs/core/lcos_local/tests/unit/local_dataflow_executor.cpp +++ b/libs/core/lcos_local/tests/unit/local_dataflow_executor.cpp @@ -5,12 +5,12 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include -#include +#include +#include #include #include diff --git a/libs/core/lcos_local/tests/unit/local_dataflow_executor_additional_arguments.cpp b/libs/core/lcos_local/tests/unit/local_dataflow_executor_additional_arguments.cpp index 1cf2fe54f881..df85939852b1 100644 --- a/libs/core/lcos_local/tests/unit/local_dataflow_executor_additional_arguments.cpp +++ b/libs/core/lcos_local/tests/unit/local_dataflow_executor_additional_arguments.cpp @@ -6,13 +6,13 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include -#include #include +#include +#include #include #include @@ -67,7 +67,7 @@ struct additional_argument_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_one_way_executor : std::true_type { @@ -77,7 +77,7 @@ namespace hpx { namespace parallel { namespace execution { struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution std::atomic void_f_count; std::atomic int_f_count; diff --git a/libs/core/lcos_local/tests/unit/local_dataflow_external_future.cpp b/libs/core/lcos_local/tests/unit/local_dataflow_external_future.cpp index 88f3de96c72a..4fb6cde327a6 100644 --- a/libs/core/lcos_local/tests/unit/local_dataflow_external_future.cpp +++ b/libs/core/lcos_local/tests/unit/local_dataflow_external_future.cpp @@ -6,16 +6,16 @@ // 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) -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include +#include #include #include @@ -183,7 +183,7 @@ struct external_future_additional_argument_executor } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { @@ -194,7 +194,7 @@ namespace hpx { namespace parallel { namespace execution { : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution int hpx_main() { diff --git a/libs/core/lcos_local/tests/unit/local_dataflow_small_vector.cpp b/libs/core/lcos_local/tests/unit/local_dataflow_small_vector.cpp index 763cba0815af..7fa7b850348b 100644 --- a/libs/core/lcos_local/tests/unit/local_dataflow_small_vector.cpp +++ b/libs/core/lcos_local/tests/unit/local_dataflow_small_vector.cpp @@ -6,11 +6,11 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include -#include +#include +#include #include -#include +#include +#include #include #include @@ -22,7 +22,7 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace traits { +namespace hpx::traits { // support unwrapping of hpx::detail::small_vector template (); } }; -}} // namespace hpx::traits +} // namespace hpx::traits template using small_vector = diff --git a/libs/core/lcos_local/tests/unit/local_dataflow_std_array.cpp b/libs/core/lcos_local/tests/unit/local_dataflow_std_array.cpp index 28fccec75076..536aa3046a7e 100644 --- a/libs/core/lcos_local/tests/unit/local_dataflow_std_array.cpp +++ b/libs/core/lcos_local/tests/unit/local_dataflow_std_array.cpp @@ -4,13 +4,11 @@ // 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) -#include - -#include -#include -#include +#include +#include #include -#include +#include +#include #include #include diff --git a/libs/core/lcos_local/tests/unit/run_guarded.cpp b/libs/core/lcos_local/tests/unit/run_guarded.cpp index 01694e88bb7c..69fef2585d36 100644 --- a/libs/core/lcos_local/tests/unit/run_guarded.cpp +++ b/libs/core/lcos_local/tests/unit/run_guarded.cpp @@ -3,9 +3,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/lcos_local/tests/unit/split_future.cpp b/libs/core/lcos_local/tests/unit/split_future.cpp index 610b84089aab..77a9ea58f88d 100644 --- a/libs/core/lcos_local/tests/unit/split_future.cpp +++ b/libs/core/lcos_local/tests/unit/split_future.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/logging/include/hpx/modules/logging.hpp b/libs/core/logging/include/hpx/modules/logging.hpp index 3d438adfe43c..ad465ea00a15 100644 --- a/libs/core/logging/include/hpx/modules/logging.hpp +++ b/libs/core/logging/include/hpx/modules/logging.hpp @@ -233,7 +233,6 @@ template bootstrap_logging const& operator<<( bootstrap_logging const& l, T const& t) //-V835 { - // NOLINTNEXTLINE(bugprone-branch-clone) LBT_(info) << t; LPROGRESS_ << t; return l; diff --git a/libs/core/pack_traversal/tests/unit/unwrap.cpp b/libs/core/pack_traversal/tests/unit/unwrap.cpp index 3b3ec8aa965f..c58f57e26835 100644 --- a/libs/core/pack_traversal/tests/unit/unwrap.cpp +++ b/libs/core/pack_traversal/tests/unit/unwrap.cpp @@ -6,12 +6,12 @@ // 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) -#include -#include -#include -#include +#include +#include #include -#include +#include +#include +#include #include #include diff --git a/libs/core/program_options/tests/regressions/command_line_arguments_706.cpp b/libs/core/program_options/tests/regressions/command_line_arguments_706.cpp index 75635d920125..ff5b77dd7f3c 100644 --- a/libs/core/program_options/tests/regressions/command_line_arguments_706.cpp +++ b/libs/core/program_options/tests/regressions/command_line_arguments_706.cpp @@ -7,7 +7,7 @@ // verify #706 is fixed (`hpx::init` removes portions of non-option command // line arguments before last `=` sign) -#include +#include #include char const* argv[] = {"command_line_argument_test", diff --git a/libs/core/program_options/tests/regressions/command_line_required_arguments_2990.cpp b/libs/core/program_options/tests/regressions/command_line_required_arguments_2990.cpp index 4d6a9d1ec947..cb97583e5beb 100644 --- a/libs/core/program_options/tests/regressions/command_line_required_arguments_2990.cpp +++ b/libs/core/program_options/tests/regressions/command_line_required_arguments_2990.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/program_options/tests/regressions/commandline_options_1437.cpp b/libs/core/program_options/tests/regressions/commandline_options_1437.cpp index 5c25700e04fa..85f89bba1966 100644 --- a/libs/core/program_options/tests/regressions/commandline_options_1437.cpp +++ b/libs/core/program_options/tests/regressions/commandline_options_1437.cpp @@ -6,7 +6,7 @@ // // Demonstrating #1437: hpx::init() should strip HPX-related flags from argv -#include +#include #include bool invoked_main = false; diff --git a/libs/core/resiliency/examples/1d_stencil_replay_exception.cpp b/libs/core/resiliency/examples/1d_stencil_replay_exception.cpp index 10f90b3c21af..aba258a77fdb 100644 --- a/libs/core/resiliency/examples/1d_stencil_replay_exception.cpp +++ b/libs/core/resiliency/examples/1d_stencil_replay_exception.cpp @@ -7,9 +7,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/examples/1d_stencil_replay_validate.cpp b/libs/core/resiliency/examples/1d_stencil_replay_validate.cpp index 695cd1c83d77..97a93798579f 100644 --- a/libs/core/resiliency/examples/1d_stencil_replay_validate.cpp +++ b/libs/core/resiliency/examples/1d_stencil_replay_validate.cpp @@ -7,9 +7,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/examples/async_replay.cpp b/libs/core/resiliency/examples/async_replay.cpp index f8aef221f46b..f2a947731af6 100644 --- a/libs/core/resiliency/examples/async_replay.cpp +++ b/libs/core/resiliency/examples/async_replay.cpp @@ -8,11 +8,11 @@ // 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) -#include -#include -#include +#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/examples/async_replicate.cpp b/libs/core/resiliency/examples/async_replicate.cpp index 1e38404586a5..1af8285d5c96 100644 --- a/libs/core/resiliency/examples/async_replicate.cpp +++ b/libs/core/resiliency/examples/async_replicate.cpp @@ -8,9 +8,9 @@ // 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) -#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/examples/async_replicate_vote.cpp b/libs/core/resiliency/examples/async_replicate_vote.cpp index d65922c334cc..adff96421ac9 100644 --- a/libs/core/resiliency/examples/async_replicate_vote.cpp +++ b/libs/core/resiliency/examples/async_replicate_vote.cpp @@ -6,10 +6,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/examples/dataflow_replicate.cpp b/libs/core/resiliency/examples/dataflow_replicate.cpp index 9dcb6adee032..6c85bd300301 100644 --- a/libs/core/resiliency/examples/dataflow_replicate.cpp +++ b/libs/core/resiliency/examples/dataflow_replicate.cpp @@ -8,7 +8,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/resiliency/examples/version.cpp b/libs/core/resiliency/examples/version.cpp index bca069ff9202..19b4f4c8239c 100644 --- a/libs/core/resiliency/examples/version.cpp +++ b/libs/core/resiliency/examples/version.cpp @@ -6,7 +6,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/resiliency/tests/performance/replay/1d_stencil.cpp b/libs/core/resiliency/tests/performance/replay/1d_stencil.cpp index d2a50b8de1ba..6e37da5b482b 100644 --- a/libs/core/resiliency/tests/performance/replay/1d_stencil.cpp +++ b/libs/core/resiliency/tests/performance/replay/1d_stencil.cpp @@ -18,9 +18,8 @@ // computation. This example is still fully local but demonstrates nice // scalability on SMP machines. -#include - -#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/performance/replay/1d_stencil_checksum.cpp b/libs/core/resiliency/tests/performance/replay/1d_stencil_checksum.cpp index 35ae3a581a60..c67de2cf4d64 100644 --- a/libs/core/resiliency/tests/performance/replay/1d_stencil_checksum.cpp +++ b/libs/core/resiliency/tests/performance/replay/1d_stencil_checksum.cpp @@ -18,8 +18,8 @@ // computation. This example is still fully local but demonstrates nice // scalability on SMP machines. -#include -#include +#include +#include #include #include #include diff --git a/libs/core/resiliency/tests/performance/replay/1d_stencil_replay.cpp b/libs/core/resiliency/tests/performance/replay/1d_stencil_replay.cpp index 91add6ea37a6..48438b63079b 100644 --- a/libs/core/resiliency/tests/performance/replay/1d_stencil_replay.cpp +++ b/libs/core/resiliency/tests/performance/replay/1d_stencil_replay.cpp @@ -18,8 +18,8 @@ // computation. This example is still fully local but demonstrates nice // scalability on SMP machines. -#include -#include +#include +#include #include #include #include diff --git a/libs/core/resiliency/tests/performance/replay/async_replay.cpp b/libs/core/resiliency/tests/performance/replay/async_replay.cpp index 7015b0da6c08..baab05d615f7 100644 --- a/libs/core/resiliency/tests/performance/replay/async_replay.cpp +++ b/libs/core/resiliency/tests/performance/replay/async_replay.cpp @@ -6,10 +6,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/tests/performance/replay/async_replay_validate.cpp b/libs/core/resiliency/tests/performance/replay/async_replay_validate.cpp index 47805bda328b..3b4815911f95 100644 --- a/libs/core/resiliency/tests/performance/replay/async_replay_validate.cpp +++ b/libs/core/resiliency/tests/performance/replay/async_replay_validate.cpp @@ -6,10 +6,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/tests/performance/replay/dataflow_replay.cpp b/libs/core/resiliency/tests/performance/replay/dataflow_replay.cpp index 18cde504fa1a..b489745bc4d5 100644 --- a/libs/core/resiliency/tests/performance/replay/dataflow_replay.cpp +++ b/libs/core/resiliency/tests/performance/replay/dataflow_replay.cpp @@ -18,8 +18,8 @@ // computation. This example is still fully local but demonstrates nice // scalability on SMP machines. -#include -#include +#include +#include #include #include #include diff --git a/libs/core/resiliency/tests/performance/replay/dataflow_replay_validate.cpp b/libs/core/resiliency/tests/performance/replay/dataflow_replay_validate.cpp index 3cf3eef60adb..a8746218ed18 100644 --- a/libs/core/resiliency/tests/performance/replay/dataflow_replay_validate.cpp +++ b/libs/core/resiliency/tests/performance/replay/dataflow_replay_validate.cpp @@ -18,8 +18,8 @@ // computation. This example is still fully local but demonstrates nice // scalability on SMP machines. -#include -#include +#include +#include #include #include #include diff --git a/libs/core/resiliency/tests/performance/replay/pure_async_for_replay.cpp b/libs/core/resiliency/tests/performance/replay/pure_async_for_replay.cpp index 5b426b8f2b42..9fcc31baac65 100644 --- a/libs/core/resiliency/tests/performance/replay/pure_async_for_replay.cpp +++ b/libs/core/resiliency/tests/performance/replay/pure_async_for_replay.cpp @@ -6,10 +6,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/tests/performance/replay/pure_dataflow.cpp b/libs/core/resiliency/tests/performance/replay/pure_dataflow.cpp index 3177ff3e9f54..8c59a48645f2 100644 --- a/libs/core/resiliency/tests/performance/replay/pure_dataflow.cpp +++ b/libs/core/resiliency/tests/performance/replay/pure_dataflow.cpp @@ -18,10 +18,10 @@ // computation. This example is still fully local but demonstrates nice // scalability on SMP machines. +#include #include -#include -#include -#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/performance/replicate/1d_stencil_replicate.cpp b/libs/core/resiliency/tests/performance/replicate/1d_stencil_replicate.cpp index d24275dbbb3d..a3633a478c69 100644 --- a/libs/core/resiliency/tests/performance/replicate/1d_stencil_replicate.cpp +++ b/libs/core/resiliency/tests/performance/replicate/1d_stencil_replicate.cpp @@ -18,8 +18,8 @@ // computation. This example is still fully local but demonstrates nice // scalability on SMP machines. -#include -#include +#include +#include #include #include #include diff --git a/libs/core/resiliency/tests/performance/replicate/1d_stencil_replicate_checksum.cpp b/libs/core/resiliency/tests/performance/replicate/1d_stencil_replicate_checksum.cpp index 4eae376beb77..76e17b837f59 100644 --- a/libs/core/resiliency/tests/performance/replicate/1d_stencil_replicate_checksum.cpp +++ b/libs/core/resiliency/tests/performance/replicate/1d_stencil_replicate_checksum.cpp @@ -18,8 +18,8 @@ // computation. This example is still fully local but demonstrates nice // scalability on SMP machines. -#include -#include +#include +#include #include #include #include diff --git a/libs/core/resiliency/tests/performance/replicate/async_replicate.cpp b/libs/core/resiliency/tests/performance/replicate/async_replicate.cpp index 694ad5887330..eb7c66b1370e 100644 --- a/libs/core/resiliency/tests/performance/replicate/async_replicate.cpp +++ b/libs/core/resiliency/tests/performance/replicate/async_replicate.cpp @@ -6,10 +6,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/tests/performance/replicate/async_replicate_validate.cpp b/libs/core/resiliency/tests/performance/replicate/async_replicate_validate.cpp index fbead3b269f1..121f468c48da 100644 --- a/libs/core/resiliency/tests/performance/replicate/async_replicate_validate.cpp +++ b/libs/core/resiliency/tests/performance/replicate/async_replicate_validate.cpp @@ -6,10 +6,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/tests/performance/replicate/async_replicate_vote.cpp b/libs/core/resiliency/tests/performance/replicate/async_replicate_vote.cpp index 002bcd6da3ac..850dd928bf31 100644 --- a/libs/core/resiliency/tests/performance/replicate/async_replicate_vote.cpp +++ b/libs/core/resiliency/tests/performance/replicate/async_replicate_vote.cpp @@ -6,10 +6,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/tests/performance/replicate/async_replicate_vote_validate.cpp b/libs/core/resiliency/tests/performance/replicate/async_replicate_vote_validate.cpp index da64c9495760..b5d702d01bf2 100644 --- a/libs/core/resiliency/tests/performance/replicate/async_replicate_vote_validate.cpp +++ b/libs/core/resiliency/tests/performance/replicate/async_replicate_vote_validate.cpp @@ -6,10 +6,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/tests/performance/replicate/pure_async_for_replicate.cpp b/libs/core/resiliency/tests/performance/replicate/pure_async_for_replicate.cpp index 18602a531ad3..dbe7bca883e2 100644 --- a/libs/core/resiliency/tests/performance/replicate/pure_async_for_replicate.cpp +++ b/libs/core/resiliency/tests/performance/replicate/pure_async_for_replicate.cpp @@ -6,10 +6,10 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include #include diff --git a/libs/core/resiliency/tests/unit/async_replay_executor.cpp b/libs/core/resiliency/tests/unit/async_replay_executor.cpp index 895fed6f6cbf..a2251dbc903d 100644 --- a/libs/core/resiliency/tests/unit/async_replay_executor.cpp +++ b/libs/core/resiliency/tests/unit/async_replay_executor.cpp @@ -8,9 +8,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/async_replay_plain.cpp b/libs/core/resiliency/tests/unit/async_replay_plain.cpp index 5f805708c61f..55c7ae6e4b27 100644 --- a/libs/core/resiliency/tests/unit/async_replay_plain.cpp +++ b/libs/core/resiliency/tests/unit/async_replay_plain.cpp @@ -8,8 +8,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/async_replicate_executor.cpp b/libs/core/resiliency/tests/unit/async_replicate_executor.cpp index e2f04797035c..56067381be94 100644 --- a/libs/core/resiliency/tests/unit/async_replicate_executor.cpp +++ b/libs/core/resiliency/tests/unit/async_replicate_executor.cpp @@ -8,9 +8,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/async_replicate_plain.cpp b/libs/core/resiliency/tests/unit/async_replicate_plain.cpp index 1f64d83b2f7f..7a3e18b9c6e7 100644 --- a/libs/core/resiliency/tests/unit/async_replicate_plain.cpp +++ b/libs/core/resiliency/tests/unit/async_replicate_plain.cpp @@ -8,8 +8,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/async_replicate_vote_executor.cpp b/libs/core/resiliency/tests/unit/async_replicate_vote_executor.cpp index b0331b4a432c..8da74b2a0b1c 100644 --- a/libs/core/resiliency/tests/unit/async_replicate_vote_executor.cpp +++ b/libs/core/resiliency/tests/unit/async_replicate_vote_executor.cpp @@ -7,9 +7,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/async_replicate_vote_plain.cpp b/libs/core/resiliency/tests/unit/async_replicate_vote_plain.cpp index 950e8f3ff24b..435a72d199df 100644 --- a/libs/core/resiliency/tests/unit/async_replicate_vote_plain.cpp +++ b/libs/core/resiliency/tests/unit/async_replicate_vote_plain.cpp @@ -7,8 +7,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/dataflow_replay_executor.cpp b/libs/core/resiliency/tests/unit/dataflow_replay_executor.cpp index 6148e691d707..b4502b0b0ff5 100644 --- a/libs/core/resiliency/tests/unit/dataflow_replay_executor.cpp +++ b/libs/core/resiliency/tests/unit/dataflow_replay_executor.cpp @@ -8,9 +8,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/dataflow_replay_plain.cpp b/libs/core/resiliency/tests/unit/dataflow_replay_plain.cpp index 6cd8e92ff557..84e5598368ce 100644 --- a/libs/core/resiliency/tests/unit/dataflow_replay_plain.cpp +++ b/libs/core/resiliency/tests/unit/dataflow_replay_plain.cpp @@ -8,8 +8,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/dataflow_replicate_executor.cpp b/libs/core/resiliency/tests/unit/dataflow_replicate_executor.cpp index 1fde2d7c7afa..28ba0a254fae 100644 --- a/libs/core/resiliency/tests/unit/dataflow_replicate_executor.cpp +++ b/libs/core/resiliency/tests/unit/dataflow_replicate_executor.cpp @@ -8,9 +8,9 @@ // 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) -#include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/dataflow_replicate_plain.cpp b/libs/core/resiliency/tests/unit/dataflow_replicate_plain.cpp index b0fb8e657df7..7a75fa6ee265 100644 --- a/libs/core/resiliency/tests/unit/dataflow_replicate_plain.cpp +++ b/libs/core/resiliency/tests/unit/dataflow_replicate_plain.cpp @@ -8,8 +8,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/replay_executor.cpp b/libs/core/resiliency/tests/unit/replay_executor.cpp index 3da4943a7a57..52670db6a2c9 100644 --- a/libs/core/resiliency/tests/unit/replay_executor.cpp +++ b/libs/core/resiliency/tests/unit/replay_executor.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/libs/core/resiliency/tests/unit/replicate_executor.cpp b/libs/core/resiliency/tests/unit/replicate_executor.cpp index 3eb96f63340e..48a81d64b01c 100644 --- a/libs/core/resiliency/tests/unit/replicate_executor.cpp +++ b/libs/core/resiliency/tests/unit/replicate_executor.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/libs/core/resource_partitioner/examples/async_customization.cpp b/libs/core/resource_partitioner/examples/async_customization.cpp index afe7ae27738d..93269debc08c 100644 --- a/libs/core/resource_partitioner/examples/async_customization.cpp +++ b/libs/core/resource_partitioner/examples/async_customization.cpp @@ -7,14 +7,14 @@ #define GUIDED_EXECUTOR_DEBUG 1 #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include +#include #include #include @@ -239,12 +239,12 @@ struct test_async_executor // -------------------------------------------------------------------- // set traits for executor to say it is an async executor // -------------------------------------------------------------------- -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution template T dummy_task(T val) @@ -430,7 +430,7 @@ struct dummy_tag { }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct pool_numa_hint { @@ -472,7 +472,7 @@ namespace hpx { namespace parallel { namespace execution { return 4; } }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution int hpx_main() { diff --git a/libs/core/resource_partitioner/examples/guided_pool_test.cpp b/libs/core/resource_partitioner/examples/guided_pool_test.cpp index 38e744ab9ad8..d97328d26252 100644 --- a/libs/core/resource_partitioner/examples/guided_pool_test.cpp +++ b/libs/core/resource_partitioner/examples/guided_pool_test.cpp @@ -4,13 +4,13 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include #include #include +#include +#include #include #include @@ -71,7 +71,7 @@ std::string a_function(hpx::future&& df) return "The number 2"; } -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { struct guided_test_tag { @@ -118,7 +118,7 @@ namespace hpx { namespace parallel { namespace execution { return 56; } }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution using namespace hpx::parallel::execution; diff --git a/libs/core/resource_partitioner/examples/oversubscribing_resource_partitioner.cpp b/libs/core/resource_partitioner/examples/oversubscribing_resource_partitioner.cpp index 1eb89598c506..93b905138b80 100644 --- a/libs/core/resource_partitioner/examples/oversubscribing_resource_partitioner.cpp +++ b/libs/core/resource_partitioner/examples/oversubscribing_resource_partitioner.cpp @@ -6,13 +6,13 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include -#include -#include -#include +#include +#include +#include #include #include +#include +#include // #include #include @@ -28,7 +28,7 @@ // NB // this test needs to be updated as it no longer does what it is supposed to do -namespace resource { namespace pools { +namespace resource::pools { enum ids { DEFAULT = 0, @@ -36,7 +36,7 @@ namespace resource { namespace pools { GPU = 2, MATRIX = 3, }; -}} // namespace resource::pools +} // namespace resource::pools static bool use_pools = false; static int pool_threads = 1; diff --git a/libs/core/resource_partitioner/examples/simple_resource_partitioner.cpp b/libs/core/resource_partitioner/examples/simple_resource_partitioner.cpp index e2885caad324..a963cfcf34e6 100644 --- a/libs/core/resource_partitioner/examples/simple_resource_partitioner.cpp +++ b/libs/core/resource_partitioner/examples/simple_resource_partitioner.cpp @@ -7,13 +7,13 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include -#include -#include +#include +#include +#include #include #include #include +#include #include #include diff --git a/libs/core/resource_partitioner/examples/simplest_resource_partitioner_1.cpp b/libs/core/resource_partitioner/examples/simplest_resource_partitioner_1.cpp index 79047cc5c3ed..83414345a7dd 100644 --- a/libs/core/resource_partitioner/examples/simplest_resource_partitioner_1.cpp +++ b/libs/core/resource_partitioner/examples/simplest_resource_partitioner_1.cpp @@ -8,7 +8,7 @@ // intended for inclusion in the documentation. //[body -#include +#include int hpx_main() { diff --git a/libs/core/resource_partitioner/examples/simplest_resource_partitioner_2.cpp b/libs/core/resource_partitioner/examples/simplest_resource_partitioner_2.cpp index 587f3ca79457..d66557cc12e2 100644 --- a/libs/core/resource_partitioner/examples/simplest_resource_partitioner_2.cpp +++ b/libs/core/resource_partitioner/examples/simplest_resource_partitioner_2.cpp @@ -9,7 +9,7 @@ // intended for inclusion in the documentation. //[body -#include +#include #include #include diff --git a/libs/core/resource_partitioner/examples/system_characteristics.hpp b/libs/core/resource_partitioner/examples/system_characteristics.hpp index f4d16b0ea7f6..794ba4b40815 100644 --- a/libs/core/resource_partitioner/examples/system_characteristics.hpp +++ b/libs/core/resource_partitioner/examples/system_characteristics.hpp @@ -6,8 +6,8 @@ #pragma once -#include #include +#include #include diff --git a/libs/core/resource_partitioner/tests/regressions/help_exit_4317_1.cpp b/libs/core/resource_partitioner/tests/regressions/help_exit_4317_1.cpp index a5421e1aca18..c8d0d3802213 100644 --- a/libs/core/resource_partitioner/tests/regressions/help_exit_4317_1.cpp +++ b/libs/core/resource_partitioner/tests/regressions/help_exit_4317_1.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/regressions/help_exit_4317_2.cpp b/libs/core/resource_partitioner/tests/regressions/help_exit_4317_2.cpp index dd9f583c2f11..a81331c18abb 100644 --- a/libs/core/resource_partitioner/tests/regressions/help_exit_4317_2.cpp +++ b/libs/core/resource_partitioner/tests/regressions/help_exit_4317_2.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/background_scheduler.cpp b/libs/core/resource_partitioner/tests/unit/background_scheduler.cpp index 51d6a5915a56..3da2e5d48712 100644 --- a/libs/core/resource_partitioner/tests/unit/background_scheduler.cpp +++ b/libs/core/resource_partitioner/tests/unit/background_scheduler.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/cross_pool_injection.cpp b/libs/core/resource_partitioner/tests/unit/cross_pool_injection.cpp index 73d98fcf3f2e..a8042d88fb9c 100644 --- a/libs/core/resource_partitioner/tests/unit/cross_pool_injection.cpp +++ b/libs/core/resource_partitioner/tests/unit/cross_pool_injection.cpp @@ -13,14 +13,14 @@ // cross pool injection of tasks does not cause segfaults or other // problems such as lockups. -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/named_pool_executor.cpp b/libs/core/resource_partitioner/tests/unit/named_pool_executor.cpp index 9dd2e3bc7f16..49e6a0324065 100644 --- a/libs/core/resource_partitioner/tests/unit/named_pool_executor.cpp +++ b/libs/core/resource_partitioner/tests/unit/named_pool_executor.cpp @@ -8,12 +8,12 @@ // pool and executor #include -#include -#include -#include -#include +#include +#include +#include #include #include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/resource_partitioner_info.cpp b/libs/core/resource_partitioner/tests/unit/resource_partitioner_info.cpp index 5a3aa4fe994b..2672fbb1f470 100644 --- a/libs/core/resource_partitioner/tests/unit/resource_partitioner_info.cpp +++ b/libs/core/resource_partitioner/tests/unit/resource_partitioner_info.cpp @@ -7,10 +7,10 @@ // Simple test verifying basic resource_partitioner functionality. #include -#include -#include +#include #include #include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/scheduler_binding_check.cpp b/libs/core/resource_partitioner/tests/unit/scheduler_binding_check.cpp index ddc019634b79..1db907303f7e 100644 --- a/libs/core/resource_partitioner/tests/unit/scheduler_binding_check.cpp +++ b/libs/core/resource_partitioner/tests/unit/scheduler_binding_check.cpp @@ -9,14 +9,14 @@ // Tasks should always report the right core number when they run. #include -#include -#include -#include -#include -#include +#include +#include +#include #include #include #include +#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/scheduler_priority_check.cpp b/libs/core/resource_partitioner/tests/unit/scheduler_priority_check.cpp index 33bf9f54cf2b..7be77c7ebeda 100644 --- a/libs/core/resource_partitioner/tests/unit/scheduler_priority_check.cpp +++ b/libs/core/resource_partitioner/tests/unit/scheduler_priority_check.cpp @@ -9,13 +9,12 @@ // The test is intended to be used with a task plotting/profiling // tool to verify that high priority tasks run before low ones. -#include -#include -#include -#include +#include +#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/shutdown_suspended_pus.cpp b/libs/core/resource_partitioner/tests/unit/shutdown_suspended_pus.cpp index 90ee9d6bcadd..fa1bafbad5f3 100644 --- a/libs/core/resource_partitioner/tests/unit/shutdown_suspended_pus.cpp +++ b/libs/core/resource_partitioner/tests/unit/shutdown_suspended_pus.cpp @@ -7,14 +7,14 @@ // Simple test verifying basic resource_partitioner functionality. #include -#include -#include -#include +#include +#include #include #include #include -#include -#include +#include +#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/suspend_disabled.cpp b/libs/core/resource_partitioner/tests/unit/suspend_disabled.cpp index 2b79323e79ad..6a5d428c54ac 100644 --- a/libs/core/resource_partitioner/tests/unit/suspend_disabled.cpp +++ b/libs/core/resource_partitioner/tests/unit/suspend_disabled.cpp @@ -6,11 +6,11 @@ // Simple test verifying basic resource_partitioner functionality. -#include -#include +#include #include #include -#include +#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/suspend_pool.cpp b/libs/core/resource_partitioner/tests/unit/suspend_pool.cpp index e3f019fd4303..d8dec3d78922 100644 --- a/libs/core/resource_partitioner/tests/unit/suspend_pool.cpp +++ b/libs/core/resource_partitioner/tests/unit/suspend_pool.cpp @@ -7,19 +7,17 @@ // Simple test verifying basic resource_partitioner functionality. #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include +#include #include -#include -#include -#include +#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/suspend_pool_external.cpp b/libs/core/resource_partitioner/tests/unit/suspend_pool_external.cpp index 118f18c47b1d..4eea2224c9e9 100644 --- a/libs/core/resource_partitioner/tests/unit/suspend_pool_external.cpp +++ b/libs/core/resource_partitioner/tests/unit/suspend_pool_external.cpp @@ -6,17 +6,15 @@ // Simple test verifying basic resource_partitioner functionality. -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include +#include #include -#include -#include -#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/suspend_runtime.cpp b/libs/core/resource_partitioner/tests/unit/suspend_runtime.cpp index eb61ef64ace7..a52aa344bb90 100644 --- a/libs/core/resource_partitioner/tests/unit/suspend_runtime.cpp +++ b/libs/core/resource_partitioner/tests/unit/suspend_runtime.cpp @@ -6,13 +6,13 @@ // Simple test verifying basic resource_partitioner functionality. -#include -#include -#include -#include -#include +#include +#include +#include #include #include +#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/suspend_thread.cpp b/libs/core/resource_partitioner/tests/unit/suspend_thread.cpp index f1207d130a37..694cc31be2ea 100644 --- a/libs/core/resource_partitioner/tests/unit/suspend_thread.cpp +++ b/libs/core/resource_partitioner/tests/unit/suspend_thread.cpp @@ -7,15 +7,14 @@ // Simple test verifying basic resource_partitioner functionality. #include -#include -#include -#include -#include +#include +#include +#include #include #include #include -#include -#include +#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/suspend_thread_external.cpp b/libs/core/resource_partitioner/tests/unit/suspend_thread_external.cpp index 4248b3c6f084..0d1c97a020a9 100644 --- a/libs/core/resource_partitioner/tests/unit/suspend_thread_external.cpp +++ b/libs/core/resource_partitioner/tests/unit/suspend_thread_external.cpp @@ -7,15 +7,14 @@ // Simple test verifying basic resource_partitioner functionality. #include -#include -#include -#include -#include +#include +#include +#include #include #include #include -#include -#include +#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/suspend_thread_timed.cpp b/libs/core/resource_partitioner/tests/unit/suspend_thread_timed.cpp index 64baeea26c8c..e82a8e268b98 100644 --- a/libs/core/resource_partitioner/tests/unit/suspend_thread_timed.cpp +++ b/libs/core/resource_partitioner/tests/unit/suspend_thread_timed.cpp @@ -7,15 +7,14 @@ // Simple test verifying basic resource_partitioner functionality. #include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -#include +#include #include #include diff --git a/libs/core/resource_partitioner/tests/unit/used_pus.cpp b/libs/core/resource_partitioner/tests/unit/used_pus.cpp index 92fad8ec05f3..008dc4df7843 100644 --- a/libs/core/resource_partitioner/tests/unit/used_pus.cpp +++ b/libs/core/resource_partitioner/tests/unit/used_pus.cpp @@ -6,10 +6,10 @@ // Simple test verifying basic resource_partitioner functionality. -#include -#include +#include #include #include +#include #include #include diff --git a/libs/core/runtime_local/tests/unit/thread_mapper.cpp b/libs/core/runtime_local/tests/unit/thread_mapper.cpp index aa5d50ff8349..bb40ca5b0980 100644 --- a/libs/core/runtime_local/tests/unit/thread_mapper.cpp +++ b/libs/core/runtime_local/tests/unit/thread_mapper.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include +#include #include +#include #include #include diff --git a/libs/core/schedulers/tests/unit/schedule_last.cpp b/libs/core/schedulers/tests/unit/schedule_last.cpp index 646aac98ee36..9f53cdf57174 100644 --- a/libs/core/schedulers/tests/unit/schedule_last.cpp +++ b/libs/core/schedulers/tests/unit/schedule_last.cpp @@ -4,12 +4,11 @@ // 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) -#include -#include -#include +#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/serialization/include/hpx/serialization/array.hpp b/libs/core/serialization/include/hpx/serialization/array.hpp index 542c95c3c920..5e74c38a2340 100644 --- a/libs/core/serialization/include/hpx/serialization/array.hpp +++ b/libs/core/serialization/include/hpx/serialization/array.hpp @@ -54,7 +54,6 @@ namespace hpx::serialization { void serialize(Archive& ar, unsigned int) { #if !defined(HPX_SERIALIZATION_HAVE_ALL_TYPES_ARE_BITWISE_SERIALIZABLE) - // NOLINTNEXTLINE(bugprone-branch-clone) if (ar.disable_array_optimization() || ar.endianess_differs()) { // normal serialization diff --git a/libs/core/serialization/tests/regressions/buffer_overrun_2839.cpp b/libs/core/serialization/tests/regressions/buffer_overrun_2839.cpp index f838c6359442..79f4209a096b 100644 --- a/libs/core/serialization/tests/regressions/buffer_overrun_2839.cpp +++ b/libs/core/serialization/tests/regressions/buffer_overrun_2839.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include #include diff --git a/libs/core/serialization/tests/regressions/non_default_constructible_5886.cpp b/libs/core/serialization/tests/regressions/non_default_constructible_5886.cpp index 143385bc014a..da5f71ce29a4 100644 --- a/libs/core/serialization/tests/regressions/non_default_constructible_5886.cpp +++ b/libs/core/serialization/tests/regressions/non_default_constructible_5886.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/core/serialization/tests/regressions/not_bitwise_shared_ptr_serialization.cpp b/libs/core/serialization/tests/regressions/not_bitwise_shared_ptr_serialization.cpp index e0beeb06c3f7..ef86215c5092 100644 --- a/libs/core/serialization/tests/regressions/not_bitwise_shared_ptr_serialization.cpp +++ b/libs/core/serialization/tests/regressions/not_bitwise_shared_ptr_serialization.cpp @@ -11,7 +11,7 @@ #define HPX_SERIALIZATION_HAVE_ALLOW_RAW_POINTER_SERIALIZATION #include -#include +#include #include #include diff --git a/libs/core/serialization/tests/unit/serialization_raw_pointer.cpp b/libs/core/serialization/tests/unit/serialization_raw_pointer.cpp index 37b102969c2a..de4ea643b03b 100644 --- a/libs/core/serialization/tests/unit/serialization_raw_pointer.cpp +++ b/libs/core/serialization/tests/unit/serialization_raw_pointer.cpp @@ -11,7 +11,7 @@ #define HPX_SERIALIZATION_HAVE_ALLOW_CONST_TUPLE_MEMBERS #include -#include +#include #include #include #include diff --git a/libs/core/static_reinit/include/hpx/static_reinit/reinitializable_static.hpp b/libs/core/static_reinit/include/hpx/static_reinit/reinitializable_static.hpp index ed7519cd8e31..3058bd06b5fb 100644 --- a/libs/core/static_reinit/include/hpx/static_reinit/reinitializable_static.hpp +++ b/libs/core/static_reinit/include/hpx/static_reinit/reinitializable_static.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include // for placement new diff --git a/libs/core/synchronization/tests/performance/channel_mpmc_throughput.cpp b/libs/core/synchronization/tests/performance/channel_mpmc_throughput.cpp index 506df5ed3388..c08c75858314 100644 --- a/libs/core/synchronization/tests/performance/channel_mpmc_throughput.cpp +++ b/libs/core/synchronization/tests/performance/channel_mpmc_throughput.cpp @@ -6,11 +6,11 @@ // This work is inspired by https://github.com/aprell/tasking-2.0 -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/synchronization/tests/performance/channel_mpsc_throughput.cpp b/libs/core/synchronization/tests/performance/channel_mpsc_throughput.cpp index 2e0cce9564d4..837b33527f12 100644 --- a/libs/core/synchronization/tests/performance/channel_mpsc_throughput.cpp +++ b/libs/core/synchronization/tests/performance/channel_mpsc_throughput.cpp @@ -6,11 +6,11 @@ // This work is inspired by https://github.com/aprell/tasking-2.0 -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/synchronization/tests/performance/channel_spsc_throughput.cpp b/libs/core/synchronization/tests/performance/channel_spsc_throughput.cpp index 86a9d732a2ac..f37435b0a0c1 100644 --- a/libs/core/synchronization/tests/performance/channel_spsc_throughput.cpp +++ b/libs/core/synchronization/tests/performance/channel_spsc_throughput.cpp @@ -6,11 +6,11 @@ // This work is inspired by https://github.com/aprell/tasking-2.0 -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/synchronization/tests/regressions/ignore_while_locked_1485.cpp b/libs/core/synchronization/tests/regressions/ignore_while_locked_1485.cpp index 3ab042bd51b8..d0f7e5a0c381 100644 --- a/libs/core/synchronization/tests/regressions/ignore_while_locked_1485.cpp +++ b/libs/core/synchronization/tests/regressions/ignore_while_locked_1485.cpp @@ -9,10 +9,10 @@ // `ignore_all_while_checking` can be used instead to ignore all locks // (including the ones that are not supported by `ignore_while_checking`). -#include -#include +#include #include #include +#include #include #include diff --git a/libs/core/synchronization/tests/regressions/shared_mutex_1702.cpp b/libs/core/synchronization/tests/regressions/shared_mutex_1702.cpp index ca9e1994965e..54795e20df8a 100644 --- a/libs/core/synchronization/tests/regressions/shared_mutex_1702.cpp +++ b/libs/core/synchronization/tests/regressions/shared_mutex_1702.cpp @@ -7,9 +7,9 @@ // This test case demonstrates the issue described in #1702: Shared_mutex does // not compile with no_mutex cond_var -#include +#include #include -#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/async_rw_mutex.cpp b/libs/core/synchronization/tests/unit/async_rw_mutex.cpp index c6923d18ee06..a48bf467ca3b 100644 --- a/libs/core/synchronization/tests/unit/async_rw_mutex.cpp +++ b/libs/core/synchronization/tests/unit/async_rw_mutex.cpp @@ -5,11 +5,10 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include -#include +#include +#include #include -#include +#include #include #include @@ -201,10 +200,13 @@ void test_multiple_accesses( std::atomic count{0}; // Read-only and read-write access return senders of different types + // clang-format off using r_sender_type = std::decay_t; using rw_sender_type = std::decay_t; + // clang-format on + std::vector r_senders; std::vector rw_senders; diff --git a/libs/core/synchronization/tests/unit/barrier_cpp20.cpp b/libs/core/synchronization/tests/unit/barrier_cpp20.cpp index 6064c603634e..88725c27bc7a 100644 --- a/libs/core/synchronization/tests/unit/barrier_cpp20.cpp +++ b/libs/core/synchronization/tests/unit/barrier_cpp20.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/binary_semaphore_cpp20.cpp b/libs/core/synchronization/tests/unit/binary_semaphore_cpp20.cpp index fbed2c5747a9..6b268d6fabe6 100644 --- a/libs/core/synchronization/tests/unit/binary_semaphore_cpp20.cpp +++ b/libs/core/synchronization/tests/unit/binary_semaphore_cpp20.cpp @@ -5,10 +5,10 @@ // 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) -#include -#include -#include +#include #include +#include +#include #include diff --git a/libs/core/synchronization/tests/unit/channel_mpmc_fib.cpp b/libs/core/synchronization/tests/unit/channel_mpmc_fib.cpp index 44705e4268ae..c05f9e27805d 100644 --- a/libs/core/synchronization/tests/unit/channel_mpmc_fib.cpp +++ b/libs/core/synchronization/tests/unit/channel_mpmc_fib.cpp @@ -6,11 +6,11 @@ // This work is inspired by https://github.com/aprell/tasking-2.0 -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/channel_mpmc_shift.cpp b/libs/core/synchronization/tests/unit/channel_mpmc_shift.cpp index 2e9371e4ad2c..ee6c40994f64 100644 --- a/libs/core/synchronization/tests/unit/channel_mpmc_shift.cpp +++ b/libs/core/synchronization/tests/unit/channel_mpmc_shift.cpp @@ -6,11 +6,11 @@ // This work is inspired by https://github.com/aprell/tasking-2.0 -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/channel_mpsc_fib.cpp b/libs/core/synchronization/tests/unit/channel_mpsc_fib.cpp index 1f1e5e329dd3..f1d15d7e3d04 100644 --- a/libs/core/synchronization/tests/unit/channel_mpsc_fib.cpp +++ b/libs/core/synchronization/tests/unit/channel_mpsc_fib.cpp @@ -6,11 +6,11 @@ // This work is inspired by https://github.com/aprell/tasking-2.0 -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/channel_mpsc_shift.cpp b/libs/core/synchronization/tests/unit/channel_mpsc_shift.cpp index 9bc6777be38d..ec2147bd01e3 100644 --- a/libs/core/synchronization/tests/unit/channel_mpsc_shift.cpp +++ b/libs/core/synchronization/tests/unit/channel_mpsc_shift.cpp @@ -6,11 +6,11 @@ // This work is inspired by https://github.com/aprell/tasking-2.0 -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/channel_spsc_fib.cpp b/libs/core/synchronization/tests/unit/channel_spsc_fib.cpp index 106546bd9b60..75f896c43ec1 100644 --- a/libs/core/synchronization/tests/unit/channel_spsc_fib.cpp +++ b/libs/core/synchronization/tests/unit/channel_spsc_fib.cpp @@ -6,11 +6,11 @@ // This work is inspired by https://github.com/aprell/tasking-2.0 -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/channel_spsc_shift.cpp b/libs/core/synchronization/tests/unit/channel_spsc_shift.cpp index 59596eb8bb36..25f9f69f7c12 100644 --- a/libs/core/synchronization/tests/unit/channel_spsc_shift.cpp +++ b/libs/core/synchronization/tests/unit/channel_spsc_shift.cpp @@ -6,11 +6,11 @@ // This work is inspired by https://github.com/aprell/tasking-2.0 -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/condition_variable.cpp b/libs/core/synchronization/tests/unit/condition_variable.cpp index d06b5928118d..1e172f59de30 100644 --- a/libs/core/synchronization/tests/unit/condition_variable.cpp +++ b/libs/core/synchronization/tests/unit/condition_variable.cpp @@ -9,11 +9,11 @@ // 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) -#include +#include +#include #include -#include -#include -#include +#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/counting_semaphore.cpp b/libs/core/synchronization/tests/unit/counting_semaphore.cpp index 79975ebf6e23..6262449085d1 100644 --- a/libs/core/synchronization/tests/unit/counting_semaphore.cpp +++ b/libs/core/synchronization/tests/unit/counting_semaphore.cpp @@ -5,12 +5,12 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include #include +#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/counting_semaphore_cpp20.cpp b/libs/core/synchronization/tests/unit/counting_semaphore_cpp20.cpp index a575128c313a..059e210458d3 100644 --- a/libs/core/synchronization/tests/unit/counting_semaphore_cpp20.cpp +++ b/libs/core/synchronization/tests/unit/counting_semaphore_cpp20.cpp @@ -5,10 +5,10 @@ // 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) -#include -#include -#include +#include #include +#include +#include #include diff --git a/libs/core/synchronization/tests/unit/in_place_stop_token.cpp b/libs/core/synchronization/tests/unit/in_place_stop_token.cpp index 579ea37ceef0..eeca4fbd4e10 100644 --- a/libs/core/synchronization/tests/unit/in_place_stop_token.cpp +++ b/libs/core/synchronization/tests/unit/in_place_stop_token.cpp @@ -9,7 +9,7 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/in_place_stop_token_cb2.cpp b/libs/core/synchronization/tests/unit/in_place_stop_token_cb2.cpp index 267dcb55feed..8868a81f8683 100644 --- a/libs/core/synchronization/tests/unit/in_place_stop_token_cb2.cpp +++ b/libs/core/synchronization/tests/unit/in_place_stop_token_cb2.cpp @@ -9,7 +9,7 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/latch_cpp20.cpp b/libs/core/synchronization/tests/unit/latch_cpp20.cpp index 2d518e3f2630..280bd86bfc05 100644 --- a/libs/core/synchronization/tests/unit/latch_cpp20.cpp +++ b/libs/core/synchronization/tests/unit/latch_cpp20.cpp @@ -4,8 +4,8 @@ // 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) -#include -#include +#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/local_barrier.cpp b/libs/core/synchronization/tests/unit/local_barrier.cpp index d30ad4b20b36..526f52122c68 100644 --- a/libs/core/synchronization/tests/unit/local_barrier.cpp +++ b/libs/core/synchronization/tests/unit/local_barrier.cpp @@ -5,11 +5,11 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/local_barrier_count_up.cpp b/libs/core/synchronization/tests/unit/local_barrier_count_up.cpp index 06256a42f50b..56680712c42e 100644 --- a/libs/core/synchronization/tests/unit/local_barrier_count_up.cpp +++ b/libs/core/synchronization/tests/unit/local_barrier_count_up.cpp @@ -6,12 +6,12 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/local_barrier_reset.cpp b/libs/core/synchronization/tests/unit/local_barrier_reset.cpp index f0e528d6c581..1b207921ade5 100644 --- a/libs/core/synchronization/tests/unit/local_barrier_reset.cpp +++ b/libs/core/synchronization/tests/unit/local_barrier_reset.cpp @@ -6,12 +6,12 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/local_event.cpp b/libs/core/synchronization/tests/unit/local_event.cpp index 4374c854c986..42b72db68356 100644 --- a/libs/core/synchronization/tests/unit/local_event.cpp +++ b/libs/core/synchronization/tests/unit/local_event.cpp @@ -5,12 +5,12 @@ // 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) -#include -#include -#include +#include +#include #include #include #include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/local_latch.cpp b/libs/core/synchronization/tests/unit/local_latch.cpp index 59f6c0ee72ad..aa72ebe47bc7 100644 --- a/libs/core/synchronization/tests/unit/local_latch.cpp +++ b/libs/core/synchronization/tests/unit/local_latch.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/local_mutex.cpp b/libs/core/synchronization/tests/unit/local_mutex.cpp index e7c193a7ae64..b6f4c415eca3 100644 --- a/libs/core/synchronization/tests/unit/local_mutex.cpp +++ b/libs/core/synchronization/tests/unit/local_mutex.cpp @@ -7,13 +7,13 @@ // 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) -#include -#include +#include +#include +#include #include -#include #include -#include -#include +#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/shared_mutex/shared_mutex1.cpp b/libs/core/synchronization/tests/unit/shared_mutex/shared_mutex1.cpp index f4d3f0aad6ec..a36f3cf9d3af 100644 --- a/libs/core/synchronization/tests/unit/shared_mutex/shared_mutex1.cpp +++ b/libs/core/synchronization/tests/unit/shared_mutex/shared_mutex1.cpp @@ -6,12 +6,12 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/shared_mutex/shared_mutex2.cpp b/libs/core/synchronization/tests/unit/shared_mutex/shared_mutex2.cpp index f258a0180304..9a0cf5fe6ed5 100644 --- a/libs/core/synchronization/tests/unit/shared_mutex/shared_mutex2.cpp +++ b/libs/core/synchronization/tests/unit/shared_mutex/shared_mutex2.cpp @@ -6,10 +6,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/libs/core/synchronization/tests/unit/sliding_semaphore.cpp b/libs/core/synchronization/tests/unit/sliding_semaphore.cpp index 220fa317cd48..fd6876fa9b9a 100644 --- a/libs/core/synchronization/tests/unit/sliding_semaphore.cpp +++ b/libs/core/synchronization/tests/unit/sliding_semaphore.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include -#include +#include +#include #include #include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/stop_token.cpp b/libs/core/synchronization/tests/unit/stop_token.cpp index a1b24eef68be..8d534d0dfc52 100644 --- a/libs/core/synchronization/tests/unit/stop_token.cpp +++ b/libs/core/synchronization/tests/unit/stop_token.cpp @@ -9,7 +9,7 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include #include diff --git a/libs/core/synchronization/tests/unit/stop_token_cb2.cpp b/libs/core/synchronization/tests/unit/stop_token_cb2.cpp index 7276ec2e6cd0..754dca8b8ee5 100644 --- a/libs/core/synchronization/tests/unit/stop_token_cb2.cpp +++ b/libs/core/synchronization/tests/unit/stop_token_cb2.cpp @@ -9,7 +9,7 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include #include diff --git a/libs/core/threading/tests/unit/condition_variable2.cpp b/libs/core/threading/tests/unit/condition_variable2.cpp index 4215afa7e3e4..15ab53c2a8ed 100644 --- a/libs/core/threading/tests/unit/condition_variable2.cpp +++ b/libs/core/threading/tests/unit/condition_variable2.cpp @@ -9,11 +9,11 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include -#include +#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/threading/tests/unit/condition_variable3.cpp b/libs/core/threading/tests/unit/condition_variable3.cpp index 9051afafcd8e..e5369361355f 100644 --- a/libs/core/threading/tests/unit/condition_variable3.cpp +++ b/libs/core/threading/tests/unit/condition_variable3.cpp @@ -9,10 +9,10 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/threading/tests/unit/condition_variable4.cpp b/libs/core/threading/tests/unit/condition_variable4.cpp index f5fb36c46637..ea150cb67fa2 100644 --- a/libs/core/threading/tests/unit/condition_variable4.cpp +++ b/libs/core/threading/tests/unit/condition_variable4.cpp @@ -9,10 +9,10 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/threading/tests/unit/condition_variable_race.cpp b/libs/core/threading/tests/unit/condition_variable_race.cpp index 6df6cecc0a73..567299b79548 100644 --- a/libs/core/threading/tests/unit/condition_variable_race.cpp +++ b/libs/core/threading/tests/unit/condition_variable_race.cpp @@ -9,10 +9,10 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/threading/tests/unit/error_callback.cpp b/libs/core/threading/tests/unit/error_callback.cpp index 1dc4fe5348cc..d7d95a6314a1 100644 --- a/libs/core/threading/tests/unit/error_callback.cpp +++ b/libs/core/threading/tests/unit/error_callback.cpp @@ -4,9 +4,9 @@ // 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) -#include -#include +#include #include +#include #include #include diff --git a/libs/core/threading/tests/unit/in_place_stop_token_cb1.cpp b/libs/core/threading/tests/unit/in_place_stop_token_cb1.cpp index afb865c8333d..fdc04f709439 100644 --- a/libs/core/threading/tests/unit/in_place_stop_token_cb1.cpp +++ b/libs/core/threading/tests/unit/in_place_stop_token_cb1.cpp @@ -9,12 +9,12 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include -#include +#include +#include #include #include -#include -#include +#include +#include #include #include diff --git a/libs/core/threading/tests/unit/in_place_stop_token_race.cpp b/libs/core/threading/tests/unit/in_place_stop_token_race.cpp index 6ce08d01394c..e81d20841a9b 100644 --- a/libs/core/threading/tests/unit/in_place_stop_token_race.cpp +++ b/libs/core/threading/tests/unit/in_place_stop_token_race.cpp @@ -9,10 +9,10 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include -#include +#include #include -#include +#include +#include #include #include diff --git a/libs/core/threading/tests/unit/in_place_stop_token_race2.cpp b/libs/core/threading/tests/unit/in_place_stop_token_race2.cpp index 4dbd948e7801..cc6f69c02d00 100644 --- a/libs/core/threading/tests/unit/in_place_stop_token_race2.cpp +++ b/libs/core/threading/tests/unit/in_place_stop_token_race2.cpp @@ -9,9 +9,9 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include -#include +#include #include diff --git a/libs/core/threading/tests/unit/jthread1.cpp b/libs/core/threading/tests/unit/jthread1.cpp index 185d6aa4f80f..fb3169774668 100644 --- a/libs/core/threading/tests/unit/jthread1.cpp +++ b/libs/core/threading/tests/unit/jthread1.cpp @@ -9,9 +9,9 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include -#include +#include #include #include diff --git a/libs/core/threading/tests/unit/jthread2.cpp b/libs/core/threading/tests/unit/jthread2.cpp index f46166c34144..bf403014f5b2 100644 --- a/libs/core/threading/tests/unit/jthread2.cpp +++ b/libs/core/threading/tests/unit/jthread2.cpp @@ -9,9 +9,9 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include -#include +#include #include #include diff --git a/libs/core/threading/tests/unit/stack_check.cpp b/libs/core/threading/tests/unit/stack_check.cpp index eaf053fc405a..2a0763e6aa48 100644 --- a/libs/core/threading/tests/unit/stack_check.cpp +++ b/libs/core/threading/tests/unit/stack_check.cpp @@ -5,9 +5,9 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include +#include #include +#include #include #include diff --git a/libs/core/threading/tests/unit/stop_token_cb1.cpp b/libs/core/threading/tests/unit/stop_token_cb1.cpp index 190b2bf5e70c..697951e37d88 100644 --- a/libs/core/threading/tests/unit/stop_token_cb1.cpp +++ b/libs/core/threading/tests/unit/stop_token_cb1.cpp @@ -9,12 +9,12 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include -#include +#include +#include #include #include -#include -#include +#include +#include #include #include diff --git a/libs/core/threading/tests/unit/stop_token_race.cpp b/libs/core/threading/tests/unit/stop_token_race.cpp index b6afa23e4054..0b4ee8a7d853 100644 --- a/libs/core/threading/tests/unit/stop_token_race.cpp +++ b/libs/core/threading/tests/unit/stop_token_race.cpp @@ -9,10 +9,10 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include -#include +#include #include -#include +#include +#include #include #include diff --git a/libs/core/threading/tests/unit/stop_token_race2.cpp b/libs/core/threading/tests/unit/stop_token_race2.cpp index 161ef5a23c84..1f2041695d8a 100644 --- a/libs/core/threading/tests/unit/stop_token_race2.cpp +++ b/libs/core/threading/tests/unit/stop_token_race2.cpp @@ -9,9 +9,9 @@ // Creative Commons Attribution 4.0 International License // (http://creativecommons.org/licenses/by/4.0/). -#include +#include #include -#include +#include #include diff --git a/libs/core/threading/tests/unit/thread.cpp b/libs/core/threading/tests/unit/thread.cpp index 2cf349395c63..59332e027f62 100644 --- a/libs/core/threading/tests/unit/thread.cpp +++ b/libs/core/threading/tests/unit/thread.cpp @@ -6,11 +6,11 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/threading/tests/unit/thread_id.cpp b/libs/core/threading/tests/unit/thread_id.cpp index 9dfcb90bfffd..33b5f5a358d4 100644 --- a/libs/core/threading/tests/unit/thread_id.cpp +++ b/libs/core/threading/tests/unit/thread_id.cpp @@ -5,11 +5,11 @@ // 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) -#include -#include -#include -#include +#include +#include +#include #include +#include #include #include diff --git a/libs/core/threading/tests/unit/thread_launching.cpp b/libs/core/threading/tests/unit/thread_launching.cpp index cd948156abfb..2f92be6d04e0 100644 --- a/libs/core/threading/tests/unit/thread_launching.cpp +++ b/libs/core/threading/tests/unit/thread_launching.cpp @@ -5,9 +5,9 @@ // 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) -#include -#include +#include #include +#include #include #include diff --git a/libs/core/threading/tests/unit/thread_mf.cpp b/libs/core/threading/tests/unit/thread_mf.cpp index 6199da19531b..52c320d83691 100644 --- a/libs/core/threading/tests/unit/thread_mf.cpp +++ b/libs/core/threading/tests/unit/thread_mf.cpp @@ -6,10 +6,10 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#include -#include -#include +#include #include +#include +#include #include diff --git a/libs/core/threading/tests/unit/thread_yield.cpp b/libs/core/threading/tests/unit/thread_yield.cpp index b42db5503b5e..f9dfa697e25f 100644 --- a/libs/core/threading/tests/unit/thread_yield.cpp +++ b/libs/core/threading/tests/unit/thread_yield.cpp @@ -4,10 +4,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/threading/tests/unit/tss.cpp b/libs/core/threading/tests/unit/tss.cpp index 69a6f118d8ab..19660df351db 100644 --- a/libs/core/threading/tests/unit/tss.cpp +++ b/libs/core/threading/tests/unit/tss.cpp @@ -6,10 +6,10 @@ // 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) -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/libs/core/threading_base/src/create_thread.cpp b/libs/core/threading_base/src/create_thread.cpp index 81d6dd4ca554..14e3168baa66 100644 --- a/libs/core/threading_base/src/create_thread.cpp +++ b/libs/core/threading_base/src/create_thread.cpp @@ -88,7 +88,6 @@ namespace hpx::threads::detail { // create the new thread scheduler->create_thread(data, &id, ec); - // NOLINTNEXTLINE(bugprone-branch-clone) LTM_(info) .format("create_thread: pool({}), scheduler({}), thread({}), " "initial_state({}), run_now({})", diff --git a/libs/core/threading_base/src/set_thread_state.cpp b/libs/core/threading_base/src/set_thread_state.cpp index f7ccada50ac3..7ba34efc4127 100644 --- a/libs/core/threading_base/src/set_thread_state.cpp +++ b/libs/core/threading_base/src/set_thread_state.cpp @@ -45,7 +45,6 @@ namespace hpx::threads::detail { if (current_state.state() == previous_state.state() && current_state != previous_state) { - // NOLINTNEXTLINE(bugprone-branch-clone) LTM_(warning).format( "set_active_state: thread is still active, however it was " "non-active since the original set_state request was issued, " @@ -102,7 +101,6 @@ namespace hpx::threads::detail { // nothing to do here if the state doesn't change if (new_state == previous_state_val) { - // NOLINTNEXTLINE(bugprone-branch-clone) LTM_(warning).format( "set_thread_state: old thread state is the same as new " "thread state, aborting state change, thread({}), " @@ -125,7 +123,6 @@ namespace hpx::threads::detail { if (retry_on_active) { // schedule a new thread to set the state - // NOLINTNEXTLINE(bugprone-branch-clone) LTM_(warning).format( "set_thread_state: thread is currently active, " "scheduling new thread, thread({}), description({}), " @@ -150,7 +147,6 @@ namespace hpx::threads::detail { k, "hpx::threads::detail::set_thread_state"); ++k; - // NOLINTNEXTLINE(bugprone-branch-clone) LTM_(warning).format( "set_thread_state: thread is currently active, but not " "scheduling new thread because retry_on_active = " @@ -170,7 +166,6 @@ namespace hpx::threads::detail { case thread_schedule_state::terminated: { - // NOLINTNEXTLINE(bugprone-branch-clone) LTM_(warning).format( "set_thread_state: thread is terminated, aborting state " "change, thread({}), description({}), new state({})", @@ -200,7 +195,6 @@ namespace hpx::threads::detail { thrd, get_thread_id_data(thrd)->get_description(), new_state); - // NOLINTNEXTLINE(bugprone-branch-clone) LTM_(fatal) << str; HPX_THROWS_IF(ec, hpx::error::bad_parameter, @@ -230,7 +224,6 @@ namespace hpx::threads::detail { // some point will ignore this thread by simply skipping it (if it's // not pending anymore). - // NOLINTNEXTLINE(bugprone-branch-clone) LTM_(info).format("set_thread_state: thread({}), description({}), " "new state({}), old state({})", thrd, get_thread_id_data(thrd)->get_description(), @@ -245,7 +238,6 @@ namespace hpx::threads::detail { } // state has changed since we fetched it from the thread, retry - // NOLINTNEXTLINE(bugprone-branch-clone) LTM_(warning).format( "set_thread_state: state has been changed since it was " "fetched, retrying, thread({}), description({}), new " diff --git a/libs/core/threading_base/src/set_thread_state_timed.cpp b/libs/core/threading_base/src/set_thread_state_timed.cpp index 60cbbfc554ac..7663d028dfcf 100644 --- a/libs/core/threading_base/src/set_thread_state_timed.cpp +++ b/libs/core/threading_base/src/set_thread_state_timed.cpp @@ -142,7 +142,6 @@ namespace hpx::threads::detail { HPX_ASSERT(statex == thread_restart_state::abort || statex == thread_restart_state::timeout); - // NOLINTNEXTLINE(bugprone-branch-clone) if (thread_restart_state::timeout != statex) //-V601 { triggered->store(true); diff --git a/libs/core/threading_base/tests/regressions/thread_local_data.cpp b/libs/core/threading_base/tests/regressions/thread_local_data.cpp index 3066d8329807..763f7e01732e 100644 --- a/libs/core/threading_base/tests/regressions/thread_local_data.cpp +++ b/libs/core/threading_base/tests/regressions/thread_local_data.cpp @@ -4,10 +4,10 @@ // 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) -#include +#include #include #include -#include +#include #include #include diff --git a/libs/core/threading_base/tests/regressions/thread_stacksize_current.cpp b/libs/core/threading_base/tests/regressions/thread_stacksize_current.cpp index 2e4cee1c4d34..077df205ea9f 100644 --- a/libs/core/threading_base/tests/regressions/thread_stacksize_current.cpp +++ b/libs/core/threading_base/tests/regressions/thread_stacksize_current.cpp @@ -10,11 +10,10 @@ // thread_stacksize::minimal and thread_stacksize::maximal when a thread has been // created. -#include - +#include #include #include -#include +#include #include #include diff --git a/libs/core/timed_execution/tests/unit/minimal_timed_async_executor.cpp b/libs/core/timed_execution/tests/unit/minimal_timed_async_executor.cpp index 509d0e31bbf5..3a12631aad5d 100644 --- a/libs/core/timed_execution/tests/unit/minimal_timed_async_executor.cpp +++ b/libs/core/timed_execution/tests/unit/minimal_timed_async_executor.cpp @@ -4,11 +4,9 @@ // 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) -#include -#include -#include +#include +#include #include -#include #include #include @@ -183,7 +181,7 @@ struct test_timed_async_executor1 : test_async_executor1 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { @@ -193,7 +191,7 @@ namespace hpx { namespace parallel { namespace execution { struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_timed_async_executor2 : test_async_executor1 { @@ -224,7 +222,7 @@ struct test_timed_async_executor3 : test_timed_async_executor2 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { @@ -234,7 +232,7 @@ namespace hpx { namespace parallel { namespace execution { struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_timed_async_executor4 : test_async_executor1 { @@ -260,7 +258,7 @@ struct test_timed_async_executor5 : test_timed_async_executor4 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_two_way_executor : std::true_type { @@ -270,7 +268,7 @@ namespace hpx { namespace parallel { namespace execution { struct is_two_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// int hpx_main() diff --git a/libs/core/timed_execution/tests/unit/minimal_timed_sync_executor.cpp b/libs/core/timed_execution/tests/unit/minimal_timed_sync_executor.cpp index 4e6d8831e0cb..d3f42cc0087a 100644 --- a/libs/core/timed_execution/tests/unit/minimal_timed_sync_executor.cpp +++ b/libs/core/timed_execution/tests/unit/minimal_timed_sync_executor.cpp @@ -4,10 +4,9 @@ // 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) -#include -#include +#include +#include #include -#include #include #include @@ -176,7 +175,7 @@ struct test_timed_sync_executor1 : test_sync_executor1 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_one_way_executor : std::true_type { @@ -186,7 +185,7 @@ namespace hpx { namespace parallel { namespace execution { struct is_one_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution struct test_sync_executor2 : test_sync_executor1 { @@ -214,7 +213,7 @@ struct test_timed_sync_executor2 : test_sync_executor2 } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_one_way_executor : std::true_type { @@ -224,7 +223,7 @@ namespace hpx { namespace parallel { namespace execution { struct is_one_way_executor : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution /////////////////////////////////////////////////////////////////////////////// int hpx_main() diff --git a/libs/core/timed_execution/tests/unit/timed_parallel_executor.cpp b/libs/core/timed_execution/tests/unit/timed_parallel_executor.cpp index 1fca08e2d9a7..96b931e23492 100644 --- a/libs/core/timed_execution/tests/unit/timed_parallel_executor.cpp +++ b/libs/core/timed_execution/tests/unit/timed_parallel_executor.cpp @@ -4,10 +4,9 @@ // 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) -#include -#include +#include +#include #include -#include #include #include diff --git a/libs/core/type_support/tests/unit/generator.cpp b/libs/core/type_support/tests/unit/generator.cpp index e7a53c3d9d95..8853532eae61 100644 --- a/libs/core/type_support/tests/unit/generator.cpp +++ b/libs/core/type_support/tests/unit/generator.cpp @@ -13,7 +13,7 @@ #if defined(HPX_HAVE_CXX20_COROUTINES) && \ (!defined(HPX_CLANG_VERSION) || HPX_CLANG_VERSION >= 130000) -#include +#include #include #include diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/async_unwrap_result_implementations.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/async_unwrap_result_implementations.hpp index 711cbece74b2..59eeff718abc 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/async_unwrap_result_implementations.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/async_unwrap_result_implementations.hpp @@ -42,7 +42,6 @@ namespace hpx { namespace detail { typedef typename hpx::traits::extract_action::type action_type; typedef typename action_type::local_result_type result_type; - // NOLINTNEXTLINE(bugprone-branch-clone) if (policy == launch::sync || action_type::direct_execution::value) { return hpx::detail::sync_local_invoke_direct -#include +#include #include #include diff --git a/libs/full/command_line_handling/tests/regressions/late_commandline_options_5257.cpp b/libs/full/command_line_handling/tests/regressions/late_commandline_options_5257.cpp index 41a099510570..d6b3ab41618e 100644 --- a/libs/full/command_line_handling/tests/regressions/late_commandline_options_5257.cpp +++ b/libs/full/command_line_handling/tests/regressions/late_commandline_options_5257.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/full/command_line_handling/tests/regressions/options_as_config_3339.cpp b/libs/full/command_line_handling/tests/regressions/options_as_config_3339.cpp index b85ca2e3c497..8485051a43a8 100644 --- a/libs/full/command_line_handling/tests/regressions/options_as_config_3339.cpp +++ b/libs/full/command_line_handling/tests/regressions/options_as_config_3339.cpp @@ -4,7 +4,7 @@ // 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) -#include +#include #include #include diff --git a/libs/full/command_line_handling/tests/regressions/use_all_cores_2262.cpp b/libs/full/command_line_handling/tests/regressions/use_all_cores_2262.cpp index 8e89b596f25a..f11b632db1de 100644 --- a/libs/full/command_line_handling/tests/regressions/use_all_cores_2262.cpp +++ b/libs/full/command_line_handling/tests/regressions/use_all_cores_2262.cpp @@ -9,9 +9,9 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include +#include #include +#include #include #include diff --git a/libs/full/compute/CMakeLists.txt b/libs/full/compute/CMakeLists.txt index 6695a1a89d37..bc0331c91984 100644 --- a/libs/full/compute/CMakeLists.txt +++ b/libs/full/compute/CMakeLists.txt @@ -17,9 +17,8 @@ set(compute_headers # cmake-format: off set(compute_compat_headers - hpx/compute.hpp => hpx/include/compute.hpp - hpx/compute/host/target.hpp => hpx/compute/host/distributed_target.hpp - hpx/util/functional/new.hpp => hpx/include/compute.hpp + hpx/compute/host/target.hpp => hpx/compute.hpp + hpx/util/functional/new.hpp => hpx/compute.hpp ) # cmake-format: on diff --git a/libs/full/include/CMakeLists.txt b/libs/full/include/CMakeLists.txt index e1c5a025fc24..cb003216fc02 100644 --- a/libs/full/include/CMakeLists.txt +++ b/libs/full/include/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022 The STE||AR-Group +# Copyright (c) 2020-2023 The STE||AR-Group # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -12,17 +12,13 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") set(include_headers hpx/algorithm.hpp - hpx/any.hpp hpx/barrier.hpp hpx/channel.hpp - hpx/chrono.hpp - hpx/condition_variable.hpp - hpx/exception.hpp - hpx/execution.hpp - hpx/functional.hpp + hpx/compute.hpp hpx/future.hpp - hpx/generator.hpp hpx/hpx.hpp + hpx/latch.hpp + hpx/runtime.hpp hpx/include/actions.hpp hpx/include/agas.hpp hpx/include/applier.hpp @@ -105,27 +101,12 @@ set(include_headers hpx/include/traits.hpp hpx/include/unseq.hpp hpx/include/util.hpp - hpx/latch.hpp - hpx/memory.hpp - hpx/mutex.hpp - hpx/numeric.hpp - hpx/optional.hpp - hpx/runtime.hpp - hpx/semaphore.hpp - hpx/shared_mutex.hpp - hpx/source_location.hpp - hpx/stop_token.hpp - hpx/system_error.hpp - hpx/task_block.hpp - hpx/thread.hpp - hpx/tuple.hpp - hpx/type_traits.hpp - hpx/unwrap.hpp ) if(HPX_WITH_DISTRIBUTED_RUNTIME) set(include_optional_module_dependencies hpx_agas + hpx_async_colocated hpx_async_distributed hpx_runtime_components hpx_runtime_distributed diff --git a/libs/full/include/include/hpx/algorithm.hpp b/libs/full/include/include/hpx/algorithm.hpp index 60b4a3c65229..097be17ddb34 100644 --- a/libs/full/include/include/hpx/algorithm.hpp +++ b/libs/full/include/include/hpx/algorithm.hpp @@ -6,5 +6,11 @@ #pragma once -#include +#include +#include +#include +#include +#if defined(HPX_HAVE_DATAPAR) +#include +#endif #include diff --git a/libs/full/include/include/hpx/barrier.hpp b/libs/full/include/include/hpx/barrier.hpp index 2b7813f341c6..6b3eccbe5592 100644 --- a/libs/full/include/include/hpx/barrier.hpp +++ b/libs/full/include/include/hpx/barrier.hpp @@ -7,4 +7,4 @@ #pragma once #include -#include +#include diff --git a/libs/full/include/include/hpx/channel.hpp b/libs/full/include/include/hpx/channel.hpp index 6dbe9e8efc43..447172e4c33d 100644 --- a/libs/full/include/include/hpx/channel.hpp +++ b/libs/full/include/include/hpx/channel.hpp @@ -7,8 +7,4 @@ #pragma once #include -#include - -namespace hpx { namespace distributed { - using hpx::lcos::channel; -}} // namespace hpx::distributed +#include diff --git a/libs/core/include_local/include/hpx/local/thread.hpp b/libs/full/include/include/hpx/compute.hpp similarity index 64% rename from libs/core/include_local/include/hpx/local/thread.hpp rename to libs/full/include/include/hpx/compute.hpp index 4907caddcb11..a1bd71e59f84 100644 --- a/libs/core/include_local/include/hpx/local/thread.hpp +++ b/libs/full/include/include/hpx/compute.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Hartmut Kaiser +// Copyright (c) 2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,5 +6,5 @@ #pragma once -#include -#include +#include +#include diff --git a/libs/full/include/include/hpx/exception.hpp b/libs/full/include/include/hpx/exception.hpp deleted file mode 100644 index 164bfa0a19c6..000000000000 --- a/libs/full/include/include/hpx/exception.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/execution.hpp b/libs/full/include/include/hpx/execution.hpp deleted file mode 100644 index e2cd46991dcf..000000000000 --- a/libs/full/include/include/hpx/execution.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/functional.hpp b/libs/full/include/include/hpx/functional.hpp deleted file mode 100644 index bd8e863625f9..000000000000 --- a/libs/full/include/include/hpx/functional.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/future.hpp b/libs/full/include/include/hpx/future.hpp index 3766aa0eaa88..59ed24569e3c 100644 --- a/libs/full/include/include/hpx/future.hpp +++ b/libs/full/include/include/hpx/future.hpp @@ -6,10 +6,11 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/libs/full/include/include/hpx/hpx.hpp b/libs/full/include/include/hpx/hpx.hpp index 488049d0545e..1aa815b444b3 100644 --- a/libs/full/include/include/hpx/hpx.hpp +++ b/libs/full/include/include/hpx/hpx.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2012 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,7 +6,6 @@ #pragma once -#include #include #include #include @@ -30,4 +29,3 @@ #include #include -#include diff --git a/libs/full/include/include/hpx/latch.hpp b/libs/full/include/include/hpx/latch.hpp index e36fad051380..3d9b7a947d25 100644 --- a/libs/full/include/include/hpx/latch.hpp +++ b/libs/full/include/include/hpx/latch.hpp @@ -7,4 +7,4 @@ #pragma once #include -#include +#include diff --git a/libs/full/include/include/hpx/memory.hpp b/libs/full/include/include/hpx/memory.hpp deleted file mode 100644 index b2f794dd7572..000000000000 --- a/libs/full/include/include/hpx/memory.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/mutex.hpp b/libs/full/include/include/hpx/mutex.hpp deleted file mode 100644 index b0d8e499030c..000000000000 --- a/libs/full/include/include/hpx/mutex.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2021 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/numeric.hpp b/libs/full/include/include/hpx/numeric.hpp deleted file mode 100644 index 7ed904b859aa..000000000000 --- a/libs/full/include/include/hpx/numeric.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/optional.hpp b/libs/full/include/include/hpx/optional.hpp deleted file mode 100644 index b300a3e42546..000000000000 --- a/libs/full/include/include/hpx/optional.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/runtime.hpp b/libs/full/include/include/hpx/runtime.hpp index 0ec0264e8e97..a51ed7097623 100644 --- a/libs/full/include/include/hpx/runtime.hpp +++ b/libs/full/include/include/hpx/runtime.hpp @@ -6,5 +6,6 @@ #pragma once -#include #include +#include +#include diff --git a/libs/full/include/include/hpx/semaphore.hpp b/libs/full/include/include/hpx/semaphore.hpp deleted file mode 100644 index ccd41e512875..000000000000 --- a/libs/full/include/include/hpx/semaphore.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2021 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/shared_mutex.hpp b/libs/full/include/include/hpx/shared_mutex.hpp deleted file mode 100644 index 2340b6fa77e0..000000000000 --- a/libs/full/include/include/hpx/shared_mutex.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2021 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/source_location.hpp b/libs/full/include/include/hpx/source_location.hpp deleted file mode 100644 index 53b1b3fdf343..000000000000 --- a/libs/full/include/include/hpx/source_location.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2022 Hartmut Kaiser -// -// 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/stop_token.hpp b/libs/full/include/include/hpx/stop_token.hpp deleted file mode 100644 index 144d7b217c41..000000000000 --- a/libs/full/include/include/hpx/stop_token.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2021 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/system_error.hpp b/libs/full/include/include/hpx/system_error.hpp deleted file mode 100644 index 50f6e6ce7048..000000000000 --- a/libs/full/include/include/hpx/system_error.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/task_block.hpp b/libs/full/include/include/hpx/task_block.hpp deleted file mode 100644 index 0f46c8ec1c4a..000000000000 --- a/libs/full/include/include/hpx/task_block.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/tuple.hpp b/libs/full/include/include/hpx/tuple.hpp deleted file mode 100644 index 282051bbbda5..000000000000 --- a/libs/full/include/include/hpx/tuple.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/type_traits.hpp b/libs/full/include/include/hpx/type_traits.hpp deleted file mode 100644 index d5921283096f..000000000000 --- a/libs/full/include/include/hpx/type_traits.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2020 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) - -#pragma once - -#include diff --git a/libs/full/include/include/hpx/unwrap.hpp b/libs/full/include/include/hpx/unwrap.hpp deleted file mode 100644 index 432d2ad7a030..000000000000 --- a/libs/full/include/include/hpx/unwrap.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2021 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) - -#pragma once - -#include diff --git a/libs/full/init_runtime/include/hpx/hpx_init.hpp b/libs/full/init_runtime/include/hpx/hpx_init.hpp index 7ee3bc2bf961..9d82ccc16a66 100644 --- a/libs/full/init_runtime/include/hpx/hpx_init.hpp +++ b/libs/full/init_runtime/include/hpx/hpx_init.hpp @@ -1,5 +1,5 @@ // Copyright (c) 2018 Mikael Simberg -// Copyright (c) 2007-2016 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2010-2011 Phillip LeBlanc, Dylan Stark // Copyright (c) 2011 Bryce Lelbach // @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -23,9 +24,6 @@ #include #include -#include -#include -#include /////////////////////////////////////////////////////////////////////////////// /// \namespace hpx diff --git a/libs/full/init_runtime/include/hpx/hpx_init_impl.hpp b/libs/full/init_runtime/include/hpx/hpx_init_impl.hpp index afd372b767fc..cc3570264c40 100644 --- a/libs/full/init_runtime/include/hpx/hpx_init_impl.hpp +++ b/libs/full/init_runtime/include/hpx/hpx_init_impl.hpp @@ -10,26 +10,20 @@ #include #include +#include #include -#include #include #include #include #include -#include #include #include #include #include -#include #include -#include #include -#include -#include #include -#include #if defined(__FreeBSD__) extern HPX_EXPORT char** freebsd_environ; @@ -37,6 +31,8 @@ extern char** environ; #endif #if defined(HPX_WINDOWS) && defined(HPX_HAVE_APEX) +#include + namespace apex { // force linking of the application with APEX @@ -44,40 +40,13 @@ namespace apex { } // namespace apex #endif -namespace hpx { - namespace detail { - inline int init_impl( - hpx::function const& f, - int argc, char** argv, init_params const& params) - { - if (argc == 0 || argv == nullptr) - { - argc = hpx::local::detail::dummy_argc; - argv = hpx::local::detail::dummy_argv; - } +namespace hpx_startup { -#if defined(HPX_WINDOWS) - detail::init_winsocket(); -#if defined(HPX_HAVE_APEX) - // artificially force the apex shared library to be loaded by the - // application - apex::version(); -#endif -#endif - util::set_hpx_prefix(HPX_PREFIX); -#if defined(__FreeBSD__) - freebsd_environ = environ; -#endif - // set a handler for std::abort, std::at_quick_exit, and std::atexit - std::signal(SIGABRT, detail::on_abort); - std::atexit(detail::on_exit); -#if defined(HPX_HAVE_CXX11_STD_QUICK_EXIT) - std::at_quick_exit(detail::on_exit); -#endif - return detail::run_or_start(f, argc, argv, params, true); - } - } // namespace detail + extern std::function const& + get_main_func(); +} +namespace hpx { /// \brief Main entry point for launching the HPX runtime system. /// /// This is the main entry point for any HPX application. This function @@ -87,7 +56,7 @@ namespace hpx { inline int init(std::function f, int argc, char** argv, init_params const& params) { - return detail::init_impl(HPX_MOVE(f), argc, argv, params); + return detail::init_impl(HPX_MOVE(f), argc, argv, params, HPX_PREFIX); } /// \brief Main entry point for launching the HPX runtime system. @@ -101,7 +70,8 @@ namespace hpx { { std::function main_f = hpx::bind_back(detail::init_helper, HPX_MOVE(f)); - return detail::init_impl(HPX_MOVE(main_f), argc, argv, params); + return detail::init_impl( + HPX_MOVE(main_f), argc, argv, params, HPX_PREFIX); } /// \brief Main entry point for launching the HPX runtime system. @@ -112,9 +82,8 @@ namespace hpx { /// function given by \p f as a HPX thread. inline int init(int argc, char** argv, init_params const& params) { - std::function main_f = - static_cast(::hpx_main); - return detail::init_impl(HPX_MOVE(main_f), argc, argv, params); + return detail::init_impl( + hpx_startup::get_main_func(), argc, argv, params, HPX_PREFIX); } /// \brief Main entry point for launching the HPX runtime system. @@ -127,7 +96,8 @@ namespace hpx { std::nullptr_t, int argc, char** argv, init_params const& params) { hpx::function main_f; - return detail::init_impl(HPX_MOVE(main_f), argc, argv, params); + return detail::init_impl( + HPX_MOVE(main_f), argc, argv, params, HPX_PREFIX); } /// \brief Main entry point for launching the HPX runtime system. @@ -137,10 +107,8 @@ namespace hpx { /// console mode or worker mode depending on the command line settings). inline int init(init_params const& params) { - hpx::function main_f = - static_cast(::hpx_main); - return detail::init_impl(HPX_MOVE(main_f), + return detail::init_impl(hpx_startup::get_main_func(), hpx::local::detail::dummy_argc, hpx::local::detail::dummy_argv, - params); + params, HPX_PREFIX); } } // namespace hpx diff --git a/libs/full/init_runtime/include/hpx/hpx_init_params.hpp b/libs/full/init_runtime/include/hpx/hpx_init_params.hpp index c8b4443920a1..a121c5dd61d6 100644 --- a/libs/full/init_runtime/include/hpx/hpx_init_params.hpp +++ b/libs/full/init_runtime/include/hpx/hpx_init_params.hpp @@ -1,5 +1,5 @@ // Copyright (c) 2020 ETH Zurich -// Copyright (c) 2022 Hartmut Kaiser +// Copyright (c) 2022-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -27,9 +27,10 @@ /////////////////////////////////////////////////////////////////////////////// // One of these functions must be implemented by the application for the // console locality. -int hpx_main(); -int hpx_main(int argc, char** argv); -int hpx_main(hpx::program_options::variables_map& vm); +// +// int hpx_main(); +// int hpx_main(int argc, char* argv[]); +// int hpx_main(hpx::program_options::variables_map& vm); #endif /////////////////////////////////////////////////////////////////////////////// diff --git a/libs/full/init_runtime/include/hpx/hpx_start.hpp b/libs/full/init_runtime/include/hpx/hpx_start.hpp index f9a4fc885541..357200ce800a 100644 --- a/libs/full/init_runtime/include/hpx/hpx_start.hpp +++ b/libs/full/init_runtime/include/hpx/hpx_start.hpp @@ -1,5 +1,5 @@ // Copyright (c) 2018 Mikael Simberg -// Copyright (c) 2007-2016 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -13,14 +13,14 @@ #include #include #include +#include #include #include #include #include #include -#include -#include +#include /////////////////////////////////////////////////////////////////////////////// /// \namespace hpx diff --git a/libs/full/init_runtime/include/hpx/hpx_start_impl.hpp b/libs/full/init_runtime/include/hpx/hpx_start_impl.hpp index 95fbd9efeed0..baebdab1b64c 100644 --- a/libs/full/init_runtime/include/hpx/hpx_start_impl.hpp +++ b/libs/full/init_runtime/include/hpx/hpx_start_impl.hpp @@ -10,24 +10,18 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include #include -#include #include -#include -#include #include -#include #if defined(__FreeBSD__) extern HPX_EXPORT char** freebsd_environ; @@ -35,6 +29,8 @@ extern char** environ; #endif #if defined(HPX_WINDOWS) && defined(HPX_HAVE_APEX) +#include + namespace apex { // force linking of the application with APEX @@ -42,40 +38,13 @@ namespace apex { } // namespace apex #endif -namespace hpx { - namespace detail { - inline bool start_impl( - hpx::function const& f, - int argc, char** argv, init_params const& params) - { - if (argc == 0 || argv == nullptr) - { - argc = local::detail::dummy_argc; - argv = local::detail::dummy_argv; - } +namespace hpx_startup { -#if defined(HPX_WINDOWS) - detail::init_winsocket(); -#if defined(HPX_HAVE_APEX) - // artificially force the apex shared library to be loaded by the - // application - apex::version(); -#endif -#endif - util::set_hpx_prefix(HPX_PREFIX); -#if defined(__FreeBSD__) - freebsd_environ = environ; -#endif - // set a handler for std::abort, std::at_quick_exit, and std::atexit - std::signal(SIGABRT, detail::on_abort); - std::atexit(detail::on_exit); -#if defined(HPX_HAVE_CXX11_STD_QUICK_EXIT) - std::at_quick_exit(detail::on_exit); -#endif - return 0 == detail::run_or_start(f, argc, argv, params, false); - } - } // namespace detail + extern std::function const& + get_main_func(); +} +namespace hpx { /// \brief Main non-blocking entry point for launching the HPX runtime system. /// /// This is the main, non-blocking entry point for any HPX application. @@ -88,7 +57,7 @@ namespace hpx { std::function f, int argc, char** argv, init_params const& params) { - return detail::start_impl(HPX_MOVE(f), argc, argv, params); + return detail::start_impl(HPX_MOVE(f), argc, argv, params, HPX_PREFIX); } /// \brief Main non-blocking entry point for launching the HPX runtime system. @@ -104,7 +73,8 @@ namespace hpx { { hpx::function main_f = hpx::bind_back(detail::init_helper, HPX_MOVE(f)); - return detail::start_impl(HPX_MOVE(main_f), argc, argv, params); + return detail::start_impl( + HPX_MOVE(main_f), argc, argv, params, HPX_PREFIX); } /// \brief Main non-blocking entry point for launching the HPX runtime system. @@ -117,9 +87,8 @@ namespace hpx { /// with the runtime system's execution. inline bool start(int argc, char** argv, init_params const& params) { - hpx::function main_f = - static_cast(::hpx_main); - return detail::start_impl(HPX_MOVE(main_f), argc, argv, params); + return detail::start_impl( + hpx_startup::get_main_func(), argc, argv, params, HPX_PREFIX); } /// \brief Main non-blocking entry point for launching the HPX runtime system. @@ -134,7 +103,8 @@ namespace hpx { std::nullptr_t, int argc, char** argv, init_params const& params) { hpx::function main_f; - return detail::start_impl(HPX_MOVE(main_f), argc, argv, params); + return detail::start_impl( + HPX_MOVE(main_f), argc, argv, params, HPX_PREFIX); } /// \brief Main non-blocking entry point for launching the HPX runtime system. @@ -147,10 +117,8 @@ namespace hpx { /// with the runtime system's execution. inline bool start(init_params const& params) { - hpx::function main_f = - static_cast(::hpx_main); - return detail::start_impl(HPX_MOVE(main_f), + return detail::start_impl(hpx_startup::get_main_func(), hpx::local::detail::dummy_argc, hpx::local::detail::dummy_argv, - params); + params, HPX_PREFIX); } } // namespace hpx diff --git a/libs/full/init_runtime/include/hpx/init.hpp b/libs/full/init_runtime/include/hpx/init.hpp index 7f0038b9ec76..d26d41622461 100644 --- a/libs/full/init_runtime/include/hpx/init.hpp +++ b/libs/full/init_runtime/include/hpx/init.hpp @@ -6,6 +6,8 @@ #pragma once +#include + #include #include #include diff --git a/libs/full/init_runtime/include/hpx/init_runtime/detail/run_or_start.hpp b/libs/full/init_runtime/include/hpx/init_runtime/detail/run_or_start.hpp index ae9d7f1079e4..14279896ff1e 100644 --- a/libs/full/init_runtime/include/hpx/init_runtime/detail/run_or_start.hpp +++ b/libs/full/init_runtime/include/hpx/init_runtime/detail/run_or_start.hpp @@ -13,10 +13,21 @@ namespace hpx { /// \cond NOINTERNAL namespace detail { + HPX_EXPORT int run_or_start( hpx::function const& f, int argc, char** argv, init_params const& params, bool blocking); + + HPX_EXPORT int init_impl( + hpx::function const& f, + int argc, char** argv, init_params const& params, + char const* hpx_prefix); + + HPX_EXPORT bool start_impl( + hpx::function const& f, + int argc, char** argv, init_params const& params, + char const* hpx_prefix); } // namespace detail /// \endcond } // namespace hpx diff --git a/libs/full/init_runtime/src/hpx_init.cpp b/libs/full/init_runtime/src/hpx_init.cpp index e3d07d9104e1..8623d500cc8f 100644 --- a/libs/full/init_runtime/src/hpx_init.cpp +++ b/libs/full/init_runtime/src/hpx_init.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -76,12 +78,9 @@ #include #endif -#if defined(HPX_NATIVE_MIC) || defined(__bgq__) -#include -#endif - #include #include +#include #include #include #include @@ -101,13 +100,79 @@ namespace hpx_startup { std::vector (*user_main_config_function)( std::vector const&) = nullptr; -} +} // namespace hpx_startup /////////////////////////////////////////////////////////////////////////////// namespace hpx::detail { // forward declarations only void console_print(std::string const&); + + int init_impl( + hpx::function const& f, + int argc, char** argv, init_params const& params, + char const* hpx_prefix) + { + if (argc == 0 || argv == nullptr) + { + argc = hpx::local::detail::dummy_argc; + argv = hpx::local::detail::dummy_argv; + } + +#if defined(HPX_WINDOWS) + detail::init_winsocket(); +#if defined(HPX_HAVE_APEX) + // artificially force the apex shared library to be loaded by the + // application + apex::version(); +#endif +#endif + util::set_hpx_prefix(hpx_prefix); +#if defined(__FreeBSD__) + freebsd_environ = environ; +#endif + // set a handler for std::abort, std::at_quick_exit, and std::atexit + std::signal(SIGABRT, detail::on_abort); + std::atexit(detail::on_exit); +#if defined(HPX_HAVE_CXX11_STD_QUICK_EXIT) + [[maybe_unused]] int ret = std::at_quick_exit(detail::on_exit); + HPX_ASSERT(ret == 0); +#endif + return detail::run_or_start(f, argc, argv, params, true); + } + + bool start_impl( + hpx::function const& f, + int argc, char** argv, init_params const& params, + char const* hpx_prefix) + { + if (argc == 0 || argv == nullptr) + { + argc = local::detail::dummy_argc; + argv = local::detail::dummy_argv; + } + +#if defined(HPX_WINDOWS) + detail::init_winsocket(); +#if defined(HPX_HAVE_APEX) + // artificially force the apex shared library to be loaded by the + // application + apex::version(); +#endif +#endif + util::set_hpx_prefix(hpx_prefix); +#if defined(__FreeBSD__) + freebsd_environ = environ; +#endif + // set a handler for std::abort, std::at_quick_exit, and std::atexit + std::signal(SIGABRT, detail::on_abort); + std::atexit(detail::on_exit); +#if defined(HPX_HAVE_CXX11_STD_QUICK_EXIT) + [[maybe_unused]] int ret = std::at_quick_exit(detail::on_exit); + HPX_ASSERT(ret == 0); +#endif + return 0 == detail::run_or_start(f, argc, argv, params, false); + } } // namespace hpx::detail #if defined(HPX_HAVE_DISTRIBUTED_RUNTIME) diff --git a/libs/full/init_runtime/tests/unit/parcel_pool.cpp b/libs/full/init_runtime/tests/unit/parcel_pool.cpp index 245047793247..8af55dfb0d47 100644 --- a/libs/full/init_runtime/tests/unit/parcel_pool.cpp +++ b/libs/full/init_runtime/tests/unit/parcel_pool.cpp @@ -4,11 +4,11 @@ // 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) +#include +#include #include -#include -#include -#include #include +#include #include #include diff --git a/libs/full/init_runtime/tests/unit/runtime_type.cpp b/libs/full/init_runtime/tests/unit/runtime_type.cpp index 93a4d2b63e80..cfcddbc95b19 100644 --- a/libs/full/init_runtime/tests/unit/runtime_type.cpp +++ b/libs/full/init_runtime/tests/unit/runtime_type.cpp @@ -5,13 +5,17 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include #include +#include +#include #include static bool ran_hpx_main; +// forward declare only (is defined in hpx_init) +int hpx_main(hpx::program_options::variables_map&); + int hpx_main() { ran_hpx_main = true; diff --git a/libs/full/init_runtime/tests/unit/shutdown_suspended_thread.cpp b/libs/full/init_runtime/tests/unit/shutdown_suspended_thread.cpp index 4244c979b68b..e74ddb25c8e4 100644 --- a/libs/full/init_runtime/tests/unit/shutdown_suspended_thread.cpp +++ b/libs/full/init_runtime/tests/unit/shutdown_suspended_thread.cpp @@ -7,11 +7,10 @@ // This test checks that the runtime takes into account suspended threads before // initiating full shutdown. -#include -#include -#include -#include +#include +#include #include +#include #include diff --git a/libs/full/init_runtime/tests/unit/start_stop_callbacks.cpp b/libs/full/init_runtime/tests/unit/start_stop_callbacks.cpp index b33f4d9f916a..0a3ad35a72c7 100644 --- a/libs/full/init_runtime/tests/unit/start_stop_callbacks.cpp +++ b/libs/full/init_runtime/tests/unit/start_stop_callbacks.cpp @@ -5,8 +5,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include #include +#include #include #include diff --git a/libs/full/lcos_distributed/include/hpx/lcos_distributed/channel.hpp b/libs/full/lcos_distributed/include/hpx/lcos_distributed/channel.hpp index 584002fe47c2..111ebd8e4793 100644 --- a/libs/full/lcos_distributed/include/hpx/lcos_distributed/channel.hpp +++ b/libs/full/lcos_distributed/include/hpx/lcos_distributed/channel.hpp @@ -21,7 +21,7 @@ #include #include -namespace hpx { namespace lcos { +namespace hpx::lcos { /////////////////////////////////////////////////////////////////////////// template @@ -557,5 +557,11 @@ namespace hpx { namespace lcos { return close(launch::sync, force_delete_entries); } }; -}} // namespace hpx::lcos +} // namespace hpx::lcos + +namespace hpx::distributed { + + using hpx::lcos::channel; +} // namespace hpx::distributed + #endif diff --git a/libs/full/parcelset/tests/unit/put_parcels.cpp b/libs/full/parcelset/tests/unit/put_parcels.cpp index fcad0c0b88e7..ec24b7b2f58f 100644 --- a/libs/full/parcelset/tests/unit/put_parcels.cpp +++ b/libs/full/parcelset/tests/unit/put_parcels.cpp @@ -6,10 +6,10 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) +#include #include #include #include -#include #include #include diff --git a/libs/full/runtime_distributed/src/runtime_distributed.cpp b/libs/full/runtime_distributed/src/runtime_distributed.cpp index 486e3b84d307..9f56911bcf80 100644 --- a/libs/full/runtime_distributed/src/runtime_distributed.cpp +++ b/libs/full/runtime_distributed/src/runtime_distributed.cpp @@ -104,7 +104,10 @@ namespace hpx { #if defined(HPX_HAVE_NETWORKING) void dijkstra_make_black() { - get_runtime_support_ptr()->dijkstra_make_black(); + if (auto* rtp = get_runtime_support_ptr(); rtp != nullptr) + { + rtp->dijkstra_make_black(); + } } #endif @@ -172,8 +175,12 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// components::server::runtime_support* get_runtime_support_ptr() { - return static_cast( - get_runtime_distributed().get_runtime_support_lva()); + if (auto const* rt = get_runtime_distributed_ptr(); rt != nullptr) + { + return static_cast( + rt->get_runtime_support_lva()); + } + return nullptr; } /////////////////////////////////////////////////////////////////////////// diff --git a/libs/full/runtime_distributed/tests/regressions/unhandled_exception_582.cpp b/libs/full/runtime_distributed/tests/regressions/unhandled_exception_582.cpp index 4ee8d52d0688..35b5cac881e8 100644 --- a/libs/full/runtime_distributed/tests/regressions/unhandled_exception_582.cpp +++ b/libs/full/runtime_distributed/tests/regressions/unhandled_exception_582.cpp @@ -6,8 +6,8 @@ // // Checking that #582 was fixed +#include #include -#include #include int hpx_main() diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_target.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_target.cpp index ffb934e5be71..8868874e89d3 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_target.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_target.cpp @@ -6,8 +6,8 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) +#include #include -#include #include #include #include diff --git a/tests/performance/local/async_overheads.cpp b/tests/performance/local/async_overheads.cpp index e33daf479935..830a0a858b24 100644 --- a/tests/performance/local/async_overheads.cpp +++ b/tests/performance/local/async_overheads.cpp @@ -4,9 +4,9 @@ // 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) +#include +#include #include -#include -#include #include #include "worker_timed.hpp" diff --git a/tests/performance/local/future_overhead.cpp b/tests/performance/local/future_overhead.cpp index 094382294d1e..2ea3701c48d0 100644 --- a/tests/performance/local/future_overhead.cpp +++ b/tests/performance/local/future_overhead.cpp @@ -9,21 +9,17 @@ #include #if defined(HPX_HAVE_DISTRIBUTED_RUNTIME) && !defined(HPX_COMPUTE_DEVICE_CODE) #include -#include -#include -#include #endif +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include #include #include #include -#include +#include +#include #include #include @@ -287,12 +283,12 @@ struct unlimited_number_of_chunks } }; -namespace hpx { namespace parallel { namespace execution { +namespace hpx::parallel::execution { template <> struct is_executor_parameters : std::true_type { }; -}}} // namespace hpx::parallel::execution +} // namespace hpx::parallel::execution template void measure_function_futures_for_loop(std::uint64_t count, bool csv, diff --git a/tests/performance/local/future_overhead_report.cpp b/tests/performance/local/future_overhead_report.cpp index f0dc5f5c2ad0..05acfd7af2eb 100644 --- a/tests/performance/local/future_overhead_report.cpp +++ b/tests/performance/local/future_overhead_report.cpp @@ -7,11 +7,11 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include -#include -#include +#include +#include +#include #include +#include #include #include diff --git a/tests/performance/local/hpx_heterogeneous_timed_task_spawn.cpp b/tests/performance/local/hpx_heterogeneous_timed_task_spawn.cpp index 21c223136de5..06e6f14fd203 100644 --- a/tests/performance/local/hpx_heterogeneous_timed_task_spawn.cpp +++ b/tests/performance/local/hpx_heterogeneous_timed_task_spawn.cpp @@ -7,11 +7,11 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include -#include +#include +#include +#include +#include #include -#include #include #include diff --git a/tests/performance/local/htts_v2/htts2_hpx.cpp b/tests/performance/local/htts_v2/htts2_hpx.cpp index 993549014e8d..49624b38ac2d 100644 --- a/tests/performance/local/htts_v2/htts2_hpx.cpp +++ b/tests/performance/local/htts_v2/htts2_hpx.cpp @@ -7,11 +7,11 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "htts2.hpp" diff --git a/tests/performance/local/parent_vs_child_stealing.cpp b/tests/performance/local/parent_vs_child_stealing.cpp index f7d27b1dcea7..72edfe0f3745 100644 --- a/tests/performance/local/parent_vs_child_stealing.cpp +++ b/tests/performance/local/parent_vs_child_stealing.cpp @@ -6,11 +6,11 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/tests/performance/local/resume_suspend.cpp b/tests/performance/local/resume_suspend.cpp index 4f3b29399882..60bb8102ee10 100644 --- a/tests/performance/local/resume_suspend.cpp +++ b/tests/performance/local/resume_suspend.cpp @@ -8,13 +8,12 @@ // runtime. This is meant to be compared to start_stop and // openmp_parallel_region. -#include +#include +#include +#include #include -#include -#include #include - -#include +#include #include #include diff --git a/tests/performance/local/skynet.cpp b/tests/performance/local/skynet.cpp index 84a084397342..b822f7c2efe2 100644 --- a/tests/performance/local/skynet.cpp +++ b/tests/performance/local/skynet.cpp @@ -17,9 +17,9 @@ // This code implements two versions of the skynet micro benchmark: a 'normal' // and a futurized one. -#include -#include -#include +#include +#include +#include #include #include diff --git a/tests/performance/local/start_stop.cpp b/tests/performance/local/start_stop.cpp index e52d9338d12a..0b479605e9cd 100644 --- a/tests/performance/local/start_stop.cpp +++ b/tests/performance/local/start_stop.cpp @@ -7,12 +7,12 @@ // This example benchmarks the time it takes to start and stop the HPX runtime. // This is meant to be compared to resume_suspend and openmp_parallel_region. -#include +#include +#include +#include #include -#include -#include -#include #include +#include #include #include diff --git a/tests/performance/local/stream.cpp b/tests/performance/local/stream.cpp index e39f47d4ba18..8e1129e5fa22 100644 --- a/tests/performance/local/stream.cpp +++ b/tests/performance/local/stream.cpp @@ -17,13 +17,13 @@ #define BOOST_NO_CXX11_ALLOCATOR #endif +#include +#include +#include #include -#include -#include -#include #include #include -#include +#include #include #include diff --git a/tests/performance/local/stream_report.cpp b/tests/performance/local/stream_report.cpp index 4bdd3173e4b2..c693daa89681 100644 --- a/tests/performance/local/stream_report.cpp +++ b/tests/performance/local/stream_report.cpp @@ -17,13 +17,13 @@ #define BOOST_NO_CXX11_ALLOCATOR #endif +#include +#include +#include #include -#include -#include -#include #include -#include #include +#include #include #include diff --git a/tests/performance/local/transform_reduce_binary_scaling.cpp b/tests/performance/local/transform_reduce_binary_scaling.cpp index 540018af6864..b9445289f98f 100644 --- a/tests/performance/local/transform_reduce_binary_scaling.cpp +++ b/tests/performance/local/transform_reduce_binary_scaling.cpp @@ -4,11 +4,11 @@ // 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) -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/tests/performance/local/wait_all_timings.cpp b/tests/performance/local/wait_all_timings.cpp index 94dd2875b036..ac0529b9c52e 100644 --- a/tests/performance/local/wait_all_timings.cpp +++ b/tests/performance/local/wait_all_timings.cpp @@ -6,12 +6,12 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include diff --git a/tests/regressions/stack_size_config_4543.cpp b/tests/regressions/stack_size_config_4543.cpp index 5066a15625ce..13abba301415 100644 --- a/tests/regressions/stack_size_config_4543.cpp +++ b/tests/regressions/stack_size_config_4543.cpp @@ -5,7 +5,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include diff --git a/tests/regressions/threads/block_os_threads_1036.cpp b/tests/regressions/threads/block_os_threads_1036.cpp index f122f9a6ece7..a889886cb5e4 100644 --- a/tests/regressions/threads/block_os_threads_1036.cpp +++ b/tests/regressions/threads/block_os_threads_1036.cpp @@ -7,13 +7,13 @@ // This test demonstrates the issue described in #1036: Scheduler hangs when // user code attempts to "block" OS-threads -#include +#include +#include #include -#include #include #include -#include -#include +#include +#include #include #include diff --git a/tests/regressions/threads/run_as_hpx_thread_exceptions_3304.cpp b/tests/regressions/threads/run_as_hpx_thread_exceptions_3304.cpp index 4326ca1c19a2..0495f868c4a6 100644 --- a/tests/regressions/threads/run_as_hpx_thread_exceptions_3304.cpp +++ b/tests/regressions/threads/run_as_hpx_thread_exceptions_3304.cpp @@ -4,12 +4,12 @@ // 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) +#include +#include +#include #include -#include -#include -#include -#include #include +#include #include #include diff --git a/tests/regressions/threads/stackless_self_4155.cpp b/tests/regressions/threads/stackless_self_4155.cpp index 9a23da9ce36b..236351c05c61 100644 --- a/tests/regressions/threads/stackless_self_4155.cpp +++ b/tests/regressions/threads/stackless_self_4155.cpp @@ -5,8 +5,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include #include +#include void stackless_thread() { diff --git a/tests/regressions/threads/thread_data_1111.cpp b/tests/regressions/threads/thread_data_1111.cpp index 49f191827be5..ccce9dae4c31 100644 --- a/tests/regressions/threads/thread_data_1111.cpp +++ b/tests/regressions/threads/thread_data_1111.cpp @@ -7,8 +7,8 @@ // This test illustrates #1111: hpx::threads::get_thread_data always returns zero #include -#include #include +#include #include #include diff --git a/tests/regressions/threads/thread_rescheduling.cpp b/tests/regressions/threads/thread_rescheduling.cpp index 0e98518ce137..abb25eda95e0 100644 --- a/tests/regressions/threads/thread_rescheduling.cpp +++ b/tests/regressions/threads/thread_rescheduling.cpp @@ -7,10 +7,10 @@ //////////////////////////////////////////////////////////////////////////////// #include -#include -#include -#include +#include +#include #include +#include #include #include diff --git a/tests/regressions/threads/thread_suspend_duration.cpp b/tests/regressions/threads/thread_suspend_duration.cpp index 4f1a4302843d..fb1909bcb1e0 100644 --- a/tests/regressions/threads/thread_suspend_duration.cpp +++ b/tests/regressions/threads/thread_suspend_duration.cpp @@ -5,11 +5,11 @@ // 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) +#include +#include #include -#include -#include -#include #include +#include #include #include diff --git a/tests/regressions/threads/thread_suspend_pending.cpp b/tests/regressions/threads/thread_suspend_pending.cpp index 98113f79c0a4..76305a6550da 100644 --- a/tests/regressions/threads/thread_suspend_pending.cpp +++ b/tests/regressions/threads/thread_suspend_pending.cpp @@ -5,11 +5,11 @@ // 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) +#include +#include #include -#include -#include -#include #include +#include #include #include diff --git a/tests/regressions/threads/threads_all_1422.cpp b/tests/regressions/threads/threads_all_1422.cpp index 432ff1dc8745..a855720c0580 100644 --- a/tests/regressions/threads/threads_all_1422.cpp +++ b/tests/regressions/threads/threads_all_1422.cpp @@ -8,9 +8,9 @@ // allocates too many os threads #include -#include -#include #include +#include +#include #include #include From 93594ac82e0acdec8ebe0d2dc7ed0f6e30fffbd7 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 8 May 2023 09:33:39 -0500 Subject: [PATCH 61/63] Fixing deprecation comments --- libs/core/include_local/CMakeLists.txt | 2 +- libs/core/init_runtime_local/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/include_local/CMakeLists.txt b/libs/core/include_local/CMakeLists.txt index 6ff50767efd4..230d3a01dc85 100644 --- a/libs/core/include_local/CMakeLists.txt +++ b/libs/core/include_local/CMakeLists.txt @@ -46,7 +46,7 @@ if(NOT HPX_WITH_DISTRIBUTED_RUNTIME) ) endif() -# The headers in hpx/local/ were deprecated in HPX V1.9.0 +# The headers in hpx/local/ were deprecated in HPX V1.10.0 # cmake-format: off set(include_local_compat_headers hpx/local/algorithm.hpp => hpx/algorithm.hpp diff --git a/libs/core/init_runtime_local/CMakeLists.txt b/libs/core/init_runtime_local/CMakeLists.txt index 13609da7cafa..f7d9c1aa424a 100644 --- a/libs/core/init_runtime_local/CMakeLists.txt +++ b/libs/core/init_runtime_local/CMakeLists.txt @@ -18,7 +18,7 @@ endif() set(init_runtime_local_sources init_logging.cpp init_runtime_local.cpp) -# The headers in hpx/local/ were deprecated in HPX V1.9.0 +# The headers in hpx/local/ were deprecated in HPX V1.10.0 # cmake-format: off set(init_runtime_local_compat_headers hpx/local/init.hpp => hpx/init.hpp From 0527180e41f7a1b5295c05335fad5e4589fe3859 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 8 May 2023 09:35:45 -0500 Subject: [PATCH 62/63] Fixing deprecation warning message --- libs/core/config/include/hpx/config/deprecation.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/config/include/hpx/config/deprecation.hpp b/libs/core/config/include/hpx/config/deprecation.hpp index 4410ab5168e8..b387b2b4bc5e 100644 --- a/libs/core/config/include/hpx/config/deprecation.hpp +++ b/libs/core/config/include/hpx/config/deprecation.hpp @@ -59,7 +59,7 @@ #if (HPX_VERSION_FULL >= 0x011000) && (HPX_HAVE_DEPRECATION_WARNINGS_V1_10 != 0) #define HPX_DEPRECATED_MSG_V1_10 \ "This functionality is deprecated starting HPX V1.10 and will be removed " \ - "in the future. You can define HPX_HAVE_DEPRECATION_WARNINGS_V1_9=0 to " \ + "in the future. You can define HPX_HAVE_DEPRECATION_WARNINGS_V1_10=0 to " \ "acknowledge that you have received this warning." #define HPX_DEPRECATED_V1_10(x) \ [[deprecated(x " (" HPX_PP_EXPAND(HPX_DEPRECATED_MSG_V1_10) ")")]] From 4dfaec935191a313d4a340769527838715815f38 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 8 May 2023 09:06:55 -0500 Subject: [PATCH 63/63] Modernize more modules (levels 12-16) --- cmake/HPX_PrintSummary.cmake | 7 +- .../include/hpx/affinity/affinity_data.hpp | 10 +- .../include/hpx/affinity/detail/partlit.hpp | 30 +- .../hpx/affinity/parse_affinity_options.hpp | 5 +- libs/core/affinity/src/affinity_data.cpp | 48 +-- .../affinity/src/parse_affinity_options.cpp | 237 +++++++++------ .../include/hpx/async_base/async.hpp | 2 +- .../include/hpx/async_base/launch_policy.hpp | 6 +- libs/core/async_base/src/launch_policy.cpp | 6 +- .../command_line_handling_local.hpp | 4 +- .../late_command_line_handling_local.hpp | 10 +- .../parse_command_line_local.hpp | 4 +- .../src/command_line_handling_local.cpp | 3 - .../src/late_command_line_handling_local.cpp | 41 +-- .../hpx/io_service/io_service_thread_pool.hpp | 2 +- .../io_service/src/io_service_thread_pool.cpp | 3 +- .../component_registry_base.hpp | 16 +- .../runtime_configuration.hpp | 11 +- .../static_factory_data.hpp | 7 +- .../src/init_ini_data.cpp | 51 ++-- .../src/runtime_configuration.cpp | 74 +++-- .../src/runtime_mode.cpp | 3 +- .../src/static_factory_data.cpp | 8 +- .../thread_pools/scheduled_thread_pool.hpp | 2 +- .../scheduled_thread_pool_impl.hpp | 223 +++++++------- .../hpx/threading_base/callback_notifier.hpp | 2 +- .../threading_base/detail/reset_backtrace.hpp | 9 +- .../detail/reset_lco_description.hpp | 9 +- .../hpx/threading_base/execution_agent.hpp | 2 +- .../hpx/threading_base/external_timer.hpp | 20 +- .../hpx/threading_base/register_thread.hpp | 18 +- .../hpx/threading_base/scheduler_base.hpp | 61 +--- .../hpx/threading_base/scheduler_mode.hpp | 20 +- .../hpx/threading_base/scoped_annotation.hpp | 18 +- .../hpx/threading_base/thread_data.hpp | 73 ++--- .../threading_base/thread_data_stackful.hpp | 25 +- .../threading_base/thread_data_stackless.hpp | 23 +- .../hpx/threading_base/thread_description.hpp | 151 ++++----- .../hpx/threading_base/thread_helpers.hpp | 19 +- .../hpx/threading_base/thread_init_data.hpp | 23 +- .../hpx/threading_base/thread_num_tss.hpp | 13 +- .../hpx/threading_base/thread_pool_base.hpp | 40 ++- .../thread_queue_init_parameters.hpp | 22 +- .../hpx/threading_base/threading_base_fwd.hpp | 12 +- .../threading_base/src/callback_notifier.cpp | 7 +- .../src/detail/reset_backtrace.cpp | 6 +- .../src/detail/reset_lco_description.cpp | 5 +- .../threading_base/src/execution_agent.cpp | 1 + .../threading_base/src/scheduler_base.cpp | 64 +++- .../threading_base/src/set_thread_state.cpp | 39 ++- .../src/set_thread_state_timed.cpp | 24 +- libs/core/threading_base/src/thread_data.cpp | 44 +-- .../src/thread_data_stackful.cpp | 9 +- .../src/thread_data_stackless.cpp | 9 +- .../threading_base/src/thread_description.cpp | 21 +- .../threading_base/src/thread_helpers.cpp | 28 +- .../threading_base/src/thread_num_tss.cpp | 7 +- .../threading_base/src/thread_pool_base.cpp | 26 +- .../include/hpx/modules/threadmanager.hpp | 3 +- .../include/hpx/topology/topology.hpp | 79 ++--- libs/core/topology/src/topology.cpp | 286 +++++++++--------- 61 files changed, 1034 insertions(+), 997 deletions(-) diff --git a/cmake/HPX_PrintSummary.cmake b/cmake/HPX_PrintSummary.cmake index e96189eb650b..8c5b3811d5fd 100644 --- a/cmake/HPX_PrintSummary.cmake +++ b/cmake/HPX_PrintSummary.cmake @@ -77,7 +77,7 @@ function(create_configuration_summary message module_name) if(NOT ${__pos} EQUAL -1) set(hpx_config_information "${hpx_config_information}" - "\n \"${_variableName}=${_value}\"," + "\n \"${_variableName}=${_value}\"," ) elseif(NOT ${_variableName}Category STREQUAL "Generic" AND NOT ${_variableName}Category STREQUAL "Build Targets" @@ -88,8 +88,9 @@ function(create_configuration_summary message module_name) PROPERTY TYPE ) if(_type STREQUAL "BOOL") - set(hpx_config_information "${hpx_config_information}" - "\n \"${_variableName}=OFF\"," + set(hpx_config_information + "${hpx_config_information}" + "\n \"${_variableName}=OFF\"," ) endif() endif() diff --git a/libs/core/affinity/include/hpx/affinity/affinity_data.hpp b/libs/core/affinity/include/hpx/affinity/affinity_data.hpp index 29e39e7d6afa..bc3ce2524f2b 100644 --- a/libs/core/affinity/include/hpx/affinity/affinity_data.hpp +++ b/libs/core/affinity/include/hpx/affinity/affinity_data.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -26,6 +26,12 @@ namespace hpx::threads::policies::detail { struct HPX_CORE_EXPORT affinity_data { affinity_data(); + + affinity_data(affinity_data const&); + affinity_data(affinity_data&&) noexcept; + affinity_data& operator=(affinity_data const&); + affinity_data& operator=(affinity_data&&) noexcept; + ~affinity_data(); void init(std::size_t num_threads = 1, std::size_t max_cores = 1, @@ -56,7 +62,7 @@ namespace hpx::threads::policies::detail { } mask_type get_pu_mask( - threads::topology const& topo, std::size_t num_thread) const; + threads::topology const& topo, std::size_t global_thread_num) const; mask_type get_used_pus_mask( threads::topology const& topo, std::size_t pu_num) const; diff --git a/libs/core/affinity/include/hpx/affinity/detail/partlit.hpp b/libs/core/affinity/include/hpx/affinity/detail/partlit.hpp index a1c07708bbdb..6a5e297f678d 100644 --- a/libs/core/affinity/include/hpx/affinity/detail/partlit.hpp +++ b/libs/core/affinity/include/hpx/affinity/detail/partlit.hpp @@ -1,9 +1,9 @@ /*============================================================================= Copyright (c) 2001-2011 Joel de Guzman - Copyright (c) 2001-2022 Hartmut Kaiser + Copyright (c) 2001-2023 Hartmut Kaiser Copyright (c) 2010 Bryce Lelbach -// SPDX-License-Identifier: BSL-1.0 + 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) ==============================================================================*/ @@ -17,13 +17,12 @@ #include #include -#include #include namespace hpx::threads::detail { template - inline bool partial_string_parse( + constexpr bool partial_string_parse( Char const* str, Iterator& first, Iterator const& last) noexcept { Iterator i = first; @@ -45,14 +44,13 @@ namespace hpx::threads::detail { } template - inline bool partial_string_parse( + constexpr bool partial_string_parse( String const& str, Iterator& first, Iterator const& last) noexcept { Iterator i = first; - typename String::const_iterator stri = str.begin(); - typename String::const_iterator str_last = str.end(); + auto const str_last = str.end(); - for (; stri != str_last; ++stri, ++i) + for (auto stri = str.begin(); stri != str_last; ++stri, ++i) { if (i == last || (*stri != *i)) { @@ -67,7 +65,7 @@ namespace hpx::threads::detail { } template - inline bool partial_string_parse(Char const* uc_i, Char const* lc_i, + constexpr bool partial_string_parse(Char const* uc_i, Char const* lc_i, Iterator& first, Iterator const& last) noexcept { Iterator i = first; @@ -87,15 +85,13 @@ namespace hpx::threads::detail { } template - inline bool partial_string_parse(String const& ucstr, String const& lcstr, - Iterator& first, Iterator const& last) noexcept + constexpr bool partial_string_parse(String const& ucstr, + String const& lcstr, Iterator& first, Iterator const& last) noexcept { - typename String::const_iterator uc_i = ucstr.begin(); - typename String::const_iterator uc_last = ucstr.end(); - typename String::const_iterator lc_i = lcstr.begin(); Iterator i = first; - - for (; uc_i != uc_last; ++uc_i, ++lc_i, ++i) + auto const uc_last = ucstr.end(); + auto lc_i = lcstr.begin(); + for (auto uc_i = ucstr.begin(); uc_i != uc_last; ++uc_i, ++lc_i, ++i) { if (i == last || ((*uc_i != *i) && (*lc_i != *i))) { @@ -115,7 +111,7 @@ namespace hpx::threads::detail { { using attribute_type = Attribute; - static constexpr bool const has_attribute = + static constexpr bool has_attribute = !std::is_same_v; constexpr partlit_parser(String const& str, Attribute const& value) diff --git a/libs/core/affinity/include/hpx/affinity/parse_affinity_options.hpp b/libs/core/affinity/include/hpx/affinity/parse_affinity_options.hpp index 9ac258c1e699..9983144d5905 100644 --- a/libs/core/affinity/include/hpx/affinity/parse_affinity_options.hpp +++ b/libs/core/affinity/include/hpx/affinity/parse_affinity_options.hpp @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2007-2016 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon // Copyright (c) 2012-2013 Thomas Heller // @@ -62,10 +62,9 @@ namespace hpx::threads { { } - spec_type(type t, std::int64_t min = all_entities(), + explicit spec_type(type t, std::int64_t min = all_entities(), std::int64_t max = all_entities()) : type_(t) - , index_bounds_() { if (t != type::unknown) { diff --git a/libs/core/affinity/src/affinity_data.cpp b/libs/core/affinity/src/affinity_data.cpp index e05933481232..592c45ea3049 100644 --- a/libs/core/affinity/src/affinity_data.cpp +++ b/libs/core/affinity/src/affinity_data.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -34,13 +34,10 @@ namespace hpx::threads::policies::detail { affinity_data::affinity_data() : num_threads_(0) - , pu_offset_(std::size_t(-1)) + , pu_offset_(static_cast(-1)) , pu_step_(1) , used_cores_(0) , affinity_domain_("pu") - , affinity_masks_() - , pu_nums_() - , no_affinity_() , use_process_mask_(false) , num_pus_needed_(0) { @@ -48,6 +45,11 @@ namespace hpx::threads::policies::detail { no_affinity_, static_cast(hardware_concurrency())); } + affinity_data::affinity_data(affinity_data const&) = default; + affinity_data::affinity_data(affinity_data&&) noexcept = default; + affinity_data& affinity_data::operator=(affinity_data const&) = default; + affinity_data& affinity_data::operator=(affinity_data&&) noexcept = default; + affinity_data::~affinity_data() { --instance_number_counter_; @@ -64,10 +66,10 @@ namespace hpx::threads::policies::detail { use_process_mask_ = use_process_mask; num_threads_ = num_threads; - std::size_t num_system_pus = + std::size_t const num_system_pus = static_cast(hardware_concurrency()); - if (pu_offset == std::size_t(-1)) + if (pu_offset == static_cast(-1)) { pu_offset_ = 0; } @@ -107,8 +109,9 @@ namespace hpx::threads::policies::detail { used_cores, max_cores, num_threads_, pu_nums_, use_process_mask_); - std::size_t num_initialized = count_initialized(affinity_masks_); - if (num_initialized != num_threads_) + if (std::size_t const num_initialized = + count_initialized(affinity_masks_); + num_initialized != num_threads_) { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "affinity_data::affinity_data", @@ -117,7 +120,7 @@ namespace hpx::threads::policies::detail { num_threads_, num_initialized); } } - else if (pu_offset == std::size_t(-1)) + else if (pu_offset == static_cast(-1)) { // calculate the pu offset based on the used cores, but only if its // not explicitly specified @@ -139,17 +142,15 @@ namespace hpx::threads::policies::detail { cores.reserve(num_threads_); for (std::size_t i = 0; i != num_threads_; ++i) { - std::size_t add_me = topo.get_core_number(get_pu_num(i)); + std::size_t const add_me = topo.get_core_number(get_pu_num(i)); cores.push_back(add_me); } std::sort(cores.begin(), cores.end()); - std::vector::iterator it = - std::unique(cores.begin(), cores.end()); + auto const it = std::unique(cores.begin(), cores.end()); cores.erase(it, cores.end()); - std::size_t num_unique_cores = cores.size(); - + std::size_t const num_unique_cores = cores.size(); num_pus_needed_ = (std::max)(num_unique_cores, max_cores); } @@ -171,7 +172,7 @@ namespace hpx::threads::policies::detail { return affinity_masks_[global_thread_num]; // otherwise return mask based on affinity domain - std::size_t pu_num = get_pu_num(global_thread_num); + std::size_t const pu_num = get_pu_num(global_thread_num); if (0 == std::string("pu").find(affinity_domain_)) { // The affinity domain is 'processing unit', just convert the @@ -202,9 +203,10 @@ namespace hpx::threads::policies::detail { mask_type affinity_data::get_used_pus_mask( threads::topology const& topo, std::size_t pu_num) const { - auto overall_threads = static_cast(hardware_concurrency()); + auto const overall_threads = + static_cast(hardware_concurrency()); - mask_type ret = mask_type(); + auto ret = mask_type(); threads::resize(ret, overall_threads); // --hpx:bind=none disables all affinity @@ -260,7 +262,7 @@ namespace hpx::threads::policies::detail { // means of adding a processing unit after initialization void affinity_data::add_punit(std::size_t virt_core, std::size_t thread_num) { - std::size_t num_system_pus = + std::size_t const num_system_pus = static_cast(hardware_concurrency()); // initialize affinity_masks and set the mask for the given virt_core @@ -273,13 +275,13 @@ namespace hpx::threads::policies::detail { threads::set(affinity_masks_[virt_core], thread_num); // find first used pu, which is then stored as the pu_offset - std::size_t first_pu = std::size_t(-1); + std::size_t first_pu = static_cast(-1); for (std::size_t i = 0; i != num_threads_; ++i) { std::size_t first = threads::find_first(affinity_masks_[i]); first_pu = (std::min)(first_pu, first); } - if (first_pu != std::size_t(-1)) + if (first_pu != static_cast(-1)) pu_offset_ = first_pu; init_cached_pu_nums(num_system_pus); @@ -312,13 +314,13 @@ namespace hpx::threads::policies::detail { // // The base line processing unit number is computed from the given // pu-offset and pu-step. - std::size_t num_pu = pu_offset_ + pu_step_ * num_thread; + std::size_t const num_pu = pu_offset_ + pu_step_ * num_thread; // We add an additional offset, which allows to 'roll over' if the // pu number would get larger than the number of available // processing units. Note that it does not make sense to 'roll over' // farther than the given pu-step. - std::size_t offset = (num_pu / hardware_concurrency) % pu_step_; + std::size_t const offset = (num_pu / hardware_concurrency) % pu_step_; // The resulting pu number has to be smaller than the available // number of processing units. diff --git a/libs/core/affinity/src/parse_affinity_options.cpp b/libs/core/affinity/src/parse_affinity_options.cpp index 3aeec9e0e12c..5b60b061f6d1 100644 --- a/libs/core/affinity/src/parse_affinity_options.cpp +++ b/libs/core/affinity/src/parse_affinity_options.cpp @@ -4,14 +4,13 @@ // 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) +#include #include #include #include #include #include -#include - #include #include @@ -169,8 +168,8 @@ namespace hpx::threads::detail { void parse_mappings( std::string const& spec, mappings_type& mappings, error_code& ec) { - std::string::const_iterator begin = spec.begin(); - if (!detail::parse(begin, spec.end(), mappings) || begin != spec.end()) + if (auto begin = spec.begin(); + !detail::parse(begin, spec.end(), mappings) || begin != spec.end()) { HPX_THROWS_IF(ec, hpx::error::bad_parameter, "parse_affinity_options", @@ -191,8 +190,8 @@ namespace hpx::threads::detail { if (m.index_bounds_.empty()) return result; - bounds_type::const_iterator first = m.index_bounds_.begin(); - bounds_type::const_iterator last = m.index_bounds_.end(); + auto first = m.index_bounds_.begin(); + auto const last = m.index_bounds_.end(); while (first != last) { @@ -201,17 +200,18 @@ namespace hpx::threads::detail { // bind all entities result.clear(); for (std::size_t i = 0; i != default_last; ++i) - result.push_back(i); + { + result.push_back(static_cast(i)); + } break; // we will not get more than 'all' } - bounds_type::const_iterator second = first; - if (++second != last) + if (auto second = first; ++second != last) { if (*second == 0 || *second == spec_type::all_entities()) { // one element only - if (default_last <= std::size_t(*first)) + if (default_last <= static_cast(*first)) { result.clear(); HPX_THROWS_IF(ec, hpx::error::bad_parameter, @@ -225,7 +225,7 @@ namespace hpx::threads::detail { else if (*second < 0) { // all elements between min and -max - if (default_last <= std::size_t(-*second)) + if (default_last <= static_cast(-*second)) { result.clear(); HPX_THROWS_IF(ec, hpx::error::bad_parameter, @@ -234,13 +234,16 @@ namespace hpx::threads::detail { "number of existing resources"); return result; } + for (std::int64_t i = *first; i <= -*second; ++i) + { result.push_back(i); + } } else { // just min and max - if (default_last <= std::size_t(*second)) + if (default_last <= static_cast(*second)) { result.clear(); HPX_THROWS_IF(ec, hpx::error::bad_parameter, @@ -257,7 +260,7 @@ namespace hpx::threads::detail { else { // one element only - if (default_last <= std::size_t(*first)) + if (default_last <= static_cast(*first)) { result.clear(); HPX_THROWS_IF(ec, hpx::error::bad_parameter, @@ -278,14 +281,14 @@ namespace hpx::threads::detail { } /////////////////////////////////////////////////////////////////////////// - // index, mask - typedef hpx::tuple mask_info; + // index, mask + using mask_info = hpx::tuple; - inline std::size_t get_index(mask_info const& smi) + constexpr std::size_t get_index(mask_info const& smi) noexcept { return hpx::get<0>(smi); } - inline mask_cref_type get_mask(mask_info const& smi) + constexpr mask_cref_type get_mask(mask_info const& smi) noexcept { return hpx::get<1>(smi); } @@ -295,7 +298,7 @@ namespace hpx::threads::detail { topology const& t, bounds_type const& b) { std::vector masks; - for (std::int64_t index : b) + for (std::int64_t const index : b) { masks.emplace_back(static_cast(index), t.init_socket_affinity_mask_from_socket( @@ -308,7 +311,7 @@ namespace hpx::threads::detail { topology const& t, bounds_type const& b) { std::vector masks; - for (std::int64_t index : b) + for (std::int64_t const index : b) { masks.emplace_back(static_cast(index), t.init_numa_node_affinity_mask_from_numa_node( @@ -327,26 +330,26 @@ namespace hpx::threads::detail { { switch (s.type_) { + // requested top level is a socket case spec_type::type::socket: - // requested top level is a socket - { - std::size_t num_sockets = t.get_number_of_sockets(); - return extract_socket_masks( - t, extract_bounds(s, num_sockets, ec)); - } + { + std::size_t const num_sockets = t.get_number_of_sockets(); + return extract_socket_masks(t, extract_bounds(s, num_sockets, ec)); + } + // requested top level is a NUMA node case spec_type::type::numanode: - // requested top level is a NUMA node - { - std::size_t num_numanodes = t.get_number_of_numa_nodes(); - return extract_numanode_masks( - t, extract_bounds(s, num_numanodes, ec)); - } + { + std::size_t const num_numanodes = t.get_number_of_numa_nodes(); + return extract_numanode_masks( + t, extract_bounds(s, num_numanodes, ec)); + } case spec_type::type::unknown: { std::vector masks; - masks.emplace_back(std::size_t(-1), extract_machine_mask(t, ec)); + masks.emplace_back( + static_cast(-1), extract_machine_mask(t, ec)); return masks; } @@ -358,7 +361,7 @@ namespace hpx::threads::detail { break; } - return std::vector(); + return {}; } std::vector extract_core_masks(topology const& t, @@ -372,9 +375,9 @@ namespace hpx::threads::detail { case spec_type::type::core: { std::size_t base = 0; - std::size_t num_cores = 0; + std::size_t num_cores; - if (socket != std::size_t(-1)) + if (socket != static_cast(-1)) { for (std::size_t i = 0; i != socket; ++i) { @@ -384,25 +387,34 @@ namespace hpx::threads::detail { // just sockets, but no direct numa domains. The bind // description might relate to sockets, not NUMA domains. if (t.get_number_of_numa_nodes() == 0) + { base += t.get_number_of_socket_cores(i); + } else + { base += t.get_number_of_numa_node_cores(i); + } } + if (t.get_number_of_numa_nodes() == 0) + { num_cores = t.get_number_of_socket_cores(socket); + } else + { num_cores = t.get_number_of_numa_node_cores(socket); + } } else { num_cores = t.get_number_of_cores(); } - bounds_type bounds = extract_bounds(s, num_cores, ec); + bounds_type const bounds = extract_bounds(s, num_cores, ec); if (ec) break; - for (std::int64_t index : bounds) + for (std::int64_t const index : bounds) { mask_type mask = t.init_core_affinity_mask_from_core( static_cast(index + base)); @@ -414,8 +426,9 @@ namespace hpx::threads::detail { case spec_type::type::unknown: { - mask_type mask = extract_machine_mask(t, ec); - masks.emplace_back(std::size_t(-1), mask & socket_mask); + mask_type const mask = extract_machine_mask(t, ec); + masks.emplace_back( + static_cast(-1), mask & socket_mask); } break; @@ -439,21 +452,25 @@ namespace hpx::threads::detail { { case spec_type::type::pu: { - std::size_t num_pus = 0; std::size_t socket_base = 0; - if (std::size_t(-1) != socket) + if (static_cast(-1) != socket) { // core number is relative to socket for (std::size_t i = 0; i != socket; ++i) { if (t.get_number_of_numa_nodes() == 0) + { socket_base += t.get_number_of_socket_cores(i); + } else + { socket_base += t.get_number_of_numa_node_cores(i); + } } } - if (std::size_t(-1) != core) + std::size_t num_pus; + if (static_cast(-1) != core) { num_pus = t.get_number_of_core_pus(core); } @@ -461,15 +478,16 @@ namespace hpx::threads::detail { { num_pus = t.get_number_of_pus(); } - bounds_type bounds = extract_bounds(s, num_pus, ec); + + bounds_type const bounds = extract_bounds(s, num_pus, ec); if (ec) break; - std::size_t num_cores = t.get_number_of_cores(); - for (std::int64_t index : bounds) + std::size_t const num_cores = t.get_number_of_cores(); + for (std::int64_t const index : bounds) { std::size_t base_core = socket_base; - if (std::size_t(-1) != core) //-V1051 + if (static_cast(-1) != core) //-V1051 { base_core += core; } @@ -479,10 +497,13 @@ namespace hpx::threads::detail { std::size_t base = 0; for (/**/; base_core < num_cores; ++base_core) { - std::size_t num_core_pus = + std::size_t const num_core_pus = t.get_number_of_core_pus(base_core); - if (base + num_core_pus > std::size_t(index)) + if (base + num_core_pus > + static_cast(index)) + { break; + } base += num_core_pus; } } @@ -497,8 +518,8 @@ namespace hpx::threads::detail { case spec_type::type::unknown: { - mask_type mask = extract_machine_mask(t, ec); - masks.emplace_back(std::size_t(-1), mask & core_mask); + mask_type const mask = extract_machine_mask(t, ec); + masks.emplace_back(static_cast(-1), mask & core_mask); } break; @@ -514,10 +535,10 @@ namespace hpx::threads::detail { /////////////////////////////////////////////////////////////////////////// // sanity checks - void mappings_sanity_checks(full_mapping_type& fmt, std::size_t /* size */, - bounds_type const& b, error_code& ec) + void mappings_sanity_checks(full_mapping_type const& fmt, + std::size_t /* size */, bounds_type const& b, error_code& ec) { - mapping_type& m = fmt.second; + mapping_type const& m = fmt.second; if (m.size() != 3) { HPX_THROWS_IF(ec, hpx::error::bad_parameter, "decode_mapping", @@ -546,7 +567,7 @@ namespace hpx::threads::detail { // get the core masks for each of the sockets for (mask_info const& cmi : core_masks) { - if (get_index(cmi) == std::size_t(-1)) + if (get_index(cmi) == static_cast(-1)) { // all cores if (specs[2].type_ == spec_type::type::unknown) @@ -557,8 +578,9 @@ namespace hpx::threads::detail { else { // handle pu information in the absence of core information - std::vector pu_masks = extract_pu_masks(t, - specs[2], socket, std::size_t(-1), get_mask(cmi), ec); + std::vector const pu_masks = + extract_pu_masks(t, specs[2], socket, + static_cast(-1), get_mask(cmi), ec); if (ec) break; @@ -594,7 +616,7 @@ namespace hpx::threads::detail { // get the core masks for each of the sockets for (mask_info const& smi : socket_masks) { - if (get_index(smi) == std::size_t(-1)) + if (get_index(smi) == static_cast(-1)) { // all NUMA domains if (specs[1].type_ == spec_type::type::unknown) @@ -608,9 +630,11 @@ namespace hpx::threads::detail { else { // handle pu information in the absence of core/socket - std::vector pu_masks = - extract_pu_masks(t, specs[2], std::size_t(-1), - std::size_t(-1), get_mask(smi), ec); + std::vector const pu_masks = + extract_pu_masks(t, specs[2], + static_cast(-1), + static_cast(-1), get_mask(smi), + ec); if (ec) break; @@ -627,8 +651,10 @@ namespace hpx::threads::detail { if (specs[2].type_ == spec_type::type::unknown) { // no pu information - std::vector core_masks = extract_core_masks( - t, specs[1], std::size_t(-1), get_mask(smi), ec); + std::vector const core_masks = + extract_core_masks(t, specs[1], + static_cast(-1), get_mask(smi), + ec); if (ec) break; @@ -639,15 +665,18 @@ namespace hpx::threads::detail { } else { - std::vector core_masks = extract_core_masks( - t, specs[1], std::size_t(-1), get_mask(smi), ec); + std::vector const core_masks = + extract_core_masks(t, specs[1], + static_cast(-1), get_mask(smi), + ec); if (ec) break; // get the pu masks (i.e. overall affinity masks) for // all of the core masks - extract_pu_affinities(t, specs, std::size_t(-1), - core_masks, affinities, ec); + extract_pu_affinities(t, specs, + static_cast(-1), core_masks, + affinities, ec); if (ec) break; } @@ -671,7 +700,7 @@ namespace hpx::threads::detail { } } - void decode_mappings(topology const& t, full_mapping_type& m, + void decode_mappings(topology const& t, full_mapping_type const& m, std::vector& affinities, std::size_t num_threads, error_code& ec) { @@ -681,7 +710,7 @@ namespace hpx::threads::detail { // numbering is relative to the given socket. // generate overall masks for each of the given sockets - std::vector socket_masks = + std::vector const socket_masks = extract_socket_or_numanode_masks(t, m.second[0], ec); HPX_ASSERT(!socket_masks.empty()); @@ -696,7 +725,7 @@ namespace hpx::threads::detail { } /////////////////////////////////////////////////////////////////////////// - bool pu_in_process_mask(bool use_process_mask, topology& t, + bool pu_in_process_mask(bool use_process_mask, topology const& t, std::size_t num_core, std::size_t num_pu) { if (!use_process_mask) @@ -704,20 +733,20 @@ namespace hpx::threads::detail { return true; } - threads::mask_type proc_mask = t.get_cpubind_mask(); - threads::mask_type pu_mask = + threads::mask_type const proc_mask = t.get_cpubind_mask(); + threads::mask_type const pu_mask = t.init_thread_affinity_mask(num_core, num_pu); return threads::bit_and(proc_mask, pu_mask); } - void check_num_threads(bool use_process_mask, topology& t, + void check_num_threads(bool use_process_mask, topology const& t, std::size_t num_threads, error_code& ec) { if (use_process_mask) { - threads::mask_type proc_mask = t.get_cpubind_mask(); - std::size_t num_pus_proc_mask = threads::count(proc_mask); + threads::mask_type const proc_mask = t.get_cpubind_mask(); + std::size_t const num_pus_proc_mask = threads::count(proc_mask); if (num_threads > num_pus_proc_mask) { @@ -730,7 +759,7 @@ namespace hpx::threads::detail { } else { - std::size_t num_threads_available = + auto const num_threads_available = static_cast(threads::hardware_concurrency()); if (num_threads > num_threads_available) @@ -745,12 +774,12 @@ namespace hpx::threads::detail { } /////////////////////////////////////////////////////////////////////////// - void decode_compact_distribution(topology& t, + void decode_compact_distribution(topology const& t, std::vector& affinities, std::size_t used_cores, std::size_t max_cores, std::vector& num_pus, bool use_process_mask, error_code& ec) { - std::size_t num_threads = affinities.size(); + std::size_t const num_threads = affinities.size(); check_num_threads(use_process_mask, t, num_threads, ec); @@ -760,14 +789,15 @@ namespace hpx::threads::detail { max_cores = t.get_number_of_cores(); } - std::size_t num_cores = (std::min)(max_cores, t.get_number_of_cores()); + std::size_t const num_cores = + (std::min)(max_cores, t.get_number_of_cores()); num_pus.resize(num_threads); for (std::size_t num_thread = 0; num_thread < num_threads; /**/) { for (std::size_t num_core = 0; num_core < num_cores; ++num_core) { - std::size_t num_core_pus = + std::size_t const num_core_pus = t.get_number_of_core_pus(num_core + used_cores); for (std::size_t num_pu = 0; num_pu < num_core_pus; ++num_pu) { @@ -798,12 +828,12 @@ namespace hpx::threads::detail { } } - void decode_scatter_distribution(topology& t, + void decode_scatter_distribution(topology const& t, std::vector& affinities, std::size_t used_cores, std::size_t max_cores, std::vector& num_pus, bool use_process_mask, error_code& ec) { - std::size_t num_threads = affinities.size(); + std::size_t const num_threads = affinities.size(); check_num_threads(use_process_mask, t, num_threads, ec); @@ -813,7 +843,8 @@ namespace hpx::threads::detail { max_cores = t.get_number_of_cores(); } - std::size_t num_cores = (std::min)(max_cores, t.get_number_of_cores()); + std::size_t const num_cores = + (std::min)(max_cores, t.get_number_of_cores()); std::vector next_pu_index(num_cores, 0); num_pus.resize(num_threads); @@ -831,7 +862,8 @@ namespace hpx::threads::detail { return; } - std::size_t num_core_pus = t.get_number_of_core_pus(num_core); + std::size_t const num_core_pus = + t.get_number_of_core_pus(num_core); std::size_t pu_index = next_pu_index[num_core]; bool use_pu = false; @@ -867,12 +899,12 @@ namespace hpx::threads::detail { } /////////////////////////////////////////////////////////////////////////// - void decode_balanced_distribution(topology& t, + void decode_balanced_distribution(topology const& t, std::vector& affinities, std::size_t used_cores, std::size_t max_cores, std::vector& num_pus, bool use_process_mask, error_code& ec) { - std::size_t num_threads = affinities.size(); + std::size_t const num_threads = affinities.size(); check_num_threads(use_process_mask, t, num_threads, ec); @@ -882,7 +914,8 @@ namespace hpx::threads::detail { max_cores = t.get_number_of_cores(); } - std::size_t num_cores = (std::min)(max_cores, t.get_number_of_cores()); + std::size_t const num_cores = + (std::min)(max_cores, t.get_number_of_cores()); std::vector num_pus_cores(num_cores, 0); std::vector next_pu_index(num_cores, 0); @@ -895,7 +928,8 @@ namespace hpx::threads::detail { { for (std::size_t num_core = 0; num_core < num_cores; ++num_core) { - std::size_t num_core_pus = t.get_number_of_core_pus(num_core); + std::size_t const num_core_pus = + t.get_number_of_core_pus(num_core); std::size_t pu_index = next_pu_index[num_core]; bool use_pu = false; @@ -954,13 +988,13 @@ namespace hpx::threads::detail { } /////////////////////////////////////////////////////////////////////////// - void decode_numabalanced_distribution(topology& t, + void decode_numabalanced_distribution(topology const& t, std::vector& affinities, std::size_t used_cores, - std::size_t max_cores, std::vector& num_pus, - bool use_process_mask, error_code& ec) + [[maybe_unused]] std::size_t max_cores, + std::vector& num_pus, bool use_process_mask, + error_code& ec) { - HPX_UNUSED(max_cores); - std::size_t num_threads = affinities.size(); + std::size_t const num_threads = affinities.size(); check_num_threads(use_process_mask, t, num_threads, ec); @@ -972,8 +1006,8 @@ namespace hpx::threads::detail { num_pus.resize(num_threads); // numa nodes - std::size_t num_numas = - (std::max)(std::size_t(1), t.get_number_of_numa_nodes()); + std::size_t const num_numas = (std::max)( + static_cast(1), t.get_number_of_numa_nodes()); std::vector num_cores_numa(num_numas, 0); std::vector num_pus_numa(num_numas, 0); std::vector num_threads_numa(num_numas, 0); @@ -989,9 +1023,9 @@ namespace hpx::threads::detail { for (std::size_t num_core = 0; num_core < num_cores_numa[n]; ++num_core) { - std::size_t num_pus = + std::size_t const pus = t.get_number_of_core_pus(num_core + core_offset); - for (std::size_t num_pu = 0; num_pu < num_pus; ++num_pu) + for (std::size_t num_pu = 0; num_pu < pus; ++num_pu) { if (pu_in_process_mask(use_process_mask, t, num_core + core_offset, num_pu)) @@ -1009,7 +1043,7 @@ namespace hpx::threads::detail { std::size_t pus_t2 = 0; for (std::size_t n = 0; n < num_numas; ++n) { - std::size_t temp = static_cast( + auto temp = static_cast( std::round(static_cast(num_threads * num_pus_numa[n]) / static_cast(pus_t))); @@ -1041,7 +1075,7 @@ namespace hpx::threads::detail { for (std::size_t num_core = 0; num_core < num_cores_numa[n]; ++num_core) { - std::size_t num_core_pus = + std::size_t const num_core_pus = t.get_number_of_core_pus(num_core); std::size_t pu_index = next_pu_index[num_core]; bool use_pu = false; @@ -1103,7 +1137,7 @@ namespace hpx::threads::detail { } /////////////////////////////////////////////////////////////////////////// - void decode_distribution(distribution_type d, topology& t, + void decode_distribution(distribution_type d, topology const& t, std::vector& affinities, std::size_t used_cores, std::size_t max_cores, std::size_t num_threads, std::vector& num_pus, bool use_process_mask, @@ -1154,7 +1188,7 @@ namespace hpx::threads { // We need to instantiate a new topology object as the runtime has not // been initialized yet - threads::topology& t = threads::create_topology(); + threads::topology const& t = threads::create_topology(); switch (mappings.which()) { @@ -1236,6 +1270,9 @@ namespace hpx::threads { } } break; + + default: + HPX_ASSERT(false); } } } // namespace hpx::threads diff --git a/libs/core/async_base/include/hpx/async_base/async.hpp b/libs/core/async_base/include/hpx/async_base/async.hpp index 5c2572c86382..82a0dd4a1b23 100644 --- a/libs/core/async_base/include/hpx/async_base/async.hpp +++ b/libs/core/async_base/include/hpx/async_base/async.hpp @@ -70,7 +70,7 @@ namespace hpx { /// argument, the program is ill-formed. /// /// \param f Callable object to call - /// \param ts... parameters to pass to f + /// \param ts parameters to pass to f /// /// \returns hpx::future referring to the shared state created by this call /// to \a hpx::async. diff --git a/libs/core/async_base/include/hpx/async_base/launch_policy.hpp b/libs/core/async_base/include/hpx/async_base/launch_policy.hpp index 1152c7c7c9aa..e20a456a7dc7 100644 --- a/libs/core/async_base/include/hpx/async_base/launch_policy.hpp +++ b/libs/core/async_base/include/hpx/async_base/launch_policy.hpp @@ -548,7 +548,7 @@ namespace hpx { return pred_(); } - constexpr bool is_valid() const noexcept + static constexpr bool is_valid() noexcept { return true; } @@ -883,7 +883,7 @@ namespace hpx { namespace detail { HPX_FORCEINLINE constexpr bool has_async_policy(launch p) noexcept { - return bool(static_cast(p.get_policy()) & + return static_cast(static_cast(p.get_policy()) & static_cast(detail::launch_policy::async_policies)); } @@ -891,7 +891,7 @@ namespace hpx { HPX_FORCEINLINE constexpr bool has_async_policy( detail::policy_holder const& p) noexcept { - return bool(static_cast(p.policy()) & + return static_cast(static_cast(p.policy()) & static_cast(detail::launch_policy::async_policies)); } } // namespace detail diff --git a/libs/core/async_base/src/launch_policy.cpp b/libs/core/async_base/src/launch_policy.cpp index 38ff67fc63cd..c0e8e420d7a3 100644 --- a/libs/core/async_base/src/launch_policy.cpp +++ b/libs/core/async_base/src/launch_policy.cpp @@ -43,7 +43,7 @@ namespace hpx { ar >> policy_; ar >> priority_; ar >> hint_.hint >> hint_.mode; - std::int8_t mode = 0; + std::uint8_t mode = 0; ar >> mode; hint_.placement_mode( static_cast(mode)); @@ -58,8 +58,8 @@ namespace hpx { ar << policy_; ar << priority_; ar << hint_.hint << hint_.mode - << static_cast(hint_.placement_mode()) - << static_cast(hint_.sharing_mode()); + << static_cast(hint_.placement_mode()) + << static_cast(hint_.sharing_mode()); } } // namespace detail } // namespace hpx diff --git a/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/command_line_handling_local.hpp b/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/command_line_handling_local.hpp index 6dc26a88747d..83bb82d0ed27 100644 --- a/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/command_line_handling_local.hpp +++ b/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/command_line_handling_local.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -13,9 +13,7 @@ #include #include -#include #include -#include #include #include diff --git a/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/late_command_line_handling_local.hpp b/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/late_command_line_handling_local.hpp index 1e2fac248879..5aee6ed75976 100644 --- a/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/late_command_line_handling_local.hpp +++ b/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/late_command_line_handling_local.hpp @@ -25,12 +25,14 @@ namespace hpx::local::detail { util::runtime_configuration& ini, std::vector const& still_unregistered_options); - HPX_CORE_EXPORT bool handle_full_help(util::runtime_configuration& ini, + HPX_CORE_EXPORT bool handle_full_help( + util::runtime_configuration const& ini, hpx::program_options::options_description const& options); - HPX_CORE_EXPORT bool handle_late_options(util::runtime_configuration& ini, - hpx::program_options::variables_map& vm, + HPX_CORE_EXPORT bool handle_late_options( + util::runtime_configuration const& ini, + hpx::program_options::variables_map const& vm, void (*handle_print_bind)(std::size_t) = nullptr); HPX_CORE_EXPORT std::string get_full_commandline( - util::runtime_configuration& ini); + util::runtime_configuration const& ini); } // namespace hpx::local::detail diff --git a/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/parse_command_line_local.hpp b/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/parse_command_line_local.hpp index d59175eccea7..ba7ebc417d24 100644 --- a/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/parse_command_line_local.hpp +++ b/libs/core/command_line_handling_local/include/hpx/command_line_handling_local/parse_command_line_local.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -8,10 +8,8 @@ #include #include - #include -#include #include #include #include diff --git a/libs/core/command_line_handling_local/src/command_line_handling_local.cpp b/libs/core/command_line_handling_local/src/command_line_handling_local.cpp index 6dab0322fed0..0ac2f7a8e21b 100644 --- a/libs/core/command_line_handling_local/src/command_line_handling_local.cpp +++ b/libs/core/command_line_handling_local/src/command_line_handling_local.cpp @@ -27,12 +27,9 @@ #include #include -#include #include -#include #include #include -#include #include #include #include diff --git a/libs/core/command_line_handling_local/src/late_command_line_handling_local.cpp b/libs/core/command_line_handling_local/src/late_command_line_handling_local.cpp index dd1865be0cf2..2ce4f4eda96e 100644 --- a/libs/core/command_line_handling_local/src/late_command_line_handling_local.cpp +++ b/libs/core/command_line_handling_local/src/late_command_line_handling_local.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -64,15 +63,15 @@ namespace hpx::local::detail { } } - bool handle_full_help(util::runtime_configuration& ini, + bool handle_full_help(util::runtime_configuration const& ini, hpx::program_options::options_description const& options) { - std::string fullhelp(ini.get_entry("hpx.cmd_line_help", "")); - if (!fullhelp.empty()) + if (std::string const fullhelp(ini.get_entry("hpx.cmd_line_help", "")); + !fullhelp.empty()) { - std::string help_option( - ini.get_entry("hpx.cmd_line_help_option", "")); - if (0 == std::string("full").find(help_option)) + if (std::string const help_option( + ini.get_entry("hpx.cmd_line_help_option", "")); + 0 == std::string("full").find(help_option)) { std::cout << decode_string(fullhelp); std::cout << options << std::endl; @@ -87,7 +86,7 @@ namespace hpx::local::detail { return false; } - std::string get_full_commandline(util::runtime_configuration& ini) + std::string get_full_commandline(util::runtime_configuration const& ini) { return ini.get_entry("hpx.commandline.command", "") + " " + ini.get_entry("hpx.commandline.prepend_options", "") + @@ -95,13 +94,13 @@ namespace hpx::local::detail { ini.get_entry("hpx.commandline.config_options", ""); } - bool handle_late_options(util::runtime_configuration& ini, - hpx::program_options::variables_map& vm, + bool handle_late_options(util::runtime_configuration const& ini, + hpx::program_options::variables_map const& vm, void (*handle_print_bind)(std::size_t)) { if (handle_print_bind != nullptr && vm.count("hpx:print-bind")) { - std::size_t num_threads = hpx::util::from_string( + std::size_t const num_threads = hpx::util::from_string( ini.get_entry("hpx.os_threads", 1)); handle_print_bind(num_threads); } @@ -121,16 +120,18 @@ namespace hpx::local::detail { // do secondary command line processing, check validity of options only try { - std::string unknown_cmd_line( - ini.get_entry("hpx.unknown_cmd_line", "")); - if (!unknown_cmd_line.empty()) + if (std::string const unknown_cmd_line( + ini.get_entry("hpx.unknown_cmd_line", "")); + !unknown_cmd_line.empty()) { util::commandline_error_mode mode = util::commandline_error_mode::rethrow_on_error; - std::string allow_unknown( - ini.get_entry("hpx.commandline.allow_unknown", "0")); - if (allow_unknown != "0") + if (std::string const allow_unknown( + ini.get_entry("hpx.commandline.allow_unknown", "0")); + allow_unknown != "0") + { mode |= util::commandline_error_mode::allow_unregistered; + } hpx::program_options::variables_map vm; std::vector still_unregistered_options; @@ -148,8 +149,8 @@ namespace hpx::local::detail { // secondary command line handling, looking for --exit and other // options - std::string cmd_line(get_full_commandline(ini)); - if (!cmd_line.empty()) + if (std::string const cmd_line(get_full_commandline(ini)); + !cmd_line.empty()) { hpx::program_options::variables_map vm; diff --git a/libs/core/io_service/include/hpx/io_service/io_service_thread_pool.hpp b/libs/core/io_service/include/hpx/io_service/io_service_thread_pool.hpp index 195e51c24b98..419167704fc3 100644 --- a/libs/core/io_service/include/hpx/io_service/io_service_thread_pool.hpp +++ b/libs/core/io_service/include/hpx/io_service/io_service_thread_pool.hpp @@ -55,7 +55,7 @@ namespace hpx::threads::detail { thread_restart_state newstate_ex, thread_priority priority, error_code& ec) override; - void report_error( + bool report_error( std::size_t num, std::exception_ptr const& e) override; /////////////////////////////////////////////////////////////////////// diff --git a/libs/core/io_service/src/io_service_thread_pool.cpp b/libs/core/io_service/src/io_service_thread_pool.cpp index 86f7d14b3e7e..9a200c38a9b4 100644 --- a/libs/core/io_service/src/io_service_thread_pool.cpp +++ b/libs/core/io_service/src/io_service_thread_pool.cpp @@ -71,9 +71,10 @@ namespace hpx::threads::detail { return id; } - void io_service_thread_pool::report_error( + bool io_service_thread_pool::report_error( std::size_t /* num */, std::exception_ptr const& /* e */) { + return false; } /////////////////////////////////////////////////////////////////////////// diff --git a/libs/core/runtime_configuration/include/hpx/runtime_configuration/component_registry_base.hpp b/libs/core/runtime_configuration/include/hpx/runtime_configuration/component_registry_base.hpp index 853702754eed..17bba1fa7c0c 100644 --- a/libs/core/runtime_configuration/include/hpx/runtime_configuration/component_registry_base.hpp +++ b/libs/core/runtime_configuration/include/hpx/runtime_configuration/component_registry_base.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2014 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -29,6 +29,8 @@ namespace hpx::components { /// with the ini-information (one line per vector /// element) for all components implemented in this /// module. + /// \param filepath [in] + /// \param is_static [in] /// /// \return Returns \a true if the parameter \a fillini has been /// successfully initialized with the registry data of all @@ -36,17 +38,7 @@ namespace hpx::components { virtual bool get_component_info(std::vector& fillini, std::string const& filepath, bool is_static = false) = 0; - /// \brief Return the unique identifier of the component type this - /// factory is responsible for - /// - /// \param locality [in] The id of the locality this factory - /// is responsible for. - /// \param agas_client [in] The AGAS client to use for component id - /// registration (if needed). - /// - /// \return Returns the unique identifier of the component type this - /// factory instance is responsible for. This function throws on - /// any error. + /// \brief Register the component type represented by this component virtual void register_component_type() = 0; }; } // namespace hpx::components diff --git a/libs/core/runtime_configuration/include/hpx/runtime_configuration/runtime_configuration.hpp b/libs/core/runtime_configuration/include/hpx/runtime_configuration/runtime_configuration.hpp index a1723f8d1134..2630c3b1ccb4 100644 --- a/libs/core/runtime_configuration/include/hpx/runtime_configuration/runtime_configuration.hpp +++ b/libs/core/runtime_configuration/include/hpx/runtime_configuration/runtime_configuration.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -43,15 +43,15 @@ namespace hpx::util { public: // initialize and load configuration information runtime_configuration(char const* argv0, runtime_mode mode, - std::vector const& extra_static_ini_defs = {}); + std::vector extra_static_ini_defs = {}); // re-initialize all entries based on the additional information from // the given configuration file - void reconfigure(std::string const& ini_file); + void reconfigure(std::string ini_file); // re-initialize all entries based on the additional information from // any explicit command line options - void reconfigure(std::vector const& ini_defs); + void reconfigure(std::vector ini_defs); std::vector> load_modules( @@ -102,9 +102,6 @@ namespace hpx::util { // Enable lock detection during suspension bool enable_lock_detection() const; - // Enable global lock tracking - bool enable_global_lock_detection() const; - // Enable minimal deadlock detection for HPX threads bool enable_minimal_deadlock_detection() const; bool enable_spinlock_deadlock_detection() const; diff --git a/libs/core/runtime_configuration/include/hpx/runtime_configuration/static_factory_data.hpp b/libs/core/runtime_configuration/include/hpx/runtime_configuration/static_factory_data.hpp index c9976553130d..160682849d34 100644 --- a/libs/core/runtime_configuration/include/hpx/runtime_configuration/static_factory_data.hpp +++ b/libs/core/runtime_configuration/include/hpx/runtime_configuration/static_factory_data.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2014 Hartmut Kaiser +// Copyright (c) 2005-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -51,9 +51,12 @@ namespace hpx::components { } // namespace hpx::components //////////////////////////////////////////////////////////////////////////////// +// clang-format off #define HPX_DECLARE_FACTORY_STATIC(name, base) \ extern "C" HPX_PLUGIN_EXPORT_API std::map* \ - HPX_PLUGIN_API HPX_PLUGIN_LIST_NAME(name, base)() /**/ + HPX_PLUGIN_API HPX_PLUGIN_LIST_NAME(name, base)() \ + /**/ +// clang-format on #define HPX_DEFINE_FACTORY_STATIC(module, name, base) \ { \ diff --git a/libs/core/runtime_configuration/src/init_ini_data.cpp b/libs/core/runtime_configuration/src/init_ini_data.cpp index 625dfc8ec83e..644f0dc2ddd5 100644 --- a/libs/core/runtime_configuration/src/init_ini_data.cpp +++ b/libs/core/runtime_configuration/src/init_ini_data.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2017 Hartmut Kaiser +// Copyright (c) 2005-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -30,7 +30,7 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace util { +namespace hpx::util { /////////////////////////////////////////////////////////////////////////// bool handle_ini_file(section& ini, std::string const& loc) { @@ -110,8 +110,8 @@ namespace hpx { namespace util { } // look in the current directory first - std::string cwd = fs::current_path().string() + "/.hpx.ini"; { + std::string cwd = fs::current_path().string() + "/.hpx.ini"; bool result2 = handle_ini_file(ini, cwd); if (result2) { @@ -140,9 +140,7 @@ namespace hpx { namespace util { if (!hpx_ini_file.empty()) { - namespace fs = filesystem; - std::error_code ec; - if (!fs::exists(hpx_ini_file, ec) || ec) + if (std::error_code ec; !fs::exists(hpx_ini_file, ec) || ec) { std::cerr << "hpx::init: command line warning: file specified using " @@ -183,9 +181,8 @@ namespace hpx { namespace util { ini_paths.push_back(*it); // have all path elements, now find ini files in there... - std::vector::iterator ini_end = ini_paths.end(); - for (std::vector::iterator it = ini_paths.begin(); - it != ini_end; ++it) + auto ini_end = ini_paths.end(); + for (auto it = ini_paths.begin(); it != ini_end; ++it) { try { @@ -211,13 +208,11 @@ namespace hpx { namespace util { } catch (hpx::exception const& /*e*/) { - ; } } } catch (fs::filesystem_error const& /*e*/) { - ; } } } @@ -227,11 +222,11 @@ namespace hpx { namespace util { // default ini settings assuming all of those are components std::vector> load_component_factory_static(util::section& ini, std::string name, - hpx::util::plugin::get_plugins_list_type get_factory, error_code& ec) + hpx::util::plugin::get_plugins_list_type const get_factory, + error_code& ec) { hpx::util::plugin::static_plugin_factory< - components::component_registry_base> - pf(get_factory); + components::component_registry_base> const pf(get_factory); std::vector> registries; @@ -271,7 +266,7 @@ namespace hpx { namespace util { continue; registry->get_component_info(ini_data, "", true); - registries.push_back(registry); + registries.push_back(HPX_MOVE(registry)); } } @@ -287,8 +282,8 @@ namespace hpx { namespace util { component_registries, std::string name, error_code& ec) { - hpx::util::plugin::plugin_factory - pf(d, "registry"); + hpx::util::plugin::plugin_factory< + components::component_registry_base> const pf(d, "registry"); // retrieve the names of all known registries std::vector names; @@ -325,7 +320,7 @@ namespace hpx { namespace util { return; registry->get_component_info(ini_data, curr); - component_registries.push_back(registry); + component_registries.push_back(HPX_MOVE(registry)); } } @@ -340,12 +335,12 @@ namespace hpx { namespace util { std::string const& /* curr */, std::string const& /* name */, error_code& ec) { - typedef std::vector> - plugin_list_type; + using plugin_list_type = + std::vector>; plugin_list_type plugin_registries; - hpx::util::plugin::plugin_factory pf( - d, "plugin"); + hpx::util::plugin::plugin_factory const + pf(d, "plugin"); // retrieve the names of all known registries std::vector names; @@ -366,7 +361,7 @@ namespace hpx { namespace util { continue; registry->get_plugin_info(ini_data); - plugin_registries.push_back(registry); + plugin_registries.push_back(HPX_MOVE(registry)); } } @@ -402,8 +397,8 @@ namespace hpx { namespace util { { namespace fs = filesystem; - typedef std::vector> - plugin_list_type; + using plugin_list_type = + std::vector>; plugin_list_type plugin_registries; @@ -444,8 +439,8 @@ namespace hpx { namespace util { if (0 == name.find("lib")) name = name.substr(3); #endif -#if defined(__APPLE__) // shared library version is added berfore extension - const std::string version = hpx::full_version_as_string(); +#if defined(__APPLE__) // shared library version is added before extension + std::string const version = hpx::full_version_as_string(); std::string::size_type i = name.find(version); if (i != std::string::npos) name.erase( @@ -554,4 +549,4 @@ namespace hpx { namespace util { } return plugin_registries; } -}} // namespace hpx::util +} // namespace hpx::util diff --git a/libs/core/runtime_configuration/src/runtime_configuration.cpp b/libs/core/runtime_configuration/src/runtime_configuration.cpp index 1cd436e3dcbf..230df545614d 100644 --- a/libs/core/runtime_configuration/src/runtime_configuration.cpp +++ b/libs/core/runtime_configuration/src/runtime_configuration.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2020 Hartmut Kaiser +// Copyright (c) 2005-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Adelstein-Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -65,7 +65,7 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace util { +namespace hpx::util { namespace detail { @@ -368,7 +368,7 @@ namespace hpx { namespace util { void runtime_configuration::pre_initialize_logging_ini() { #if defined(HPX_HAVE_LOGGING) - std::vector lines = { + std::vector const lines = { // clang-format off #define HPX_TIMEFORMAT "$hh:$mm.$ss.$mili" #define HPX_LOGFORMAT "(T%locality%/%hpxthread%.%hpxphase%/%hpxcomponent%) " @@ -531,7 +531,7 @@ namespace hpx { namespace util { // invoke last reconfigure reconfigure(); - for (auto& registry : registries) + for (auto const& registry : registries) { registry->register_component_type(); } @@ -554,20 +554,19 @@ namespace hpx { namespace util { if (!path.empty()) { - fs::path this_p(path); + fs::path const this_p(path); std::error_code fsec; fs::path canonical_p = fs::canonical(this_p, fs::initial_path(), fsec); if (fsec) canonical_p = this_p; - std::pair::iterator, bool> p = - component_paths.emplace(canonical_p.string()); - - if (p.second) + if (auto const [it, ok] = + component_paths.emplace(canonical_p.string()); + ok) { // have all path elements, now find ini files in there... - fs::path this_path(*p.first); + fs::path const this_path(*it); if (fs::exists(this_path, fsec) && !fsec) { plugin_list_type tmp_regs = @@ -643,9 +642,9 @@ namespace hpx { namespace util { plugin_list_type plugin_registries; // load plugin paths from component_base_paths and suffixes - std::string component_base_paths( + std::string const component_base_paths( get_entry("hpx.component_base_paths", HPX_DEFAULT_COMPONENT_PATH)); - std::string component_path_suffixes( + std::string const component_path_suffixes( get_entry("hpx.component_path_suffixes", "/lib/hpx")); load_component_paths(plugin_registries, component_registries, @@ -653,7 +652,7 @@ namespace hpx { namespace util { basenames); // load additional explicit plugin paths from plugin_paths key - std::string plugin_paths(get_entry("hpx.component_paths", "")); + std::string const plugin_paths(get_entry("hpx.component_paths", "")); load_component_paths(plugin_registries, component_registries, plugin_paths, "", component_paths, basenames); @@ -678,9 +677,8 @@ namespace hpx { namespace util { /////////////////////////////////////////////////////////////////////////// runtime_configuration::runtime_configuration(char const* argv0_, - runtime_mode mode, - std::vector const& extra_static_ini_defs_) - : extra_static_ini_defs(extra_static_ini_defs_) + runtime_mode mode, std::vector extra_static_ini_defs_) + : extra_static_ini_defs(HPX_MOVE(extra_static_ini_defs_)) , mode_(mode) , num_localities(0) , num_os_threads(0) @@ -711,16 +709,15 @@ namespace hpx { namespace util { } /////////////////////////////////////////////////////////////////////////// - void runtime_configuration::reconfigure(std::string const& hpx_ini_file_) + void runtime_configuration::reconfigure(std::string ini_file) { - hpx_ini_file = hpx_ini_file_; + hpx_ini_file = HPX_MOVE(ini_file); reconfigure(); } - void runtime_configuration::reconfigure( - std::vector const& cmdline_ini_defs_) + void runtime_configuration::reconfigure(std::vector ini_defs) { - cmdline_ini_defs = cmdline_ini_defs_; + cmdline_ini_defs = HPX_MOVE(ini_defs); reconfigure(); } @@ -884,7 +881,8 @@ namespace hpx { namespace util { *sec, "local_cache_size", cache_size); } - if (cache_size != std::size_t(~0x0ul) && cache_size < 16ul) + if ((cache_size != static_cast(~0x0ul)) && + cache_size < 16ul) { cache_size = 16; // limit lower bound } @@ -1010,7 +1008,7 @@ namespace hpx { namespace util { } return HPX_SPINLOCK_DEADLOCK_DETECTION_LIMIT; #else - return std::size_t(-1); + return static_cast(-1); #endif } @@ -1079,9 +1077,10 @@ namespace hpx { namespace util { if (util::section const* sec = get_section("hpx.stacks"); nullptr != sec) { - std::string entry = sec->get_entry(entryname, defaultvaluestr); + std::string const entry = + sec->get_entry(entryname, defaultvaluestr); char* endptr = nullptr; - std::ptrdiff_t val = + std::ptrdiff_t const val = std::strtoll(entry.c_str(), &endptr, /*base:*/ 0); return endptr != entry.c_str() ? val : defaultvalue; } @@ -1133,10 +1132,13 @@ namespace hpx { namespace util { if (util::section const* sec = get_section("hpx.parcel"); nullptr != sec) { - std::uint64_t maxsize = hpx::util::get_entry_as( - *sec, "max_message_size", HPX_PARCEL_MAX_MESSAGE_SIZE); - if (maxsize > 0) + if (std::uint64_t const maxsize = + hpx::util::get_entry_as( + *sec, "max_message_size", HPX_PARCEL_MAX_MESSAGE_SIZE); + maxsize > 0) + { return maxsize; + } } return HPX_PARCEL_MAX_MESSAGE_SIZE; // default is 1GByte } @@ -1146,11 +1148,14 @@ namespace hpx { namespace util { if (util::section const* sec = get_section("hpx.parcel"); nullptr != sec) { - std::uint64_t maxsize = hpx::util::get_entry_as(*sec, - "max_outbound_message_size", - HPX_PARCEL_MAX_OUTBOUND_MESSAGE_SIZE); - if (maxsize > 0) + if (std::uint64_t const maxsize = + hpx::util::get_entry_as(*sec, + "max_outbound_message_size", + HPX_PARCEL_MAX_OUTBOUND_MESSAGE_SIZE); + maxsize > 0) + { return maxsize; + } } return HPX_PARCEL_MAX_OUTBOUND_MESSAGE_SIZE; // default is 1GByte } @@ -1196,10 +1201,13 @@ namespace hpx { namespace util { case threads::thread_stacksize::nostack: return (std::numeric_limits::max)(); + case threads::thread_stacksize::unknown: + case threads::thread_stacksize::current: default: + [[fallthrough]]; case threads::thread_stacksize::small_: break; } return small_stacksize; } -}} // namespace hpx::util +} // namespace hpx::util diff --git a/libs/core/runtime_configuration/src/runtime_mode.cpp b/libs/core/runtime_configuration/src/runtime_mode.cpp index 30594be470a5..6dbd90efc891 100644 --- a/libs/core/runtime_configuration/src/runtime_mode.cpp +++ b/libs/core/runtime_configuration/src/runtime_mode.cpp @@ -1,13 +1,12 @@ //////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2012 Bryce Adelstein-Lelbach -// Copyright (c) 2012-2022 Hartmut Kaiser +// Copyright (c) 2012-2023 Hartmut Kaiser // // 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) //////////////////////////////////////////////////////////////////////////////// -#include #include #include diff --git a/libs/core/runtime_configuration/src/static_factory_data.cpp b/libs/core/runtime_configuration/src/static_factory_data.cpp index ac58dca97df8..6029e7146fa5 100644 --- a/libs/core/runtime_configuration/src/static_factory_data.cpp +++ b/libs/core/runtime_configuration/src/static_factory_data.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2014 Hartmut Kaiser +// Copyright (c) 2005-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -63,7 +63,7 @@ namespace hpx::components { std::map; map_type const& m = get_static_factory_data(); - map_type::const_iterator it = m.find(instance); + auto const it = m.find(instance); if (it == m.end()) return false; @@ -96,7 +96,7 @@ namespace hpx::components { std::map; map_type const& m = get_static_commandline_data(); - map_type::const_iterator it = m.find(instance); + auto const it = m.find(instance); if (it == m.end()) return false; @@ -130,7 +130,7 @@ namespace hpx::components { std::map; map_type const& m = get_static_startup_shutdown_data(); - map_type::const_iterator it = m.find(instance); + auto const it = m.find(instance); if (it == m.end()) return false; diff --git a/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool.hpp b/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool.hpp index 3c4375275886..3245fe512cea 100644 --- a/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool.hpp +++ b/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool.hpp @@ -88,7 +88,7 @@ namespace hpx::threads::detail { thread_restart_state newstate_ex, thread_priority priority, error_code& ec) override; - void report_error( + bool report_error( std::size_t num, std::exception_ptr const& e) override; void abort_all_suspended_threads() override diff --git a/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool_impl.hpp b/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool_impl.hpp index 93cc6426af60..eaaa93716c66 100644 --- a/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool_impl.hpp +++ b/libs/core/thread_pools/include/hpx/thread_pools/scheduled_thread_pool_impl.hpp @@ -148,12 +148,14 @@ namespace hpx::threads::detail { } template - void scheduled_thread_pool::report_error( + bool scheduled_thread_pool::report_error( std::size_t global_thread_num, std::exception_ptr const& e) { sched_->Scheduler::set_all_states_at_least(hpx::state::terminating); - this->thread_pool_base::report_error(global_thread_num, e); + bool const result = + this->thread_pool_base::report_error(global_thread_num, e); sched_->Scheduler::on_error(global_thread_num, e); + return result; } /////////////////////////////////////////////////////////////////////////// @@ -164,13 +166,15 @@ namespace hpx::threads::detail { // os executors if (thread_count_ != 0) { - std::size_t num_thread = detail::get_local_thread_num_tss(); + std::size_t const num_thread = detail::get_local_thread_num_tss(); // Local thread number may be valid, but the thread may not yet be // up. - if (num_thread != std::size_t(-1) && + if (num_thread != static_cast(-1) && num_thread < static_cast(thread_count_)) + { return get_state(num_thread); + } } return sched_->Scheduler::get_minmax_state().second; } @@ -179,7 +183,7 @@ namespace hpx::threads::detail { hpx::state scheduled_thread_pool::get_state( std::size_t num_thread) const { - HPX_ASSERT(num_thread != std::size_t(-1)); + HPX_ASSERT(num_thread != static_cast(-1)); return sched_->Scheduler::get_state(num_thread).load(); } @@ -192,11 +196,11 @@ namespace hpx::threads::detail { std::int64_t hpx_thread_offset = (threads::get_self_ptr() && this_thread::get_pool() == this) ? 1 : 0; - bool have_hpx_threads = - get_thread_count_unknown(std::size_t(-1), false) > + bool const have_hpx_threads = + get_thread_count_unknown(static_cast(-1), false) > sched_->Scheduler::get_background_thread_count() + hpx_thread_offset; - bool have_polling_work = + bool const have_polling_work = sched_->Scheduler::get_polling_work_count() > 0; return have_hpx_threads || have_polling_work; @@ -237,7 +241,7 @@ namespace hpx::threads::detail { sched_->Scheduler::set_all_states_at_least(hpx::state::stopping); // make sure we're not waiting - sched_->Scheduler::do_some_work(std::size_t(-1)); + sched_->Scheduler::do_some_work(static_cast(-1)); if (blocking) { @@ -250,7 +254,8 @@ namespace hpx::threads::detail { // make sure no OS thread is waiting LTM_(info).format("stop: {} notify_all", id_.name()); - sched_->Scheduler::do_some_work(std::size_t(-1)); + sched_->Scheduler::do_some_work( + static_cast(-1)); LTM_(info).format("stop: {} join:{}", id_.name(), i); @@ -337,7 +342,8 @@ namespace hpx::threads::detail { // wait for all threads to have started up startup->wait(); - HPX_ASSERT(pool_threads == std::size_t(thread_count_.load())); + HPX_ASSERT( + pool_threads == static_cast(thread_count_.load())); } catch (std::exception const& e) { @@ -704,7 +710,7 @@ namespace hpx::threads::detail { std::int64_t executed_threads = 0; std::int64_t reset_executed_threads = 0; - if (num != std::size_t(-1)) + if (num != static_cast(-1)) { executed_threads = counter_data_[num].executed_threads_; reset_executed_threads = counter_data_[num].reset_executed_threads_; @@ -715,10 +721,10 @@ namespace hpx::threads::detail { else { executed_threads = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::executed_threads_); reset_executed_threads = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_executed_threads_); if (reset) //-V1051 @@ -741,12 +747,14 @@ namespace hpx::threads::detail { { std::int64_t executed_threads = accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::executed_threads_); + static_cast(0), + &scheduling_counter_data::executed_threads_); #if defined(HPX_HAVE_THREAD_CUMULATIVE_COUNTS) - std::int64_t reset_executed_threads = accumulate_projected( - counter_data_.begin(), counter_data_.end(), std::int64_t(0), - &scheduling_counter_data::reset_executed_threads_); + std::int64_t reset_executed_threads = + accumulate_projected(counter_data_.begin(), counter_data_.end(), + static_cast(0), + &scheduling_counter_data::reset_executed_threads_); HPX_ASSERT(executed_threads >= reset_executed_threads); return executed_threads - reset_executed_threads; @@ -763,7 +771,7 @@ namespace hpx::threads::detail { std::int64_t executed_phases = 0; std::int64_t reset_executed_phases = 0; - if (num != std::size_t(-1)) + if (num != static_cast(-1)) { executed_phases = counter_data_[num].executed_thread_phases_; reset_executed_phases = @@ -776,10 +784,10 @@ namespace hpx::threads::detail { else { executed_phases = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::executed_thread_phases_); reset_executed_phases = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_executed_thread_phases_); if (reset) //-V1051 @@ -806,7 +814,7 @@ namespace hpx::threads::detail { std::int64_t reset_exec_total = 0; std::int64_t reset_num_phases = 0; - if (num != std::size_t(-1)) + if (num != static_cast(-1)) { exec_total = counter_data_[num].exec_times_; num_phases = counter_data_[num].executed_thread_phases_; @@ -824,18 +832,18 @@ namespace hpx::threads::detail { } else { - exec_total = - accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::exec_times_); + exec_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::exec_times_); num_phases = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::executed_thread_phases_); reset_exec_total = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_thread_phase_duration_times_); reset_num_phases = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_thread_phase_duration_); if (reset) @@ -858,7 +866,7 @@ namespace hpx::threads::detail { exec_total -= reset_exec_total; num_phases -= reset_num_phases; - return std::int64_t( + return static_cast( (double(exec_total) * timestamp_scale_) / double(num_phases)); } @@ -871,7 +879,7 @@ namespace hpx::threads::detail { std::int64_t reset_exec_total = 0; std::int64_t reset_num_threads = 0; - if (num != std::size_t(-1)) + if (num != static_cast(-1)) { exec_total = counter_data_[num].exec_times_; num_threads = counter_data_[num].executed_threads_; @@ -887,18 +895,18 @@ namespace hpx::threads::detail { } else { - exec_total = - accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::exec_times_); + exec_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::exec_times_); num_threads = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::executed_threads_); reset_exec_total = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_thread_duration_times_); reset_num_threads = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_thread_duration_); if (reset) @@ -920,7 +928,7 @@ namespace hpx::threads::detail { exec_total -= reset_exec_total; num_threads -= reset_num_threads; - return std::int64_t( + return static_cast( (double(exec_total) * timestamp_scale_) / double(num_threads)); } @@ -936,7 +944,7 @@ namespace hpx::threads::detail { std::int64_t reset_tfunc_total = 0; std::int64_t reset_num_phases = 0; - if (num != std::size_t(-1)) + if (num != static_cast(-1)) { exec_total = counter_data_[num].exec_times_; tfunc_total = counter_data_[num].tfunc_times_; @@ -959,25 +967,25 @@ namespace hpx::threads::detail { } else { - exec_total = - accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::exec_times_); - tfunc_total = - accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::tfunc_times_); + exec_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::exec_times_); + tfunc_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::tfunc_times_); num_phases = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::executed_thread_phases_); reset_exec_total = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_thread_phase_overhead_times_); reset_tfunc_total = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data:: reset_thread_phase_overhead_times_total_); reset_num_phases = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_thread_phase_overhead_); if (reset) @@ -1012,7 +1020,7 @@ namespace hpx::threads::detail { HPX_ASSERT(tfunc_total >= exec_total); - return std::int64_t( + return static_cast( double((tfunc_total - exec_total) * timestamp_scale_) / double(num_phases)); } @@ -1029,7 +1037,7 @@ namespace hpx::threads::detail { std::int64_t reset_tfunc_total = 0; std::int64_t reset_num_threads = 0; - if (num != std::size_t(-1)) + if (num != static_cast(-1)) { exec_total = counter_data_[num].exec_times_; tfunc_total = counter_data_[num].tfunc_times_; @@ -1050,24 +1058,24 @@ namespace hpx::threads::detail { } else { - exec_total = - accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::exec_times_); - tfunc_total = - accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::tfunc_times_); + exec_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::exec_times_); + tfunc_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::tfunc_times_); num_threads = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::executed_threads_); reset_exec_total = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_thread_overhead_times_); reset_tfunc_total = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_thread_overhead_times_total_); reset_num_threads = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_thread_overhead_); if (reset) @@ -1101,7 +1109,7 @@ namespace hpx::threads::detail { HPX_ASSERT(tfunc_total >= exec_total); - return std::int64_t( + return static_cast( double((tfunc_total - exec_total) * timestamp_scale_) / double(num_threads)); } @@ -1114,7 +1122,7 @@ namespace hpx::threads::detail { std::int64_t exec_total = 0; std::int64_t reset_exec_total = 0; - if (num != std::size_t(-1)) + if (num != static_cast(-1)) { exec_total = counter_data_[num].exec_times_; reset_exec_total = @@ -1128,11 +1136,11 @@ namespace hpx::threads::detail { } else { - exec_total = - accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::exec_times_); + exec_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::exec_times_); reset_exec_total = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_cumulative_thread_duration_); if (reset) //-V1051 @@ -1149,7 +1157,7 @@ namespace hpx::threads::detail { exec_total -= reset_exec_total; - return std::int64_t(double(exec_total) * timestamp_scale_); + return static_cast(double(exec_total) * timestamp_scale_); } template @@ -1162,7 +1170,7 @@ namespace hpx::threads::detail { std::int64_t tfunc_total = 0; std::int64_t reset_tfunc_total = 0; - if (num != std::size_t(-1)) + if (num != static_cast(-1)) { exec_total = counter_data_[num].exec_times_; tfunc_total = counter_data_[num].tfunc_times_; @@ -1182,18 +1190,18 @@ namespace hpx::threads::detail { } else { - exec_total = - accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::exec_times_); + exec_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::exec_times_); reset_exec_total = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_cumulative_thread_overhead_); - tfunc_total = - accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::tfunc_times_); + tfunc_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::tfunc_times_); reset_tfunc_total = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data:: reset_cumulative_thread_overhead_total_); @@ -1218,7 +1226,7 @@ namespace hpx::threads::detail { exec_total -= reset_exec_total; tfunc_total -= reset_tfunc_total; - return std::int64_t( + return static_cast( (double(tfunc_total) - double(exec_total)) * timestamp_scale_); } #endif // HPX_HAVE_THREAD_IDLE_RATES @@ -1569,7 +1577,7 @@ namespace hpx::threads::detail { std::int64_t tfunc_total = 0; std::int64_t reset_tfunc_total = 0; - if (num != std::size_t(-1)) + if (num != static_cast(-1)) { tfunc_total = counter_data_[num].tfunc_times_; reset_tfunc_total = counter_data_[num].reset_tfunc_times_; @@ -1579,11 +1587,11 @@ namespace hpx::threads::detail { } else { - tfunc_total = - accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::tfunc_times_); + tfunc_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::tfunc_times_); reset_tfunc_total = accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::reset_tfunc_times_); if (reset) //-V1051 @@ -1599,7 +1607,8 @@ namespace hpx::threads::detail { tfunc_total -= reset_tfunc_total; - return std::int64_t(double(tfunc_total) * timestamp_scale_); + return static_cast( + double(tfunc_total) * timestamp_scale_); } #if defined(HPX_HAVE_THREAD_IDLE_RATES) @@ -1703,19 +1712,21 @@ namespace hpx::threads::detail { std::int64_t scheduled_thread_pool::avg_idle_rate_all( bool reset) noexcept { - std::int64_t exec_total = + std::int64_t exec_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::exec_times_); + std::int64_t tfunc_total = accumulate_projected(counter_data_.begin(), + counter_data_.end(), static_cast(0), + &scheduling_counter_data::tfunc_times_); + + std::int64_t reset_exec_total = accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::exec_times_); - std::int64_t tfunc_total = + static_cast(0), + &scheduling_counter_data::reset_idle_rate_time_); + std::int64_t reset_tfunc_total = accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::tfunc_times_); - - std::int64_t reset_exec_total = accumulate_projected( - counter_data_.begin(), counter_data_.end(), std::int64_t(0), - &scheduling_counter_data::reset_idle_rate_time_); - std::int64_t reset_tfunc_total = accumulate_projected( - counter_data_.begin(), counter_data_.end(), std::int64_t(0), - &scheduling_counter_data::reset_idle_rate_time_total_); + static_cast(0), + &scheduling_counter_data::reset_idle_rate_time_total_); if (reset) { @@ -1738,15 +1749,17 @@ namespace hpx::threads::detail { HPX_ASSERT(tfunc_total >= exec_total); - double const percent = 1. - (double(exec_total) / double(tfunc_total)); - return std::int64_t(10000. * percent); // 0.01 percent + double const percent = 1. - + (static_cast(exec_total) / + static_cast(tfunc_total)); + return static_cast(10000. * percent); // 0.01 percent } template std::int64_t scheduled_thread_pool::avg_idle_rate( std::size_t num, bool reset) noexcept { - if (num == std::size_t(-1)) + if (num == static_cast(-1)) return avg_idle_rate_all(reset); std::int64_t exec_time = counter_data_[num].exec_times_; @@ -1772,8 +1785,9 @@ namespace hpx::threads::detail { HPX_ASSERT(tfunc_time > exec_time); - double const percent = 1. - (double(exec_time) / double(tfunc_time)); - return std::int64_t(10000. * percent); // 0.01 percent + double const percent = 1. - + (static_cast(exec_time) / static_cast(tfunc_time)); + return static_cast(10000. * percent); // 0.01 percent } #endif // HPX_HAVE_THREAD_IDLE_RATES @@ -1781,10 +1795,10 @@ namespace hpx::threads::detail { std::int64_t scheduled_thread_pool::get_idle_loop_count( std::size_t num, bool /* reset */) { - if (num == std::size_t(-1)) + if (num == static_cast(-1)) { return accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::idle_loop_counts_); } return counter_data_[num].idle_loop_counts_; @@ -1794,10 +1808,10 @@ namespace hpx::threads::detail { std::int64_t scheduled_thread_pool::get_busy_loop_count( std::size_t num, bool /* reset */) { - if (num == std::size_t(-1)) + if (num == static_cast(-1)) { return accumulate_projected(counter_data_.begin(), - counter_data_.end(), std::int64_t(0), + counter_data_.end(), static_cast(0), &scheduling_counter_data::busy_loop_counts_); } return counter_data_[num].busy_loop_counts_; @@ -1808,7 +1822,8 @@ namespace hpx::threads::detail { const { return (accumulate_projected(counter_data_.begin(), counter_data_.end(), - std::int64_t(0), &scheduling_counter_data::tasks_active_) * + static_cast(0), + &scheduling_counter_data::tasks_active_) * 100) / thread_count_.load(); } diff --git a/libs/core/threading_base/include/hpx/threading_base/callback_notifier.hpp b/libs/core/threading_base/include/hpx/threading_base/callback_notifier.hpp index df7d9aa00678..7f521ed29687 100644 --- a/libs/core/threading_base/include/hpx/threading_base/callback_notifier.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/callback_notifier.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/libs/core/threading_base/include/hpx/threading_base/detail/reset_backtrace.hpp b/libs/core/threading_base/include/hpx/threading_base/detail/reset_backtrace.hpp index 1de775a4d1a5..71f81e5ab504 100644 --- a/libs/core/threading_base/include/hpx/threading_base/detail/reset_backtrace.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/detail/reset_backtrace.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2022 Hartmut Kaiser +// Copyright (c) 2020-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -22,7 +22,12 @@ namespace hpx::threads::detail { struct HPX_CORE_EXPORT reset_backtrace { explicit reset_backtrace( - threads::thread_id_type const& id, error_code& ec = throws); + threads::thread_id_type id, error_code& ec = throws); + + reset_backtrace(reset_backtrace const&) = delete; + reset_backtrace(reset_backtrace&&) = delete; + reset_backtrace& operator=(reset_backtrace const&) = delete; + reset_backtrace& operator=(reset_backtrace&&) = delete; ~reset_backtrace(); diff --git a/libs/core/threading_base/include/hpx/threading_base/detail/reset_lco_description.hpp b/libs/core/threading_base/include/hpx/threading_base/detail/reset_lco_description.hpp index 506ba1bcec27..22bf17248e89 100644 --- a/libs/core/threading_base/include/hpx/threading_base/detail/reset_lco_description.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/detail/reset_lco_description.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2022 Hartmut Kaiser +// Copyright (c) 2020-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -20,10 +20,15 @@ namespace hpx::threads::detail { struct HPX_CORE_EXPORT reset_lco_description { - reset_lco_description(threads::thread_id_type const& id, + reset_lco_description(threads::thread_id_type id, threads::thread_description const& description, error_code& ec = throws); + reset_lco_description(reset_lco_description const&) = delete; + reset_lco_description(reset_lco_description&&) = delete; + reset_lco_description& operator=(reset_lco_description const&) = delete; + reset_lco_description& operator=(reset_lco_description&&) = delete; + ~reset_lco_description(); threads::thread_id_type id_; diff --git a/libs/core/threading_base/include/hpx/threading_base/execution_agent.hpp b/libs/core/threading_base/include/hpx/threading_base/execution_agent.hpp index 98d89fd13c60..b3af3fff6ae5 100644 --- a/libs/core/threading_base/include/hpx/threading_base/execution_agent.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/execution_agent.hpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 Thomas Heller +// Copyright (c) 2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -11,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/libs/core/threading_base/include/hpx/threading_base/external_timer.hpp b/libs/core/threading_base/include/hpx/threading_base/external_timer.hpp index d459ce1a1450..a35e23773f3b 100644 --- a/libs/core/threading_base/include/hpx/threading_base/external_timer.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/external_timer.hpp @@ -1,10 +1,10 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // 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) -#pragma once // prevent multiple inclusions of this header file. +#pragma once #include #include @@ -310,24 +310,30 @@ namespace hpx::util::external_timer { inline std::shared_ptr new_task( threads::thread_description const&, std::uint32_t, - threads::thread_id_type) + threads::thread_id_type) noexcept { return {}; } inline std::shared_ptr update_task( - std::shared_ptr, threads::thread_description const&) + std::shared_ptr, + threads::thread_description const&) noexcept { return {}; } struct scoped_timer { - explicit scoped_timer(std::shared_ptr) noexcept {} + // clang-format off + explicit scoped_timer(std::shared_ptr) noexcept + { + } + // clang-format on + ~scoped_timer() = default; - constexpr void stop(void) noexcept {} - constexpr void yield(void) noexcept {} + static constexpr void stop() noexcept {} + static constexpr void yield() noexcept {} }; } // namespace hpx::util::external_timer diff --git a/libs/core/threading_base/include/hpx/threading_base/register_thread.hpp b/libs/core/threading_base/include/hpx/threading_base/register_thread.hpp index 86bb0ed9dfb4..8fb7210141ce 100644 --- a/libs/core/threading_base/include/hpx/threading_base/register_thread.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/register_thread.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2018 Thomas Heller // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon @@ -11,33 +11,17 @@ #include #include -#include #include #include -#include #include #include -#include #include #include #include namespace hpx::threads { - /////////////////////////////////////////////////////////////////////////// - /// \brief Create a new \a thread using the given function as the work to be - /// executed. - /// - /// \param func [in] The function to be executed as the - /// thread-function. This function has to expose the - /// minimal low level HPX-thread interface, i.e. it takes - /// one argument (a \a threads#thread_restart_state). The - /// thread will be terminated after the function returns. - /// - /// \note All other arguments are equivalent to those of the function - /// \a threads#register_thread_plain - /// namespace detail { template diff --git a/libs/core/threading_base/include/hpx/threading_base/scheduler_base.hpp b/libs/core/threading_base/include/hpx/threading_base/scheduler_base.hpp index f6d6b5b105e4..73bf921c8b17 100644 --- a/libs/core/threading_base/include/hpx/threading_base/scheduler_base.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/scheduler_base.hpp @@ -63,7 +63,8 @@ namespace hpx::threads::policies { public: using pu_mutex_type = std::mutex; - scheduler_base(std::size_t num_threads, char const* description = "", + explicit scheduler_base(std::size_t num_threads, + char const* description = "", thread_queue_init_parameters const& thread_queue_init = thread_queue_init_parameters{}, scheduler_mode mode = scheduler_mode::nothing_special); @@ -82,17 +83,17 @@ namespace hpx::threads::policies { parent_pool_ = p; } - inline std::size_t global_to_local_thread_index(std::size_t n) + std::size_t global_to_local_thread_index(std::size_t n) const { return n - parent_pool_->get_thread_offset(); } - inline std::size_t local_to_global_thread_index(std::size_t n) + std::size_t local_to_global_thread_index(std::size_t n) const { return n + parent_pool_->get_thread_offset(); } - char const* get_description() const noexcept + constexpr char const* get_description() const noexcept { return description_; } @@ -161,18 +162,6 @@ namespace hpx::threads::policies { } /////////////////////////////////////////////////////////////////////// - // domain management - std::size_t domain_from_local_thread_index(std::size_t n); - - // assumes queues use index 0..N-1 and correspond to the pool cores - std::size_t num_domains(std::size_t const workers); - - // either threads in same domain, or not in same domain - // depending on the predicate - std::vector domain_threads(std::size_t local_id, - std::vector const& ts, - hpx::function pred); - #ifdef HPX_HAVE_THREAD_CREATION_AND_CLEANUP_RATES virtual std::uint64_t get_creation_time(bool reset) = 0; virtual std::uint64_t get_cleanup_time(bool reset) = 0; @@ -195,12 +184,12 @@ namespace hpx::threads::policies { #endif virtual std::int64_t get_queue_length( - std::size_t num_thread = std::size_t(-1)) const = 0; + std::size_t num_thread = static_cast(-1)) const = 0; virtual std::int64_t get_thread_count( thread_schedule_state state = thread_schedule_state::unknown, thread_priority priority = thread_priority::default_, - std::size_t num_thread = std::size_t(-1), + std::size_t num_thread = static_cast(-1), bool reset = false) const = 0; // Queries whether a given core is idle @@ -253,40 +242,7 @@ namespace hpx::threads::policies { virtual void reset_thread_distribution() {} std::ptrdiff_t get_stack_size( - threads::thread_stacksize stacksize) const noexcept - { - if (stacksize == thread_stacksize::current) - { - stacksize = get_self_stacksize_enum(); - } - - HPX_ASSERT(stacksize != thread_stacksize::current); - - switch (stacksize) - { - case thread_stacksize::small_: - return thread_queue_init_.small_stacksize_; - - case thread_stacksize::medium: - return thread_queue_init_.medium_stacksize_; - - case thread_stacksize::large: - return thread_queue_init_.large_stacksize_; - - case thread_stacksize::huge: - return thread_queue_init_.huge_stacksize_; - - case thread_stacksize::nostack: - return (std::numeric_limits::max)(); - - default: - HPX_ASSERT_MSG( - false, util::format("Invalid stack size {1}", stacksize)); - break; - } - - return thread_queue_init_.small_stacksize_; - } + threads::thread_stacksize stacksize) const noexcept; using polling_function_ptr = detail::polling_status (*)(); using polling_work_count_function_ptr = std::size_t (*)(); @@ -310,6 +266,7 @@ namespace hpx::threads::policies { void set_sycl_polling_functions(polling_function_ptr sycl_func, polling_work_count_function_ptr sycl_work_count_func); void clear_sycl_polling_function(); + detail::polling_status custom_polling_function() const; std::size_t get_polling_work_count() const; diff --git a/libs/core/threading_base/include/hpx/threading_base/scheduler_mode.hpp b/libs/core/threading_base/include/hpx/threading_base/scheduler_mode.hpp index 1201886783fb..3efa9fd89d3f 100644 --- a/libs/core/threading_base/include/hpx/threading_base/scheduler_mode.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/scheduler_mode.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2022 Hartmut Kaiser +// Copyright (c) 2015-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -49,11 +49,11 @@ namespace hpx::threads::policies { /// enable/disable it enable_stealing = 0x0020, - /// This option allows schedulersthat support it to disallow stealing + /// This option allows schedulers that support it to disallow stealing /// between numa domains enable_stealing_numa = 0x0040, - /// This option tells schedulersthat support it to add tasks round robin + /// This option tells schedulers that support it to add tasks round robin /// to queues on each core assign_work_round_robin = 0x0080, @@ -110,47 +110,47 @@ namespace hpx::threads::policies { // clang-format on }; - inline constexpr scheduler_mode operator|( + constexpr scheduler_mode operator|( scheduler_mode lhs, scheduler_mode rhs) noexcept { return static_cast( static_cast(lhs) | static_cast(rhs)); } - inline constexpr scheduler_mode operator|( + constexpr scheduler_mode operator|( std::uint32_t lhs, scheduler_mode rhs) noexcept { return static_cast( lhs | static_cast(rhs)); } - inline constexpr scheduler_mode operator|( + constexpr scheduler_mode operator|( scheduler_mode lhs, std::uint32_t rhs) noexcept { return static_cast( static_cast(lhs) | rhs); } - inline constexpr std::uint32_t operator&( + constexpr std::uint32_t operator&( scheduler_mode lhs, scheduler_mode rhs) noexcept { return static_cast(lhs) & static_cast(rhs); } - inline constexpr std::uint32_t operator&( + constexpr std::uint32_t operator&( std::uint32_t lhs, scheduler_mode rhs) noexcept { return lhs & static_cast(rhs); } - inline constexpr std::uint32_t operator&( + constexpr std::uint32_t operator&( scheduler_mode lhs, std::uint32_t rhs) noexcept { return static_cast(lhs) & rhs; } - inline constexpr std::uint32_t operator~(scheduler_mode mode) noexcept + constexpr std::uint32_t operator~(scheduler_mode mode) noexcept { return ~static_cast(mode); } diff --git a/libs/core/threading_base/include/hpx/threading_base/scoped_annotation.hpp b/libs/core/threading_base/include/hpx/threading_base/scoped_annotation.hpp index 0d5d01592861..9f33c17d5494 100644 --- a/libs/core/threading_base/include/hpx/threading_base/scoped_annotation.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/scoped_annotation.hpp @@ -56,7 +56,7 @@ namespace hpx { explicit scoped_annotation(char const* name) : task_(thread_domain_, hpx::util::itt::string_handle(name)) { - auto* self = hpx::threads::get_self_ptr(); + auto const* self = hpx::threads::get_self_ptr(); if (self != nullptr) { desc_ = threads::get_thread_id_data(self->get_thread_id()) @@ -69,7 +69,7 @@ namespace hpx { hpx::util::itt::string_handle( detail::store_function_annotation(name))) { - auto* self = hpx::threads::get_self_ptr(); + auto const* self = hpx::threads::get_self_ptr(); if (self != nullptr) { char const* name_c_str = @@ -87,7 +87,7 @@ namespace hpx { hpx::traits::get_function_annotation_itt>::call( f)) { - auto* self = hpx::threads::get_self_ptr(); + auto const* self = hpx::threads::get_self_ptr(); if (self != nullptr) { desc_ = @@ -98,7 +98,7 @@ namespace hpx { ~scoped_annotation() { - auto* self = hpx::threads::get_self_ptr(); + auto const* self = hpx::threads::get_self_ptr(); if (self != nullptr) { threads::get_thread_id_data(self->get_thread_id()) @@ -118,7 +118,7 @@ namespace hpx { explicit scoped_annotation(char const* name) { - auto* self = hpx::threads::get_self_ptr(); + auto const* self = hpx::threads::get_self_ptr(); if (self != nullptr) { desc_ = threads::get_thread_id_data(self->get_thread_id()) @@ -134,7 +134,7 @@ namespace hpx { explicit scoped_annotation(std::string name) { - auto* self = hpx::threads::get_self_ptr(); + auto const* self = hpx::threads::get_self_ptr(); if (self != nullptr) { char const* name_c_str = @@ -159,7 +159,7 @@ namespace hpx { std::enable_if_t, std::string>>> explicit scoped_annotation(F&& f) { - auto* self = hpx::threads::get_self_ptr(); + auto const* self = hpx::threads::get_self_ptr(); if (self != nullptr) { desc_ = @@ -175,7 +175,7 @@ namespace hpx { ~scoped_annotation() { - auto* self = hpx::threads::get_self_ptr(); + auto const* self = hpx::threads::get_self_ptr(); if (self != nullptr) { threads::get_thread_id_data(self->get_thread_id()) @@ -191,7 +191,7 @@ namespace hpx { /// \brief scoped_annotation associates a \c name with a section of code /// (scope). It can be used to visualize code execution in profiling /// tools like \a Intel \a VTune, \a Apex \a Profiler, etc. That - /// allows analysing performance to figure out which part(s) of code + /// allows analyzing performance to figure out which part(s) of code /// is (are) responsible for performance degradation, etc. struct [[nodiscard]] scoped_annotation { diff --git a/libs/core/threading_base/include/hpx/threading_base/thread_data.hpp b/libs/core/threading_base/include/hpx/threading_base/thread_data.hpp index 7042619ec61b..0da75d2b1a8c 100644 --- a/libs/core/threading_base/include/hpx/threading_base/thread_data.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/thread_data.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon // @@ -9,7 +9,6 @@ #pragma once #include -#include #include #include #include @@ -20,7 +19,6 @@ #include #include #include -#include #include #include #if defined(HPX_HAVE_APEX) @@ -40,9 +38,10 @@ #include //////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace threads { +namespace hpx::threads { namespace detail { + using get_locality_id_type = std::uint32_t(hpx::error_code&); HPX_CORE_EXPORT void set_get_locality_id(get_locality_id_type* f); HPX_CORE_EXPORT std::uint32_t get_locality_id(hpx::error_code&); @@ -58,22 +57,21 @@ namespace hpx { namespace threads { HPX_CORE_EXPORT thread_data* get_self_id_data() noexcept; //////////////////////////////////////////////////////////////////////////// - /// A \a thread is the representation of a ParalleX thread. It's a first - /// class object in ParalleX. In our implementation this is a user level - /// thread running on top of one of the OS threads spawned by the \a - /// thread-manager. + /// A \a thread is the representation of a HPX thread. It's a first class + /// object in HPX. In our implementation this is a user level thread running + /// on top of one of the OS threads spawned by the \a thread-manager. /// /// A \a thread encapsulates: /// - A thread status word (see the functions \a thread#get_state and /// \a thread#set_state) /// - A function to execute (the thread function) - /// - A frame (in this implementation this is a block of memory used as - /// the threads stack) + /// - A frame (in this implementation this is a block of memory used as the + /// threads stack) /// - A block of registers (not implemented yet) /// /// Generally, \a threads are not created or executed directly. All - /// functionality related to the management of \a threads is - /// implemented by the thread-manager. + /// functionality related to the management of \a threads is implemented by + /// the thread-manager. class thread_data : public detail::thread_data_reference_counting { public: @@ -102,7 +100,10 @@ namespace hpx { namespace threads { /// The set_state function changes the state of this thread instance. /// - /// \param newstate [in] The new state to be set for the thread. + /// \param state [in] The new state to be set for the thread. + /// \param state_ex [in] + /// \param load_order [in] + /// \param exchange_order [in] /// /// \note This function will be seldom used directly. Most of /// the time the state of a thread will have to be @@ -116,7 +117,7 @@ namespace hpx { namespace threads { thread_restart_state state_ex = thread_restart_state::unknown, std::memory_order load_order = std::memory_order_acquire, std::memory_order exchange_order = - std::memory_order_seq_cst) noexcept + std::memory_order_seq_cst) const noexcept { thread_state prev_state = current_state_.load(load_order); @@ -143,9 +144,9 @@ namespace hpx { namespace threads { } bool set_state_tagged(thread_schedule_state newstate, - thread_state& prev_state, thread_state& new_tagged_state, + thread_state const& prev_state, thread_state& new_tagged_state, std::memory_order exchange_order = - std::memory_order_seq_cst) noexcept + std::memory_order_seq_cst) const noexcept { new_tagged_state = thread_state( newstate, prev_state.state_ex(), prev_state.tag() + 1); @@ -161,9 +162,11 @@ namespace hpx { namespace threads { /// as the second parameter. Otherwise it won't touch the thread state /// of this instance. /// - /// \param newstate [in] The new state to be set for the thread. - /// \param oldstate [in] The old state of the thread which still has to + /// \param new_state [in] The new state to be set for the thread. + /// \param old_state [in] The old state of the thread which still has to /// be the current state. + /// \param load_order [in] + /// \param load_exchange [in] /// /// \note This function will be seldom used directly. Most of /// the time the state of a thread will have to be @@ -179,11 +182,11 @@ namespace hpx { namespace threads { bool restore_state(thread_state new_state, thread_state old_state, std::memory_order load_order = std::memory_order_relaxed, std::memory_order load_exchange = - std::memory_order_seq_cst) noexcept + std::memory_order_seq_cst) const noexcept { // ignore the state_ex while compare-exchanging - thread_state current_state = current_state_.load(load_order); - thread_restart_state state_ex = current_state.state_ex(); + thread_state const current_state = current_state_.load(load_order); + thread_restart_state const state_ex = current_state.state_ex(); // ABA prevention for state only (not for state_ex) std::int64_t tag = current_state.tag(); @@ -191,7 +194,7 @@ namespace hpx { namespace threads { ++tag; thread_state old_tmp(old_state.state(), state_ex, old_state.tag()); - thread_state new_tmp(new_state.state(), state_ex, tag); + thread_state const new_tmp(new_state.state(), state_ex, tag); return current_state_.compare_exchange_strong( old_tmp, new_tmp, load_exchange); @@ -200,7 +203,7 @@ namespace hpx { namespace threads { bool restore_state(thread_schedule_state new_state, thread_restart_state state_ex, thread_state old_state, std::memory_order load_exchange = - std::memory_order_seq_cst) noexcept + std::memory_order_seq_cst) const noexcept { // ABA prevention for state only (not for state_ex) std::int64_t tag = old_state.tag(); @@ -215,14 +218,14 @@ namespace hpx { namespace threads { /// The set_state function changes the extended state of this /// thread instance. /// - /// \param newstate [in] The new extended state to be set for the + /// \param new_state [in] The new extended state to be set for the /// thread. /// /// \note This function will be seldom used directly. Most of /// the time the state of a thread will have to be /// changed using the threadmanager. thread_restart_state set_state_ex( - thread_restart_state new_state) noexcept + thread_restart_state new_state) const noexcept { thread_state prev_state = current_state_.load(std::memory_order_acquire); @@ -243,8 +246,8 @@ namespace hpx { namespace threads { public: /// Return the id of the component this thread is running in - constexpr std::uint64_t // same as naming::address_type - get_component_id() const noexcept + static constexpr std::uint64_t // same as naming::address_type + get_component_id() noexcept { return 0; } @@ -354,20 +357,21 @@ namespace hpx { namespace threads { #if !defined(HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION) #ifdef HPX_HAVE_THREAD_FULLBACKTRACE_ON_SUSPENSION - constexpr char const* get_backtrace() const noexcept + static constexpr char const* get_backtrace() noexcept { return nullptr; } - char const* set_backtrace(char const*) noexcept + static char const* set_backtrace(char const*) noexcept { return nullptr; } #else - constexpr util::backtrace const* get_backtrace() const noexcept + static constexpr util::backtrace const* get_backtrace() noexcept { return nullptr; } - util::backtrace const* set_backtrace(util::backtrace const*) noexcept + static util::backtrace const* set_backtrace( + util::backtrace const*) noexcept { return nullptr; } @@ -471,7 +475,6 @@ namespace hpx { namespace threads { HPX_THROW_EXCEPTION(hpx::error::thread_not_interruptable, "thread_data::interrupt", "interrupts are disabled for this thread"); - return; } requested_interrupt_ = flag; } @@ -718,14 +721,14 @@ namespace hpx { namespace threads { /// \note This function will return a meaningful value only if the code was /// compiled with HPX_HAVE_THREAD_TARGET_ADDRESS being defined. HPX_CORE_EXPORT std::uint64_t get_self_component_id() noexcept; -}} // namespace hpx::threads +} // namespace hpx::threads #include #include #include -namespace hpx { namespace threads { +namespace hpx::threads { HPX_FORCEINLINE coroutine_type::result_type thread_data::operator()( hpx::execution_base::this_thread::detail::agent_storage* agent_storage) @@ -736,4 +739,4 @@ namespace hpx { namespace threads { } return static_cast(this)->call(agent_storage); } -}} // namespace hpx::threads +} // namespace hpx::threads diff --git a/libs/core/threading_base/include/hpx/threading_base/thread_data_stackful.hpp b/libs/core/threading_base/include/hpx/threading_base/thread_data_stackful.hpp index f37f40d69fd8..3785a3966127 100644 --- a/libs/core/threading_base/include/hpx/threading_base/thread_data_stackful.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/thread_data_stackful.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon // @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -30,27 +29,26 @@ namespace hpx::threads { /////////////////////////////////////////////////////////////////////////// - /// A \a thread is the representation of a ParalleX thread. It's a first - /// class object in ParalleX. In our implementation this is a user level - /// thread running on top of one of the OS threads spawned by the \a - /// thread-manager. + /// A \a thread is the representation of a HPX thread. It's a first class + /// object in HPX. In our implementation this is a user level thread running + /// on top of one of the OS threads spawned by the \a thread-manager. /// /// A \a thread encapsulates: /// - A thread status word (see the functions \a thread#get_state and /// \a thread#set_state) /// - A function to execute (the thread function) - /// - A frame (in this implementation this is a block of memory used as - /// the threads stack) + /// - A frame (in this implementation this is a block of memory used as the + /// threads stack) /// - A block of registers (not implemented yet) /// /// Generally, \a threads are not created or executed directly. All - /// functionality related to the management of \a threads is - /// implemented by the thread-manager. + /// functionality related to the management of \a threads is implemented by + /// the thread-manager. class HPX_CORE_EXPORT thread_data_stackful : public thread_data { private: // Avoid warning about using 'this' in initializer list - thread_data* this_() noexcept + constexpr thread_data* this_() noexcept { return this; } @@ -151,6 +149,11 @@ namespace hpx::threads { HPX_ASSERT(coroutine_.is_ready()); } + thread_data_stackful(thread_data_stackful const&) = delete; + thread_data_stackful(thread_data_stackful&&) = delete; + thread_data_stackful& operator=(thread_data_stackful const&) = delete; + thread_data_stackful& operator=(thread_data_stackful&&) = delete; + ~thread_data_stackful(); static inline thread_data* create(thread_init_data& init_data, diff --git a/libs/core/threading_base/include/hpx/threading_base/thread_data_stackless.hpp b/libs/core/threading_base/include/hpx/threading_base/thread_data_stackless.hpp index d9adb21698e9..3a20eb76d5cb 100644 --- a/libs/core/threading_base/include/hpx/threading_base/thread_data_stackless.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/thread_data_stackless.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon // @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -29,22 +28,21 @@ namespace hpx::threads { /////////////////////////////////////////////////////////////////////////// - /// A \a thread is the representation of a ParalleX thread. It's a first - /// class object in ParalleX. In our implementation this is a user level - /// thread running on top of one of the OS threads spawned by the \a - /// thread-manager. + /// A \a thread is the representation of a HPX thread. It's a first class + /// object in HPX. In our implementation this is a user level thread running + /// on top of one of the OS threads spawned by the \a thread-manager. /// /// A \a thread encapsulates: /// - A thread status word (see the functions \a thread#get_state and /// \a thread#set_state) /// - A function to execute (the thread function) - /// - A frame (in this implementation this is a block of memory used as - /// the threads stack) + /// - A frame (in this implementation this is a block of memory used as the + /// threads stack) /// - A block of registers (not implemented yet) /// /// Generally, \a threads are not created or executed directly. All - /// functionality related to the management of \a threads is - /// implemented by the thread-manager. + /// functionality related to the management of \a threads is implemented by + /// the thread-manager. class HPX_CORE_EXPORT thread_data_stackless : public thread_data { private: @@ -142,6 +140,11 @@ namespace hpx::threads { HPX_ASSERT(coroutine_.is_ready()); } + thread_data_stackless(thread_data_stackless const&) = delete; + thread_data_stackless(thread_data_stackless&&) = delete; + thread_data_stackless& operator=(thread_data_stackless const&) = delete; + thread_data_stackless& operator=(thread_data_stackless&&) = delete; + ~thread_data_stackless(); inline static thread_data* create(thread_init_data& data, void* queue, diff --git a/libs/core/threading_base/include/hpx/threading_base/thread_description.hpp b/libs/core/threading_base/include/hpx/threading_base/thread_description.hpp index 7c944a57f994..ebc9e1468ffc 100644 --- a/libs/core/threading_base/include/hpx/threading_base/thread_description.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/thread_description.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 Hartmut Kaiser +// Copyright (c) 2016-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -42,13 +43,27 @@ namespace hpx::threads { }; private: - union data + struct data { - char const* desc_; //-V117 - std::size_t addr_; //-V117 + union + { + char const* desc_; //-V117 + std::size_t addr_; //-V117 + }; + data_type type_; + + constexpr data() noexcept + : desc_(nullptr) + , type_(data_type_description) + { + } + explicit constexpr data(char const* str) noexcept + : desc_(str) + , type_(data_type_description) + { + } }; - data_type type_; data data_; #if HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) util::itt::string_handle desc_itt_; @@ -57,56 +72,47 @@ namespace hpx::threads { HPX_CORE_EXPORT void init_from_alternative_name(char const* altname); public: - thread_description() noexcept - : type_(data_type_description) + constexpr thread_description() noexcept + : data_("") { - data_.desc_ = ""; } - thread_description(char const* desc) noexcept - : type_(data_type_description) + constexpr thread_description(char const* desc) noexcept + : data_(desc ? desc : "") { - data_.desc_ = desc ? desc : ""; } explicit thread_description(std::string desc) - : type_(data_type_description) + : data_(hpx::detail::store_function_annotation(HPX_MOVE(desc))) { - data_.desc_ = - hpx::detail::store_function_annotation(HPX_MOVE(desc)); } #if HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) thread_description( - char const* desc, util::itt::string_handle const& sh) noexcept - : type_(data_type_description) + char const* desc, util::itt::string_handle sh) noexcept + : data_(desc ? desc : "") + , desc_itt_(HPX_MOVE(sh)) { - data_.desc_ = desc ? desc : ""; - desc_itt_ = sh; } - thread_description(std::string desc, util::itt::string_handle const& sh) - : type_(data_type_description) + thread_description(std::string desc, util::itt::string_handle sh) + : data_(hpx::detail::store_function_annotation(HPX_MOVE(desc))) + , desc_itt_(HPX_MOVE(sh)) { - data_.desc_ = - hpx::detail::store_function_annotation(HPX_MOVE(desc)); - desc_itt_ = sh; } #endif - /* The priority of description is name, altname, address */ + // The priority of description is name, altname, address template ::value && - !traits::is_action::value>::type> + typename = + std::enable_if_t && + !traits::is_action_v>> explicit thread_description( F const& f, char const* altname = nullptr) noexcept - : type_(data_type_description) { - char const* name = traits::get_function_annotation::call(f); - // If a name exists, use it, not the altname. - if (name != nullptr) // -V547 + if (char const* name = traits::get_function_annotation::call(f); + name != nullptr) // -V547 { altname = name; #if HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) @@ -121,7 +127,7 @@ namespace hpx::threads { } else { - type_ = data_type_address; + data_.type_ = data_type_address; data_.addr_ = traits::get_function_address::call(f); } #else @@ -137,77 +143,74 @@ namespace hpx::threads { } template ::value>::type> + typename = std::enable_if_t>> explicit thread_description( Action, char const* /* altname */ = nullptr) noexcept - : type_(data_type_description) - { - data_.desc_ = hpx::actions::detail::get_action_name(); + : data_(hpx::actions::detail::get_action_name()) #if HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) - desc_itt_ = hpx::actions::detail::get_action_name_itt(); + , desc_itt_(hpx::actions::detail::get_action_name_itt()) #endif + { } - constexpr data_type kind() const noexcept + [[nodiscard]] constexpr data_type kind() const noexcept { - return type_; + return data_.type_; } - char const* get_description() const noexcept + [[nodiscard]] constexpr char const* get_description() const noexcept { - HPX_ASSERT(type_ == data_type_description); + HPX_ASSERT(data_.type_ == data_type_description); return data_.desc_; } #if HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) - util::itt::string_handle get_description_itt() const noexcept + [[nodiscard]] util::itt::string_handle get_description_itt() + const noexcept { - HPX_ASSERT(type_ == data_type_description); + HPX_ASSERT(data_.type_ == data_type_description); return desc_itt_ ? desc_itt_ : util::itt::string_handle(get_description()); } - util::itt::task get_task_itt( + [[nodiscard]] util::itt::task get_task_itt( util::itt::domain const& domain) const noexcept { switch (kind()) { case threads::thread_description::data_type_description: - return util::itt::task(domain, get_description_itt()); - break; + return {domain, get_description_itt()}; case threads::thread_description::data_type_address: - return util::itt::task( - domain, util::itt::string_handle("address"), get_address()); - break; + return { + domain, util::itt::string_handle("address"), get_address()}; default: HPX_ASSERT(false); break; } - return util::itt::task(domain, util::itt::string_handle("")); + return {domain, util::itt::string_handle("")}; } #endif - std::size_t get_address() const noexcept + [[nodiscard]] constexpr std::size_t get_address() const noexcept { - HPX_ASSERT(type_ == data_type_address); + HPX_ASSERT(data_.type_ == data_type_address); return data_.addr_; } - explicit operator bool() const noexcept + [[nodiscard]] explicit constexpr operator bool() const noexcept { return valid(); } - bool valid() const noexcept + [[nodiscard]] constexpr bool valid() const noexcept { - if (type_ == data_type_description) + if (data_.type_ == data_type_description) return nullptr != data_.desc_; - HPX_ASSERT(type_ == data_type_address); + HPX_ASSERT(data_.type_ == data_type_address); return 0 != data_.addr_; } }; @@ -236,72 +239,70 @@ namespace hpx::threads { } template ::value && - !traits::is_action::value>::type> + typename = + std::enable_if_t && + !traits::is_action_v>> explicit constexpr thread_description( F const& /*f*/, char const* /*altname*/ = nullptr) noexcept { } template ::value>::type> + typename = std::enable_if_t>> explicit constexpr thread_description( Action, char const* /*altname*/ = nullptr) noexcept { } - constexpr data_type kind() const noexcept + [[nodiscard]] constexpr data_type kind() const noexcept { return data_type_description; } - constexpr char const* get_description() const noexcept + [[nodiscard]] constexpr char const* get_description() const noexcept { return ""; } #if HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) - util::itt::string_handle get_description_itt() const noexcept + [[nodiscard]] util::itt::string_handle get_description_itt() + const noexcept { - HPX_ASSERT(type_ == data_type_description); + HPX_ASSERT(data_.type_ == data_type_description); return util::itt::string_handle(get_description()); } - util::itt::task get_task_itt( + [[nodiscard]] util::itt::task get_task_itt( util::itt::domain const& domain) const noexcept { switch (kind()) { case threads::thread_description::data_type_description: - return util::itt::task(domain, get_description_itt()); - break; + return {domain, get_description_itt()}; case threads::thread_description::data_type_address: - return util::itt::task(domain, "address", get_address()); - break; + return {domain, "address", get_address()}; default: HPX_ASSERT(false); break; } - return util::itt::task(domain, ""); + return {domain, ""}; } #endif - constexpr std::size_t get_address() const noexcept + [[nodiscard]] static constexpr std::size_t get_address() noexcept { return 0; } - explicit constexpr operator bool() const noexcept + [[nodiscard]] explicit constexpr operator bool() const noexcept { return valid(); } - constexpr bool valid() const noexcept + [[nodiscard]] static constexpr bool valid() noexcept { return true; } diff --git a/libs/core/threading_base/include/hpx/threading_base/thread_helpers.hpp b/libs/core/threading_base/include/hpx/threading_base/thread_helpers.hpp index 6f6e77a6a094..82db59ebe895 100644 --- a/libs/core/threading_base/include/hpx/threading_base/thread_helpers.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/thread_helpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2018 Thomas Heller // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon @@ -11,11 +11,9 @@ #include #include -#include #include #include #include -#include #include #include #include @@ -24,9 +22,6 @@ #include #include #include -#include -#include -#include /////////////////////////////////////////////////////////////////////////////// namespace hpx::threads { @@ -41,7 +36,9 @@ namespace hpx::threads { /// referenced by the \a id parameter. /// \param stateex [in] The new extended state to be set for the /// thread referenced by the \a id parameter. - /// \param priority + /// \param priority [in] + /// \param retry_on_active [in] + /// /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. @@ -87,7 +84,8 @@ namespace hpx::threads { /// referenced by the \a id parameter. /// \param stateex [in] The new extended state to be set for the /// thread referenced by the \a id parameter. - /// \param priority + /// \param priority [in] + /// \param retry_on_active [in] /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. @@ -134,7 +132,8 @@ namespace hpx::threads { /// referenced by the \a id parameter. /// \param stateex [in] The new extended state to be set for the /// thread referenced by the \a id parameter. - /// \param priority + /// \param priority [in] + /// \param retry_on_active [in] /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. @@ -458,7 +457,7 @@ namespace hpx::this_thread { /// \a hpx#error#invalid_status. /// HPX_CORE_EXPORT threads::thread_restart_state suspend( - threads::thread_schedule_state state, threads::thread_id_type id, + threads::thread_schedule_state state, threads::thread_id_type nextid, threads::thread_description const& description = threads::thread_description("this_thread::suspend"), error_code& ec = throws); diff --git a/libs/core/threading_base/include/hpx/threading_base/thread_init_data.hpp b/libs/core/threading_base/include/hpx/threading_base/thread_init_data.hpp index 03b02054f929..4f3364149098 100644 --- a/libs/core/threading_base/include/hpx/threading_base/thread_init_data.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/thread_init_data.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2013 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon // // SPDX-License-Identifier: BSL-1.0 @@ -14,14 +14,16 @@ #if defined(HPX_HAVE_APEX) #include #endif -#include #include #include -#include #include +#ifdef HPX_HAVE_APEX +#include +#endif + +namespace hpx::threads { -namespace hpx { namespace threads { /////////////////////////////////////////////////////////////////////////// class thread_init_data { @@ -54,6 +56,7 @@ namespace hpx { namespace threads { } } + thread_init_data& operator=(thread_init_data const& rhs) = delete; thread_init_data& operator=(thread_init_data&& rhs) noexcept { func = HPX_MOVE(rhs.func); @@ -68,7 +71,7 @@ namespace hpx { namespace threads { #endif #if defined(HPX_HAVE_THREAD_PARENT_REFERENCE) parent_locality_id = rhs.parent_locality_id; - parent_id = rhs.parent_id; + parent_id = HPX_MOVE(rhs.parent_id); parent_phase = rhs.parent_phase; #endif #ifdef HPX_HAVE_APEX @@ -79,6 +82,7 @@ namespace hpx { namespace threads { return *this; } + thread_init_data(thread_init_data const& rhs) = delete; thread_init_data(thread_init_data&& rhs) noexcept : func(HPX_MOVE(rhs.func)) #if defined(HPX_HAVE_THREAD_DESCRIPTION) @@ -86,7 +90,7 @@ namespace hpx { namespace threads { #endif #if defined(HPX_HAVE_THREAD_PARENT_REFERENCE) , parent_locality_id(rhs.parent_locality_id) - , parent_id(rhs.parent_id) + , parent_id(HPX_MOVE(rhs.parent_id)) , parent_phase(rhs.parent_phase) #endif #ifdef HPX_HAVE_APEX @@ -105,7 +109,8 @@ namespace hpx { namespace threads { } template - thread_init_data(F&& f, threads::thread_description const& desc, + thread_init_data(F&& f, + [[maybe_unused]] threads::thread_description const& desc, thread_priority priority_ = thread_priority::normal, thread_schedule_hint os_thread = thread_schedule_hint(), thread_stacksize stacksize_ = thread_stacksize::default_, @@ -135,8 +140,6 @@ namespace hpx { namespace threads { , run_now(run_now_) , scheduler_base(scheduler_base_) { - HPX_UNUSED(desc); - if (initial_state == thread_schedule_state::staged) { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, @@ -169,4 +172,4 @@ namespace hpx { namespace threads { policies::scheduler_base* scheduler_base; }; -}} // namespace hpx::threads +} // namespace hpx::threads diff --git a/libs/core/threading_base/include/hpx/threading_base/thread_num_tss.hpp b/libs/core/threading_base/include/hpx/threading_base/thread_num_tss.hpp index 3e7992476851..9bc4a49caad6 100644 --- a/libs/core/threading_base/include/hpx/threading_base/thread_num_tss.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/thread_num_tss.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -10,9 +10,6 @@ #include #include -#include -#include -#include #include @@ -56,12 +53,18 @@ namespace hpx::threads::detail { { } + reset_tss_helper(reset_tss_helper const&) = delete; + reset_tss_helper(reset_tss_helper&&) = delete; + reset_tss_helper& operator=(reset_tss_helper const&) = delete; + reset_tss_helper& operator=(reset_tss_helper&&) = delete; + ~reset_tss_helper() { set_global_thread_num_tss(global_thread_num_); } - constexpr std::size_t previous_global_thread_num() const noexcept + [[nodiscard]] constexpr std::size_t previous_global_thread_num() + const noexcept { return global_thread_num_; } diff --git a/libs/core/threading_base/include/hpx/threading_base/thread_pool_base.hpp b/libs/core/threading_base/include/hpx/threading_base/thread_pool_base.hpp index ef3d9a3746ac..7d6982147dfd 100644 --- a/libs/core/threading_base/include/hpx/threading_base/thread_pool_base.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/thread_pool_base.hpp @@ -1,5 +1,5 @@ // Copyright (c) 2018 Mikael Simberg -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -24,13 +23,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include @@ -86,7 +83,7 @@ namespace hpx::threads { hpx::threads::detail::network_background_callback_type const& network_background_callback = hpx::threads::detail::network_background_callback_type(), - std::size_t max_background_threads = std::size_t(-1), + std::size_t max_background_threads = static_cast(-1), std::size_t max_idle_loop_count = HPX_IDLE_LOOP_COUNT_MAX, std::size_t max_busy_loop_count = HPX_BUSY_LOOP_COUNT_MAX, std::size_t shutdown_check_count = 10) @@ -116,6 +113,11 @@ namespace hpx::threads { /// \cond NOINTERNAL explicit thread_pool_base(thread_pool_init_parameters const& init); + thread_pool_base(thread_pool_base const&) = delete; + thread_pool_base(thread_pool_base&&) = delete; + thread_pool_base& operator=(thread_pool_base const&) = delete; + thread_pool_base& operator=(thread_pool_base&&) = delete; + virtual ~thread_pool_base() = default; virtual void init(std::size_t num_threads, std::size_t threads_offset); @@ -141,17 +143,23 @@ namespace hpx::threads { /// Suspends the given processing unit. Blocks until the processing unit /// has been suspended. /// - /// \param virt_core [in] The processing unit on the the pool to be - /// suspended. The processing units are indexed - /// starting from 0. + /// \param virt_core [in] The processing unit on the the pool to be + /// suspended. The processing units are indexed + /// starting from 0. + /// \param ec [in,out] this represents the error status on exit, if this + /// is pre-initialized to \a hpx#throws the function will + /// throw on error instead. virtual void suspend_processing_unit_direct( std::size_t virt_core, error_code& ec = throws) = 0; /// Resumes the given processing unit. Blocks until the processing unit /// has been resumed. /// - /// \param virt_core [in] The processing unit on the the pool to be resumed. - /// The processing units are indexed starting from 0. + /// \param virt_core [in] The processing unit on the the pool to be resumed. + /// The processing units are indexed starting from 0. + /// \param ec [in,out] this represents the error status on exit, if this + /// is pre-initialized to \a hpx#throws the function will + /// throw on error instead. virtual void resume_processing_unit_direct( std::size_t virt_core, error_code& ec = throws) = 0; @@ -200,17 +208,17 @@ namespace hpx::threads { thread_restart_state newstate_ex, thread_priority priority, error_code& ec) = 0; - std::size_t get_pool_index() const noexcept + [[nodiscard]] std::size_t get_pool_index() const noexcept { return id_.index(); } - std::string const& get_pool_name() const noexcept + [[nodiscard]] std::string const& get_pool_name() const noexcept { return id_.name(); } - std::size_t get_thread_offset() const noexcept + [[nodiscard]] std::size_t get_thread_offset() const noexcept { return thread_offset_; } @@ -474,13 +482,13 @@ namespace hpx::threads { virtual void do_some_work(std::size_t /*num_thread*/) {} - virtual void report_error( + virtual bool report_error( std::size_t global_thread_num, std::exception_ptr const& e) { - notifier_.on_error(global_thread_num, e); + return notifier_.on_error(global_thread_num, e); } - double timestamp_scale() const noexcept + [[nodiscard]] double timestamp_scale() const noexcept { return timestamp_scale_; } diff --git a/libs/core/threading_base/include/hpx/threading_base/thread_queue_init_parameters.hpp b/libs/core/threading_base/include/hpx/threading_base/thread_queue_init_parameters.hpp index 1d6dbee1f52a..c4933b573089 100644 --- a/libs/core/threading_base/include/hpx/threading_base/thread_queue_init_parameters.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/thread_queue_init_parameters.hpp @@ -1,4 +1,5 @@ // Copyright (c) 2019 Mikael Simberg +// Copyright (c) 2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -18,25 +19,26 @@ namespace hpx::threads::policies { struct thread_queue_init_parameters { explicit thread_queue_init_parameters( - std::int64_t max_thread_count = std::int64_t( + std::int64_t max_thread_count = static_cast( HPX_THREAD_QUEUE_MAX_THREAD_COUNT), - std::int64_t min_tasks_to_steal_pending = std::int64_t( + std::int64_t min_tasks_to_steal_pending = static_cast( HPX_THREAD_QUEUE_MIN_TASKS_TO_STEAL_PENDING), - std::int64_t min_tasks_to_steal_staged = std::int64_t( + std::int64_t min_tasks_to_steal_staged = static_cast( HPX_THREAD_QUEUE_MIN_TASKS_TO_STEAL_STAGED), - std::int64_t min_add_new_count = std::int64_t( + std::int64_t min_add_new_count = static_cast( HPX_THREAD_QUEUE_MIN_ADD_NEW_COUNT), - std::int64_t max_add_new_count = std::int64_t( + std::int64_t max_add_new_count = static_cast( HPX_THREAD_QUEUE_MAX_ADD_NEW_COUNT), - std::int64_t min_delete_count = std::int64_t( + std::int64_t min_delete_count = static_cast( HPX_THREAD_QUEUE_MIN_DELETE_COUNT), - std::int64_t max_delete_count = std::int64_t( + std::int64_t max_delete_count = static_cast( HPX_THREAD_QUEUE_MAX_DELETE_COUNT), - std::int64_t max_terminated_threads = std::int64_t( + std::int64_t max_terminated_threads = static_cast( HPX_THREAD_QUEUE_MAX_TERMINATED_THREADS), - std::int64_t init_threads_count = std::int64_t( + std::int64_t init_threads_count = static_cast( HPX_THREAD_QUEUE_INIT_THREADS_COUNT), - double max_idle_backoff_time = double(HPX_IDLE_BACKOFF_TIME_MAX), + double max_idle_backoff_time = static_cast( + HPX_IDLE_BACKOFF_TIME_MAX), std::ptrdiff_t small_stacksize = HPX_SMALL_STACK_SIZE, std::ptrdiff_t medium_stacksize = HPX_MEDIUM_STACK_SIZE, std::ptrdiff_t large_stacksize = HPX_LARGE_STACK_SIZE, diff --git a/libs/core/threading_base/include/hpx/threading_base/threading_base_fwd.hpp b/libs/core/threading_base/include/hpx/threading_base/threading_base_fwd.hpp index 93ac53dea55a..97e9780e88df 100644 --- a/libs/core/threading_base/include/hpx/threading_base/threading_base_fwd.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/threading_base_fwd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -12,17 +12,13 @@ #include #include #include -#include #include -#include -#include -#include -#include -#include #include #if defined(HPX_HAVE_APEX) +#include + namespace hpx::util::external_timer { struct task_wrapper; @@ -62,7 +58,7 @@ namespace hpx::threads { #if defined(HPX_HAVE_APEX) HPX_CORE_EXPORT std::shared_ptr - get_self_timer_data(void); + get_self_timer_data(); HPX_CORE_EXPORT void set_self_timer_data( std::shared_ptr data); #endif diff --git a/libs/core/threading_base/src/callback_notifier.cpp b/libs/core/threading_base/src/callback_notifier.cpp index 42242f80cec9..807bee30d093 100644 --- a/libs/core/threading_base/src/callback_notifier.cpp +++ b/libs/core/threading_base/src/callback_notifier.cpp @@ -15,12 +15,7 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx::threads::policies { - callback_notifier::callback_notifier() - : on_start_thread_callbacks_() - , on_stop_thread_callbacks_() - , on_error_() - { - } + callback_notifier::callback_notifier() = default; void callback_notifier::on_start_thread(std::size_t local_thread_num, std::size_t global_thread_num, char const* pool_name, diff --git a/libs/core/threading_base/src/detail/reset_backtrace.cpp b/libs/core/threading_base/src/detail/reset_backtrace.cpp index 53121e064dbc..1bc03540dfc9 100644 --- a/libs/core/threading_base/src/detail/reset_backtrace.cpp +++ b/libs/core/threading_base/src/detail/reset_backtrace.cpp @@ -19,9 +19,8 @@ namespace hpx::threads::detail { - reset_backtrace::reset_backtrace( - threads::thread_id_type const& id, error_code& ec) - : id_(id) + reset_backtrace::reset_backtrace(threads::thread_id_type id, error_code& ec) + : id_(HPX_MOVE(id)) , backtrace_(new hpx::util::backtrace()) #ifdef HPX_HAVE_THREAD_FULLBACKTRACE_ON_SUSPENSION , full_backtrace_(backtrace_->trace()) @@ -34,6 +33,7 @@ namespace hpx::threads::detail { threads::set_thread_backtrace(id_, backtrace_.get(), ec_); #endif } + reset_backtrace::~reset_backtrace() { threads::set_thread_backtrace(id_, 0, ec_); diff --git a/libs/core/threading_base/src/detail/reset_lco_description.cpp b/libs/core/threading_base/src/detail/reset_lco_description.cpp index 7478ebdfa7a8..53a8f6afad71 100644 --- a/libs/core/threading_base/src/detail/reset_lco_description.cpp +++ b/libs/core/threading_base/src/detail/reset_lco_description.cpp @@ -15,10 +15,9 @@ namespace hpx::threads::detail { - reset_lco_description::reset_lco_description( - threads::thread_id_type const& id, + reset_lco_description::reset_lco_description(threads::thread_id_type id, threads::thread_description const& description, error_code& ec) - : id_(id) + : id_(HPX_MOVE(id)) , ec_(ec) { old_desc_ = threads::set_thread_lco_description(id_, description, ec_); diff --git a/libs/core/threading_base/src/execution_agent.cpp b/libs/core/threading_base/src/execution_agent.cpp index 6dd4b9411792..5a0d21171040 100644 --- a/libs/core/threading_base/src/execution_agent.cpp +++ b/libs/core/threading_base/src/execution_agent.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/libs/core/threading_base/src/scheduler_base.cpp b/libs/core/threading_base/src/scheduler_base.cpp index 369bb4ad44ad..3bb4facc62b3 100644 --- a/libs/core/threading_base/src/scheduler_base.cpp +++ b/libs/core/threading_base/src/scheduler_base.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -58,7 +57,7 @@ namespace hpx::threads::policies { scheduler_base::set_scheduler_mode(mode); #if defined(HPX_HAVE_THREAD_MANAGER_IDLE_BACKOFF) - double max_time = thread_queue_init.max_idle_backoff_time_; + double const max_time = thread_queue_init.max_idle_backoff_time_; wait_counts_.resize(num_threads); for (auto&& data : wait_counts_) @@ -86,10 +85,11 @@ namespace hpx::threads::policies { // Exponential back-off with a maximum sleep time. static constexpr std::int64_t const max_exponent = std::numeric_limits::max_exponent; - double exponent = - (std::min)(double(data.wait_count_), double(max_exponent - 1)); + double const exponent = + (std::min)(static_cast(data.wait_count_), + static_cast(max_exponent - 1)); - std::chrono::milliseconds period(std::lround((std::min)( + std::chrono::milliseconds const period(std::lround((std::min)( data.max_idle_backoff_time_, std::pow(2.0, exponent)))); ++data.wait_count_; @@ -141,7 +141,7 @@ namespace hpx::threads::policies { void scheduler_base::resume(std::size_t num_thread) { - if (num_thread == std::size_t(-1)) + if (num_thread == static_cast(-1)) { for (std::condition_variable& c : suspend_conds_) { @@ -176,7 +176,7 @@ namespace hpx::threads::policies { for (std::size_t offset = 0; offset < states_size; ++offset) { - std::size_t num_thread_local = + std::size_t const num_thread_local = (num_thread + offset) % states_size; { @@ -228,10 +228,10 @@ namespace hpx::threads::policies { } // Try all pus only once if fallback is allowed - HPX_ASSERT(num_thread != std::size_t(-1)); + HPX_ASSERT(num_thread != static_cast(-1)); for (std::size_t offset = 0; offset < states_size; ++offset) { - std::size_t num_thread_local = + std::size_t const num_thread_local = (num_thread + offset) % states_size; std::unique_lock l( @@ -324,26 +324,26 @@ namespace hpx::threads::policies { { // distribute the same value across all cores mode_.data_.store(mode, std::memory_order_release); - do_some_work(std::size_t(-1)); + do_some_work(static_cast(-1)); } void scheduler_base::add_scheduler_mode(scheduler_mode mode) noexcept { // distribute the same value across all cores - mode = scheduler_mode(get_scheduler_mode() | mode); + mode = static_cast(get_scheduler_mode() | mode); set_scheduler_mode(mode); } void scheduler_base::remove_scheduler_mode(scheduler_mode mode) noexcept { - mode = scheduler_mode(get_scheduler_mode() & ~mode); + mode = static_cast(get_scheduler_mode() & ~mode); set_scheduler_mode(mode); } void scheduler_base::add_remove_scheduler_mode( scheduler_mode to_add_mode, scheduler_mode to_remove_mode) noexcept { - scheduler_mode mode = scheduler_mode( + scheduler_mode const mode = static_cast( (get_scheduler_mode() | to_add_mode) & ~to_remove_mode); set_scheduler_mode(mode); } @@ -432,6 +432,42 @@ namespace hpx::threads::policies { } #endif + std::ptrdiff_t scheduler_base::get_stack_size( + threads::thread_stacksize stacksize) const noexcept + { + if (stacksize == thread_stacksize::current) + { + stacksize = get_self_stacksize_enum(); + } + + HPX_ASSERT(stacksize != thread_stacksize::current); + + switch (stacksize) + { + case thread_stacksize::small_: + return thread_queue_init_.small_stacksize_; + + case thread_stacksize::medium: + return thread_queue_init_.medium_stacksize_; + + case thread_stacksize::large: + return thread_queue_init_.large_stacksize_; + + case thread_stacksize::huge: + return thread_queue_init_.huge_stacksize_; + + case thread_stacksize::nostack: + return (std::numeric_limits::max)(); + + default: + HPX_ASSERT_MSG( + false, util::format("Invalid stack size {1}", stacksize)); + break; + } + + return thread_queue_init_.small_stacksize_; + } + void scheduler_base::set_mpi_polling_functions( polling_function_ptr mpi_func, polling_work_count_function_ptr mpi_work_count_func) diff --git a/libs/core/threading_base/src/set_thread_state.cpp b/libs/core/threading_base/src/set_thread_state.cpp index f7ccada50ac3..e5380603ba7b 100644 --- a/libs/core/threading_base/src/set_thread_state.cpp +++ b/libs/core/threading_base/src/set_thread_state.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,19 +6,18 @@ #include #include -#include #include #include #include #include #include #include +#include #include #include #include #include -#include #include #include @@ -34,13 +33,12 @@ namespace hpx::threads::detail { HPX_THROW_EXCEPTION(hpx::error::null_thread_id, "threads::detail::set_active_state", "null thread id encountered"); - return thread_result_type( - thread_schedule_state::terminated, invalid_thread_id); } // make sure that the thread has not been suspended and set active again // in the meantime - thread_state current_state = get_thread_id_data(thrd)->get_state(); + thread_state const current_state = + get_thread_id_data(thrd)->get_state(); if (current_state.state() == previous_state.state() && current_state != previous_state) @@ -53,8 +51,7 @@ namespace hpx::threads::detail { "state({})", thrd, get_thread_id_data(thrd)->get_description(), get_thread_state_name(newstate)); - return thread_result_type( - thread_schedule_state::terminated, invalid_thread_id); + return {thread_schedule_state::terminated, invalid_thread_id}; } // just retry, set_state will create new thread if target is still active @@ -62,8 +59,7 @@ namespace hpx::threads::detail { detail::set_thread_state(thrd.noref(), newstate, newstate_ex, priority, thread_schedule_hint(), true, ec); - return thread_result_type( - thread_schedule_state::terminated, invalid_thread_id); + return {thread_schedule_state::terminated, invalid_thread_id}; } /////////////////////////////////////////////////////////////////////////// @@ -77,8 +73,8 @@ namespace hpx::threads::detail { HPX_THROWS_IF(ec, hpx::error::null_thread_id, "threads::detail::set_thread_state", "null thread id encountered"); - return thread_state( - thread_schedule_state::unknown, thread_restart_state::unknown); + return { + thread_schedule_state::unknown, thread_restart_state::unknown}; } // set_state can't be used to force a thread into active state @@ -87,8 +83,8 @@ namespace hpx::threads::detail { HPX_THROWS_IF(ec, hpx::error::bad_parameter, "threads::detail::set_thread_state", "invalid new state: {}", new_state); - return thread_state( - thread_schedule_state::unknown, thread_restart_state::unknown); + return { + thread_schedule_state::unknown, thread_restart_state::unknown}; } thread_state previous_state; @@ -113,7 +109,7 @@ namespace hpx::threads::detail { if (&ec != &throws) ec = make_success_code(); - return thread_state(new_state, previous_state.state_ex()); + return {new_state, previous_state.state_ex()}; } // the thread to set the state for is currently running, so we @@ -166,7 +162,6 @@ namespace hpx::threads::detail { return previous_state; // done } - break; case thread_schedule_state::terminated: { @@ -184,7 +179,6 @@ namespace hpx::threads::detail { // pending nothing has to be done anymore. return previous_state; } - break; case thread_schedule_state::pending: [[fallthrough]]; @@ -205,14 +199,17 @@ namespace hpx::threads::detail { HPX_THROWS_IF(ec, hpx::error::bad_parameter, "threads::detail::set_thread_state", str); - return thread_state(thread_schedule_state::unknown, - thread_restart_state::unknown); + return {thread_schedule_state::unknown, + thread_restart_state::unknown}; } break; case thread_schedule_state::suspended: break; // fine, just set the new state + case thread_schedule_state::unknown: + case thread_schedule_state::depleted: + case thread_schedule_state::staged: case thread_schedule_state::pending_do_not_schedule: [[fallthrough]]; default: @@ -256,7 +253,7 @@ namespace hpx::threads::detail { get_thread_state_name(previous_state_val)); } while (true); - thread_schedule_state previous_state_val = previous_state.state(); + thread_schedule_state const previous_state_val = previous_state.state(); if (!(previous_state_val == thread_schedule_state::pending || previous_state_val == thread_schedule_state::pending_boost) && (new_state == thread_schedule_state::pending || @@ -265,7 +262,7 @@ namespace hpx::threads::detail { // REVIEW: Passing a specific target thread may interfere with the // round robin queuing. - auto* thrd_data = get_thread_id_data(thrd); + auto const* thrd_data = get_thread_id_data(thrd); auto* scheduler = thrd_data->get_scheduler_base(); scheduler->schedule_thread( thrd, schedulehint, false, thrd_data->get_priority()); diff --git a/libs/core/threading_base/src/set_thread_state_timed.cpp b/libs/core/threading_base/src/set_thread_state_timed.cpp index 60cbbfc554ac..dec59fc30c27 100644 --- a/libs/core/threading_base/src/set_thread_state_timed.cpp +++ b/libs/core/threading_base/src/set_thread_state_timed.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -17,11 +17,9 @@ #include #include -#include #include #include -#include #include #include #include @@ -43,8 +41,6 @@ namespace hpx::threads::detail { HPX_THROW_EXCEPTION(hpx::error::null_thread_id, "threads::detail::wake_timer_thread", "null thread id encountered (id)"); - return thread_result_type( - thread_schedule_state::terminated, invalid_thread_id); } if (HPX_UNLIKELY(!timer_id)) @@ -52,8 +48,6 @@ namespace hpx::threads::detail { HPX_THROW_EXCEPTION(hpx::error::null_thread_id, "threads::detail::wake_timer_thread", "null thread id encountered (timer_id)"); - return thread_result_type( - thread_schedule_state::terminated, invalid_thread_id); } HPX_ASSERT(my_statex == thread_restart_state::abort || @@ -67,14 +61,13 @@ namespace hpx::threads::detail { retry_on_active, ec); } - return thread_result_type( - thread_schedule_state::terminated, invalid_thread_id); + return {thread_schedule_state::terminated, invalid_thread_id}; } // This thread function initiates the required set_state action (on behalf // of one of the threads#detail#set_thread_state functions). thread_result_type at_timer(policies::scheduler_base* scheduler, - std::chrono::steady_clock::time_point& abs_time, + std::chrono::steady_clock::time_point const& abs_time, thread_id_ref_type const& thrd, thread_schedule_state newstate, thread_restart_state newstate_ex, thread_priority priority, std::atomic* started, bool retry_on_active) @@ -83,14 +76,12 @@ namespace hpx::threads::detail { { HPX_THROW_EXCEPTION(hpx::error::null_thread_id, "threads::detail::at_timer", "null thread id encountered"); - return thread_result_type( - thread_schedule_state::terminated, invalid_thread_id); } // create a new thread in suspended state, which will execute the // requested set_state when timer fires and will re-awaken this thread, // allowing the deadline_timer to go out of scope gracefully - thread_id_ref_type self_id = get_self_id(); // keep alive + thread_id_ref_type const self_id = get_self_id(); // keep alive std::shared_ptr> triggered( std::make_shared>(false)); @@ -136,7 +127,7 @@ namespace hpx::threads::detail { // this waits for the thread to be reactivated when the timer fired // if it returns signaled the timer has been canceled, otherwise // the timer fired and the wake_timer_thread above has been executed - thread_restart_state statex = get_self().yield(thread_result_type( + thread_restart_state const statex = get_self().yield(thread_result_type( thread_schedule_state::suspended, invalid_thread_id)); HPX_ASSERT(statex == thread_restart_state::abort || @@ -156,8 +147,7 @@ namespace hpx::threads::detail { thrd.noref(), newstate, newstate_ex, priority); } - return thread_result_type( - thread_schedule_state::terminated, invalid_thread_id); + return {thread_schedule_state::terminated, invalid_thread_id}; } // Set a timer to set the state of the given \a thread to the given new @@ -178,7 +168,7 @@ namespace hpx::threads::detail { return invalid_thread_id; } - // this creates a new thread which creates the timer and handles the + // this creates a new thread that creates the timer and handles the // requested actions thread_init_data data( hpx::bind(&at_timer, scheduler, abs_time.value(), diff --git a/libs/core/threading_base/src/thread_data.cpp b/libs/core/threading_base/src/thread_data.cpp index a0ca2bf1517b..5e305cb193c5 100644 --- a/libs/core/threading_base/src/thread_data.cpp +++ b/libs/core/threading_base/src/thread_data.cpp @@ -73,7 +73,7 @@ namespace hpx::threads { , ran_exit_funcs_(false) , is_stackless_(is_stackless) , scheduler_base_(init_data.scheduler_base) - , last_worker_thread_num_(std::size_t(-1)) + , last_worker_thread_num_(static_cast(-1)) , stacksize_(stacksize) , stacksize_enum_(init_data.stacksize) , queue_(queue) @@ -220,7 +220,7 @@ namespace hpx::threads { ran_exit_funcs_ = false; exit_funcs_.clear(); scheduler_base_ = init_data.scheduler_base; - last_worker_thread_num_ = std::size_t(-1); + last_worker_thread_num_ = static_cast(-1); // We explicitly set the logical stack size again as it can be different // from what the previous use required. However, the physical stack size @@ -237,8 +237,7 @@ namespace hpx::threads { // purposes if (parent_thread_id_ == nullptr) { - thread_self* self = get_self_ptr(); - if (self) + if (thread_self const* self = get_self_ptr()) { parent_thread_id_ = threads::get_self_id(); parent_thread_phase_ = self->get_thread_phase(); @@ -307,32 +306,34 @@ namespace hpx::threads { thread_id_type get_self_id() noexcept { - thread_self* self = get_self_ptr(); - if (HPX_LIKELY(nullptr != self)) + if (thread_self const* self = get_self_ptr(); + HPX_LIKELY(nullptr != self)) + { return self->get_thread_id(); - + } return threads::invalid_thread_id; } thread_data* get_self_id_data() noexcept { - thread_self* self = get_self_ptr(); - if (HPX_LIKELY(nullptr != self)) + if (thread_self const* self = get_self_ptr(); + HPX_LIKELY(nullptr != self)) + { return get_thread_id_data(self->get_thread_id()); - + } return nullptr; } std::ptrdiff_t get_self_stacksize() noexcept { - thread_data* thrd_data = get_self_id_data(); + thread_data const* thrd_data = get_self_id_data(); return thrd_data ? thrd_data->get_stack_size() : 0; } thread_stacksize get_self_stacksize_enum() noexcept { - thread_data* thrd_data = get_self_id_data(); - thread_stacksize stacksize = thrd_data ? + thread_data const* thrd_data = get_self_id_data(); + thread_stacksize const stacksize = thrd_data ? thrd_data->get_stack_size_enum() : thread_stacksize::default_; HPX_ASSERT(stacksize != thread_stacksize::current); @@ -358,8 +359,8 @@ namespace hpx::threads { #else thread_id_type get_parent_id() noexcept { - thread_data* thrd_data = get_self_id_data(); - if (HPX_LIKELY(nullptr != thrd_data)) + if (thread_data const* thrd_data = get_self_id_data(); + HPX_LIKELY(nullptr != thrd_data)) { return thrd_data->get_parent_thread_id(); } @@ -368,8 +369,8 @@ namespace hpx::threads { std::size_t get_parent_phase() noexcept { - thread_data* thrd_data = get_self_id_data(); - if (HPX_LIKELY(nullptr != thrd_data)) + if (thread_data const* thrd_data = get_self_id_data(); + HPX_LIKELY(nullptr != thrd_data)) { return thrd_data->get_parent_thread_phase(); } @@ -378,8 +379,8 @@ namespace hpx::threads { std::uint32_t get_parent_locality_id() noexcept { - thread_data* thrd_data = get_self_id_data(); - if (HPX_LIKELY(nullptr != thrd_data)) + if (thread_data const* thrd_data = get_self_id_data(); + HPX_LIKELY(nullptr != thrd_data)) { return thrd_data->get_parent_locality_id(); } @@ -394,8 +395,8 @@ namespace hpx::threads { #ifndef HPX_HAVE_THREAD_TARGET_ADDRESS return 0; #else - thread_data* thrd_data = get_self_id_data(); - if (HPX_LIKELY(nullptr != thrd_data)) + if (thread_data const* thrd_data = get_self_id_data(); + HPX_LIKELY(nullptr != thrd_data)) { return thrd_data->get_component_id(); } @@ -423,7 +424,6 @@ namespace hpx::threads { { thrd_data->set_timer_data(data); } - return; } #endif } // namespace hpx::threads diff --git a/libs/core/threading_base/src/thread_data_stackful.cpp b/libs/core/threading_base/src/thread_data_stackful.cpp index 8a8022520def..b3ef63d30347 100644 --- a/libs/core/threading_base/src/thread_data_stackful.cpp +++ b/libs/core/threading_base/src/thread_data_stackful.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2022 Hartmut Kaiser +// Copyright (c) 2019-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -15,10 +15,15 @@ namespace hpx::threads { util::internal_allocator thread_data_stackful::thread_alloc_; +#if !defined(HPX_HAVE_LOGGING) + thread_data_stackful::~thread_data_stackful() = default; +#else thread_data_stackful::~thread_data_stackful() { LTM_(debug).format( "~thread_data_stackful({}), description({}), phase({})", this, - this->get_description(), this->get_thread_phase()); + this->get_description(), + this->thread_data_stackful::get_thread_phase()); } +#endif } // namespace hpx::threads diff --git a/libs/core/threading_base/src/thread_data_stackless.cpp b/libs/core/threading_base/src/thread_data_stackless.cpp index e2aca1a95552..596ec6ec571a 100644 --- a/libs/core/threading_base/src/thread_data_stackless.cpp +++ b/libs/core/threading_base/src/thread_data_stackless.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2022 Hartmut Kaiser +// Copyright (c) 2019-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -15,10 +15,15 @@ namespace hpx::threads { util::internal_allocator thread_data_stackless::thread_alloc_; +#if !defined(HPX_HAVE_LOGGING) + thread_data_stackless::~thread_data_stackless() = default; +#else thread_data_stackless::~thread_data_stackless() { LTM_(debug).format( "~thread_data_stackless({}), description({}), phase({})", this, - this->get_description(), this->get_thread_phase()); + this->get_description(), + this->thread_data_stackless::get_thread_phase()); } +#endif } // namespace hpx::threads diff --git a/libs/core/threading_base/src/thread_description.cpp b/libs/core/threading_base/src/thread_description.cpp index 384ceb3b3e62..358c192deb94 100644 --- a/libs/core/threading_base/src/thread_description.cpp +++ b/libs/core/threading_base/src/thread_description.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 Hartmut Kaiser +// Copyright (c) 2016-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -56,32 +55,34 @@ namespace hpx::threads { !defined(HPX_HAVE_THREAD_DESCRIPTION_FULL) if (altname != nullptr) { - type_ = data_type_description; + data_.type_ = data_type_description; data_.desc_ = altname; return; } - hpx::threads::thread_id_type id = hpx::threads::get_self_id(); + hpx::threads::thread_id_type const id = hpx::threads::get_self_id(); if (id) { // get the current task description - thread_description desc = hpx::threads::get_thread_description(id); - type_ = desc.kind(); + thread_description const desc = + hpx::threads::get_thread_description(id); + data_.type_ = desc.kind(); + // if the current task has a description, use it. - if (type_ == data_type_description) + if (data_.type_ == data_type_description) { data_.desc_ = desc.get_description(); } else { // otherwise, use the address of the task. - HPX_ASSERT(type_ == data_type_address); + HPX_ASSERT(data_.type_ == data_type_address); data_.addr_ = desc.get_address(); } } else { - type_ = data_type_description; + data_.type_ = data_type_description; data_.desc_ = ""; } #endif @@ -102,7 +103,7 @@ namespace hpx::threads { HPX_THROWS_IF(ec, hpx::error::null_thread_id, "hpx::threads::set_thread_description", "null thread id encountered"); - return threads::thread_description(); + return {}; } if (&ec != &throws) ec = make_success_code(); diff --git a/libs/core/threading_base/src/thread_helpers.cpp b/libs/core/threading_base/src/thread_helpers.cpp index aca9e52e593e..7fc4fce6f422 100644 --- a/libs/core/threading_base/src/thread_helpers.cpp +++ b/libs/core/threading_base/src/thread_helpers.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include /////////////////////////////////////////////////////////////////////////////// @@ -79,7 +78,7 @@ namespace hpx::threads { thread_id_type const& id, error_code& /* ec */) noexcept { return id ? get_thread_id_data(id)->get_thread_phase() : - std::size_t(~0); + static_cast(~0); } /////////////////////////////////////////////////////////////////////////// @@ -142,7 +141,6 @@ namespace hpx::threads { HPX_THROW_EXCEPTION(hpx::error::null_thread_id, "hpx::threads::get_thread_interruption_enabled", "null thread id encountered"); - return false; } if (&ec != &throws) @@ -159,7 +157,6 @@ namespace hpx::threads { HPX_THROW_EXCEPTION(hpx::error::null_thread_id, "hpx::threads::get_thread_interruption_enabled", "null thread id encountered"); - return false; } if (&ec != &throws) @@ -301,8 +298,7 @@ namespace hpx::threads { std::size_t& get_continuation_recursion_count() noexcept { - thread_self* self_ptr = get_self_ptr(); - if (self_ptr) + if (thread_self* self_ptr = get_self_ptr()) { return self_ptr->get_continuation_recursion_count(); } @@ -449,8 +445,7 @@ namespace hpx::this_thread { if (ec) return threads::thread_restart_state::unknown; - threads::thread_restart_state statex = - threads::thread_restart_state::unknown; + threads::thread_restart_state statex; { // verify that there are no more registered locks for this OS-thread @@ -464,8 +459,8 @@ namespace hpx::this_thread { #ifdef HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION threads::detail::reset_backtrace bt(id, ec); #endif - // We might need to dispatch 'nextid' to it's correct scheduler - // only if our current scheduler is the same, we should yield the id + // We might need to dispatch 'nextid' to it's correct scheduler only + // if our current scheduler is the same, we should yield to the id if (nextid && get_thread_id_data(nextid)->get_scheduler_base() != get_thread_id_data(id)->get_scheduler_base()) @@ -522,8 +517,7 @@ namespace hpx::this_thread { return threads::thread_restart_state::unknown; // let the thread manager do other things while waiting - threads::thread_restart_state statex = - threads::thread_restart_state::unknown; + threads::thread_restart_state statex; { #ifdef HPX_HAVE_VERIFY_LOCKS @@ -538,7 +532,7 @@ namespace hpx::this_thread { threads::detail::reset_backtrace bt(id, ec); #endif std::atomic timer_started(false); - threads::thread_id_ref_type timer_id = + threads::thread_id_ref_type const timer_id = threads::set_thread_state(id.noref(), abs_time, &timer_started, threads::thread_schedule_state::pending, threads::thread_restart_state::timeout, @@ -546,8 +540,8 @@ namespace hpx::this_thread { if (ec) return threads::thread_restart_state::unknown; - // We might need to dispatch 'nextid' to it's correct scheduler - // only if our current scheduler is the same, we should yield the id + // We might need to dispatch 'nextid' to it's correct scheduler only + // if our current scheduler is the same, we should yield to the id if (nextid && get_thread_id_data(nextid)->get_scheduler_base() != get_thread_id_data(id)->get_scheduler_base()) @@ -611,12 +605,10 @@ namespace hpx::this_thread { std::ptrdiff_t get_available_stack_space() noexcept { - threads::thread_self* self = threads::get_self_ptr(); - if (self) + if (threads::thread_self const* self = threads::get_self_ptr()) { return self->get_available_stack_space(); } - return (std::numeric_limits::max)(); } diff --git a/libs/core/threading_base/src/thread_num_tss.cpp b/libs/core/threading_base/src/thread_num_tss.cpp index 15c4d6dddae2..a4d9cf781b5a 100644 --- a/libs/core/threading_base/src/thread_num_tss.cpp +++ b/libs/core/threading_base/src/thread_num_tss.cpp @@ -1,15 +1,13 @@ -// Copyright (c) 2007-2015 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // 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) -#include #include #include #include -#include #include #include @@ -20,7 +18,8 @@ namespace hpx::threads::detail { thread_nums& thread_nums_tss() { static thread_local thread_nums thread_nums_tss_ = { - std::size_t(-1), std::size_t(-1), std::size_t(-1)}; + static_cast(-1), static_cast(-1), + static_cast(-1)}; return thread_nums_tss_; } } // namespace diff --git a/libs/core/threading_base/src/thread_pool_base.cpp b/libs/core/threading_base/src/thread_pool_base.cpp index 6897a1561a4d..d6f1812c5595 100644 --- a/libs/core/threading_base/src/thread_pool_base.cpp +++ b/libs/core/threading_base/src/thread_pool_base.cpp @@ -1,15 +1,11 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // // 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) #include -#include -#include #include -#include -#include #include #include #include @@ -19,10 +15,7 @@ #include #include #include -#include #include -#include -#include namespace hpx::threads { @@ -43,11 +36,11 @@ namespace hpx::threads { auto const& topo = create_topology(); auto const sched = get_scheduler(); - mask_type used_processing_units = mask_type(); + auto used_processing_units = mask_type(); threads::resize(used_processing_units, static_cast(hardware_concurrency())); - std::size_t max_cores = get_os_thread_count(); + std::size_t const max_cores = get_os_thread_count(); for (std::size_t thread_num = 0; thread_num != max_cores && num_cores != 0; ++thread_num) { @@ -90,7 +83,7 @@ namespace hpx::threads { hwloc_bitmap_ptr thread_pool_base::get_numa_domain_bitmap() const { auto const& topo = create_topology(); - mask_type used_processing_units = get_used_processing_units(); + mask_type const used_processing_units = get_used_processing_units(); return topo.cpuset_to_nodeset(used_processing_units); } @@ -115,8 +108,9 @@ namespace hpx::threads { void thread_pool_base::init_pool_time_scale() { // scale timestamps to nanoseconds - std::uint64_t base_timestamp = util::hardware::timestamp(); - std::uint64_t base_time = hpx::chrono::high_resolution_clock::now(); + std::uint64_t const base_timestamp = util::hardware::timestamp(); + std::uint64_t const base_time = + hpx::chrono::high_resolution_clock::now(); std::uint64_t curr_timestamp = util::hardware::timestamp(); std::uint64_t curr_time = hpx::chrono::high_resolution_clock::now(); @@ -128,8 +122,8 @@ namespace hpx::threads { if (curr_timestamp - base_timestamp != 0) { - timestamp_scale_ = double(curr_time - base_time) / - double(curr_timestamp - base_timestamp); + timestamp_scale_ = static_cast(curr_time - base_time) / + static_cast(curr_timestamp - base_timestamp); } } @@ -142,7 +136,7 @@ namespace hpx::threads { std::ostream& operator<<( std::ostream& os, thread_pool_base const& thread_pool) { - auto id = thread_pool.get_pool_id(); + auto const id = thread_pool.get_pool_id(); os << id.name() << "(" << static_cast(id.index()) << ")"; return os; diff --git a/libs/core/threadmanager/include/hpx/modules/threadmanager.hpp b/libs/core/threadmanager/include/hpx/modules/threadmanager.hpp index 6ab66fa3954f..4f9317dd2bb9 100644 --- a/libs/core/threadmanager/include/hpx/modules/threadmanager.hpp +++ b/libs/core/threadmanager/include/hpx/modules/threadmanager.hpp @@ -223,7 +223,8 @@ namespace hpx { namespace threads { /// raised. The exception will be routed through the notifier and the /// scheduler (which will result in it being passed to the runtime /// object, which in turn will report it to the console, etc.). - void report_error(std::size_t num_thread, std::exception_ptr const& e) + void report_error( + std::size_t num_thread, std::exception_ptr const& e) const { // propagate the error reporting to all pools, which in turn // will propagate to schedulers diff --git a/libs/core/topology/include/hpx/topology/topology.hpp b/libs/core/topology/include/hpx/topology/topology.hpp index 368afc228059..b88ea2ae96da 100644 --- a/libs/core/topology/include/hpx/topology/topology.hpp +++ b/libs/core/topology/include/hpx/topology/topology.hpp @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2007-2017 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon // Copyright (c) 2012-2013 Thomas Heller // @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -29,7 +28,7 @@ #error On Intel Xeon/Phi coprocessors HPX cannot be use with a HWLOC version earlier than V1.6. #endif -namespace hpx { namespace threads { +namespace hpx::threads { struct hpx_hwloc_bitmap_wrapper { @@ -42,7 +41,7 @@ namespace hpx { namespace threads { } explicit hpx_hwloc_bitmap_wrapper(void* bmp) noexcept - : bmp_(reinterpret_cast(bmp)) + : bmp_(static_cast(bmp)) { } @@ -69,7 +68,7 @@ namespace hpx { namespace threads { return bmp_; } - // stringify the bitmp using hwloc + // stringify the bitmap using hwloc friend HPX_CORE_EXPORT std::ostream& operator<<( std::ostream& os, hpx_hwloc_bitmap_wrapper const* bmp); @@ -102,16 +101,23 @@ namespace hpx { namespace threads { struct HPX_CORE_EXPORT topology { topology(); + + topology(topology const&) = delete; + topology(topology&&) = delete; + topology& operator=(topology const&) = delete; + topology& operator=(topology&&) = delete; + ~topology(); /// \brief Return the Socket number of the processing unit the /// given thread is running on. /// + /// \param num_thread [in] /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. - std::size_t get_socket_number( - std::size_t num_thread, error_code& /*ec*/ = throws) const noexcept + std::size_t get_socket_number(std::size_t num_thread, + [[maybe_unused]] error_code& ec = throws) const noexcept { return socket_numbers_[num_thread % num_of_pus_]; } @@ -119,11 +125,12 @@ namespace hpx { namespace threads { /// \brief Return the NUMA node number of the processing unit the /// given thread is running on. /// + /// \param num_thread [in] /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. - std::size_t get_numa_node_number( - std::size_t num_thread, error_code& /*ec*/ = throws) const noexcept + std::size_t get_numa_node_number(std::size_t num_thread, + [[maybe_unused]] error_code& ec = throws) const noexcept { return numa_node_numbers_[num_thread % num_of_pus_]; } @@ -154,6 +161,7 @@ namespace hpx { namespace threads { /// processing unit available to the given thread inside /// the socket it is running on. /// + /// \param num_thread [in] /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. @@ -164,25 +172,18 @@ namespace hpx { namespace threads { /// processing unit available to the given thread inside /// the NUMA domain it is running on. /// + /// \param num_thread [in] /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. mask_cref_type get_numa_node_affinity_mask( std::size_t num_thread, error_code& ec = throws) const; - /// \brief Return a bit mask where each set bit corresponds to a - /// processing unit associated with the given NUMA node. - /// - /// \param ec [in,out] this represents the error status on exit, - /// if this is pre-initialized to \a hpx#throws - /// the function will throw on error instead. - mask_type get_numa_node_affinity_mask_from_numa_node( - std::size_t num_node) const; - /// \brief Return a bit mask where each set bit corresponds to a /// processing unit available to the given thread inside /// the core it is running on. /// + /// \param num_thread [in] /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. @@ -192,6 +193,7 @@ namespace hpx { namespace threads { /// \brief Return a bit mask where each set bit corresponds to a /// processing unit available to the given thread. /// + /// \param num_thread [in] /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. @@ -202,6 +204,7 @@ namespace hpx { namespace threads { /// thread. Each set bit corresponds to a processing unit the /// thread will be allowed to run on. /// + /// \param mask [in] /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. @@ -215,13 +218,14 @@ namespace hpx { namespace threads { /// processing unit co-located with the memory the given /// address is currently allocated on. /// + /// \param lva [in] /// \param ec [in,out] this represents the error status on exit, /// if this is pre-initialized to \a hpx#throws /// the function will throw on error instead. mask_type get_thread_affinity_mask_from_lva( void const* lva, error_code& ec = throws) const; - /// \brief Prints the \param m to os in a human readable form + /// \brief Prints the given mask \a m to os in a human readable form void print_affinity_mask(std::ostream& os, std::size_t num_thread, mask_cref_type m, std::string const& pool_name) const; @@ -269,14 +273,14 @@ namespace hpx { namespace threads { error_code& ec = throws) const; /// Return the size of the cache associated with the given mask. - std::size_t get_cache_size(mask_type mask, int level) const; + std::size_t get_cache_size(mask_cref_type mask, int level) const; mask_type get_cpubind_mask(error_code& ec = throws) const; mask_type get_cpubind_mask( std::thread& handle, error_code& ec = throws) const; /// convert a cpu mask into a numa node mask in hwloc bitmap form - hwloc_bitmap_ptr cpuset_to_nodeset(mask_cref_type cpuset) const; + hwloc_bitmap_ptr cpuset_to_nodeset(mask_cref_type mask) const; void write_to_log() const; @@ -286,7 +290,7 @@ namespace hpx { namespace threads { /// allocate memory with binding to a numa node set as /// specified by the policy and flags (see hwloc docs) - void* allocate_membind(std::size_t len, hwloc_bitmap_ptr bitmap, + void* allocate_membind(std::size_t len, const hwloc_bitmap_ptr& bitmap, hpx_hwloc_membind_policy policy, int flags) const; threads::mask_type get_area_membind_nodeset( @@ -300,10 +304,10 @@ namespace hpx { namespace threads { /// Free memory that was previously allocated by allocate void deallocate(void* addr, std::size_t len) const noexcept; - void print_vector( - std::ostream& os, std::vector const& v) const; - void print_mask_vector( - std::ostream& os, std::vector const& v) const; + static void print_vector( + std::ostream& os, std::vector const& v); + static void print_mask_vector( + std::ostream& os, std::vector const& v); void print_hwloc(std::ostream&) const; mask_type init_socket_affinity_mask_from_socket( @@ -327,16 +331,16 @@ namespace hpx { namespace threads { friend std::size_t get_memory_page_size(); std::size_t init_node_number( - std::size_t num_thread, hwloc_obj_type_t type); + std::size_t num_thread, hwloc_obj_type_t type) const; - std::size_t init_socket_number(std::size_t num_thread) + std::size_t init_socket_number(std::size_t num_thread) const { return init_node_number(num_thread, HWLOC_OBJ_SOCKET); } - std::size_t init_numa_node_number(std::size_t num_thread); + std::size_t init_numa_node_number(std::size_t num_thread) const; - std::size_t init_core_number(std::size_t num_thread) + std::size_t init_core_number(std::size_t num_thread) const { return init_node_number( num_thread, use_pus_as_cores_ ? HWLOC_OBJ_PU : HWLOC_OBJ_CORE); @@ -366,16 +370,17 @@ namespace hpx { namespace threads { mask_type init_core_affinity_mask(std::size_t num_thread) const { - mask_type default_mask = numa_node_affinity_masks_[num_thread]; + mask_type const default_mask = + numa_node_affinity_masks_[num_thread]; return init_core_affinity_mask_from_core( get_core_number(num_thread), default_mask); } void init_num_of_pus(); - hwloc_obj_t get_pu_obj(std::size_t num_core) const; + hwloc_obj_t get_pu_obj(std::size_t num_pu) const; - hwloc_topology_t topo; + hwloc_topology_t topo = nullptr; // We need to define a constant pu offset. // This is mainly to skip the first Core on the Xeon Phi @@ -388,8 +393,8 @@ namespace hpx { namespace threads { static constexpr std::size_t core_offset = 1; #endif - std::size_t num_of_pus_; - bool use_pus_as_cores_; + std::size_t num_of_pus_ = 0; + bool use_pus_as_cores_ = false; using mutex_type = hpx::util::spinlock; mutable mutex_type topo_mtx; @@ -411,7 +416,7 @@ namespace hpx { namespace threads { // For example, core_affinity_masks[0] is a bitmask, where the // elements = 1 indicate the PUs that belong to the core on which // PU #0 (zero-based index) lies. - mask_type machine_affinity_mask_; + mask_type machine_affinity_mask_{}; std::vector socket_affinity_masks_; std::vector numa_node_affinity_masks_; std::vector core_affinity_masks_; @@ -430,4 +435,4 @@ namespace hpx { namespace threads { { return hpx::threads::topology::memory_page_size_; } -}} // namespace hpx::threads +} // namespace hpx::threads diff --git a/libs/core/topology/src/topology.cpp b/libs/core/topology/src/topology.cpp index 343917c234a3..c050e4b36b4b 100644 --- a/libs/core/topology/src/topology.cpp +++ b/libs/core/topology/src/topology.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon // Copyright (c) 2012-2013 Thomas Heller // @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -59,7 +58,7 @@ namespace hpx::threads::detail { { try { - threads::topology& top = threads::create_topology(); + threads::topology const& top = threads::create_topology(); return top.get_number_of_pus(); } catch (...) @@ -166,7 +165,7 @@ namespace hpx::threads { // as the first NUMA domain is likely to have the PCI controllers etc. mask_cref_type machine_mask = this->get_numa_node_affinity_mask(0, ec); if (ec || !any(machine_mask)) - return mask_type(); + return {}; if (&ec != &throws) ec = make_success_code(); @@ -176,9 +175,8 @@ namespace hpx::threads { return (!any(res)) ? machine_mask : res; } - bool topology::reduce_thread_priority(error_code& ec) const + bool topology::reduce_thread_priority([[maybe_unused]] error_code& ec) const { - HPX_UNUSED(ec); #ifdef HPX_HAVE_NICE_THREADLEVEL #if defined(__linux__) && !defined(__ANDROID__) && !defined(__bgq__) pid_t tid; @@ -215,9 +213,6 @@ namespace hpx::threads { #endif topology::topology() - : topo(nullptr) - , use_pus_as_cores_(false) - , machine_affinity_mask_(0) { int err = hwloc_topology_init(&topo); if (err != 0) @@ -381,7 +376,7 @@ namespace hpx::threads { HPX_THROWS_IF(ec, hpx::error::no_success, "topology::hwloc_get_nobjs_by_type", "Failed to get number of cores"); - return std::size_t(-1); + return static_cast(-1); } use_pus = true; } @@ -394,13 +389,14 @@ namespace hpx::threads { topo, HWLOC_OBJ_CORE, static_cast(num_core)); num_pu %= core_obj->arity; //-V101 //-V104 - return std::size_t(core_obj->children[num_pu]->logical_index); + return static_cast( + core_obj->children[num_pu]->logical_index); } core_obj = hwloc_get_obj_by_type( topo, HWLOC_OBJ_PU, static_cast(num_core)); - return std::size_t(core_obj->logical_index); + return static_cast(core_obj->logical_index); } /////////////////////////////////////////////////////////////////////////// @@ -416,9 +412,8 @@ namespace hpx::threads { mask_cref_type topology::get_socket_affinity_mask( std::size_t num_thread, error_code& ec) const { - std::size_t num_pu = num_thread % num_of_pus_; - - if (num_pu < socket_affinity_masks_.size()) + if (std::size_t const num_pu = num_thread % num_of_pus_; + num_pu < socket_affinity_masks_.size()) { if (&ec != &throws) ec = make_success_code(); @@ -435,9 +430,8 @@ namespace hpx::threads { mask_cref_type topology::get_numa_node_affinity_mask( std::size_t num_thread, error_code& ec) const { - std::size_t num_pu = num_thread % num_of_pus_; - - if (num_pu < numa_node_affinity_masks_.size()) + if (std::size_t const num_pu = num_thread % num_of_pus_; + num_pu < numa_node_affinity_masks_.size()) { if (&ec != &throws) ec = make_success_code(); @@ -454,9 +448,8 @@ namespace hpx::threads { mask_cref_type topology::get_core_affinity_mask( std::size_t num_thread, error_code& ec) const { - std::size_t num_pu = num_thread % num_of_pus_; - - if (num_pu < core_affinity_masks_.size()) + if (std::size_t const num_pu = num_thread % num_of_pus_; + num_pu < core_affinity_masks_.size()) { if (&ec != &throws) ec = make_success_code(); @@ -473,9 +466,8 @@ namespace hpx::threads { mask_cref_type topology::get_thread_affinity_mask( std::size_t num_thread, error_code& ec) const { - std::size_t num_pu = num_thread % num_of_pus_; - - if (num_pu < thread_affinity_masks_.size()) + if (std::size_t const num_pu = num_thread % num_of_pus_; + num_pu < thread_affinity_masks_.size()) { if (&ec != &throws) ec = make_success_code(); @@ -495,7 +487,7 @@ namespace hpx::threads { { #if !defined(__APPLE__) // setting thread affinities is not supported by OSX - hwloc_cpuset_t cpuset = hwloc_bitmap_alloc(); + hwloc_cpuset_t const cpuset = hwloc_bitmap_alloc(); int const pu_depth = hwloc_get_type_or_below_depth(topo, HWLOC_OBJ_PU); @@ -503,8 +495,8 @@ namespace hpx::threads { { if (test(mask, i)) { - hwloc_obj_t const pu_obj = - hwloc_get_obj_by_depth(topo, pu_depth, unsigned(i)); + hwloc_obj_t const pu_obj = hwloc_get_obj_by_depth( + topo, pu_depth, static_cast(i)); HPX_ASSERT(i == detail::get_index(pu_obj)); hwloc_bitmap_set( cpuset, static_cast(pu_obj->os_index)); @@ -519,8 +511,7 @@ namespace hpx::threads { // Strict binding not supported or failed, try weak binding. if (hwloc_set_cpubind(topo, cpuset, HWLOC_CPUBIND_THREAD)) { - std::unique_ptr buffer = - std::make_unique(1024); + auto const buffer = std::make_unique(1024); hwloc_bitmap_snprintf(buffer.get(), 1024, cpuset); hwloc_bitmap_free(cpuset); @@ -554,65 +545,67 @@ namespace hpx::threads { ec = make_success_code(); hwloc_membind_policy_t policy = ::HWLOC_MEMBIND_DEFAULT; - hwloc_nodeset_t nodeset = hwloc_bitmap_alloc(); { + hwloc_nodeset_t nodeset = hwloc_bitmap_alloc(); std::unique_lock lk(topo_mtx); - int ret = #if HWLOC_API_VERSION >= 0x00010b06 - hwloc_get_area_membind( - topo, lva, 1, nodeset, &policy, HWLOC_MEMBIND_BYNODESET); + int const ret = hwloc_get_area_membind( + topo, lva, 1, nodeset, &policy, HWLOC_MEMBIND_BYNODESET); #else - hwloc_get_area_membind_nodeset( - topo, lva, 1, nodeset, &policy, 0); + int const ret = hwloc_get_area_membind_nodeset( + topo, lva, 1, nodeset, &policy, 0); #endif if (-1 != ret) { - hwloc_cpuset_t cpuset = hwloc_bitmap_alloc(); + hwloc_cpuset_t const cpuset = hwloc_bitmap_alloc(); hwloc_cpuset_from_nodeset(topo, cpuset, nodeset); lk.unlock(); hwloc_bitmap_free(nodeset); - mask_type mask = mask_type(); + auto mask = mask_type(); resize(mask, get_number_of_pus()); int const pu_depth = hwloc_get_type_or_below_depth(topo, HWLOC_OBJ_PU); - for (unsigned int i = 0; std::size_t(i) != num_of_pus_; ++i) + for (unsigned int i = 0; + static_cast(i) != num_of_pus_; ++i) { hwloc_obj_t const pu_obj = hwloc_get_obj_by_depth(topo, pu_depth, i); - unsigned idx = static_cast(pu_obj->os_index); - if (hwloc_bitmap_isset(cpuset, idx) != 0) + + if (auto const idx = + static_cast(pu_obj->os_index); + hwloc_bitmap_isset(cpuset, idx) != 0) + { set(mask, detail::get_index(pu_obj)); + } } hwloc_bitmap_free(cpuset); return mask; } - else - { - std::string errstr = std::strerror(errno); - lk.unlock(); - HPX_THROW_EXCEPTION(hpx::error::no_success, - "topology::get_thread_affinity_mask_from_lva", - "failed calling 'hwloc_get_area_membind_nodeset', " - "reported error: {}", - errstr); - } + std::string const errstr = std::strerror(errno); + + lk.unlock(); + HPX_THROW_EXCEPTION(hpx::error::no_success, + "topology::get_thread_affinity_mask_from_lva", + "failed calling 'hwloc_get_area_membind_nodeset', " + "reported error: {}", + errstr); } } - std::size_t topology::init_numa_node_number(std::size_t num_thread) + std::size_t topology::init_numa_node_number(std::size_t num_thread) const { #if HWLOC_API_VERSION >= 0x00020000 - if (std::size_t(-1) == num_thread) - return std::size_t(-1); + if (static_cast(-1) == num_thread) + return static_cast(-1); - std::size_t num_pu = (num_thread + pu_offset) % num_of_pus_; + std::size_t const num_pu = (num_thread + pu_offset) % num_of_pus_; hwloc_obj_t obj; { @@ -628,7 +621,7 @@ namespace hpx::threads { { if (hwloc_bitmap_intersects(tmp->cpuset, obj->cpuset)) { - /* tmp matches, use it */ + // tmp matches, use it return static_cast(tmp->logical_index); } } @@ -639,12 +632,12 @@ namespace hpx::threads { } std::size_t topology::init_node_number( - std::size_t num_thread, hwloc_obj_type_t type) + std::size_t num_thread, hwloc_obj_type_t type) const { - if (std::size_t(-1) == num_thread) - return std::size_t(-1); + if (static_cast(-1) == num_thread) + return static_cast(-1); - std::size_t num_pu = (num_thread + pu_offset) % num_of_pus_; + std::size_t const num_pu = (num_thread + pu_offset) % num_of_pus_; { hwloc_obj_t obj; @@ -739,28 +732,26 @@ namespace hpx::threads { std::size_t topology::get_number_of_sockets() const { - int nobjs = hwloc_get_nbobjs_by_type(topo, HWLOC_OBJ_SOCKET); + int const nobjs = hwloc_get_nbobjs_by_type(topo, HWLOC_OBJ_SOCKET); if (0 > nobjs) { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::get_number_of_sockets", "hwloc_get_nbobjs_by_type failed"); - return std::size_t(nobjs); } - return std::size_t(nobjs); + return static_cast(nobjs); } std::size_t topology::get_number_of_numa_nodes() const { - int nobjs = hwloc_get_nbobjs_by_type(topo, HWLOC_OBJ_NUMANODE); + int const nobjs = hwloc_get_nbobjs_by_type(topo, HWLOC_OBJ_NUMANODE); if (0 > nobjs) { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::get_number_of_numa_nodes", "hwloc_get_nbobjs_by_type failed"); - return std::size_t(nobjs); } - return std::size_t(nobjs); + return static_cast(nobjs); } std::size_t topology::get_number_of_cores() const @@ -773,7 +764,6 @@ namespace hpx::threads { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::get_number_of_cores", "hwloc_get_nbobjs_by_type(HWLOC_OBJ_CORE) failed"); - return std::size_t(nobjs); } else if (0 == nobjs) { @@ -785,7 +775,6 @@ namespace hpx::threads { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::get_number_of_cores", "hwloc_get_nbobjs_by_type(HWLOC_OBJ_PU) failed"); - return std::size_t(nobjs); } } @@ -796,15 +785,14 @@ namespace hpx::threads { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::get_number_of_cores", "hwloc_get_nbobjs_by_type reports zero cores/pus"); - return std::size_t(nobjs); } - return std::size_t(nobjs); + return static_cast(nobjs); } std::size_t topology::get_number_of_socket_pus(std::size_t num_socket) const { - hwloc_obj_t socket_obj = nullptr; + hwloc_obj_t socket_obj; { std::unique_lock lk(topo_mtx); @@ -815,7 +803,7 @@ namespace hpx::threads { if (socket_obj) { HPX_ASSERT(num_socket == detail::get_index(socket_obj)); - std::size_t pu_count = 0; + constexpr std::size_t pu_count = 0; return extract_node_count(socket_obj, HWLOC_OBJ_PU, pu_count); } @@ -825,7 +813,7 @@ namespace hpx::threads { std::size_t topology::get_number_of_numa_node_pus( std::size_t numa_node) const { - hwloc_obj_t node_obj = nullptr; + hwloc_obj_t node_obj; { std::unique_lock lk(topo_mtx); @@ -836,8 +824,9 @@ namespace hpx::threads { if (node_obj) { HPX_ASSERT(numa_node == detail::get_index(node_obj)); - std::size_t pu_count = 0; node_obj = detail::adjust_node_obj(node_obj); + + constexpr std::size_t pu_count = 0; return extract_node_count(node_obj, HWLOC_OBJ_PU, pu_count); } @@ -846,17 +835,17 @@ namespace hpx::threads { std::size_t topology::get_number_of_core_pus_locked(std::size_t core) const { - hwloc_obj_t core_obj = hwloc_get_obj_by_type( + hwloc_obj_t const core_obj = hwloc_get_obj_by_type( topo, HWLOC_OBJ_CORE, static_cast(core)); if (!use_pus_as_cores_ && core_obj) { HPX_ASSERT(core == detail::get_index(core_obj)); - std::size_t pu_count = 0; + constexpr std::size_t pu_count = 0; return extract_node_count_locked(core_obj, HWLOC_OBJ_PU, pu_count); } - return std::size_t(1); + return static_cast(1); } std::size_t topology::get_number_of_core_pus(std::size_t core) const @@ -868,7 +857,7 @@ namespace hpx::threads { std::size_t topology::get_number_of_socket_cores( std::size_t num_socket) const { - hwloc_obj_t socket_obj = nullptr; + hwloc_obj_t socket_obj; { std::unique_lock lk(topo_mtx); @@ -879,7 +868,7 @@ namespace hpx::threads { if (socket_obj) { HPX_ASSERT(num_socket == detail::get_index(socket_obj)); - std::size_t pu_count = 0; + constexpr std::size_t pu_count = 0; return extract_node_count(socket_obj, use_pus_as_cores_ ? HWLOC_OBJ_PU : HWLOC_OBJ_CORE, pu_count); } @@ -890,7 +879,7 @@ namespace hpx::threads { std::size_t topology::get_number_of_numa_node_cores( std::size_t numa_node) const { - hwloc_obj_t node_obj = nullptr; + hwloc_obj_t node_obj; { std::unique_lock lk(topo_mtx); node_obj = hwloc_get_obj_by_type( @@ -900,8 +889,9 @@ namespace hpx::threads { if (node_obj) { HPX_ASSERT(numa_node == detail::get_index(node_obj)); - std::size_t pu_count = 0; node_obj = detail::adjust_node_obj(node_obj); + + constexpr std::size_t pu_count = 0; return extract_node_count(node_obj, use_pus_as_cores_ ? HWLOC_OBJ_PU : HWLOC_OBJ_CORE, pu_count); } @@ -972,14 +962,13 @@ namespace hpx::threads { for (std::size_t i = 0; i != num_of_pus_; ++i) { - hwloc_obj_t obj = - hwloc_get_obj_by_type(topo, HWLOC_OBJ_PU, unsigned(i)); + hwloc_obj_t obj = hwloc_get_obj_by_type( + topo, HWLOC_OBJ_PU, static_cast(i)); if (!obj) { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::print_affinity_mask", "object not found"); - return; } if (!test(m, detail::get_index(obj))) //-V106 @@ -1011,7 +1000,7 @@ namespace hpx::threads { mask_type topology::init_machine_affinity_mask() const { - mask_type machine_affinity_mask = mask_type(); + auto machine_affinity_mask = mask_type(); resize(machine_affinity_mask, get_number_of_pus()); hwloc_obj_t machine_obj; @@ -1019,6 +1008,7 @@ namespace hpx::threads { std::unique_lock lk(topo_mtx); machine_obj = hwloc_get_obj_by_type(topo, HWLOC_OBJ_MACHINE, 0); } + if (machine_obj) { extract_node_mask(machine_obj, machine_affinity_mask); @@ -1028,7 +1018,6 @@ namespace hpx::threads { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::init_machine_affinity_mask", "failed to initialize machine affinity mask"); - return empty_mask; } mask_type topology::init_socket_affinity_mask_from_socket( @@ -1036,10 +1025,11 @@ namespace hpx::threads { { // If we have only one or no socket, the socket affinity mask // spans all processors - if (std::size_t(-1) == num_socket) + if (static_cast(-1) == num_socket) return machine_affinity_mask_; - hwloc_obj_t socket_obj = nullptr; + hwloc_obj_t socket_obj; + { std::unique_lock lk(topo_mtx); socket_obj = hwloc_get_obj_by_type( @@ -1050,7 +1040,7 @@ namespace hpx::threads { { HPX_ASSERT(num_socket == detail::get_index(socket_obj)); - mask_type socket_affinity_mask = mask_type(); + auto socket_affinity_mask = mask_type(); resize(socket_affinity_mask, get_number_of_pus()); extract_node_mask(socket_obj, socket_affinity_mask); @@ -1065,12 +1055,13 @@ namespace hpx::threads { { // If we have only one or no NUMA domain, the NUMA affinity mask // spans all processors - if (std::size_t(-1) == numa_node) + if (static_cast(-1) == numa_node) { return machine_affinity_mask_; } - hwloc_obj_t numa_node_obj = nullptr; + hwloc_obj_t numa_node_obj; + { std::unique_lock lk(topo_mtx); numa_node_obj = hwloc_get_obj_by_type( @@ -1080,7 +1071,7 @@ namespace hpx::threads { if (numa_node_obj) { HPX_ASSERT(numa_node == detail::get_index(numa_node_obj)); - mask_type node_affinity_mask = mask_type(); + auto node_affinity_mask = mask_type(); resize(node_affinity_mask, get_number_of_pus()); numa_node_obj = detail::adjust_node_obj(numa_node_obj); @@ -1094,14 +1085,14 @@ namespace hpx::threads { mask_type topology::init_core_affinity_mask_from_core( std::size_t core, mask_cref_type default_mask) const { - if (std::size_t(-1) == core) + if (static_cast(-1) == core) { return default_mask; } - hwloc_obj_t core_obj = nullptr; - - std::size_t num_core = (core + core_offset) % get_number_of_cores(); + hwloc_obj_t core_obj; + std::size_t const num_core = + (core + core_offset) % get_number_of_cores(); { std::unique_lock lk(topo_mtx); @@ -1125,14 +1116,13 @@ namespace hpx::threads { mask_type topology::init_thread_affinity_mask(std::size_t num_thread) const { - if (std::size_t(-1) == num_thread) + if (static_cast(-1) == num_thread) { return get_core_affinity_mask(num_thread); } - std::size_t num_pu = (num_thread + pu_offset) % num_of_pus_; - - hwloc_obj_t obj = nullptr; + std::size_t const num_pu = (num_thread + pu_offset) % num_of_pus_; + hwloc_obj_t obj; { std::unique_lock lk(topo_mtx); @@ -1146,7 +1136,7 @@ namespace hpx::threads { } HPX_ASSERT(num_pu == detail::get_index(obj)); - mask_type mask = mask_type(); + auto mask = mask_type(); resize(mask, get_number_of_pus()); set(mask, detail::get_index(obj)); //-V106 @@ -1157,11 +1147,11 @@ namespace hpx::threads { mask_type topology::init_thread_affinity_mask( std::size_t num_core, std::size_t num_pu) const { - hwloc_obj_t obj = nullptr; + hwloc_obj_t obj; { std::unique_lock lk(topo_mtx); - int num_cores = hwloc_get_nbobjs_by_type( + int const num_cores = hwloc_get_nbobjs_by_type( topo, use_pus_as_cores_ ? HWLOC_OBJ_PU : HWLOC_OBJ_CORE); // If num_cores is smaller 0, we have an error, it should never be @@ -1172,10 +1162,10 @@ namespace hpx::threads { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::init_thread_affinity_mask", "hwloc_get_nbobjs_by_type failed"); - return empty_mask; } - num_core = (num_core + core_offset) % std::size_t(num_cores); + num_core = + (num_core + core_offset) % static_cast(num_cores); obj = hwloc_get_obj_by_type(topo, use_pus_as_cores_ ? HWLOC_OBJ_PU : HWLOC_OBJ_CORE, static_cast(num_core)); @@ -1186,7 +1176,7 @@ namespace hpx::threads { HPX_ASSERT(num_core == detail::get_index(obj)); - mask_type mask = mask_type(); + auto mask = mask_type(); resize(mask, get_number_of_pus()); if (use_pus_as_cores_) @@ -1218,8 +1208,9 @@ namespace hpx::threads { use_pus_as_cores_ = true; } - int num_of_pus = hwloc_get_nbobjs_by_type(topo, HWLOC_OBJ_PU); - if (num_of_pus > 0) + if (int const num_of_pus = + hwloc_get_nbobjs_by_type(topo, HWLOC_OBJ_PU); + num_of_pus > 0) { num_of_pus_ = static_cast(num_of_pus); } @@ -1234,9 +1225,9 @@ namespace hpx::threads { /////////////////////////////////////////////////////////////////////////// mask_type topology::get_cpubind_mask(error_code& ec) const { - hwloc_cpuset_t cpuset = hwloc_bitmap_alloc(); + hwloc_cpuset_t const cpuset = hwloc_bitmap_alloc(); - mask_type mask = mask_type(); + auto mask = mask_type(); resize(mask, get_number_of_pus()); #if !defined(__APPLE__) @@ -1257,7 +1248,7 @@ namespace hpx::threads { { hwloc_obj_t const pu_obj = hwloc_get_obj_by_depth(topo, pu_depth, i); - unsigned idx = static_cast(pu_obj->os_index); + auto const idx = static_cast(pu_obj->os_index); if (hwloc_bitmap_isset(cpuset, idx) != 0) set(mask, detail::get_index(pu_obj)); } @@ -1277,7 +1268,7 @@ namespace hpx::threads { { hwloc_cpuset_t cpuset = hwloc_bitmap_alloc(); - mask_type mask = mask_type(); + auto mask = mask_type(); resize(mask, get_number_of_pus()); { @@ -1304,7 +1295,7 @@ namespace hpx::threads { { hwloc_obj_t const pu_obj = hwloc_get_obj_by_depth(topo, pu_depth, i); - unsigned idx = static_cast(pu_obj->os_index); + auto const idx = static_cast(pu_obj->os_index); if (hwloc_bitmap_isset(cpuset, idx) != 0) set(mask, detail::get_index(pu_obj)); } @@ -1329,13 +1320,14 @@ namespace hpx::threads { /////////////////////////////////////////////////////////////////////////// /// Allocate some memory on NUMA memory nodes specified by nodeset /// as specified by the hwloc hwloc_alloc_membind_nodeset call - void* topology::allocate_membind(std::size_t len, hwloc_bitmap_ptr bitmap, - hpx_hwloc_membind_policy policy, int flags) const + void* topology::allocate_membind(std::size_t len, + hwloc_bitmap_ptr const& bitmap, hpx_hwloc_membind_policy policy, + int flags) const { return #if HWLOC_API_VERSION >= 0x00010b06 hwloc_alloc_membind(topo, len, bitmap->get_bmp(), - hwloc_membind_policy_t(policy), + static_cast(policy), flags | HWLOC_MEMBIND_BYNODESET); #else hwloc_alloc_membind_nodeset(topo, len, bitmap->get_bmp(), @@ -1348,13 +1340,13 @@ namespace hpx::threads { { #if !defined(__APPLE__) hwloc_membind_policy_t policy = ::HWLOC_MEMBIND_BIND; - hwloc_nodeset_t ns = reinterpret_cast(nodeset); + auto ns = static_cast(nodeset); - int ret = #if HWLOC_API_VERSION >= 0x00010b06 - hwloc_set_area_membind( - topo, addr, len, ns, policy, HWLOC_MEMBIND_BYNODESET); + int ret = hwloc_set_area_membind( + topo, addr, len, ns, policy, HWLOC_MEMBIND_BYNODESET); #else + int ret = hwloc_set_area_membind_nodeset(topo, addr, len, ns, policy, 0); #endif @@ -1363,12 +1355,12 @@ namespace hpx::threads { std::string msg = std::strerror(errno); if (errno == ENOSYS) msg = "the action is not supported"; - if (errno == EXDEV) + else if (errno == EXDEV) msg = "the binding cannot be enforced"; + HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::set_area_membind_nodeset", "hwloc_set_area_membind_nodeset failed : {}", msg); - return false; } #endif return true; @@ -1391,8 +1383,7 @@ namespace hpx::threads { } hwloc_membind_policy_t policy; - hwloc_nodeset_t ns = - reinterpret_cast(nodeset.get_bmp()); + auto ns = reinterpret_cast(nodeset.get_bmp()); #if HWLOC_API_VERSION >= 0x00010b06 if (hwloc_get_area_membind( @@ -1405,7 +1396,6 @@ namespace hpx::threads { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::get_area_membind_nodeset", "hwloc_get_area_membind_nodeset failed"); - return bitmap_to_mask(ns, HWLOC_OBJ_MACHINE); } return bitmap_to_mask(ns, HWLOC_OBJ_NUMANODE); @@ -1421,10 +1411,9 @@ namespace hpx::threads { } // - hwloc_nodeset_t ns = - reinterpret_cast(nodeset.get_bmp()); + auto const ns = reinterpret_cast(nodeset.get_bmp()); - int ret = hwloc_get_area_memlocation( + int const ret = hwloc_get_area_memlocation( topo, addr, 1, ns, HWLOC_MEMBIND_BYNODESET); if (ret < 0) { @@ -1436,11 +1425,10 @@ namespace hpx::threads { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "hpx::threads::topology::get_numa_domain", "hwloc_get_area_memlocation failed {}", msg); - return -1; #endif } - threads::mask_type mask = bitmap_to_mask(ns, HWLOC_OBJ_NUMANODE); + threads::mask_type const mask = bitmap_to_mask(ns, HWLOC_OBJ_NUMANODE); return static_cast(threads::find_first(mask)); #else return 0; @@ -1456,7 +1444,7 @@ namespace hpx::threads { //////////////////////////////////////////////////////////////////////////// hwloc_obj_t topology::get_pu_obj(std::size_t num_pu) const { - hwloc_obj_t pu_obj = hwloc_get_obj_by_type( + hwloc_obj_t const pu_obj = hwloc_get_obj_by_type( topo, HWLOC_OBJ_CORE, static_cast(num_pu)); if (pu_obj == nullptr) @@ -1474,7 +1462,8 @@ namespace hpx::threads { static void iterate(hwloc_bitmap_t cpuset, F&& f) { for (auto id = hwloc_bitmap_first(cpuset); - (unsigned) id != (unsigned) -1; id = hwloc_bitmap_next(cpuset, id)) + static_cast(id) != static_cast(-1); + id = hwloc_bitmap_next(cpuset, id)) { if (hwloc_bitmap_isset(cpuset, id)) { @@ -1491,7 +1480,7 @@ namespace hpx::threads { } // Return the size of the cache associated with the given cpuset. - std::size_t topology::get_cache_size(mask_type mask, int level) const + std::size_t topology::get_cache_size(mask_cref_type mask, int level) const { if (level < 1 || level > 5) { @@ -1536,12 +1525,13 @@ namespace hpx::threads { if (pu_obj == nullptr) return; - hwloc_obj_t cache_obj = + hwloc_obj_t const cache_obj = hwloc_get_ancestor_obj_by_type(topo, type, pu_obj); if (cache_obj == nullptr) return; - cache_size += std::size_t(cache_obj->attr->cache.size) / + cache_size += + static_cast(cache_obj->attr->cache.size) / num_set_bits(cache_obj->cpuset); #else // traverse up until found the requested cache level @@ -1566,7 +1556,7 @@ namespace hpx::threads { hwloc_bitmap_t topology::mask_to_bitmap( mask_cref_type mask, hwloc_obj_type_t htype) const { - hwloc_bitmap_t bitmap = hwloc_bitmap_alloc(); + hwloc_bitmap_t const bitmap = hwloc_bitmap_alloc(); hwloc_bitmap_zero(bitmap); // int const depth = hwloc_get_type_or_below_depth(topo, htype); @@ -1575,8 +1565,8 @@ namespace hpx::threads { { if (test(mask, i)) { - hwloc_obj_t const hw_obj = - hwloc_get_obj_by_depth(topo, depth, unsigned(i)); + hwloc_obj_t const hw_obj = hwloc_get_obj_by_depth( + topo, depth, static_cast(i)); HPX_ASSERT(i == detail::get_index(hw_obj)); hwloc_bitmap_set( bitmap, static_cast(hw_obj->os_index)); @@ -1589,16 +1579,17 @@ namespace hpx::threads { mask_type topology::bitmap_to_mask( hwloc_bitmap_t bitmap, hwloc_obj_type_t htype) const { - mask_type mask = mask_type(); + auto mask = mask_type(); resize(mask, get_number_of_pus()); - std::size_t num = hwloc_get_nbobjs_by_type(topo, htype); - // + std::size_t const num = hwloc_get_nbobjs_by_type(topo, htype); + int const pu_depth = hwloc_get_type_or_below_depth(topo, htype); - for (unsigned int i = 0; std::size_t(i) != num; ++i) //-V104 + for (unsigned int i = 0; static_cast(i) != num; + ++i) //-V104 { hwloc_obj_t const pu_obj = hwloc_get_obj_by_depth(topo, pu_depth, i); - unsigned idx = static_cast(pu_obj->os_index); + auto const idx = static_cast(pu_obj->os_index); if (hwloc_bitmap_isset(bitmap, idx) != 0) set(mask, detail::get_index(pu_obj)); } @@ -1607,9 +1598,9 @@ namespace hpx::threads { /////////////////////////////////////////////////////////////////////////// void topology::print_mask_vector( - std::ostream& os, std::vector const& v) const + std::ostream& os, std::vector const& v) { - std::size_t s = v.size(); + std::size_t const s = v.size(); if (s == 0) { os << "(empty)\n"; @@ -1624,9 +1615,9 @@ namespace hpx::threads { } void topology::print_vector( - std::ostream& os, std::vector const& v) const + std::ostream& os, std::vector const& v) { - std::size_t s = v.size(); + std::size_t const s = v.size(); if (s == 0) { os << "(empty)\n"; @@ -1655,6 +1646,7 @@ namespace hpx::threads { << "hardware concurrency : " << hpx::threads::hardware_concurrency() << "\n" << std::endl; + //! -------------------------------------- topology (affinity masks) os << "[HWLOC topology info] affinity masks :\n" << "machine : \n" @@ -1696,7 +1688,7 @@ namespace hpx::threads { struct hw_concurrency { hw_concurrency() -#if defined(__ANDROID__) && defined(ANDROID) +#if defined(__ANDROID__) || defined(ANDROID) : num_of_cores_(::android_getCpuCount()) #else : num_of_cores_(detail::hwloc_hardware_concurrency())