From 32aa69b5b6f313afe55a72ef4638ac0038069541 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 22 May 2023 09:26:06 -0500 Subject: [PATCH 01/72] Preparing V1.9.1 release --- CMakeLists.txt | 4 +-- docs/sphinx/releases.rst | 3 +- docs/sphinx/releases/whats_new_1_9_1.rst | 35 ++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 docs/sphinx/releases/whats_new_1_9_1.rst diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a17a011aa41..bb20bb306279 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,9 +59,9 @@ endif() # ############################################################################## set(HPX_VERSION_MAJOR 1) set(HPX_VERSION_MINOR 9) -set(HPX_VERSION_SUBMINOR 0) +set(HPX_VERSION_SUBMINOR 1) set(HPX_VERSION_DATE 20230502) -set(HPX_VERSION_TAG "") +set(HPX_VERSION_TAG "-rc1") set(HPX_VERSION "${HPX_VERSION_MAJOR}.${HPX_VERSION_MINOR}.${HPX_VERSION_SUBMINOR}" diff --git a/docs/sphinx/releases.rst b/docs/sphinx/releases.rst index 1de9f8930e91..b76bac815851 100644 --- a/docs/sphinx/releases.rst +++ b/docs/sphinx/releases.rst @@ -1,5 +1,5 @@ .. - Copyright (C) 2018-2022 STE||AR Group + Copyright (C) 2018-2023 STE||AR Group SPDX-License-Identifier: BSL-1.0 Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -17,6 +17,7 @@ List of releases .. toctree:: :maxdepth: 1 + releases/whats_new_1_9_1 releases/whats_new_1_9_0 releases/whats_new_1_8_1 releases/whats_new_1_8_0 diff --git a/docs/sphinx/releases/whats_new_1_9_1.rst b/docs/sphinx/releases/whats_new_1_9_1.rst new file mode 100644 index 000000000000..a0379f4d25c2 --- /dev/null +++ b/docs/sphinx/releases/whats_new_1_9_1.rst @@ -0,0 +1,35 @@ +.. + 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) + +.. _hpx_1_9_1: + +=========================== +|hpx| V1.9.1 (TBD) +=========================== + +General changes +=============== + +This point release fixes a couple of problems reported for the V1.9.0 release. +Most importantly, we fixed various occasional hanging during startup and shutdown +in distributed scenarios. We also added support for zero-copy serialization on +the receiving side to the TCP, MPI, and LCI parcelports. Last but not least, we +have added support for Visual Studio 2019 and gcc using MINGW on Windows. + + +Breaking changes +================ + +None + +Closed issues +============= + + +Closed pull requests +==================== + From d8b05003ea844799baa7fcad0842f3c127b01621 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Thu, 25 May 2023 16:58:27 -0500 Subject: [PATCH 02/72] Increase timeout threshold for circleci segmented algorithm tests --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5ecbcb179e03..9ee7c0e8b178 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -568,7 +568,7 @@ jobs: command: | ulimit -c unlimited ctest \ - --timeout 180 \ + --timeout 270 \ -T test \ --no-compress-output \ --output-on-failure \ From 9a6986b879c5d2252005aa86cade73db69fb1be2 Mon Sep 17 00:00:00 2001 From: dimitraka Date: Thu, 11 May 2023 17:45:15 +0200 Subject: [PATCH 03/72] Fix long tables and content --- .../manual/optimizing_hpx_applications.rst | 1313 +++++++++-------- 1 file changed, 681 insertions(+), 632 deletions(-) diff --git a/docs/sphinx/manual/optimizing_hpx_applications.rst b/docs/sphinx/manual/optimizing_hpx_applications.rst index 6fec8b13dc88..f3ec0d4c2a27 100644 --- a/docs/sphinx/manual/optimizing_hpx_applications.rst +++ b/docs/sphinx/manual/optimizing_hpx_applications.rst @@ -756,21 +756,13 @@ counters. These counters expose critical information about different modules of the runtime system. They can help determine system bottlenecks and fine-tune system and application performance. -.. list-table:: :term:`AGAS` performance counters +.. list-table:: :term:`AGAS` performance counter ``/agas/count/`` + :widths: 20 80 * * Counter type - * Counter instance formatting - * Description - * Parameters - * * ``/agas/count/`` - - .. _agas-count-agas-service: - - :ref:`??` + * ``/agas/count/`` - where: - - ```` is one of the following: + where ```` is one of the following: *primary namespace services*: ``route``, ``bind_gid``, ``resolve_gid``, ``unbind_gid``, ``increment_credit``, ``decrement_credit``, ``allocate``, @@ -786,11 +778,10 @@ system and application performance. *symbol namespace services*: ``bind``, ``resolve``, ``unbind``, ``iterate_names``, ``on_symbol_namespace_event`` + * * Counter instance formatting * ``/total`` - where: - - ```` is the name of the :term:`AGAS` service to query. + where ```` is the name of the :term:`AGAS` service to query. Currently, this value will be ``locality#0`` where ``0`` is the root :term:`locality` (the id of the locality hosting the :term:`AGAS` service). @@ -801,25 +792,22 @@ system and application performance. ``resolve``, ``unbind``, and ``iterate_names`` (only the primary and symbol :term:`AGAS` service components live on all localities, whereas all other :term:`AGAS` services are available on ``locality#0`` only). - * None + * * Description * Returns the total number of invocations of the specified :term:`AGAS` service since its creation. - * * ``/agas//count`` - - .. _agas-agas-service-category-count: - :ref:`??` +.. list-table:: :term:`AGAS` performance counter ``/agas//count`` + :widths: 20 80 - where: + * * Counter type + * ``/agas//count`` - ```` is one of the following: ``primary``, + where ```` is one of the following: ``primary``, ``locality``, ``component`` or ``symbol`` - + * * Counter instance formatting * ``/total`` - where: - - ```` is the name of the :term:`AGAS` service to query. + where ```` is the name of the :term:`AGAS` service to query. Currently, this value will be ``locality#0`` where ``0`` is the root :term:`locality` (the id of the :term:`locality` hosting the :term:`AGAS` service). Except for ````, ``primary`` or @@ -827,20 +815,42 @@ system and application performance. (only the primary and symbol :term:`AGAS` service components live on all localities, whereas all other :term:`AGAS` services are available on ``locality#0`` only). - * None + * * Description * Returns the overall total number of invocations of all :term:`AGAS` services provided by the given :term:`AGAS` service category since its creation. - * * ``agas/time/`` - .. _agas-time-agas-service: +.. list-table:: :term:`AGAS` performance counter ``/agas//count`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/agas//count`` - where: + where ```` is one of the following: ``primary``, + ``locality``, ``component`` or ``symbol`` + * * Counter instance formatting + * ``/total`` - ```` is one of the following: + where ```` is the name of the :term:`AGAS` service to query. + Currently, this value will be ``locality#0`` where ``0`` is the root + :term:`locality` (the id of the :term:`locality` hosting the :term:`AGAS` + service). Except for ````, ``primary`` or + ``symbol`` for which the value for ``*`` can be any :term:`locality` id + (only the primary and symbol :term:`AGAS` service components live on all + localities, whereas all other :term:`AGAS` services are available on + ``locality#0`` only). + * * Description + * Returns the overall total number of invocations of all :term:`AGAS` + services provided by the given :term:`AGAS` service category since its + creation. + +.. list-table:: :term:`AGAS` performance counter ``agas/time/`` + :widths: 20 80 + + * * Counter type + * ``agas/time/`` + where ```` is one of the following: *primary namespace services*: ``route``, ``bind_gid``, ``resolve_gid``, ``unbind_gid``, ``increment_credit``, ``decrement_credit``, ``allocate`` @@ -856,12 +866,10 @@ system and application performance. *symbol namespace services*: ``bind``, ``resolve``, ``unbind``, ``iterate_names``, ``on_symbol_namespace_event`` - + * * Counter instance formatting * ``/total`` - where: - - ```` is the name of the :term:`AGAS` service to query. + where ```` is the name of the :term:`AGAS` service to query. Currently, this value will be ``locality#0`` where ``0`` is the root :term:`locality` (the id of the :term:`locality` hosting the :term:`AGAS` service). @@ -872,24 +880,22 @@ system and application performance. ``resolve``, ``unbind``, and ``iterate_names`` (only the primary and symbol :term:`AGAS` service components live on all localities, whereas all other :term:`AGAS` services are available on ``locality#0`` only). - * None + * * Description * Returns the overall execution time of the specified :term:`AGAS` service since its creation (in nanoseconds). - * * ``/agas//time`` - - .. _agas-agas-service-category-time: - :ref:`??` +.. list-table:: :term:`AGAS` performance counter `/agas//time`` + :widths: 20 80 - where: + * * Counter type + * ``/agas//time`` - ```` is one of the following: ``primary``, + where ```` is one of the following: ``primary``, ``locality``, ``component`` or ``symbol`` + * * Counter instance formatting * ``/total`` - where: - - ```` is the name of the :term:`AGAS` service to query. + where ```` is the name of the :term:`AGAS` service to query. Currently, this value will be ``locality#0`` where ``0`` is the root :term:`locality` (the id of the :term:`locality` hosting the :term:`AGAS` service). Except for ``` - - * ``locality#*/total`` +.. list-table:: :term:`AGAS` performance counter ``/agas/count/entries`` + :widths: 20 80 - where: + * * Counter type + * ``/agas/count/entries`` + * * Counter instance formatting + * ``locality#*/total`` - ``*`` is the :term:`locality` id of the :term:`locality` the :term:`AGAS` - cache should be queried. The :term:`locality` id is a (zero based) number - identifying the :term:`locality`. - * None + where ``*`` is the :term:`locality` id of the :term:`locality` the + :term:`AGAS` cache should be queried. The :term:`locality` id is a (zero based) + number identifying the :term:`locality`. + * * Description * Returns the number of cache entries resident in the :term:`AGAS` cache of the specified :term:`locality` (see ````). - * * ``/agas/count/`` - .. _agas-count-cache-statistics: +.. list-table:: :term:`AGAS` performance counter ``/agas/count/`` + :widths: 20 80 - :ref:`??` - - where: + * * Counter type + * ``/agas/count/`` - ```` is one of the following: ``cache/evictions``, - ``cache/hits``, ``cache/insertions``, ``cache/misses`` + where ```` is one of the + following: ``cache/evictions``, ``cache/hits``, ``cache/insertions``, ``cache/misses`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the :term:`AGAS` + where ``*`` is the :term:`locality` id of the :term:`locality` the :term:`AGAS` cache should be queried. The :term:`locality` id is a (zero based) number - identifying the :term:`locality`. - * None + identifying the :term:`locality` + * * Description * Returns the number of cache events (evictions, hits, inserts, and misses) in the :term:`AGAS` cache of the specified :term:`locality` (see ````). - * * ``/agas/count/`` - .. _agas-count-full-cache-statistics: +.. list-table:: :term:`AGAS` performance counter ``/agas/count/`` + :widths: 20 80 - :ref:`??` - - where: + * * Counter type + * ``/agas/count/`` - ```` is one of the following: ``cache/get_entry``, + where ```` is one of the following: ``cache/get_entry``, ``cache/insert_entry``, ``cache/update_entry``, ``cache/erase_entry`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the :term:`AGAS` + where ``*`` is the :term:`locality` id of the :term:`locality` the :term:`AGAS` cache should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. - * None + * * Description * Returns the number of invocations of the specified cache API function of the :term:`AGAS` cache. - * * ``/agas/time/`` - .. _agas-time-full-cache-statistics: +.. list-table:: :term:`AGAS` performance counter ``/agas/time/`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/agas/time/`` - where: + where ```` is one of the following: - ```` is one of the following: ``cache/get_entry``, ``cache/insert_entry``, ``cache/update_entry``, ``cache/erase_entry`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the :term:`AGAS` + where ``*`` is the :term:`locality` id of the :term:`locality` the :term:`AGAS` cache should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. - * None + * * Description * Returns the overall time spent executing of the specified API function of the :term:`AGAS` cache. -.. list-table:: :term:`Parcel` layer performance counters +.. list-table:: :term:`Parcel` layer performance counter ``/data/count//`` + :widths: 20 80 * * Counter type - * Counter instance formatting - * Description - * Parameters - * * ``/data/count//`` - - .. _data-count-connection-type-operation: - - :ref:`??` + * ``/data/count//`` where: - ```` is one of the following: ``sent``, ``received`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the overall + where ``*`` is the :term:`locality` id of the :term:`locality` the overall number of transmitted bytes should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall number of raw (uncompressed) bytes sent or received (see ````, e.g. ``sent`` or ``received``) for the specified ````. @@ -1020,25 +1013,26 @@ system and application performance. ``HPX_WITH_PARCELPORT_MPI``. Please see :ref:`cmake_variables` for more details. - * None - * * ``/data/time//`` - .. _data-time-connection-type-operation: - :ref:`??` +.. list-table:: :term:`Parcel` layer performance counter ``/data/time//`` + :widths: 20 80 + + * * Counter type + * ``/data/time//`` where: ```` is one of the following: ``sent``, ``received`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the total + where ``*`` is the :term:`locality` id of the :term:`locality` the total transmission time should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the total time (in nanoseconds) between the start of each asynchronous transmission operation and the end of the corresponding operation for the specified ```` the given @@ -1056,25 +1050,25 @@ system and application performance. ``HPX_WITH_PARCELPORT_MPI``. Please see :ref:`cmake_variables` for more details. - * None - * * ``/serialize/count//`` - .. _serialize-count-connection-type-operation: +.. list-table:: :term:`Parcel` layer performance counter ``/serialize/count//`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/serialize/count//`` where: ```` is one of the following: ``sent``, ``received`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the overall + where ``*`` is the :term:`locality` id of the :term:`locality` the overall number of transmitted bytes should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall number of bytes transferred (see ````, e.g. ``sent`` or ``received`` possibly compressed) for the specified ```` by the given :term:`locality`. @@ -1091,28 +1085,30 @@ system and application performance. ``HPX_WITH_PARCELPORT_MPI``. Please see :ref:`cmake_variables` for more details. + * * Description * If the configure-time option ``-DHPX_WITH_PARCELPORT_ACTION_COUNTERS=On`` was specified, this counter allows one to specify an optional action name as its parameter. In this case the counter will report the number of bytes transmitted for the given action only. - * * ``/serialize/time//`` - .. _serialize-time-connection-type-operation: +.. list-table:: :term:`Parcel` layer performance counter ``/serialize/time//`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/serialize/time//`` where: ```` is one of the following: ``sent``, ``received`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the + where ``*`` is the :term:`locality` id of the :term:`locality` the serialization time should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall time spent performing outgoing data serialization for the specified ```` on the given :term:`locality` (see ````, e.g. ``sent`` or ``received``). @@ -1129,23 +1125,24 @@ system and application performance. ``HPX_WITH_PARCELPORT_MPI``. Please see :ref:`cmake_variables` for more details. + * * Parameters * If the configure-time option ``-DHPX_WITH_PARCELPORT_ACTION_COUNTERS=On`` was specified, this counter allows one to specify an optional action name as its parameter. In this case the counter will report the serialization time for the given action only. - * * ``/parcels/count/routed`` - - .. _parcels-count-routed: - :ref:`??` +.. list-table:: :term:`Parcel` layer performance counter ``/parcels/count/routed`` + :widths: 20 80 + * * Counter type + * ``/parcels/count/routed`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the number of + where ``*`` is the :term:`locality` id of the :term:`locality` the number of routed parcels should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall number of routed (outbound) parcels transferred by the given :term:`locality`. @@ -1156,28 +1153,30 @@ system and application performance. (and is responsible for resolving the destination address). This :term:`AGAS` service component will deliver the parcel to its final target. + * * Parameters * If the configure-time option ``-DHPX_WITH_PARCELPORT_ACTION_COUNTERS=On`` was specified, this counter allows one to specify an optional action name as its parameter. In this case the counter will report the number of parcels for the given action only. - * * ``/parcels/count//`` - .. _parcels-count-connection-type-operation: +.. list-table:: :term:`Parcel` layer performance counter ``/parcels/count//`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/parcels/count//`` where: ```` is one of the following: ``sent``, ``received`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the number of + where ``*`` is the :term:`locality` id of the :term:`locality` the number of parcels should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall number of parcels transferred using the specified ```` by the given :term:`locality` (see ``operation>``, e.g. ``sent`` or ``received``. @@ -1194,25 +1193,24 @@ system and application performance. ``HPX_WITH_PARCELPORT_MPI``. Please see :ref:`cmake_variables` for more details. - * None - * * ``/messages/count//`` - .. _messages-count-connection-type-operation: - - :ref:`??` +.. list-table:: :term:`Parcel` layer performance counter ``/messages/count//`` + :widths: 20 80 + * * Counter type + * ``/messages/count//`` where: ```` is one of the following: ``sent``, ``received`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the number of + where ``*`` is the :term:`locality` id of the :term:`locality` the number of messages should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall number of messages [#]_ transferred using the specified ```` by the given :term:`locality` (see ````, e.g. ``sent`` or ``received``) @@ -1229,25 +1227,25 @@ system and application performance. ``HPX_WITH_PARCELPORT_MPI``. Please see :ref:`cmake_variables` for more details. - * None - * * ``/parcelport/count//zero_copy_chunks/`` - .. _parcelport-count-connection-type-zero_copy_chunks-operation: +.. list-table:: :term:`Parcel` layer performance counter ``/parcelport/count//zero_copy_chunks/`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/parcelport/count//zero_copy_chunks/`` where: ```` is one of the following: ``sent``, ``received`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the overall + where ``*`` is the :term:`locality` id of the :term:`locality` the overall number of transmitted bytes should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall number of zero-copy chunks sent or received (see ````, e.g. ``sent`` or ``received``) for the specified ````. @@ -1264,25 +1262,25 @@ system and application performance. ``HPX_WITH_PARCELPORT_MPI``. Please see :ref:`cmake_variables` for more details. - * None - * * ``/parcelport/count-max//zero_copy_chunks/`` - .. _parcelport-count-max-connection-type-zero_copy_chunks-operation: +.. list-table:: :term:`Parcel` layer performance counter ``/parcelport/count-max//zero_copy_chunks/`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/parcelport/count-max//zero_copy_chunks/`` where: ```` is one of the following: ``sent``, ``received`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the overall + where ``*`` is the :term:`locality` id of the :term:`locality` the overall number of transmitted bytes should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the maximum number of zero-copy chunks sent or received per message (see ````, e.g. ``sent`` or ``received``) for the specified ````. @@ -1299,25 +1297,25 @@ system and application performance. ``HPX_WITH_PARCELPORT_MPI``. Please see :ref:`cmake_variables` for more details. - * None - * * ``/parcelport/size//zero_copy_chunks/`` - .. _parcelport-size-connection-type-zero_copy_chunks-operation: +.. list-table:: :term:`Parcel` layer performance counter ``/parcelport/size//zero_copy_chunks/`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/parcelport/size//zero_copy_chunks/`` where: ```` is one of the following: ``sent``, ``received`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the overall + where ``*`` is the :term:`locality` id of the :term:`locality` the overall number of transmitted bytes should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall size of zero-copy chunks sent or received (see ````, e.g. ``sent`` or ``received``) for the specified ````. @@ -1334,25 +1332,25 @@ system and application performance. ``HPX_WITH_PARCELPORT_MPI``. Please see :ref:`cmake_variables` for more details. - * None - * * ``/parcelport/size-max//zero_copy_chunks/`` - .. _parcelport-size-max-connection-type-zero_copy_chunks-operation: +.. list-table:: :term:`Parcel` layer performance counter ``/parcelport/size-max//zero_copy_chunks/`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/parcelport/size-max//zero_copy_chunks/`` where: ```` is one of the following: ``sent``, ``received`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the overall + where ``*`` is the :term:`locality` id of the :term:`locality` the overall number of transmitted bytes should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the maximum size of zero-copy chunks sent or received (see ````, e.g. ``sent`` or ``received``) for the specified ````. @@ -1369,12 +1367,12 @@ system and application performance. ``HPX_WITH_PARCELPORT_MPI``. Please see :ref:`cmake_variables` for more details. - * None - * * ``/parcelport/count//`` - .. _parcelport-count-connection-type-cache-statistics: +.. list-table:: :term:`Parcel` layer performance counter ``/parcelport/count//`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/parcelport/count//`` where: @@ -1382,13 +1380,13 @@ system and application performance. ``cache/evictions``, ``cache/hits``, ``cache/misses`` ```` is one of the following: ``tcp``, ``mpi`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the number of + where ``*`` is the :term:`locality` id of the :term:`locality` the number of messages should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall number cache events (evictions, hits, inserts, misses, and reclaims) for the connection cache of the given connection type on the given :term:`locality` (see ```` - - .. _parcelqueue-length-operation: - :ref:`??` +.. list-table:: :term:`Parcel` layer performance counter ``/parcelqueue/length/`` + :widths: 20 80 - where: + * * Counter type + * ``/parcelqueue/length/`` - ```` is one of the following: ``sent``, ``receive`` + where ```` is one of the following: ``sent``, ``receive`` + * * Counter instance formatting * ``locality#*/total`` - where: - - ``*`` is the :term:`locality` id of the :term:`locality` the :term:`parcel` queue + where ``*`` is the :term:`locality` id of the :term:`locality` the :term:`parcel` queue should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the current number of parcels stored in the :term:`parcel` queue (see ```` for which queue to query, e.g. ``sent`` or ``received``). - * None -.. list-table:: Thread manager performance counters +.. list-table:: Thread manager performance counter ``/threads/count/cumulative`` + :widths: 20 80 * * Counter type - * Counter instance formatting - * Description - * Parameters - * * ``/threads/count/cumulative`` - - .. _threads-count-cumulative: - - :ref:`??` - + * ``/threads/count/cumulative`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1445,7 +1434,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the overall number of retired |hpx|-threads should be queried for. The - :term:`locality` id (given by ``*`` is a (zero based) number identifying + :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1453,11 +1442,12 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the overall number of retired |hpx|-threads should be queried for. The worker thread - number (given by the ``*`` is a (zero based) number identifying the + number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the overall number of executed (retired) |hpx|-threads on the given :term:`locality` since application start. If the instance name is ``total`` the counter returns the accumulated number of retired @@ -1467,13 +1457,13 @@ system and application performance. separately. This counter is available only if the configuration time constant ``HPX_WITH_THREAD_CUMULATIVE_COUNTS`` is set to ``ON`` (default: ``ON``). - * None - * * ``/threads/time/average`` - - .. _threads-time-average: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/time/average`` + :widths: 20 80 + * * Counter type + * ``/threads/time/average`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1483,10 +1473,9 @@ system and application performance. where: - ``locality#*`` is defining the :term:`locality` for which the average time spent executing one |hpx|-thread should be queried for. The - :term:`locality` id (given by ``*`` is a (zero based) number identifying + :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1494,11 +1483,12 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the average time spent executing one |hpx|-thread should be queried for. The worker - thread number (given by the ``*`` is a (zero based) number identifying + thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the average time spent executing one |hpx|-thread on the given :term:`locality` since application start. If the instance name is ``total`` the counter returns the average time spent executing one |hpx|-thread for @@ -1509,13 +1499,13 @@ system and application performance. ``HPX_WITH_THREAD_CUMULATIVE_COUNTS`` (default: ``ON``) and ``HPX_WITH_THREAD_IDLE_RATES`` are set to ``ON`` (default: ``OFF``). The unit of measure for this counter is nanosecond [ns]. - * None - * * ``/threads/time/average-overhead`` - - .. _threads-time-average-overhead: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/time/average-overhead`` + :widths: 20 80 + * * Counter type + * ``/threads/time/average-overhead`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1526,7 +1516,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the average overhead spent executing one |hpx|-thread should be queried for. The - :term:`locality` id (given by ``*`` is a (zero based) number identifying + :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1534,11 +1524,12 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the average overhead spent executing one |hpx|-thread should be queried for. The - worker thread number (given by the ``*`` is a (zero based) number + worker thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the average time spent on overhead while executing one |hpx|-thread on the given :term:`locality` since application start. If the instance name is ``total`` the counter returns the average time spent @@ -1550,13 +1541,13 @@ system and application performance. ``HPX_WITH_THREAD_CUMULATIVE_COUNTS`` (default: ``ON``) and ``HPX_WITH_THREAD_IDLE_RATES`` are set to ``ON`` (default: ``OFF``). The unit of measure for this counter is nanosecond [ns]. - * None - * * ``/threads/count/cumulative-phases`` - - .. _threads-count-cumulative-phases: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/count/cumulative-phases`` + :widths: 20 80 + * * Counter type + * ``/threads/count/cumulative-phases`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1567,7 +1558,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the overall number of executed |hpx|-thread phases (invocations) should be queried - for. The :term:`locality` id (given by ``*`` is a (zero based) number + for. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1575,11 +1566,12 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the overall number of executed |hpx|-thread phases (invocations) should be queried - for. The worker thread number (given by the ``*`` is a (zero based) + for. The worker thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the overall number of executed |hpx|-thread phases (invocations) on the given :term:`locality` since application start. If the instance name is ``total`` the counter returns the accumulated number of executed @@ -1590,13 +1582,13 @@ system and application performance. configuration time constant ``HPX_WITH_THREAD_CUMULATIVE_COUNTS`` is set to ``ON`` (default: ``ON``). The unit of measure for this counter is nanosecond [ns]. - * None - * * ``/threads/time/average-phase`` - - .. _threads-time-average-phase: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/time/average-phase`` + :widths: 20 80 + * * Counter type + * ``/threads/time/average-phase`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1607,7 +1599,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the average time spent executing one |hpx|-thread phase (invocation) should be - queried for. The :term:`locality` id (given by ``*`` is a (zero based) + queried for. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1615,11 +1607,12 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the average time executing one |hpx|-thread phase (invocation) should be queried for. - The worker thread number (given by the ``*`` is a (zero based) number + The worker thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the average time spent executing one |hpx|-thread phase (invocation) on the given :term:`locality` since application start. If the instance name is ``total`` the counter returns the average time spent @@ -1631,13 +1624,13 @@ system and application performance. ``HPX_WITH_THREAD_CUMULATIVE_COUNTS`` (default: ``ON``) and ``HPX_WITH_THREAD_IDLE_RATES`` are set to ``ON`` (default: ``OFF``). The unit of measure for this counter is nanosecond [ns]. - * None - * * ``/threads/time/average-phase-overhead`` - .. _threads-time-average-phase-overhead: - - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/time/average-phase-overhead`` + :widths: 20 80 + * * Counter type + * ``/threads/time/average-phase-overhead`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1649,7 +1642,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the average time overhead executing one |hpx|-thread phase (invocation) should be - queried for. The :term:`locality` id (given by ``*`` is a (zero based) + queried for. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1657,11 +1650,12 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the average overhead executing one |hpx|-thread phase (invocation) should be queried - for. The worker thread number (given by the ``*`` is a (zero based) + for. The worker thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the average time spent on overhead executing one |hpx|-thread phase (invocation) on the given :term:`locality` since application start. If the instance name is ``total`` the counter returns the average time @@ -1673,13 +1667,13 @@ system and application performance. constants ``HPX_WITH_THREAD_CUMULATIVE_COUNTS`` (default: ``ON``) and ``HPX_WITH_THREAD_IDLE_RATES`` are set to ``ON`` (default: ``OFF``). The unit of measure for this counter is nanosecond [ns]. - * None - * * ``/threads/time/overall`` - .. _threads-time-overall: - - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/time/overall`` + :widths: 20 80 + * * Counter type + * ``/threads/time/overall`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1690,7 +1684,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the overall time spent running the scheduler should be queried for. The - :term:`locality` id (given by ``*`` is a (zero based) number identifying + :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1698,11 +1692,12 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the overall time spent running the scheduler should be queried for. The worker thread - number (given by the ``*`` is a (zero based) number identifying the + number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the overall time spent running the scheduler on the given :term:`locality` since application start. If the instance name is ``total`` the counter returns the overall time spent running the scheduler for all @@ -1712,13 +1707,13 @@ system and application performance. only if the configuration time constant ``HPX_WITH_THREAD_IDLE_RATES`` is set to ``ON`` (default: ``OFF``). The unit of measure for this counter is nanosecond [ns]. - * None - * * ``/threads/time/cumulative`` - - .. _threads-time-cumulative: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/time/cumulative`` + :widths: 20 80 + * * Counter type + * ``/threads/time/cumulative`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1729,7 +1724,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the overall time spent executing all |hpx|-threads should be queried for. The - :term:`locality` id (given by ``*`` is a (zero based) number identifying + :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1737,11 +1732,12 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the overall time spent executing all |hpx|-threads should be queried for. The worker - thread number (given by the ``*`` is a (zero based) number identifying + thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the overall time spent executing all |hpx|-threads on the given :term:`locality` since application start. If the instance name is ``total`` the counter returns the overall time spent executing all |hpx|-threads for @@ -1751,13 +1747,13 @@ system and application performance. is available only if the configuration time constants ``HPX_THREAD_MAINTAIN_CUMULATIVE_COUNTS`` (default: ``ON``) and ``HPX_THREAD_MAINTAIN_IDLE_RATES`` are set to ``ON`` (default: ``OFF``). - * None - * * ``/threads/time/cumulative-overheads`` - .. _threads-time-cumulative-overheads: - - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/time/cumulative-overheads`` + :widths: 20 80 + * * Counter type + * ``/threads/time/cumulative-overheads`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1768,7 +1764,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the overall overhead time incurred by executing all |hpx|-threads should be queried - for. The :term:`locality` id (given by ``*`` is a (zero based) number + for. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1776,11 +1772,12 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the the overall overhead time incurred by executing all |hpx|-threads should be - queried for. The worker thread number (given by the ``*`` is a (zero + queried for. The worker thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the overall overhead time incurred executing all |hpx|-threads on the given :term:`locality` since application start. If the instance name is ``total`` the counter returns the overall overhead time incurred @@ -1792,17 +1789,18 @@ system and application performance. ``HPX_THREAD_MAINTAIN_CUMULATIVE_COUNTS`` (default: ``ON``) and ``HPX_THREAD_MAINTAIN_IDLE_RATES`` are set to ``ON`` (default: ``OFF``). The unit of measure for this counter is nanosecond [ns]. - * None - * * ``threads/count/instantaneous/`` - .. _threads-count-instantaneous-thread-state: +.. list-table:: Thread manager performance counter ``threads/count/instantaneous/`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``threads/count/instantaneous/`` where: ```` is one of the following: ``all``, ``active``, ``pending``, ``suspended``, ``terminated``, ``staged`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1813,7 +1811,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the current number of threads with the given state should be queried for. The - :term:`locality` id (given by ``*`` is a (zero based) number identifying + :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1821,7 +1819,7 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the current number of threads with the given state should be queried for. The worker - thread number (given by the ``*`` is a (zero based) number identifying + thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers @@ -1829,22 +1827,24 @@ system and application performance. The ``staged`` thread state refers to registered tasks before they are converted to thread objects. + * * Description * Returns the current number of |hpx|-threads having the given thread state on the given :term:`locality`. If the instance name is ``total`` the counter returns the current number of |hpx|-threads of the given state for all worker threads (cores) on that :term:`locality`. If the instance name is ``worker-thread#*`` the counter will return the current number of |hpx|-threads in the given state for all worker threads separately. - * None - * * ``threads/wait-time/`` - .. _threads-wait-time-thread-state: +.. list-table:: Thread manager performance counter ``threads/wait-time/`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``threads/wait-time/`` where: ```` is one of the following: ``pending`` ``staged`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1863,7 +1863,7 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the average wait time for the given state should be queried for. The worker thread - number (given by the ``*`` is a (zero based) number identifying the + number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers @@ -1873,6 +1873,7 @@ system and application performance. before they are converted into thread objects, while the ``pending`` thread state refers to the wait time of threads in any of the scheduling queues. + * * Description * Returns the average wait time of |hpx|-threads (if the thread state is ``pending`` or of task descriptions (if the thread state is ``staged`` on the given :term:`locality` since application start. If the instance name @@ -1886,13 +1887,13 @@ system and application performance. ``HPX_WITH_THREAD_QUEUE_WAITTIME`` was defined while compiling the |hpx| core library (default: ``OFF``). The unit of measure for this counter is nanosecond [ns]. - * None - * * ``/threads/idle-rate`` - - .. _threads-idle-rate: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/idle-rate`` + :widths: 20 80 + * * Counter type + * ``/threads/idle-rate`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1903,7 +1904,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the average idle rate of all (or one) worker threads should be queried for. The - :term:`locality` id (given by ``*`` is a (zero based) number identifying + :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality` ``pool#*`` is defining the pool for which the current value of the @@ -1915,19 +1916,20 @@ system and application performance. of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the average idle rate for the given worker thread(s) on the given :term:`locality`. The idle rate is defined as the ratio of the time spent on scheduling and management tasks and the overall time spent executing work since the application started. This counter is available only if the configuration time constant ``HPX_WITH_THREAD_IDLE_RATES`` is set to ``ON`` (default: ``OFF``). - * None - * * ``/threads/creation-idle-rate`` - .. _threads-creation-idle-rate: - - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/creation-idle-rate`` + :widths: 20 80 + * * Counter type + * ``/threads/creation-idle-rate`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1938,7 +1940,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the average creation idle rate of all (or one) worker threads should be queried for. - The :term:`locality` id (given by ``*`` is a (zero based) number + The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1950,6 +1952,7 @@ system and application performance. of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the average idle rate for the given worker thread(s) on the given :term:`locality` which is caused by creating new threads. The creation idle rate is defined as the ratio of the time spent on creating new threads and @@ -1957,13 +1960,13 @@ system and application performance. counter is available only if the configuration time constants ``HPX_WITH_THREAD_IDLE_RATES`` (default: ``OFF``) and ``HPX_WITH_THREAD_CREATION_AND_CLEANUP_RATES`` are set to ``ON``. - * None - * * ``/threads/cleanup-idle-rate`` - .. _threads-cleanup-idle-rate: - - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/cleanup-idle-rate`` + :widths: 20 80 + * * Counter type + * ``/threads/cleanup-idle-rate`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -1975,7 +1978,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the average cleanup idle rate of all (or one) worker threads should be queried for. - The :term:`locality` id (given by ``*`` is a (zero based) number + The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -1983,10 +1986,11 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the averaged cleanup idle rate should be queried for. The worker thread number (given - by the ``*`` is a (zero based) number identifying the worker thread. The + by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the average idle rate for the given worker thread(s) on the given :term:`locality` which is caused by cleaning up terminated threads. The cleanup idle rate is defined as the ratio of the time spent on cleaning up @@ -1995,13 +1999,13 @@ system and application performance. configuration time constants ``HPX_WITH_THREAD_IDLE_RATES`` (default: ``OFF``) and ``HPX_WITH_THREAD_CREATION_AND_CLEANUP_RATES`` are set to ``ON``. - * None - * * ``/threadqueue/length`` - - .. _threadqueue-length: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threadqueue/length`` + :widths: 20 80 + * * Counter type + * ``/threadqueue/length`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -2012,7 +2016,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the current length of all thread queues in the scheduler for all (or one) worker - threads should be queried for. The :term:`locality` id (given by ``*`` is + threads should be queried for. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -2020,20 +2024,21 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the current length of all thread queues in the scheduler should be queried for. The - worker thread number (given by the ``*`` is a (zero based) number + worker thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the overall length of all queues for the given worker thread(s) on the given :term:`locality`. - * None - * * ``/threads/count/stack-unbinds`` - - .. _threads-count-stack-unbinds: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/count/stack-unbinds`` + :widths: 20 80 + * * Counter type + * ``/threads/count/stack-unbinds`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2041,16 +2046,17 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the unbind (madvise) operations should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the total number of |hpx|-thread unbind (madvise) operations performed for the referenced :term:`locality`. Note that this counter is not available on Windows based platforms. - * None - * * ``/threads/count/stack-recycles`` - .. _threads-count-stack-recycles: - - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/count/stack-recycles`` + :widths: 20 80 + * * Counter type + * ``/threads/count/stack-recycles`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2058,33 +2064,35 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the recycling operations should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the total number of |hpx|-thread recycling operations performed. - * None - * * ``/threads/count/stolen-from-pending`` - .. _threads-count-stolen-from-pending: - - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/count/stolen-from-pending`` + :widths: 20 80 + * * Counter type + * ``/threads/count/stolen-from-pending`` + * * Counter instance formatting * ``locality#*/total`` - where: + where: ``*`` is the :term:`locality` id of the :term:`locality` the number of 'stole' threads should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the total number of |hpx|-threads 'stolen' from the pending thread queue by a neighboring thread worker thread (these threads are executed by a different worker thread than they were initially scheduled on). This counter is available only if the configuration time constant ``HPX_WITH_THREAD_STEALING_COUNTS`` is set to ``ON`` (default: ``ON``). - * None - * * ``/threads/count/pending-misses`` - - .. _threads-count-pending-misses: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/count/pending-misses`` + :widths: 20 80 + * * Counter type + * ``/threads/count/pending-misses`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -2095,7 +2103,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the number of pending queue misses of all (or one) worker threads should be queried - for. The :term:`locality` id (given by ``*`` is a (zero based) number + for. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality` ``pool#*`` is defining the pool for which the current value of the @@ -2103,23 +2111,24 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the number of pending queue misses should be queried for. The worker thread number - (given by the ``*`` is a (zero based) number identifying the worker + (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the total number of times that the referenced worker-thread on the referenced :term:`locality` failed to find pending |hpx|-threads in its associated queue. This counter is available only if the configuration time constant ``HPX_WITH_THREAD_STEALING_COUNTS`` is set to ``ON`` (default: ``ON``). - * None - * * ``/threads/count/pending-accesses`` - - .. _threads-count-pending-accesses: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/count/pending-accesses`` + :widths: 20 80 + * * Counter type + * ``/threads/count/pending-accesses`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -2130,7 +2139,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the number of pending queue accesses of all (or one) worker threads should be queried - for. The :term:`locality` id (given by ``*`` is a (zero based) number + for. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality` ``pool#*`` is defining the pool for which the current value of the @@ -2138,23 +2147,24 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the number of pending queue accesses should be queried for. The worker thread number - (given by the ``*`` is a (zero based) number identifying the worker + (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the total number of times that the referenced worker-thread on the referenced :term:`locality` looked for pending |hpx|-threads in its associated queue. This counter is available only if the configuration time constant ``HPX_WITH_THREAD_STEALING_COUNTS`` is set to ``ON`` (default: ``ON``). - * None - * * ``/threads/count/stolen-from-staged`` - - .. _threads-count-stolen-from-staged: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/count/stolen-from-staged`` + :widths: 20 80 + * * Counter type + * ``/threads/count/stolen-from-staged`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -2165,7 +2175,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the number of |hpx|-threads stolen from the staged queue of all (or one) worker threads - should be queried for. The :term:`locality` id (given by ``*`` is a (zero + should be queried for. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -2173,23 +2183,24 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the number of |hpx|-threads stolen from the staged queue should be queried for. The - worker thread number (given by the ``*`` is a (zero based) number + worker thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the total number of |hpx|-threads 'stolen' from the staged thread queue by a neighboring worker thread (these threads are executed by a different worker thread than they were initially scheduled on). This counter is available only if the configuration time constant ``HPX_WITH_THREAD_STEALING_COUNTS`` is set to ``ON`` (default: ``ON``). - * None - * * ``/threads/count/stolen-to-pending`` - - .. _threads-count-stolen-to-pending: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/count/stolen-to-pending`` + :widths: 20 80 + * * Counter type + * ``/threads/count/stolen-to-pending`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -2200,7 +2211,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the number of |hpx|-threads stolen to the pending queue of all (or one) worker threads - should be queried for. The :term:`locality` id (given by ``*`` is a (zero + should be queried for. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -2208,23 +2219,24 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the number of |hpx|-threads stolen to the pending queue should be queried for. The - worker thread number (given by the ``*`` is a (zero based) number + worker thread number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the total number of |hpx|-threads 'stolen' to the pending thread queue of the worker thread (these threads are executed by a different worker thread than they were initially scheduled on). This counter is available only if the configuration time constant ``HPX_WITH_THREAD_STEALING_COUNTS`` is set to ``ON`` (default: ``ON``). - * None - * * ``/threads/count/stolen-to-staged`` - - .. _threads-count-stolen-to-staged: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/count/stolen-to-staged`` + :widths: 20 80 + * * Counter type + * ``/threads/count/stolen-to-staged`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` or @@ -2235,7 +2247,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the number of |hpx|-threads stolen to the staged queue of all (or one) worker threads - should be queried for. The :term:`locality` id (given by ``*`` is a (zero + should be queried for. The :term:`locality` id (given by ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -2243,24 +2255,25 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the number of |hpx|-threads stolen to the staged queue should be queried for. The - worker thread number (given by the ``*`` is a (zero based) worker thread - number (given by the ``*`` is a (zero based) number identifying the + worker thread number (given by the ``*``) is a (zero based) worker thread + number (given by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the total number of |hpx|-threads 'stolen' to the staged thread queue of a neighboring worker thread (these threads are executed by a different worker thread than they were initially scheduled on). This counter is available only if the configuration time constant ``HPX_WITH_THREAD_STEALING_COUNTS`` is set to ``ON`` (default: ``ON``). - * None - * * ``/threads/count/objects`` - - .. _threads-count-objects: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/count/objects`` + :widths: 20 80 + * * Counter type + * ``/threads/count/objects`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/allocator#*`` @@ -2269,42 +2282,46 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the current (cumulative) number of all created |hpx|-thread objects should be queried - for. The :term:`locality` id (given by ``*`` is a (zero based) number + for. The :term:`locality` id (given by ``*``) is a (zero based) number identifying the :term:`locality`. ``allocator#*`` is defining the number of the allocator instance using which the threads have been created. |hpx| uses a varying number of allocators to create (and recycle) |hpx|-thread objects, most likely these counters are of use for debugging purposes only. The allocator id - (given by ``*`` is a (zero based) number identifying the allocator to + (given by ``*``) is a (zero based) number identifying the allocator to query. + * * Description * Returns the total number of |hpx|-thread objects created. Note that thread objects are reused to improve system performance, thus this number does not reflect the number of actually executed (retired) |hpx|-threads. - * None - * * ``/scheduler/utilization/instantaneous`` - - .. _scheduler-utilization-instantaneous: - :ref:`??` +.. list-table:: Thread manager performance counter ``/scheduler/utilization/instantaneous`` + :widths: 20 80 + * * Counter type + * ``/scheduler/utilization/instantaneous`` + * * Counter instance formatting * ``locality#*/total`` where: ``locality#*`` is defining the :term:`locality` for which the current (instantaneous) scheduler utilization queried for. The :term:`locality` - id (given by ``*`` is a (zero based) number identifying the + id (given by ``*``) is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the total (instantaneous) scheduler utilization. This is the current percentage of scheduler threads executing |hpx| threads. + * * Parameters * Percent - * * ``/threads/idle-loop-count/instantaneous`` - .. _threads-idle-loop-count-instantaneous: +.. list-table:: Thread manager performance counter ``/threads/idle-loop-count/instantaneous`` + :widths: 20 80 - :ref:`??` - + * * Counter type + * ``/threads/idle-loop-count/instantaneous`` + * * Counter instance formatting * ``locality#*/worker-thread#*`` or ``locality#*/pool#*/worker-thread#*`` @@ -2313,7 +2330,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the current current accumulated value of all idle-loop counters of all worker threads - should be queried. The :term:`locality` id (given by ``*`` is a (zero + should be queried. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -2321,20 +2338,21 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the current value of the idle-loop counter should be queried for. The worker thread - number (given by the ``*`` is a (zero based) worker thread number (given - by the ``*`` is a (zero based) number identifying the worker thread. The + number (given by the ``*``) is a (zero based) worker thread number (given + by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the current (instantaneous) idle-loop count for the given |hpx|- worker thread or the accumulated value for all worker threads. - * None - * * ``/threads/busy-loop-count/instantaneous`` - .. _threads-busy-loop-count-instantaneous: +.. list-table:: Thread manager performance counter ``/threads/busy-loop-count/instantaneous`` + :widths: 20 80 - :ref:`??` - + * * Counter type + * ``/threads/busy-loop-count/instantaneous`` + * * Counter instance formatting * ``locality#*/worker-thread#*`` or ``locality#*/pool#*/worker-thread#*`` @@ -2343,7 +2361,7 @@ system and application performance. ``locality#*`` is defining the :term:`locality` for which the current current accumulated value of all busy-loop counters of all worker threads - should be queried. The :term:`locality` id (given by ``*`` is a (zero + should be queried. The :term:`locality` id (given by the ``*``) is a (zero based) number identifying the :term:`locality`. ``pool#*`` is defining the pool for which the current value of the @@ -2351,20 +2369,23 @@ system and application performance. ``worker-thread#*`` is defining the worker thread for which the current value of the busy-loop counter should be queried for. The worker thread - number (given by the ``*`` is a (zero based) worker thread number (given - by the ``*`` is a (zero based) number identifying the worker thread. The + number (given by the ``*``) is a (zero based) worker thread number (given + by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. If no pool-name is specified the counter refers to the 'default' pool. + * * Description * Returns the current (instantaneous) busy-loop count for the given |hpx|- worker thread or the accumulated value for all worker threads. - * None - * * ``/threads/time/background-work-duration`` - .. _threads-time-background-work-duration: +................................................................................... - :ref:`??` - +.. list-table:: Thread manager performance counter ``/threads/time/background-work-duration`` + :widths: 20 80 + + * * Counter type + * ``/threads/time/background-work-duration`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` @@ -2381,7 +2402,7 @@ system and application performance. the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. - + * * Description * Returns the overall time spent performing background work on the given locality since application start. If the instance name is ``total`` the counter returns the overall time spent performing background work for all @@ -2393,13 +2414,13 @@ system and application performance. ``HPX_WITH_THREAD_IDLE_RATES`` are set to ``ON`` (default: ``OFF``). The unit of measure for this counter is nanosecond [ns]. - * None - * * ``/threads/background-overhead`` - .. _threads-background-overhead: - - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/background-overhead`` + :widths: 20 80 + * * Counter type + * ``/threads/background-overhead`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` @@ -2416,6 +2437,7 @@ system and application performance. thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. + * * Description * Returns the background overhead on the given locality since application start. If the instance name is ``total`` the counter returns the background overhead for all worker threads (cores) on that locality. If @@ -2425,13 +2447,13 @@ system and application performance. ``HPX_WITH_BACKGROUND_THREAD_COUNTERS`` (default: ``OFF``) and ``HPX_WITH_THREAD_IDLE_RATES`` are set to ``ON`` (default: ``OFF``). The unit of measure displayed for this counter is 0.1%. - * None - * * ``/threads/time/background-send-duration`` - .. _threads-time-background-send-duration: - - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/time/background-send-duration`` + :widths: 20 80 + * * Counter type + * ``/threads/time/background-send-duration`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` @@ -2449,7 +2471,7 @@ system and application performance. based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. - + * * Description * Returns the overall time spent performing background work related to sending parcels on the given locality since application start. If the instance name is ``total`` the counter returns the overall time spent @@ -2464,13 +2486,13 @@ system and application performance. This counter will currently return meaningful values for the MPI parcelport only. - * None - * * ``/threads/background-send-overhead`` - - .. _threads-background-send-overhead: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/background-send-overhead`` + :widths: 20 80 + * * Counter type + * ``/threads/background-send-overhead`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` @@ -2487,6 +2509,7 @@ system and application performance. identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. + * * Description * Returns the background overhead related to sending parcels on the given locality since application start. If the instance name is ``total`` the counter returns the background overhead for all worker threads (cores) on @@ -2499,13 +2522,13 @@ system and application performance. This counter will currently return meaningful values for the MPI parcelport only. - * None - * * ``/threads/time/background-receive-duration`` - - .. _threads-time-background-receive-duration: - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/time/background-receive-duration`` + :widths: 20 80 + * * Counter type + * ``/threads/time/background-receive-duration`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` @@ -2524,6 +2547,7 @@ system and application performance. worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. + * * Description * Returns the overall time spent performing background work related to receiving parcels on the given locality since application start. If the instance name is ``total`` the counter returns the overall time spent @@ -2537,13 +2561,13 @@ system and application performance. This counter will currently return meaningful values for the MPI parcelport only. - * None - * * ``/threads/background-receive-overhead`` - .. _threads-background-receive-overhead: - - :ref:`??` +.. list-table:: Thread manager performance counter ``/threads/background-receive-overhead`` + :widths: 20 80 + * * Counter type + * ``/threads/background-receive-overhead`` + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` @@ -2560,6 +2584,7 @@ system and application performance. identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. + * * Description * Returns the background overhead related to receiving parcels on the given locality since application start. If the instance name is ``total`` the counter returns the background overhead for all worker threads (cores) on @@ -2572,20 +2597,14 @@ system and application performance. This counter will currently return meaningful values for the MPI parcelport only. - * None -.. list-table:: General performance counters exposing characteristics of localities - * * Counter type - * Counter instance formatting - * Description - * Parameters - * * ``/runtime/count/component`` - - .. _runtime-count-component: - - :ref:`??` +.. list-table:: General performance counter ``/runtime/count/component`` + :widths: 20 80 + * * Counter type + * ``/runtime/count/component`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2593,17 +2612,20 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of components should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall number of currently active components of the specified type on the given :term:`locality`. + * * Parameters * The type of the component. This is the string which has been used while registering the component with |hpx|, e.g. which has been passed as the second parameter to the macro :c:macro:`HPX_REGISTER_COMPONENT`. - * * ``/runtime/count/action-invocation`` - .. _runtime-count-action-invocation: - - :ref:`??` +.. list-table:: General performance counter ``/runtime/count/action-invocation`` + :widths: 20 80 + * * Counter type + * ``/runtime/count/action-invocation`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2611,18 +2633,21 @@ system and application performance. ``*`` is the :term:`locality` id of the locality the number of action invocations should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall (local) invocation count of the specified action type on the given :term:`locality`. + * * Parameters * The action type. This is the string which has been used while registering the action with |hpx|, e.g. which has been passed as the second parameter to the macro :c:macro:`HPX_REGISTER_ACTION` or :c:macro:`HPX_REGISTER_ACTION_ID`. - * * ``/runtime/count/remote-action-invocation`` - - .. _runtime-count-remote-action-invocation: - :ref:`??` +.. list-table:: General performance counter ``/runtime/count/remote-action-invocation`` + :widths: 20 80 + * * Counter type + * ``/runtime/count/remote-action-invocation`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2630,18 +2655,21 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of action invocations should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall (remote) invocation count of the specified action type on the given :term:`locality`. + * * Parameters * The action type. This is the string which has been used while registering the action with |hpx|, e.g. which has been passed as the second parameter to the macro :c:macro:`HPX_REGISTER_ACTION` or :c:macro:`HPX_REGISTER_ACTION_ID`. - * * ``/runtime/uptime`` - - .. _runtime-uptime: - :ref:`??` +.. list-table:: General performance counter ``/runtime/uptime`` + :widths: 20 80 + * * Counter type + * ``/runtime/uptime`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2649,15 +2677,16 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the system uptime should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the overall time since application start on the given :term:`locality` in nanoseconds. - * None - * * ``/runtime/memory/virtual`` - - .. _runtime-memory-virtual: - :ref:`??` +.. list-table:: General performance counter ``/runtime/memory/virtual`` + :widths: 20 80 + * * Counter type + * ``/runtime/memory/virtual`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2665,15 +2694,16 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the allocated virtual memory should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the amount of virtual memory currently allocated by the referenced :term:`locality` (in bytes). - * None - * * ``/runtime/memory/resident`` - - .. _runtime-memory-resident: - :ref:`??` +.. list-table:: General performance counter ``/runtime/memory/resident`` + :widths: 20 80 + * * Counter type + * ``/runtime/memory/resident`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2681,15 +2711,16 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the allocated resident memory should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the amount of resident memory currently allocated by the referenced :term:`locality` (in bytes). - * None - * * ``/runtime/memory/total`` - - .. _runtime-memory-total: - :ref:`??` +.. list-table:: General performance counter ``/runtime/memory/total`` + :widths: 20 80 + * * Counter type + * ``/runtime/memory/total`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2698,16 +2729,17 @@ system and application performance. available memory should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. Note: only supported in Linux. + * * Description * Returns the total available memory for use by the referenced :term:`locality` (in bytes). This counter is available on Linux and Windows systems only. - * None - * * ``/runtime/io/read_bytes_issued`` - .. _runtime-io-read-bytes-issued: - - :ref:`??` +.. list-table:: General performance counter ``/runtime/io/read_bytes_issued`` + :widths: 20 80 + * * Counter type + * ``/runtime/io/read_bytes_issued`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2715,17 +2747,18 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of bytes read should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the number of bytes read by the process (aggregate of count arguments passed to read() call or its analogues). This performance counter is available only on systems which expose the related data through the /proc file system. - * None - * * ``/runtime/io/write_bytes_issued`` - .. _runtime-io-write-bytes-issued: - - :ref:`??` +.. list-table:: General performance counter ``/runtime/io/write_bytes_issued`` + :widths: 20 80 + * * Counter type + * ``/runtime/io/write_bytes_issued`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2733,17 +2766,18 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of bytes written should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the number of bytes written by the process (aggregate of count arguments passed to write() call or its analogues). This performance counter is available only on systems which expose the related data through the /proc file system. - * None - * * ``/runtime/io/read_syscalls`` - .. _runtime-io-read-syscalls: - - :ref:`??` +.. list-table:: General performance counter ``/runtime/io/read_syscalls`` + :widths: 20 80 + * * Counter type + * ``/runtime/io/read_syscalls`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2751,16 +2785,17 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of system calls should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the number of system calls that perform I/O reads. This performance counter is available only on systems which expose the related data through the /proc file system. - * None - * * ``/runtime/io/write_syscalls`` - .. _runtime-io-write-syscalls: - - :ref:`??` +.. list-table:: General performance counter ``/runtime/io/write_syscalls`` + :widths: 20 80 + * * Counter type + * ``/runtime/io/write_syscalls`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2768,16 +2803,17 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of system calls should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the number of system calls that perform I/O writes. This performance counter is available only on systems which expose the related data through the /proc file system. - * None - * * ``/runtime/io/read_bytes_transferred`` - - .. _runtime-io-read-bytes-transferred: - :ref:`??` +.. list-table:: General performance counter ``/runtime/io/read_bytes_transferred`` + :widths: 20 80 + * * Counter type + * ``/runtime/io/read_bytes_transferred`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2785,16 +2821,17 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of bytes transferred should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the number of bytes retrieved from storage by I/O operations. This performance counter is available only on systems which expose the related data through the /proc file system. - * None - * * ``/runtime/io/write_bytes_transferred`` - - .. _runtime-io-write-bytes-transferred: - :ref:`??` +.. list-table:: General performance counter ``/runtime/io/write_bytes_transferred`` + :widths: 20 80 + * * Counter type + * ``/runtime/io/write_bytes_transferred`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2802,16 +2839,17 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of bytes transferred should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the number of bytes retrieved from storage by I/O operations. This performance counter is available only on systems which expose the related data through the /proc file system. - * None - * * ``/runtime/io/write_bytes_cancelled`` - - .. _runtime-io-write-bytes-cancelled: - :ref:`??` +.. list-table:: General performance counter ``/runtime/io/write_bytes_cancelled`` + :widths: 20 80 + * * Counter type + * ``/runtime/io/write_bytes_cancelled`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -2819,23 +2857,18 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of bytes not being transferred should be queried. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the number of bytes accounted by write_bytes_transferred that has not been ultimately stored due to truncation or deletion. This performance counter is available only on systems which expose the related data through the /proc file system. - * None -.. list-table:: Performance counters exposing PAPI hardware counters - * * Counter type - * Counter instance formatting - * Description - * Parameters - * * ``/papi/`` - - .. _papi-papi-event: +.. list-table:: Performance counter ``/papi/`` + :widths: 20 80 - :ref:`??` + * * Counter type + * ``/papi/`` where: @@ -2846,7 +2879,7 @@ system and application performance. For a full list of available PAPI events and their (short) description use the ``--hpx:list-counters`` and ``--hpx:papi-event-info=all`` command line options. - + * * Counter instance formatting * ``locality#*/total`` or ``locality#*/worker-thread#*`` @@ -2864,29 +2897,24 @@ system and application performance. by the ``*``) is a (zero based) number identifying the worker thread. The number of available worker threads is usually specified on the command line for the application using the option :option:`--hpx:threads`. - - * This counter returns the current count of occurrences of the specified + * * Description + * Returns the current count of occurrences of the specified PAPI event. This counter is available only if the configuration time constant ``HPX_WITH_PAPI`` is set to ``ON`` (default: ``OFF``). - * None -.. list-table:: Performance counters for general statistics +.. list-table:: Performance counter ``/statistics/average`` + :widths: 20 80 * * Counter type - * Counter instance formatting - * Description - * Parameters - * * ``/statistics/average`` - - .. _statistics-average: - - :ref:`??` - + * ``/statistics/average`` + * * Counter instance formatting * Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. + * * Description * Returns the current average (mean) value calculated based on the values queried from the underlying counter (the one specified as the instance name). + * * Parameters * Any parameter will be interpreted as a list of up to two comma separated (integer) values, where the first is the time interval (in milliseconds) at which the underlying counter should be queried. If no value is @@ -2895,17 +2923,19 @@ system and application performance. underlying counter should be reset during evaluation ``1`` or not ``0``. The default value is ``0``. - * * ``/statistics/rolling_average`` - - .. _statistics-rolling-average: - - :ref:`??` +.. list-table:: Performance counter ``/statistics/rolling_average`` + :widths: 20 80 + * * Counter type + * ``/statistics/rolling_average`` + * * Counter instance formatting * Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. + * * Description * Returns the current rolling average (mean) value calculated based on the values queried from the underlying counter (the one specified as the instance name). + * * Parameters * Any parameter will be interpreted as a list of up to three comma separated (integer) values, where the first is the time interval (in milliseconds) at which the underlying counter should be queried. If no @@ -2916,17 +2946,19 @@ system and application performance. either ``0`` or ``1`` and specifies whether the underlying counter should be reset during evaluation ``1`` or not ``0``. The default value is ``0``. - * * ``/statistics/stddev`` - - .. _statistics-stddev: - - :ref:`??` +.. list-table:: Performance counter ``/statistics/stddev`` + :widths: 20 80 + * * Counter type + * ``/statistics/stddev`` + * * Counter instance formatting * Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. + * * Description * Returns the current standard deviation (stddev) value calculated based on the values queried from the underlying counter (the one specified as the instance name). + * * Parameters * Any parameter will be interpreted as a list of up to two comma separated (integer) values, where the first is the time interval (in milliseconds) at which the underlying counter should be queried. If no value is @@ -2935,17 +2967,19 @@ system and application performance. underlying counter should be reset during evaluation ``1`` or not ``0``. The default value is ``0``. - * * ``/statistics/rolling_stddev`` - - .. _statistics-rolling-stddev: - - :ref:`??` +.. list-table:: Performance counter ``/statistics/rolling_stddev`` + :widths: 20 80 + * * Counter type + * ``/statistics/rolling_stddev`` + * * Counter instance formatting * Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. + * * Description * Returns the current rolling variance (stddev) value calculated based on the values queried from the underlying counter (the one specified as the instance name). + * * Parameters * Any parameter will be interpreted as a list of up to three comma separated (integer) values, where the first is the time interval (in milliseconds) at which the underlying counter should be queried. If no @@ -2956,17 +2990,19 @@ system and application performance. or ``1`` and specifies whether the underlying counter should be reset during evaluation ``1`` or not ``0``. The default value is ``0``. - * * ``/statistics/median`` - - .. _statistics-median: - - :ref:`??` +.. list-table:: Performance counter ``/statistics/median`` + :widths: 20 80 + * * Counter type + * ``/statistics/median`` + * * Counter instance formatting * Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. + * * Description * Returns the current (statistically estimated) median value calculated based on the values queried from the underlying counter (the one specified as the instance name). + * * Parameters * Any parameter will be interpreted as a list of up to two comma separated (integer) values, where the first is the time interval (in milliseconds) at which the underlying counter should be queried. If no value is @@ -2975,16 +3011,18 @@ system and application performance. underlying counter should be reset during evaluation ``1`` or not ``0``. The default value is ``0``. - * * ``/statistics/max`` - - .. _statistics-max: - - :ref:`??` +.. list-table:: Performance counter ``/statistics/max`` + :widths: 20 80 + * * Counter type + * ``/statistics/max`` + * * Counter instance formatting * Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. + * * Description * Returns the current maximum value calculated based on the values queried from the underlying counter (the one specified as the instance name). + * * Parameters * Any parameter will be interpreted as a list of up to two comma separated (integer) values, where the first is the time interval (in milliseconds) at which the underlying counter should be queried. If no value is @@ -2993,17 +3031,19 @@ system and application performance. underlying counter should be reset during evaluation ``1`` or not ``0``. The default value is ``0``. - * * ``/statistics/rolling_max`` - - .. _statistics-rolling-max: - - :ref:`??` +.. list-table:: Performance counter ``/statistics/rolling_max`` + :widths: 20 80 + * * Counter type + * ``/statistics/rolling_max`` + * * Counter instance formatting * Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. + * * Description * Returns the current rolling maximum value calculated based on the values queried from the underlying counter (the one specified as the instance name). + * * Parameters * Any parameter will be interpreted as a list of up to three comma separated (integer) values, where the first is the time interval (in milliseconds) at which the underlying counter should be queried. If no @@ -3014,16 +3054,18 @@ system and application performance. or ``1`` and specifies whether the underlying counter should be reset during evaluation ``1`` or not ``0``. The default value is ``0``. - * * ``/statistics/min`` - - .. _statistics-min: - - :ref:`??` +.. list-table:: Performance counter ``/statistics/min`` + :widths: 20 80 + * * Counter type + * ``/statistics/min`` + * * Counter instance formatting * Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. + * * Description * Returns the current minimum value calculated based on the values queried from the underlying counter (the one specified as the instance name). + * * Parameters * Any parameter will be interpreted as a list of up to two comma separated (integer) values, where the first is the time interval (in milliseconds) at which the underlying counter should be queried. If no value is @@ -3032,17 +3074,19 @@ system and application performance. underlying counter should be reset during evaluation ``1`` or not ``0``. The default value is ``0``. - * * ``/statistics/rolling_min`` - - .. _statistics-rolling-min: - - :ref:`??` +.. list-table:: Performance counter ``/statistics/rolling_min`` + :widths: 20 80 + * * Counter type + * ``/statistics/rolling_min`` + * * Counter instance formatting * Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. + * * Description * Returns the current rolling minimum value calculated based on the values queried from the underlying counter (the one specified as the instance name). + * * Parameters * Any parameter will be interpreted as a list of up to three comma separated (integer) values, where the first is the time interval (in milliseconds) at which the underlying counter should be queried. If no @@ -3053,129 +3097,132 @@ system and application performance. or ``1`` and specifies whether the underlying counter should be reset during evaluation ``1`` or not ``0``. The default value is ``0``. -.. list-table:: Performance counters for elementary arithmetic operations +.. list-table:: Performance counter ``/arithmetics/add`` + :widths: 20 80 * * Counter type - * Counter instance formatting - * Description - * Parameters - * * ``/arithmetics/add`` - - .. _arithmetics-add: - - :ref:`??` - - * None + * ``/arithmetics/add`` + * * Description * Returns the sum calculated based on the values queried from the underlying counters (the ones specified as the parameters). + * * Parameters * The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. - * * ``/arithmetics/subtract`` - .. _arithmetics-subtract: +.. list-table:: Performance counter ``/arithmetics/subtract`` + :widths: 20 80 - :ref:`??` - - * None + * * Counter type + * ``/arithmetics/subtract`` + * * Description * Returns the difference calculated based on the values queried from the underlying counters (the ones specified as the parameters). + * * Parameters * The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. - * * ``/arithmetics/multiply`` - - .. _arithmetics-multiply: - :ref:`??` +.. list-table:: Performance counter ``/arithmetics/multiply`` + :widths: 20 80 - * None + * * Counter type + * ``/arithmetics/multiply`` + * * Description * Returns the product calculated based on the values queried from the underlying counters (the ones specified as the parameters). + * * Parameters * The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. - * * ``/arithmetics/divide`` - - .. _arithmetics-divide: - :ref:`??` +.. list-table:: Performance counter ``/arithmetics/divide`` + :widths: 20 80 - * None + * * Counter type + * ``/arithmetics/divide`` + * * Description * Returns the result of division of the values queried from the underlying counters (the ones specified as the parameters). + * * Parameters * The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. - * * ``/arithmetics/mean`` - - .. _arithmetics-mean: - :ref:`??` +.. list-table:: Performance counter ``/arithmetics/mean`` + :widths: 20 80 - * None + * * Counter type + * ``/arithmetics/mean`` + * * Description * Returns the average value of all values queried from the underlying counters (the ones specified as the parameters). + * * Parameters * The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. - * * ``/arithmetics/variance`` - - .. _arithmetics-variance: - :ref:`??` +.. list-table:: Performance counter ``/arithmetics/variance`` + :widths: 20 80 - * None + * * Counter type + * ``/arithmetics/variance`` + * * Description * Returns the standard deviation of all values queried from the underlying counters (the ones specified as the parameters). + * * Parameters * The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. - * * ``/arithmetics/median`` - - .. _arithmetics-median: - :ref:`??` +.. list-table:: Performance counter ``/arithmetics/median`` + :widths: 20 80 - * None + * * Counter type + * ``/arithmetics/median`` + * * Description * Returns the median value of all values queried from the underlying counters (the ones specified as the parameters). + * * Parameters * The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. - * * ``/arithmetics/min`` - .. _arithmetics-min: +.. list-table:: Performance counter ``/arithmetics/min`` + :widths: 20 80 - :ref:`??` - - * None + * * Counter type + * ``/arithmetics/min`` + * * Description * Returns the minimum value of all values queried from the underlying counters (the ones specified as the parameters). + * * Parameters * The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. - * * ``/arithmetics/max`` - .. _arithmetics-max: +.. list-table:: Performance counter ``/arithmetics/max`` + :widths: 20 80 - :ref:`??` - - * None + * * Counter type + * ``/arithmetics/max`` + * * Description * Returns the maximum value of all values queried from the underlying counters (the ones specified as the parameters). + * * Parameters * The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. - * * ``/arithmetics/count`` - .. _arithmetics-count: +.. list-table:: Performance counter ``/arithmetics/count`` + :widths: 20 80 - :ref:`??` - - * None + * * Counter type + * ``/arithmetics/count`` + * * Description * Returns the count value of all values queried from the underlying counters (the ones specified as the parameters). + * * Parameters * The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. @@ -3208,19 +3255,12 @@ system and application performance. /threads{locality#0/worker-thread#0}/count/cumulative,\ /threads{locality#0/worker-thread#1}/count/cumulative -.. list-table:: Performance counters tracking :term:`parcel` coalescing +.. list-table:: Performance counter ``/coalescing/count/parcels`` + :widths: 20 80 * * Counter type - * Counter instance formatting - * Description - * Parameters - - * * ``/coalescing/count/parcels`` - - .. _coalescing-count-parcels: - - :ref:`??` - + * ``/coalescing/count/parcels`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -3228,19 +3268,21 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of parcels for the given action should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the number of parcels handled by the message handler associated with the action which is given by the counter parameter. + * * Parameters * The action type. This is the string which has been used while registering the action with |hpx|, e.g. which has been passed as the second parameter to the macro :c:macro:`HPX_REGISTER_ACTION` or :c:macro:`HPX_REGISTER_ACTION_ID`. - * * ``/coalescing/count/messages`` - - .. _coalescing-count-messages: - - :ref:`??` +.. list-table:: Performance counter ``/coalescing/count/messages`` + :widths: 20 80 + * * Counter type + * ``/coalescing/count/messages`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -3248,19 +3290,21 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of messages for the given action should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the number of messages generated by the message handler associated with the action which is given by the counter parameter. + * * Parameters * The action type. This is the string which has been used while registering the action with |hpx|, e.g. which has been passed as the second parameter to the macro :c:macro:`HPX_REGISTER_ACTION` or :c:macro:`HPX_REGISTER_ACTION_ID`. - * * ``/coalescing/count/average-parcels-per-message`` - - .. _coalescing-count-average-parcels-per-message: - - :ref:`??` +.. list-table:: Performance counter ``/coalescing/count/average-parcels-per-message`` + :widths: 20 80 + * * Counter type + * ``/coalescing/count/average-parcels-per-message`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -3268,20 +3312,22 @@ system and application performance. ``*`` is the :term:`locality` id of the :term:`locality` the number of messages for the given action should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the average number of parcels sent in a message generated by the message handler associated with the action which is given by the counter parameter. + * * Parameters * The action type. This is the string which has been used while registering the action with |hpx|, e.g. which has been passed as the second parameter to the macro :c:macro:`HPX_REGISTER_ACTION` or :c:macro:`HPX_REGISTER_ACTION_ID` - * * ``/coalescing/time/average-parcel-arrival`` - - .. _coalescing-time-average-parcel-arrival: - - :ref:`??` +.. list-table:: Performance counter ``/coalescing/time/average-parcel-arrival`` + :widths: 20 80 + * * Counter type + * ``/coalescing/time/average-parcel-arrival`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -3290,19 +3336,21 @@ system and application performance. between parcels for the given action should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns the average time between arriving parcels for the action which is given by the counter parameter. + * * Parameters * The action type. This is the string which has been used while registering the action with |hpx|, e.g. which has been passed as the second parameter to the macro :c:macro:`HPX_REGISTER_ACTION` or :c:macro:`HPX_REGISTER_ACTION_ID` - * * ``/coalescing/time/parcel-arrival-histogram`` - - .. _coalescing-time-parcel-arrival-histogram: - - :ref:`??` +.. list-table:: Performance counter ``/coalescing/time/parcel-arrival-histogram`` + :widths: 20 80 + * * Counter type + * ``/coalescing/time/parcel-arrival-histogram`` + * * Counter instance formatting * ``locality#*/total`` where: @@ -3311,6 +3359,7 @@ system and application performance. between parcels for the given action should be queried for. The :term:`locality` id is a (zero based) number identifying the :term:`locality`. + * * Description * Returns a histogram representing the times between arriving parcels for the action which is given by the counter parameter. @@ -3325,7 +3374,7 @@ system and application performance. For each bucket the counter shows a value between ``0`` and ``1000`` which corresponds to a percentage value between ``0%`` and ``100%``. - + * * Parameters * The action type and optional histogram parameters. The action type is the string which has been used while registering the action with |hpx|, e.g. which has been passed as the second parameter to the macro From aeee44f08fa3e9ced7b5fd96481a21545b306f61 Mon Sep 17 00:00:00 2001 From: dimitraka Date: Thu, 11 May 2023 18:37:18 +0200 Subject: [PATCH 04/72] Fix docs build warning: title overline too short --- docs/sphinx/manual/using_the_lci_parcelport.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sphinx/manual/using_the_lci_parcelport.rst b/docs/sphinx/manual/using_the_lci_parcelport.rst index 616f1184697e..986d24f945db 100644 --- a/docs/sphinx/manual/using_the_lci_parcelport.rst +++ b/docs/sphinx/manual/using_the_lci_parcelport.rst @@ -7,9 +7,9 @@ .. _using_the_lci_parcelport: -============== +======================== Using the LCI parcelport -============== +======================== .. _info_lci: @@ -43,7 +43,7 @@ than the MPI parcelport. .. _build_lci_pp: Build |hpx| with the LCI parcelport -============================== +=================================== While building |hpx|, you can specify a set of |cmake| variables to enable and configure the LCI parcelport. Below, there is a set of the most important @@ -86,7 +86,7 @@ and frequently used CMake variables. .. _run_lci_pp: Run |hpx| with the LCI parcelport -=============================== +================================= We use the same mechanisms as MPI to launch LCI, so you can use the same way you run MPI parcelport to run LCI parcelport. Typically, it would be ``hpxrun``, ``mpirun``, or ``srun``. @@ -106,4 +106,4 @@ We encourage users to increase the zero-copy serialization threshold of LCI to ` either the cmake variable ``-DHPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD=8192`` (this will affect all the parcelports) or the command line option ``--hpx:ini=hpx.parcel.lci.zero_copy_serialization_threshold=8192`` -(this will only affect the LCI parcelport). \ No newline at end of file +(this will only affect the LCI parcelport). From e56a46d11956854ed9cf275fe370a413579021e7 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 24 May 2023 15:50:15 -0500 Subject: [PATCH 05/72] Give NVCC more information about the type --- libs/core/algorithms/include/hpx/parallel/util/loop.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/algorithms/include/hpx/parallel/util/loop.hpp b/libs/core/algorithms/include/hpx/parallel/util/loop.hpp index 9bf131fd7c01..8071cd73ff50 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/loop.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/loop.hpp @@ -214,7 +214,7 @@ namespace hpx::parallel::util { #if !defined(HPX_COMPUTE_DEVICE_CODE) template - inline constexpr loop_ind_t loop_ind = loop_ind_t{}; + inline constexpr loop_ind_t loop_ind = loop_ind_t{}; #else template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr Begin loop_ind( From 972b136785c81e06777ccc3061cc521466e297cb Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Thu, 25 May 2023 14:05:59 -0500 Subject: [PATCH 06/72] Rewriting wait_some to circumvent data races causing hangs --- libs/core/async_combinators/CMakeLists.txt | 2 +- .../hpx/async_combinators/wait_some.hpp | 145 ++++++++++-------- 2 files changed, 83 insertions(+), 64 deletions(-) diff --git a/libs/core/async_combinators/CMakeLists.txt b/libs/core/async_combinators/CMakeLists.txt index 9f19ec27c7ad..b7cf2059b489 100644 --- a/libs/core/async_combinators/CMakeLists.txt +++ b/libs/core/async_combinators/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022 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 diff --git a/libs/core/async_combinators/include/hpx/async_combinators/wait_some.hpp b/libs/core/async_combinators/include/hpx/async_combinators/wait_some.hpp index 9757e369ba95..c08caf3c2ff7 100644 --- a/libs/core/async_combinators/include/hpx/async_combinators/wait_some.hpp +++ b/libs/core/async_combinators/include/hpx/async_combinators/wait_some.hpp @@ -144,24 +144,21 @@ namespace hpx { #include #include #include -#include #include #include #include -#include #include #include #include #include -#include +#include +#include #include #include #include #include #include -#include -#include #include #include #include @@ -187,6 +184,7 @@ namespace hpx { template void operator()(SharedState const& shared_state) const { + hpx::intrusive_ptr> this_ = &wait_; if constexpr (!traits::is_shared_state_v) { apply(shared_state); @@ -194,43 +192,34 @@ namespace hpx { else { std::size_t counter = - wait_.count_.load(std::memory_order_acquire); + wait_.count_.load(std::memory_order_relaxed); if (counter < wait_.needed_count_ && shared_state) { if (!shared_state->is_ready(std::memory_order_relaxed)) { // handle future only if not enough futures are - // ready yet also, do not touch any futures which - // are already ready + // ready yet also, do not touch any futures that are + // already ready shared_state->execute_deferred(); // execute_deferred might have made the future ready if (!shared_state->is_ready( std::memory_order_relaxed)) { + auto state = shared_state; shared_state->set_on_completed( - util::deferred_call( - &wait_some::on_future_ready, - wait_.shared_from_this(), - hpx::execution_base::this_thread:: - agent())); + [this_ = HPX_MOVE(this_), + state = HPX_MOVE(state)] { + this_->on_future_ready( + state->has_exception()); + }); return; } } - - // check whether the current future is exceptional - if (!wait_.has_exceptional_results_ && - shared_state->has_exception()) - { - wait_.has_exceptional_results_ = true; - } } - if (wait_.count_.fetch_add(1) + 1 == wait_.needed_count_) - { - wait_.goal_reached_on_calling_thread_ = true; - } + wait_.on_future_ready(shared_state->has_exception()); } } @@ -263,24 +252,25 @@ namespace hpx { callback.apply(wait.values_); } + /////////////////////////////////////////////////////////////////////// template struct wait_some - : std::enable_shared_from_this> //-V690 { - public: - void on_future_ready(hpx::execution_base::agent_ref ctx) + void on_future_ready(bool has_exception) { + std::unique_lock l(mtx_.data_); + + // check whether the current future is exceptional + if (has_exception) + { + has_exceptional_results_ = true; + } + if (count_.fetch_add(1) + 1 == needed_count_) { - // reactivate waiting thread only if it's not us - if (ctx != hpx::execution_base::this_thread::agent()) - { - ctx.resume(); - } - else - { - goal_reached_on_calling_thread_ = true; - } + HPX_ASSERT_LOCKED(l, !notified_); + notified_ = true; + cond_.data_.notify_all(HPX_MOVE(l)); } } @@ -292,28 +282,35 @@ namespace hpx { wait_some& operator=(wait_some&&) = delete; public: - using argument_type = Sequence; - - wait_some(argument_type const& values, std::size_t n) noexcept - : values_(values) + template + wait_some(S&& values, std::size_t n) noexcept + : values_(HPX_FORWARD(S, values)) , count_(0) , needed_count_(n) + , refcount_(1) { + HPX_ASSERT_MSG(n > 0, + "wait_some should have to wait for at least one future to " + "become ready"); } + ~wait_some() = default; + bool operator()() { // set callback functions to executed wait future is ready set_on_completed_callback(*this); - // if all of the requested futures are already set, our - // callback above has already been called often enough, otherwise - // we suspend ourselves - if (!goal_reached_on_calling_thread_) + // if all of the requested futures are already set, our callback + // above has already been called often enough, otherwise we + // suspend ourselves { - // wait for any of the futures to return to become ready - hpx::execution_base::this_thread::suspend( - "hpx::detail::wait_some::operator()"); + std::unique_lock l(mtx_.data_); + if (count_.load(std::memory_order_acquire) < needed_count_) + { + HPX_ASSERT_LOCKED(l, !notified_); + cond_.data_.wait(l, "hpx::wait_some::operator()()"); + } } // at least N futures should be ready @@ -323,17 +320,44 @@ namespace hpx { return has_exceptional_results_; } - argument_type const& values_; + using argument_type = + std::conditional_t, Sequence, + std::decay_t>; + + argument_type values_; std::atomic count_; std::size_t const needed_count_; - bool goal_reached_on_calling_thread_ = false; bool has_exceptional_results_ = false; + bool notified_ = false; + + mutable util::cache_line_data mtx_; + mutable util::cache_line_data< + hpx::lcos::local::detail::condition_variable> + cond_; + + private: + friend void intrusive_ptr_add_ref(wait_some* p) noexcept + { + ++p->refcount_; + } + + friend void intrusive_ptr_release(wait_some* p) noexcept + { + if (0 == --p->refcount_) + { + delete p; + } + } + + hpx::util::atomic_count refcount_; }; - template - auto get_wait_some_frame(T const& values, std::size_t n) + template + auto get_wait_some_frame(Sequence&& values, std::size_t n) { - return std::make_shared>(values, n); + return hpx::intrusive_ptr>( + new wait_some(HPX_FORWARD(Sequence, values), n), + false); } } // namespace detail @@ -358,11 +382,10 @@ namespace hpx { { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "hpx::wait_some", "number of results to wait for is out of bounds"); - return false; } auto lazy_values = traits::acquire_shared_state_disp()(values); - auto f = detail::get_wait_some_frame(lazy_values, n); + auto f = detail::get_wait_some_frame(HPX_MOVE(lazy_values), n); return (*f)(); } @@ -406,11 +429,10 @@ namespace hpx { { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "hpx::wait_some", "number of results to wait for is out of bounds"); - return false; } auto lazy_values = traits::acquire_shared_state_disp()(values); - auto f = detail::get_wait_some_frame(lazy_values, n); + auto f = detail::get_wait_some_frame(HPX_MOVE(lazy_values), n); return (*f)(); } @@ -445,7 +467,7 @@ namespace hpx { wait_some_nothrow_t, std::size_t n, Iterator begin, Iterator end) { auto values = traits::acquire_shared_state()(begin, end); - auto f = detail::get_wait_some_frame(values, n); + auto f = detail::get_wait_some_frame(HPX_MOVE(values), n); return (*f)(); } @@ -469,7 +491,6 @@ namespace hpx { { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "hpx::wait_some", "number of results to wait for is out of bounds"); - return false; } f.wait(); @@ -484,7 +505,6 @@ namespace hpx { { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "hpx::wait_some", "number of results to wait for is out of bounds"); - return false; } f.wait(); @@ -504,14 +524,13 @@ namespace hpx { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "hpx::lcos::wait_some", "number of results to wait for is out of bounds"); - return false; } using result_type = hpx::tuple...>; result_type values(traits::detail::get_shared_state(ts)...); - auto f = detail::get_wait_some_frame(values, n); + auto f = detail::get_wait_some_frame(HPX_MOVE(values), n); return (*f)(); } @@ -652,7 +671,7 @@ namespace hpx { { auto values = traits::acquire_shared_state()(begin, count); - auto f = detail::get_wait_some_frame(values, n); + auto f = detail::get_wait_some_frame(HPX_MOVE(values), n); return (*f)(); } @@ -758,7 +777,7 @@ namespace hpx::lcos { Iterator wait_some_n( std::size_t n, Iterator begin, std::size_t count, error_code& = throws) { - hpx::wait_some(n, begin, count); + return hpx::wait_some(n, begin, count); } HPX_DEPRECATED_V( From 49b314248c18c09e62cd44c7d97071c60b94c958 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Thu, 18 May 2023 21:03:40 -0500 Subject: [PATCH 07/72] Resolve gcc problems on Windows - flyby: resolve winsock2.h warnings on windows - flyby: add CI builder for gcc/mingw on Windows # Conflicts: # libs/core/config/include/hpx/config/asio.hpp # libs/core/resource_partitioner/examples/guided_pool_test.cpp # libs/core/thread_support/include/hpx/thread_support/set_thread_name.hpp # libs/core/thread_support/src/set_thread_name.cpp --- .github/workflows/windows_debug_gcc_mingw.yml | 77 +++++++++++++++++ CMakeLists.txt | 16 +++- cmake/HPX_AddModule.cmake | 2 +- cmake/HPX_SetupApex.cmake | 2 +- libs/core/config/include/hpx/config/asio.hpp | 11 ++- libs/core/debugging/src/attach_debugger.cpp | 6 +- .../format/formatter/high_precision_time.cpp | 14 +++- .../include/hpx/plugin/detail/dll_windows.hpp | 8 ++ .../examples/guided_pool_test.cpp | 11 +-- .../oversubscribing_resource_partitioner.cpp | 3 + .../examples/simple_resource_partitioner.cpp | 3 + libs/core/runtime_local/CMakeLists.txt | 6 +- .../hpx/thread_support/set_thread_name.hpp | 3 +- .../thread_support/src/set_thread_name.cpp | 83 +++++++++++++++---- .../threading_base/src/thread_helpers.cpp | 3 +- libs/core/topology/src/topology.cpp | 6 +- .../src/server/runtime_support_server.cpp | 4 +- 17 files changed, 212 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/windows_debug_gcc_mingw.yml diff --git a/.github/workflows/windows_debug_gcc_mingw.yml b/.github/workflows/windows_debug_gcc_mingw.yml new file mode 100644 index 000000000000..4f61f32fc9b3 --- /dev/null +++ b/.github/workflows/windows_debug_gcc_mingw.yml @@ -0,0 +1,77 @@ +# Copyright (c) 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) + +name: Windows CI (Debug, gcc/mingw toolset) + +on: [pull_request] + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - uses: jwlawson/actions-setup-cmake@v1.9 + with: + cmake-version: '3.22.x' + - name: Install dependencies + run: | + choco install ninja -y + md C:\projects + $client = new-object System.Net.WebClient + $client.DownloadFile("https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.7z","C:\projects\boost_1_78_0.7z") + 7z x C:\projects\boost_1_78_0.7z -y -oC:\projects\boost + cd C:\projects\boost\boost_1_78_0 + .\bootstrap.bat gcc + .\b2.exe ` + link=shared ` + variant=debug ` + architecture=x86 ` + address-model=64 ` + threading=multi ` + --with-iostreams ` + --build-type=complete ` + install + $client.DownloadFile("https://download.open-mpi.org/release/hwloc/v2.8/hwloc-win64-build-2.8.0.zip","C:\projects\hwloc-win64-build-2.8.0.zip") + 7z x C:\projects\hwloc-win64-build-2.8.0.zip -y -oC:\projects + - name: Configure + shell: bash + run: | + cmake . -Bbuild -G'Ninja' \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_COMPILER=g++ \ + -DBOOST_ROOT="C:\Boost" \ + -DHWLOC_ROOT="C:\projects\hwloc-win64-build-2.8.0" \ + -DHPX_WITH_CXX_STANDARD=20 \ + -DHPX_WITH_STATIC_LINKING=ON \ + -DHPX_WITH_MALLOC=system \ + -DHPX_WITH_FETCH_ASIO=ON \ + -DHPX_WITH_PKGCONFIG=OFF \ + -DHPX_WITH_TESTS_MAX_THREADS_PER_LOCALITY=2 \ + -DHPX_WITH_EXAMPLES=ON \ + -DHPX_WITH_TESTS=ON \ + -DHPX_WITH_TESTS_UNIT=ON \ + -DHPX_WITH_DEPRECATION_WARNINGS=OFF \ + -DHPX_WITH_MODULES_AS_STATIC_LIBRARIES=OFF + - name: Build + shell: bash + run: | + cmake --build build --config Debug -- -j 4 + - name: Install + shell: bash + run: | + cmake --install build --config Debug + - name: Test + run: | + Set-Alias -Name grep -Value 'C:\Program Files\Git\usr\bin\grep.exe' + Set-Alias -Name sed -Value 'C:\Program Files\Git\usr\bin\sed.exe' + cd build + ctest ` + --output-on-failure ` + --build-config Debug ` + --tests-regex tests.examples ` + --exclude-regex ` + $(grep -v -e ^# -e ^$ D:/a/hpx/hpx/.github/workflows/tests.examples.targets | sed ':b;N;$!bb;s/\n/|/g') diff --git a/CMakeLists.txt b/CMakeLists.txt index bb20bb306279..57dc8c00a9f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,7 +110,7 @@ if(NOT HPX_CMAKE_LOGLEVEL) endif() # print initial diagnostics -hpx_info("CMake version: ${CMAKE_VERSION}") +hpx_info("CMake version: ${CMAKE_VERSION}, generator: ${CMAKE_GENERATOR}") hpx_info("HPX version: ${HPX_VERSION}") # ############################################################################## @@ -374,9 +374,9 @@ endif() # OBJECT libraries. In this case the fallback is to build whole-archive STATIC # libraries. set(HPX_WITH_MODULES_AS_STATIC_LIBRARIES_DEFAULT ON) -if("${CMAKE_MAKE_PROGRAM}" STREQUAL "ninja") - set(HPX_WITH_MODULES_AS_STATIC_LIBRARIES_DEFAULT OFF) -endif() +#if("${CMAKE_GENERATOR}" STREQUAL "Ninja") +# set(HPX_WITH_MODULES_AS_STATIC_LIBRARIES_DEFAULT ON) +#endif() hpx_option( HPX_WITH_MODULES_AS_STATIC_LIBRARIES @@ -1754,6 +1754,14 @@ if(WIN32) hpx_add_target_compile_option(-MP PUBLIC) # Increase the maximum size of object file sections hpx_add_target_compile_option(-bigobj PUBLIC) + elseif(MINGW) + if(HPX_CXX11_STD_ATOMIC_LIBRARIES) + target_link_libraries( + hpx_base_libraries INTERFACE ${HPX_CXX11_STD_ATOMIC_LIBRARIES} + ) + endif() + # Increase the maximum size of object file sections + hpx_add_target_compile_option(-Wa,-mbig-obj PUBLIC) endif() target_link_libraries(hpx_base_libraries INTERFACE psapi shlwapi) diff --git a/cmake/HPX_AddModule.cmake b/cmake/HPX_AddModule.cmake index f63f6ec29029..0fd9a441fcd1 100644 --- a/cmake/HPX_AddModule.cmake +++ b/cmake/HPX_AddModule.cmake @@ -428,7 +428,7 @@ function(add_hpx_module libname modulename) # Link modules to their higher-level libraries if(HPX_WITH_MODULES_AS_STATIC_LIBRARIES) - if(UNIX) + if(UNIX OR MINGW) if(APPLE) set(_module_target "-Wl,-all_load" "hpx_${modulename}") else() diff --git a/cmake/HPX_SetupApex.cmake b/cmake/HPX_SetupApex.cmake index 5c0cdd8efd24..39cb573f3ad4 100644 --- a/cmake/HPX_SetupApex.cmake +++ b/cmake/HPX_SetupApex.cmake @@ -70,7 +70,7 @@ if(HPX_WITH_APEX AND NOT TARGET APEX::apex) else() target_link_libraries(APEX::apex INTERFACE apex) endif() - if(UNIX AND NOT APPLE) + if((UNIX AND NOT APPLE) OR MINGW) target_link_options(APEX::apex INTERFACE "-Wl,-no-as-needed") endif() diff --git a/libs/core/config/include/hpx/config/asio.hpp b/libs/core/config/include/hpx/config/asio.hpp index ed1d700157cf..0f2f4523d5ba 100644 --- a/libs/core/config/include/hpx/config/asio.hpp +++ b/libs/core/config/include/hpx/config/asio.hpp @@ -7,8 +7,13 @@ #pragma once #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) -// On Windows, make sure winsock.h is not included even if windows.h is included -// before winsock2.h -#define _WINSOCKAPI_ +// On Windows, include winsock2.h as early as possible to make sure its seen by +// the compiler before #including windows.h #include #endif + +namespace asio { + + // forward declaration + class io_context; +} // namespace asio diff --git a/libs/core/debugging/src/attach_debugger.cpp b/libs/core/debugging/src/attach_debugger.cpp index 38e943b0e8e0..b9d8ec8dfde8 100644 --- a/libs/core/debugging/src/attach_debugger.cpp +++ b/libs/core/debugging/src/attach_debugger.cpp @@ -26,7 +26,9 @@ namespace hpx::util { void attach_debugger() { -#if defined(_POSIX_VERSION) && defined(HPX_HAVE_UNISTD_H) +#if defined(HPX_WINDOWS) + DebugBreak(); +#elif defined(_POSIX_VERSION) && defined(HPX_HAVE_UNISTD_H) volatile int i = 0; std::cerr << "PID: " << getpid() << " on " << asio::ip::host_name() << " ready for attaching debugger. Once attached set i = 1 " @@ -36,8 +38,6 @@ namespace hpx::util { { sleep(1); } -#elif defined(HPX_WINDOWS) - DebugBreak(); #endif } } // namespace hpx::util diff --git a/libs/core/logging/src/format/formatter/high_precision_time.cpp b/libs/core/logging/src/format/formatter/high_precision_time.cpp index cbe778d8f6f3..801eab265c26 100644 --- a/libs/core/logging/src/format/formatter/high_precision_time.cpp +++ b/libs/core/logging/src/format/formatter/high_precision_time.cpp @@ -29,6 +29,8 @@ #if !(defined(__linux) || defined(linux) || defined(__linux__) || \ defined(__FreeBSD__) || defined(__APPLE__) || defined(HPX_MSVC)) +#include + #include #endif @@ -56,15 +58,19 @@ namespace hpx::util::logging::formatter { std::tm local_tm; localtime_r(&tt, &local_tm); #elif defined(HPX_MSVC) - std::tm local_tm; - localtime_s(&local_tm, &tt); + std::tm local_tm{}; + [[maybe_unused]] auto const err = localtime_s(&local_tm, &tt); + HPX_ASSERT(err == 0); #else // fall back to non-thread-safe version on other platforms - std::tm local_tm; + std::tm local_tm{}; { static hpx::util::detail::spinlock mutex; std::lock_guard ul(mutex); - local_tm = *std::localtime(&tt); + if (auto const* lt = std::localtime(&tt); lt != nullptr) + { + local_tm = *lt; + } } #endif diff --git a/libs/core/plugin/include/hpx/plugin/detail/dll_windows.hpp b/libs/core/plugin/include/hpx/plugin/detail/dll_windows.hpp index 19bd8f683cdb..6d530b19424b 100644 --- a/libs/core/plugin/include/hpx/plugin/detail/dll_windows.hpp +++ b/libs/core/plugin/include/hpx/plugin/detail/dll_windows.hpp @@ -142,9 +142,17 @@ namespace hpx::util::plugin { static_assert( std::is_pointer_v, "std::is_pointer_v"); +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 100000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-function-type" +#endif // Cast the to right type. auto address = (SymbolType) GetProcAddress(dll_handle, symbol_name.c_str()); + +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 100000 +#pragma GCC diagnostic pop +#endif if (nullptr == address) { std::string const str = hpx::util::format( diff --git a/libs/core/resource_partitioner/examples/guided_pool_test.cpp b/libs/core/resource_partitioner/examples/guided_pool_test.cpp index 38e744ab9ad8..e885dc754433 100644 --- a/libs/core/resource_partitioner/examples/guided_pool_test.cpp +++ b/libs/core/resource_partitioner/examples/guided_pool_test.cpp @@ -4,11 +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 +// make available M_PI +#define _USE_MATH_DEFINES + +#include +#include +#include #include #include diff --git a/libs/core/resource_partitioner/examples/oversubscribing_resource_partitioner.cpp b/libs/core/resource_partitioner/examples/oversubscribing_resource_partitioner.cpp index 1eb89598c506..75d922a990b2 100644 --- a/libs/core/resource_partitioner/examples/oversubscribing_resource_partitioner.cpp +++ b/libs/core/resource_partitioner/examples/oversubscribing_resource_partitioner.cpp @@ -4,6 +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) +// make available M_PI +#define _USE_MATH_DEFINES + #include #if !defined(HPX_COMPUTE_DEVICE_CODE) #include diff --git a/libs/core/resource_partitioner/examples/simple_resource_partitioner.cpp b/libs/core/resource_partitioner/examples/simple_resource_partitioner.cpp index e2885caad324..6499e3e89824 100644 --- a/libs/core/resource_partitioner/examples/simple_resource_partitioner.cpp +++ b/libs/core/resource_partitioner/examples/simple_resource_partitioner.cpp @@ -5,6 +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) +// make available M_PI +#define _USE_MATH_DEFINES + #include #if !defined(HPX_COMPUTE_DEVICE_CODE) #include diff --git a/libs/core/runtime_local/CMakeLists.txt b/libs/core/runtime_local/CMakeLists.txt index 8d97c88663ad..864a8bc32fc4 100644 --- a/libs/core/runtime_local/CMakeLists.txt +++ b/libs/core/runtime_local/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2020 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 @@ -38,6 +38,10 @@ set(runtime_local_headers hpx/runtime_local/thread_stacktrace.hpp ) +if(NOT HPX_WITH_DISTRIBUTED_RUNTIME) + set(runtime_local_headers ${runtime_local_headers} hpx/init.hpp) +endif() + # cmake-format: off set(runtime_local_compat_headers hpx/custom_exception_info.hpp => hpx/modules/runtime_local.hpp diff --git a/libs/core/thread_support/include/hpx/thread_support/set_thread_name.hpp b/libs/core/thread_support/include/hpx/thread_support/set_thread_name.hpp index c188c6c6a7c6..5a53913a297d 100644 --- a/libs/core/thread_support/include/hpx/thread_support/set_thread_name.hpp +++ b/libs/core/thread_support/include/hpx/thread_support/set_thread_name.hpp @@ -8,7 +8,8 @@ #include -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) +#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && \ + !defined(HPX_MINGW) #include namespace hpx::util { diff --git a/libs/core/thread_support/src/set_thread_name.cpp b/libs/core/thread_support/src/set_thread_name.cpp index 43a189608f3c..4b8f0bc7260c 100644 --- a/libs/core/thread_support/src/set_thread_name.cpp +++ b/libs/core/thread_support/src/set_thread_name.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2013 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,40 +9,89 @@ #include -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) +#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && \ + !defined(HPX_MINGW) +#include #include +#include +#include + namespace hpx::util { - DWORD const MS_VC_EXCEPTION = 0x406D1388; + + constexpr DWORD MS_VC_EXCEPTION = 0x406D1388; #pragma pack(push, 8) - typedef struct tagTHREADNAME_INFO + using THREADNAME_INFO = struct tagTHREADNAME_INFO { DWORD dwType; // Must be 0x1000. LPCSTR szName; // Pointer to name (in user addr space). DWORD dwThreadID; // Thread ID (-1=caller thread). DWORD dwFlags; // Reserved for future use, must be zero. - } THREADNAME_INFO; + }; #pragma pack(pop) - // Set the name of the thread shown in the Visual Studio debugger - void set_thread_name(char const* threadName, DWORD dwThreadID) - { - THREADNAME_INFO info; - info.dwType = 0x1000; - info.szName = threadName; - info.dwThreadID = dwThreadID; - info.dwFlags = 0; + namespace detail { - __try + std::wstring to_wide_string(char const* name) noexcept { - RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), - (ULONG_PTR*) &info); + try + { + std::string const str(name); + if (str.empty()) + return {}; + + // determine required length of new string + std::size_t const req_length = MultiByteToWideChar(CP_UTF8, 0, + str.c_str(), static_cast(str.length()), nullptr, 0); + + // construct new string of required length + std::wstring ret(req_length, L'\0'); + + // convert old string to new string + MultiByteToWideChar(CP_UTF8, 0, str.c_str(), + static_cast(str.length()), ret.data(), + static_cast(ret.length())); + + return ret; + } + catch (...) + { + return {}; + } } - __except (EXCEPTION_EXECUTE_HANDLER) + + void set_thread_name(char const* thread_name) noexcept { + // set thread name the 'old' way + THREADNAME_INFO info; + info.dwType = 0x1000; + info.szName = thread_name; + info.dwThreadID = -1; + info.dwFlags = 0; + + __try + { + RaiseException(MS_VC_EXCEPTION, 0, + sizeof(info) / sizeof(ULONG_PTR), + reinterpret_cast(&info)); + } + __except (EXCEPTION_EXECUTE_HANDLER) + { + } } + } // namespace detail + + // Set the name of the thread shown in the Visual Studio debugger + void set_thread_name(char const* thread_name) noexcept + { + detail::set_thread_name(thread_name); + + // also set it the 'new' way in case the application is not running in + // the debugger at this time + SetThreadDescription( + GetCurrentThread(), detail::to_wide_string(thread_name).c_str()); } } // namespace hpx::util diff --git a/libs/core/threading_base/src/thread_helpers.cpp b/libs/core/threading_base/src/thread_helpers.cpp index 7fc4fce6f422..cac1b91c17e8 100644 --- a/libs/core/threading_base/src/thread_helpers.cpp +++ b/libs/core/threading_base/src/thread_helpers.cpp @@ -612,7 +612,8 @@ namespace hpx::this_thread { return (std::numeric_limits::max)(); } - bool has_sufficient_stack_space(std::size_t space_needed) noexcept + bool has_sufficient_stack_space( + [[maybe_unused]] std::size_t space_needed) noexcept { if (nullptr == hpx::threads::get_self_ptr()) return false; diff --git a/libs/core/topology/src/topology.cpp b/libs/core/topology/src/topology.cpp index c050e4b36b4b..ba734c52c0ac 100644 --- a/libs/core/topology/src/topology.cpp +++ b/libs/core/topology/src/topology.cpp @@ -130,12 +130,12 @@ namespace hpx::threads::detail { // abstract away memory page size std::size_t get_memory_page_size_impl() { -#if defined(HPX_HAVE_UNISTD_H) - return sysconf(_SC_PAGE_SIZE); -#elif defined(HPX_WINDOWS) +#if defined(HPX_WINDOWS) SYSTEM_INFO systemInfo; GetSystemInfo(&systemInfo); return static_cast(systemInfo.dwPageSize); +#elif defined(HPX_HAVE_UNISTD_H) + return sysconf(_SC_PAGE_SIZE); #else return 4096; #endif diff --git a/libs/full/runtime_distributed/src/server/runtime_support_server.cpp b/libs/full/runtime_distributed/src/server/runtime_support_server.cpp index f58c88ccb1a7..d8bfcc4528c4 100644 --- a/libs/full/runtime_distributed/src/server/runtime_support_server.cpp +++ b/libs/full/runtime_distributed/src/server/runtime_support_server.cpp @@ -1693,8 +1693,8 @@ namespace hpx { namespace components { namespace server { /////////////////////////////////////////////////////////////////////////// // Load all components from the ini files found in the configuration bool runtime_support::load_plugins(util::section& ini, - hpx::program_options::options_description& options, - std::set& startup_handled) + [[maybe_unused]] hpx::program_options::options_description& options, + [[maybe_unused]] std::set& startup_handled) { // load all components as described in the configuration information if (!ini.has_section("hpx.plugins")) From 38fd73f34caf5583ad2e09ea26fe8ba8ef7acd09 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Sun, 21 May 2023 14:45:17 -0500 Subject: [PATCH 08/72] Remove duplicate headers, instead generate those on demand --- .cmake-format.py | 1 + ...ingw.yml => windows_release_gcc_mingw.yml} | 23 +--- CMakeLists.txt | 10 +- cmake/HPX_AddModule.cmake | 23 ++++ cmake/HPX_SetupTarget.cmake | 5 + cmake/templates/hpxrun.py.in | 1 + docs/sphinx/api/public_api.rst | 62 +++++------ examples/quickstart/task_group_docs.cpp | 4 +- .../config/include/hpx/config/weak_symbol.hpp | 3 +- .../regressions/protect_with_nullary_pfo.cpp | 10 +- libs/core/include_local/CMakeLists.txt | 101 +++++++++++++----- .../{local/algorithm.hpp => algorithm.hpp.in} | 2 + .../include/hpx/{local => }/any.hpp | 1 + .../hpx/{local/barrier.hpp => barrier.hpp.in} | 2 + libs/core/include_local/include/hpx/bit.hpp | 10 ++ .../hpx/{local/channel.hpp => channel.hpp.in} | 9 +- .../core/include_local/include/hpx/chrono.hpp | 9 ++ .../hpx/{local/compute.hpp => compute.hpp.in} | 2 + .../hpx/{local => }/condition_variable.hpp | 0 .../include/hpx/{local => }/datapar.hpp | 0 .../include/hpx/{local => }/exception.hpp | 0 .../include/hpx/{local => }/execution.hpp | 2 + .../include/hpx/experimental/task_group.hpp | 9 ++ .../core/include_local/include/hpx/format.hpp | 9 ++ .../include/hpx/{local => }/functional.hpp | 0 .../hpx/{local/future.hpp => future.hpp.in} | 2 + .../include/hpx/{local => }/generator.hpp | 0 .../hpx/{local/latch.hpp => latch.hpp.in} | 2 + .../include/hpx/local/chrono.hpp | 11 -- .../include/hpx/{local => }/memory.hpp | 2 + .../include/hpx/{local => }/mutex.hpp | 5 +- .../include/hpx/{local => }/numeric.hpp | 0 .../include/hpx/{local => }/optional.hpp | 0 .../hpx/{local/runtime.hpp => runtime.hpp.in} | 2 + .../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/hpx/{local => }/thread.hpp | 4 +- .../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 | 18 +++- .../hpx/{local/init.hpp => init.hpp.in} | 0 .../format/formatter/high_precision_time.cpp | 1 + libs/core/runtime_local/CMakeLists.txt | 4 - .../full/parcelset/tests/unit/put_parcels.cpp | 2 +- 49 files changed, 227 insertions(+), 125 deletions(-) rename .github/workflows/{windows_debug_gcc_mingw.yml => windows_release_gcc_mingw.yml} (73%) rename libs/core/include_local/include/hpx/{local/algorithm.hpp => algorithm.hpp.in} (84%) rename libs/core/include_local/include/hpx/{local => }/any.hpp (81%) rename libs/core/include_local/include/hpx/{local/barrier.hpp => barrier.hpp.in} (78%) create mode 100644 libs/core/include_local/include/hpx/bit.hpp rename libs/core/include_local/include/hpx/{local/channel.hpp => channel.hpp.in} (67%) create mode 100644 libs/core/include_local/include/hpx/chrono.hpp rename libs/core/include_local/include/hpx/{local/compute.hpp => compute.hpp.in} (83%) 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%) create mode 100644 libs/core/include_local/include/hpx/experimental/task_group.hpp create mode 100644 libs/core/include_local/include/hpx/format.hpp rename libs/core/include_local/include/hpx/{local => }/functional.hpp (100%) rename libs/core/include_local/include/hpx/{local/future.hpp => future.hpp.in} (85%) rename libs/core/include_local/include/hpx/{local => }/generator.hpp (100%) rename libs/core/include_local/include/hpx/{local/latch.hpp => latch.hpp.in} (78%) delete mode 100644 libs/core/include_local/include/hpx/local/chrono.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 => runtime.hpp.in} (80%) 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/core/include_local/include/hpx/{local => }/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 => init.hpp.in} (100%) diff --git a/.cmake-format.py b/.cmake-format.py index 59592124237e..a84ef9e1025c 100644 --- a/.cmake-format.py +++ b/.cmake-format.py @@ -352,6 +352,7 @@ 'nargs': '1+'}}, 'add_hpx_module': { 'kwargs': { 'CMAKE_SUBDIRS': '+', 'COMPAT_HEADERS': '+', + 'GENERATED_HEADERS': '+', 'DEPENDENCIES': '+', 'EXCLUDE_FROM_GLOBAL_HEADER': '+', 'ADD_TO_GLOBAL_HEADER': '+', diff --git a/.github/workflows/windows_debug_gcc_mingw.yml b/.github/workflows/windows_release_gcc_mingw.yml similarity index 73% rename from .github/workflows/windows_debug_gcc_mingw.yml rename to .github/workflows/windows_release_gcc_mingw.yml index 4f61f32fc9b3..64267c21be06 100644 --- a/.github/workflows/windows_debug_gcc_mingw.yml +++ b/.github/workflows/windows_release_gcc_mingw.yml @@ -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) -name: Windows CI (Debug, gcc/mingw toolset) +name: Windows CI (Release, gcc/mingw toolset) on: [pull_request] @@ -28,7 +28,7 @@ jobs: .\bootstrap.bat gcc .\b2.exe ` link=shared ` - variant=debug ` + variant=release ` architecture=x86 ` address-model=64 ` threading=multi ` @@ -41,7 +41,7 @@ jobs: shell: bash run: | cmake . -Bbuild -G'Ninja' \ - -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_COMPILER=g++ \ -DBOOST_ROOT="C:\Boost" \ -DHWLOC_ROOT="C:\projects\hwloc-win64-build-2.8.0" \ @@ -59,19 +59,4 @@ jobs: - name: Build shell: bash run: | - cmake --build build --config Debug -- -j 4 - - name: Install - shell: bash - run: | - cmake --install build --config Debug - - name: Test - run: | - Set-Alias -Name grep -Value 'C:\Program Files\Git\usr\bin\grep.exe' - Set-Alias -Name sed -Value 'C:\Program Files\Git\usr\bin\sed.exe' - cd build - ctest ` - --output-on-failure ` - --build-config Debug ` - --tests-regex tests.examples ` - --exclude-regex ` - $(grep -v -e ^# -e ^$ D:/a/hpx/hpx/.github/workflows/tests.examples.targets | sed ':b;N;$!bb;s/\n/|/g') + cmake --build build --config Release -- -j 2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 57dc8c00a9f9..f9cf51e680c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -373,10 +373,10 @@ endif() # The cmake Ninja generator runs out of memory if the modules are being built as # OBJECT libraries. In this case the fallback is to build whole-archive STATIC # libraries. -set(HPX_WITH_MODULES_AS_STATIC_LIBRARIES_DEFAULT ON) -#if("${CMAKE_GENERATOR}" STREQUAL "Ninja") -# set(HPX_WITH_MODULES_AS_STATIC_LIBRARIES_DEFAULT ON) -#endif() +set(HPX_WITH_MODULES_AS_STATIC_LIBRARIES_DEFAULT OFF) +if("${CMAKE_GENERATOR}" STREQUAL "Ninja") + set(HPX_WITH_MODULES_AS_STATIC_LIBRARIES_DEFAULT ON) +endif() hpx_option( HPX_WITH_MODULES_AS_STATIC_LIBRARIES @@ -1760,8 +1760,6 @@ if(WIN32) hpx_base_libraries INTERFACE ${HPX_CXX11_STD_ATOMIC_LIBRARIES} ) endif() - # Increase the maximum size of object file sections - hpx_add_target_compile_option(-Wa,-mbig-obj PUBLIC) endif() target_link_libraries(hpx_base_libraries INTERFACE psapi shlwapi) diff --git a/cmake/HPX_AddModule.cmake b/cmake/HPX_AddModule.cmake index 0fd9a441fcd1..02657dd136db 100644 --- a/cmake/HPX_AddModule.cmake +++ b/cmake/HPX_AddModule.cmake @@ -15,6 +15,7 @@ function(add_hpx_module libname modulename) SOURCES HEADERS COMPAT_HEADERS + GENERATED_HEADERS OBJECTS DEPENDENCIES MODULE_DEPENDENCIES @@ -160,6 +161,28 @@ function(add_hpx_module libname modulename) set(generated_headers ${global_header}) endif() + # some headers files have to be generated, remove the `.in` file extension + if(${modulename}_GENERATED_HEADERS) + set(generated_file_base "${CMAKE_CURRENT_BINARY_DIR}/include") + if(NOT HPX_WITH_DISTRIBUTED_RUNTIME) + foreach(file_to_generate ${${modulename}_GENERATED_HEADERS}) + file(COPY_FILE include/${file_to_generate}.in + ${generated_file_base}/${file_to_generate} ONLY_IF_DIFFERENT + ) + set(generated_headers ${generated_headers} + ${generated_file_base}/${file_to_generate} + ) + endforeach() + else() + foreach(file_to_generate ${${modulename}_GENERATED_HEADERS}) + if(EXISTS ${file_to_generate}) + hpx_warn("Removing zombie generated header: ${file_to_generate}") + file(REMOVE ${file_to_generate}) + endif() + endforeach() + endif() + endif() + set(has_config_info) has_configuration_summary(${modulename} has_config_info) if(has_config_info) diff --git a/cmake/HPX_SetupTarget.cmake b/cmake/HPX_SetupTarget.cmake index 0a15727ca69a..aec75f68959e 100644 --- a/cmake/HPX_SetupTarget.cmake +++ b/cmake/HPX_SetupTarget.cmake @@ -183,6 +183,11 @@ function(hpx_setup_target target) endif() endif() + if(("${_type}" STREQUAL "EXECUTABLE") AND MINGW) + # Increase the maximum size of object file sections + target_compile_options(${target} BEFORE PRIVATE "-Wa,-mbig-obj") + endif() + if(target_COMPONENT_DEPENDENCIES) hpx_print_list( "DEBUG" "setup_target.${target} COMPONENT_DEPENDENCIES: " diff --git a/cmake/templates/hpxrun.py.in b/cmake/templates/hpxrun.py.in index 4e6d3371d84d..70a5991e22f0 100755 --- a/cmake/templates/hpxrun.py.in +++ b/cmake/templates/hpxrun.py.in @@ -422,6 +422,7 @@ Used by the tcp parcelport only. msg = 'Process 0 failed with an unexpected error ' msg += 'code of ' + str(ret) + ' (expected ' + str(options.expected) msg += ')' + print(msg, sys.stderr) sys.exit(1) sys.exit(0) diff --git a/docs/sphinx/api/public_api.rst b/docs/sphinx/api/public_api.rst index 637289c7e83a..7fc1acfb620a 100644 --- a/docs/sphinx/api/public_api.rst +++ b/docs/sphinx/api/public_api.rst @@ -23,7 +23,7 @@ sub-namespaces will eventually be removed. ``hpx/algorithm.hpp`` ===================== -The header :hpx-header:`libs/full/include/include,hpx/algorithm.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/algorithm.hpp` corresponds to the C++ standard library header :cppreference-header:`algorithm`. See :ref:`parallel_algorithms` for more information about the parallel algorithms. @@ -190,7 +190,7 @@ Functions ``hpx/any.hpp`` =============== -The header :hpx-header:`libs/full/include/include,hpx/any.hpp` corresponds to the C++ +The header :hpx-header:`libs/full/include,hpx/any.hpp` corresponds to the C++ standard library header :cppreference-header:`any`. :cpp:type:`hpx::any` is compatible with ``std::any``. @@ -252,7 +252,7 @@ Macros ``hpx/barrier.hpp`` =================== -The header :hpx-header:`libs/full/include/include,hpx/barrier.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/barrier.hpp` corresponds to the C++ standard library header :cppreference-header:`barrier` and contains a distributed barrier implementation. This functionality is also exposed through the ``hpx::distributed`` namespace. The name in ``hpx::distributed`` should be preferred. @@ -281,7 +281,7 @@ Classes ``hpx/channel.hpp`` =================== -The header :hpx-header:`libs/full/include/include,hpx/channel.hpp` contains a local and a +The header :hpx-header:`libs/full/include,hpx/channel.hpp` contains a local and a distributed channel implementation. This functionality is also exposed through the ``hpx::distributed`` namespace. The name in ``hpx::distributed`` should be preferred. @@ -309,7 +309,7 @@ Classes ``hpx/chrono.hpp`` ================== -The header :hpx-header:`libs/full/include/include,hpx/chrono.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/chrono.hpp` corresponds to the C++ standard library header :cppreference-header:`chrono`. The following replacements and extensions are provided compared to :cppreference-header:`chrono`. @@ -331,7 +331,7 @@ Classes ``hpx/condition_variable.hpp`` ============================== -The header :hpx-header:`libs/full/include/include,hpx/condition_variable.hpp` corresponds to the C++ +The header :hpx-header:`libs/full/include,hpx/condition_variable.hpp` corresponds to the C++ standard library header :cppreference-header:`condition_variable`. Classes @@ -352,7 +352,7 @@ Classes ``hpx/exception.hpp`` ===================== -The header :hpx-header:`libs/full/include/include,hpx/exception.hpp` corresponds to +The header :hpx-header:`libs/full/include,hpx/exception.hpp` corresponds to the C++ standard library header :cppreference-header:`exception`. :cpp:class:`hpx::exception` extends ``std::exception`` and is the base class for all exceptions thrown in |hpx|. :c:macro:`HPX_THROW_EXCEPTION` can be used to throw |hpx| exceptions with file and line information @@ -379,7 +379,7 @@ Classes ``hpx/execution.hpp`` ===================== -The header :hpx-header:`libs/full/include/include,hpx/execution.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/execution.hpp` corresponds to the C++ standard library header :cppreference-header:`execution`. See :ref:`parallel`, :ref:`parallel_algorithms` and :ref:`executor_parameters` for more information about execution policies and executor parameters. @@ -429,7 +429,7 @@ Classes ``hpx/functional.hpp`` ====================== -The header :hpx-header:`libs/full/include/include,hpx/functional.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/functional.hpp` corresponds to the C++ standard library header :cppreference-header:`functional`. :cpp:class:`hpx::function` is a more efficient and serializable replacement for ``std::function``. @@ -492,7 +492,7 @@ Functions ``hpx/future.hpp`` ================== -The header :hpx-header:`libs/full/include/include,hpx/future.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/future.hpp` corresponds to the C++ standard library header :cppreference-header:`future`. See :ref:`extend_futures` for more information about extensions to futures compared to the C++ standard library. @@ -609,7 +609,7 @@ Functions ``hpx/latch.hpp`` ================= -The header :hpx-header:`libs/full/include/include,hpx/latch.hpp` corresponds to the C++ +The header :hpx-header:`libs/full/include,hpx/latch.hpp` corresponds to the C++ standard library header :cppreference-header:`latch`. It contains a local and a distributed latch implementation. This functionality is also exposed through the ``hpx::distributed`` namespace. The name in ``hpx::distributed`` should be preferred. @@ -638,7 +638,7 @@ Classes ``hpx/mutex.hpp`` ================= -The header :hpx-header:`libs/full/include/include,hpx/mutex.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/mutex.hpp` corresponds to the C++ standard library header :cppreference-header:`mutex`. Classes @@ -674,7 +674,7 @@ Functions ``hpx/memory.hpp`` ================== -The header :hpx-header:`libs/full/include/include,hpx/memory.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/memory.hpp` corresponds to the C++ standard library header :cppreference-header:`memory`. It contains parallel versions of the copy, fill, move, and construct helper functions in :cppreference-header:`memory`. See :ref:`parallel_algorithms` for more information about the parallel algorithms. @@ -721,7 +721,7 @@ Functions ``hpx/numeric.hpp`` =================== -The header :hpx-header:`libs/full/include/include,hpx/numeric.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/numeric.hpp` corresponds to the C++ standard library header :cppreference-header:`numeric`. See :ref:`parallel_algorithms` for more information about the parallel algorithms. @@ -761,7 +761,7 @@ Functions ``hpx/optional.hpp`` ==================== -The header :hpx-header:`libs/full/include/include,hpx/optional.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/optional.hpp` corresponds to the C++ standard library header :cppreference-header:`optional`. :cpp:type:`hpx::optional` is compatible with ``std::optional``. @@ -788,7 +788,7 @@ Classes ``hpx/runtime.hpp`` =================== -The header :hpx-header:`libs/full/include/include,hpx/runtime.hpp` contains functions for accessing +The header :hpx-header:`libs/full/include,hpx/runtime.hpp` contains functions for accessing local and distributed runtime information. Typedefs @@ -848,7 +848,7 @@ Functions ``hpx/source_location.hpp`` =========================== -The header :hpx-header:`libs/full/include/include,hpx/source_location.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/source_location.hpp` corresponds to the C++ standard library header :cppreference-header:`source_location`. Classes @@ -867,7 +867,7 @@ Classes ``hpx/system_error.hpp`` ======================== -The header :hpx-header:`libs/full/include/include,hpx/system_error.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/system_error.hpp` corresponds to the C++ standard library header :cppreference-header:`system_error`. Classes @@ -886,7 +886,7 @@ Classes ``hpx/task_block.hpp`` ====================== -The header :hpx-header:`libs/full/include/include,hpx/task_block.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/task_block.hpp` corresponds to the ``task_block`` feature in |cpp17_n4755|_. See :ref:`using_task_block` for more details on using task blocks. @@ -918,16 +918,16 @@ Functions .. _public_api_header_hpx_task_group: -``hpx/task_group.hpp`` -====================== +``hpx/experimental/task_group.hpp`` +=================================== -The header :hpx-header:`libs/full/include/include,hpx/task_group.hpp` corresponds to the -``task_group`` feature in |oneTBB|_. +The header :hpx-header:`libs/core/include,hpx/experimental/task_group.hpp` +corresponds to the ``task_group`` feature in |oneTBB|_. Classes ------- -.. table:: Classes of header ``hpx/task_group.hpp`` +.. table:: Classes of header ``hpx/experimental/task_group.hpp`` +---------------------------------------------------------+ | Class | @@ -940,7 +940,7 @@ Classes ``hpx/thread.hpp`` ================== -The header :hpx-header:`libs/full/include/include,hpx/thread.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/thread.hpp` corresponds to the C++ standard library header :cppreference-header:`thread`. The functionality in this header is equivalent to the standard library thread functionality, with the exception that the |hpx| equivalents are implemented on top of lightweight threads and the |hpx| runtime. @@ -976,7 +976,7 @@ Functions ``hpx/semaphore.hpp`` ===================== -The header :hpx-header:`libs/full/include/include,hpx/semaphore.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/semaphore.hpp` corresponds to the C++ standard library header :cppreference-header:`semaphore`. Classes @@ -996,7 +996,7 @@ Classes ``hpx/shared_mutex.hpp`` ======================== -The header :hpx-header:`libs/full/include/include,hpx/shared_mutex.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/shared_mutex.hpp` corresponds to the C++ standard library header :cppreference-header:`shared_mutex`. Classes @@ -1015,7 +1015,7 @@ Classes ``hpx/stop_token.hpp`` ====================== -The header :hpx-header:`libs/full/include/include,hpx/stop_token.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/stop_token.hpp` corresponds to the C++ standard library header :cppreference-header:`stop_token`. Constants @@ -1048,7 +1048,7 @@ Classes ``hpx/tuple.hpp`` ================= -The header :hpx-header:`libs/full/include/include,hpx/tuple.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/tuple.hpp` corresponds to the C++ standard library header :cppreference-header:`tuple`. :cpp:class:`hpx::tuple` can be used in CUDA device code, unlike ``std::tuple``. @@ -1096,7 +1096,7 @@ Functions ``hpx/type_traits.hpp`` ======================= -The header :hpx-header:`libs/full/include/include,hpx/type_traits.hpp` corresponds to the +The header :hpx-header:`libs/full/include,hpx/type_traits.hpp` corresponds to the C++ standard library header :cppreference-header:`type_traits`. Classes @@ -1116,7 +1116,7 @@ Classes ``hpx/unwrap.hpp`` ================== -The header :hpx-header:`libs/full/include/include,hpx/unwrap.hpp` contains utilities for +The header :hpx-header:`libs/full/include,hpx/unwrap.hpp` contains utilities for unwrapping futures. Classes diff --git a/examples/quickstart/task_group_docs.cpp b/examples/quickstart/task_group_docs.cpp index aca5357ff301..f4f5d02cc117 100644 --- a/examples/quickstart/task_group_docs.cpp +++ b/examples/quickstart/task_group_docs.cpp @@ -8,8 +8,8 @@ //[task_group_docs -#include -#include +#include +#include #include void task1() diff --git a/libs/core/config/include/hpx/config/weak_symbol.hpp b/libs/core/config/include/hpx/config/weak_symbol.hpp index 22f3f062b260..f0ac710e46f5 100644 --- a/libs/core/config/include/hpx/config/weak_symbol.hpp +++ b/libs/core/config/include/hpx/config/weak_symbol.hpp @@ -6,7 +6,8 @@ #pragma once -#if (defined(__GNUC__) || defined(__clang__)) && !defined(_MSC_VER) +#if (defined(__GNUC__) || defined(__clang__)) && !defined(_MSC_VER) && \ + !defined(HPX_MINGW) #define HPX_WEAK_SYMBOL __attribute__((weak)) #else #define HPX_WEAK_SYMBOL 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..3323fb36b74a 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,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 #include diff --git a/libs/core/include_local/CMakeLists.txt b/libs/core/include_local/CMakeLists.txt index 48c64f220fcf..9cb2538bcc60 100644 --- a/libs/core/include_local/CMakeLists.txt +++ b/libs/core/include_local/CMakeLists.txt @@ -5,42 +5,85 @@ # 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/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 ) +set(generated_include_local_headers + hpx/algorithm.hpp + hpx/barrier.hpp + hpx/channel.hpp + hpx/compute.hpp + hpx/future.hpp + hpx/latch.hpp + hpx/runtime.hpp +) + +# The headers in hpx/local/ were deprecated in HPX V1.9.1 +# 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} + GENERATED_HEADERS ${generated_include_local_headers} MODULE_DEPENDENCIES hpx_algorithms hpx_async_base diff --git a/libs/core/include_local/include/hpx/local/algorithm.hpp b/libs/core/include_local/include/hpx/algorithm.hpp.in similarity index 84% rename from libs/core/include_local/include/hpx/local/algorithm.hpp rename to libs/core/include_local/include/hpx/algorithm.hpp.in index 9c14580d81a4..2af2ef9905cb 100644 --- a/libs/core/include_local/include/hpx/local/algorithm.hpp +++ b/libs/core/include_local/include/hpx/algorithm.hpp.in @@ -4,6 +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) +// Do not edit this file! It has been generated by the cmake configuration step. + #pragma once #include diff --git a/libs/core/include_local/include/hpx/local/any.hpp b/libs/core/include_local/include/hpx/any.hpp similarity index 81% rename from libs/core/include_local/include/hpx/local/any.hpp rename to libs/core/include_local/include/hpx/any.hpp index ce1f6c25d2c9..b84b39e9c622 100644 --- a/libs/core/include_local/include/hpx/local/any.hpp +++ b/libs/core/include_local/include/hpx/any.hpp @@ -7,3 +7,4 @@ #pragma once #include +#include diff --git a/libs/core/include_local/include/hpx/local/barrier.hpp b/libs/core/include_local/include/hpx/barrier.hpp.in similarity index 78% rename from libs/core/include_local/include/hpx/local/barrier.hpp rename to libs/core/include_local/include/hpx/barrier.hpp.in index c32355c90ea5..7246e322d669 100644 --- a/libs/core/include_local/include/hpx/local/barrier.hpp +++ b/libs/core/include_local/include/hpx/barrier.hpp.in @@ -4,6 +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) +// Do not edit this file! It has been generated by the cmake configuration step. + #pragma once #include 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.in similarity index 67% rename from libs/core/include_local/include/hpx/local/channel.hpp rename to libs/core/include_local/include/hpx/channel.hpp.in index cb41eb22cc38..a655c1b0e3f3 100644 --- a/libs/core/include_local/include/hpx/local/channel.hpp +++ b/libs/core/include_local/include/hpx/channel.hpp.in @@ -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) -#pragma once +// Do not edit this file! It has been generated by the cmake configuration step. -#include -#include +#pragma once -namespace hpx { - using hpx::lcos::local::channel; -} +#include diff --git a/libs/core/include_local/include/hpx/chrono.hpp b/libs/core/include_local/include/hpx/chrono.hpp new file mode 100644 index 000000000000..8199df0acb11 --- /dev/null +++ b/libs/core/include_local/include/hpx/chrono.hpp @@ -0,0 +1,9 @@ +// 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/core/include_local/include/hpx/local/compute.hpp b/libs/core/include_local/include/hpx/compute.hpp.in similarity index 83% rename from libs/core/include_local/include/hpx/local/compute.hpp rename to libs/core/include_local/include/hpx/compute.hpp.in index f7d021832794..de7067ceff41 100644 --- a/libs/core/include_local/include/hpx/local/compute.hpp +++ b/libs/core/include_local/include/hpx/compute.hpp.in @@ -4,6 +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) +// Do not edit this file! It has been generated by the cmake configuration step. + #pragma once #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/experimental/task_group.hpp b/libs/core/include_local/include/hpx/experimental/task_group.hpp new file mode 100644 index 000000000000..dfcefff952a6 --- /dev/null +++ b/libs/core/include_local/include/hpx/experimental/task_group.hpp @@ -0,0 +1,9 @@ +// 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/core/include_local/include/hpx/format.hpp b/libs/core/include_local/include/hpx/format.hpp new file mode 100644 index 000000000000..0cad59b9f37d --- /dev/null +++ b/libs/core/include_local/include/hpx/format.hpp @@ -0,0 +1,9 @@ +// 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 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.in similarity index 85% rename from libs/core/include_local/include/hpx/local/future.hpp rename to libs/core/include_local/include/hpx/future.hpp.in index b0329b022623..07849a9f9580 100644 --- a/libs/core/include_local/include/hpx/local/future.hpp +++ b/libs/core/include_local/include/hpx/future.hpp.in @@ -4,6 +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) +// Do not edit this file! It has been generated by the cmake configuration step. + #pragma once #include 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.in similarity index 78% rename from libs/core/include_local/include/hpx/local/latch.hpp rename to libs/core/include_local/include/hpx/latch.hpp.in index 9da4f1d0f5b4..02d02828a844 100644 --- a/libs/core/include_local/include/hpx/local/latch.hpp +++ b/libs/core/include_local/include/hpx/latch.hpp.in @@ -4,6 +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) +// Do not edit this file! It has been generated by the cmake configuration step. + #pragma once #include 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/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.in similarity index 80% rename from libs/core/include_local/include/hpx/local/runtime.hpp rename to libs/core/include_local/include/hpx/runtime.hpp.in index 90619e81311a..4c27fd53da22 100644 --- a/libs/core/include_local/include/hpx/local/runtime.hpp +++ b/libs/core/include_local/include/hpx/runtime.hpp.in @@ -4,6 +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) +// Do not edit this file! It has been generated by the cmake configuration step. + #pragma once #include 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/core/include_local/include/hpx/local/thread.hpp b/libs/core/include_local/include/hpx/thread.hpp similarity index 75% rename from libs/core/include_local/include/hpx/local/thread.hpp rename to libs/core/include_local/include/hpx/thread.hpp index 4907caddcb11..1d4155bbd6ff 100644 --- a/libs/core/include_local/include/hpx/local/thread.hpp +++ b/libs/core/include_local/include/hpx/thread.hpp @@ -6,5 +6,5 @@ #pragma once -#include -#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..d2316469b18b 100644 --- a/libs/core/init_runtime_local/CMakeLists.txt +++ b/libs/core/init_runtime_local/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2020 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 @@ -8,19 +8,29 @@ 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 ) +set(generated_init_runtime_local_headers hpx/init.hpp) + set(init_runtime_local_sources init_logging.cpp init_runtime_local.cpp) +# The headers in hpx/local/ were deprecated in HPX V1.9.1 +# 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} + GENERATED_HEADERS ${generated_init_runtime_local_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.in 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.in diff --git a/libs/core/logging/src/format/formatter/high_precision_time.cpp b/libs/core/logging/src/format/formatter/high_precision_time.cpp index 801eab265c26..181d1cef6e80 100644 --- a/libs/core/logging/src/format/formatter/high_precision_time.cpp +++ b/libs/core/logging/src/format/formatter/high_precision_time.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include diff --git a/libs/core/runtime_local/CMakeLists.txt b/libs/core/runtime_local/CMakeLists.txt index 864a8bc32fc4..b0215a7d8942 100644 --- a/libs/core/runtime_local/CMakeLists.txt +++ b/libs/core/runtime_local/CMakeLists.txt @@ -38,10 +38,6 @@ set(runtime_local_headers hpx/runtime_local/thread_stacktrace.hpp ) -if(NOT HPX_WITH_DISTRIBUTED_RUNTIME) - set(runtime_local_headers ${runtime_local_headers} hpx/init.hpp) -endif() - # cmake-format: off set(runtime_local_compat_headers hpx/custom_exception_info.hpp => hpx/modules/runtime_local.hpp diff --git a/libs/full/parcelset/tests/unit/put_parcels.cpp b/libs/full/parcelset/tests/unit/put_parcels.cpp index eeabb5b71603..ea9466c4cf0e 100644 --- a/libs/full/parcelset/tests/unit/put_parcels.cpp +++ b/libs/full/parcelset/tests/unit/put_parcels.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include From ed78082d4eaf15ddf1ac9ffe79e9a7787251c8d0 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 10 Apr 2023 15:51:24 -0500 Subject: [PATCH 09/72] 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 | 3 +- 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 | 30 ++++---- 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 | 6 +- .../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 | 10 ++- .../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 | 6 +- .../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/any.hpp | 10 --- libs/full/include/include/hpx/barrier.hpp | 2 +- libs/full/include/include/hpx/channel.hpp | 6 +- .../hpx/{generator.hpp => compute.hpp} | 3 +- .../include/hpx/condition_variable.hpp | 9 --- libs/full/include/include/hpx/exception.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/thread.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 +- 795 files changed, 2278 insertions(+), 2408 deletions(-) create mode 100644 init/src/hpx_init.cpp delete mode 100644 libs/full/include/include/hpx/any.hpp rename libs/full/include/include/hpx/{generator.hpp => compute.hpp} (76%) delete mode 100644 libs/full/include/include/hpx/condition_variable.hpp delete mode 100644 libs/full/include/include/hpx/exception.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/thread.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 f4f5d02cc117..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 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 325a13729920..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,6 +15,9 @@ #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. @@ -30,31 +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::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("="); + std::string::size_type const p = argument.find_first_of('='); if (p != std::string::npos) { - arg = arg.substr(p + 1); - argv[argcount++] = const_cast(arg.data()); + 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 0ac2f7a8e21b..956e099dca2e 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 @@ -559,7 +559,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 3323fb36b74a..42e39936f416 100644 --- a/libs/core/functional/tests/regressions/protect_with_nullary_pfo.cpp +++ b/libs/core/functional/tests/regressions/protect_with_nullary_pfo.cpp @@ -6,11 +6,9 @@ // http://www.boost.org/LICENSE_1_0.txt) #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 9cb2538bcc60..b95b536e1f4d 100644 --- a/libs/core/include_local/CMakeLists.txt +++ b/libs/core/include_local/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 @@ -92,9 +92,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/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 e885dc754433..62dbdb66ff03 100644 --- a/libs/core/resource_partitioner/examples/guided_pool_test.cpp +++ b/libs/core/resource_partitioner/examples/guided_pool_test.cpp @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include @@ -72,7 +74,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 { @@ -119,7 +121,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 75d922a990b2..063af6e89f02 100644 --- a/libs/core/resource_partitioner/examples/oversubscribing_resource_partitioner.cpp +++ b/libs/core/resource_partitioner/examples/oversubscribing_resource_partitioner.cpp @@ -9,13 +9,13 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include -#include -#include -#include -#include +#include +#include +#include #include #include +#include +#include // #include #include @@ -31,7 +31,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, @@ -39,7 +39,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 6499e3e89824..59ab65276351 100644 --- a/libs/core/resource_partitioner/examples/simple_resource_partitioner.cpp +++ b/libs/core/resource_partitioner/examples/simple_resource_partitioner.cpp @@ -10,13 +10,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 e5380603ba7b..dfba8ac09aaf 100644 --- a/libs/core/threading_base/src/set_thread_state.cpp +++ b/libs/core/threading_base/src/set_thread_state.cpp @@ -43,7 +43,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, " @@ -98,7 +97,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({}), " @@ -121,7 +119,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({}), " @@ -146,7 +143,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 = " @@ -165,7 +161,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({})", @@ -194,7 +189,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, @@ -227,7 +221,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(), @@ -242,7 +235,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 dec59fc30c27..8cfbb9598ff4 100644 --- a/libs/core/threading_base/src/set_thread_state_timed.cpp +++ b/libs/core/threading_base/src/set_thread_state_timed.cpp @@ -133,7 +133,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/any.hpp b/libs/full/include/include/hpx/any.hpp deleted file mode 100644 index de6ac18abb34..000000000000 --- a/libs/full/include/include/hpx/any.hpp +++ /dev/null @@ -1,10 +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 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/full/include/include/hpx/generator.hpp b/libs/full/include/include/hpx/compute.hpp similarity index 76% rename from libs/full/include/include/hpx/generator.hpp rename to libs/full/include/include/hpx/compute.hpp index f88747f9b5a9..a1bd71e59f84 100644 --- a/libs/full/include/include/hpx/generator.hpp +++ b/libs/full/include/include/hpx/compute.hpp @@ -6,4 +6,5 @@ #pragma once -#include +#include +#include diff --git a/libs/full/include/include/hpx/condition_variable.hpp b/libs/full/include/include/hpx/condition_variable.hpp deleted file mode 100644 index 9e52b7a0097a..000000000000 --- a/libs/full/include/include/hpx/condition_variable.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/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/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/thread.hpp b/libs/full/include/include/hpx/thread.hpp deleted file mode 100644 index 69218c294e82..000000000000 --- a/libs/full/include/include/hpx/thread.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// 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) - -#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 ea9466c4cf0e..36da852dbc69 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 ccb88f47b3e1808d205eaa1a723f7a32ef307df8 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 18 May 2023 12:53:35 -0500 Subject: [PATCH 10/72] Re-enable tests Tests were disabled in #5796 --- libs/core/async_cuda/tests/performance/synchronize.cu | 9 --------- libs/core/async_cuda/tests/unit/transform_stream.cu | 9 --------- 2 files changed, 18 deletions(-) diff --git a/libs/core/async_cuda/tests/performance/synchronize.cu b/libs/core/async_cuda/tests/performance/synchronize.cu index 359a59568f42..adb5a9799c20 100644 --- a/libs/core/async_cuda/tests/performance/synchronize.cu +++ b/libs/core/async_cuda/tests/performance/synchronize.cu @@ -6,9 +6,6 @@ #include -// NVCC fails unceremoniously with this test at least until V11.5 -#if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION > 1105) - #include #include #include @@ -269,9 +266,3 @@ int main(int argc, char* argv[]) return hpx::local::init(hpx_main, argc, argv, init_args); } -#else -int main(int, char*[]) -{ - return 0; -} -#endif diff --git a/libs/core/async_cuda/tests/unit/transform_stream.cu b/libs/core/async_cuda/tests/unit/transform_stream.cu index b27f197822c6..657f6d8e52cb 100644 --- a/libs/core/async_cuda/tests/unit/transform_stream.cu +++ b/libs/core/async_cuda/tests/unit/transform_stream.cu @@ -6,9 +6,6 @@ #include -// NVCC fails unceremoniously with this test at least until V11.5 -#if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION > 1105) - #include #include #include @@ -302,9 +299,3 @@ int main(int argc, char* argv[]) return hpx::util::report_errors(); } -#else -int main(int, char*[]) -{ - return 0; -} -#endif From 1e1becb57585a1cfb0e4b7ff620fc513c933d988 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 18 May 2023 13:00:02 -0500 Subject: [PATCH 11/72] Fix compute architecture and drop kepler Kepler support is removed in CUDA 12 so it's time to remove it here as well. --- .jenkins/lsu/env-gcc-10-cuda-11.sh | 2 +- .jenkins/lsu/slurm-configuration-gcc-10-cuda-11.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.jenkins/lsu/env-gcc-10-cuda-11.sh b/.jenkins/lsu/env-gcc-10-cuda-11.sh index 39aa9b3539bc..78695b5827bf 100644 --- a/.jenkins/lsu/env-gcc-10-cuda-11.sh +++ b/.jenkins/lsu/env-gcc-10-cuda-11.sh @@ -23,4 +23,4 @@ configure_extra_options+=" -DHPX_WITH_CUDA=ON" configure_extra_options+=" -DHPX_WITH_NETWORKING=OFF" configure_extra_options+=" -DHPX_WITH_DISTRIBUTED_RUNTIME=OFF" configure_extra_options+=" -DHPX_WITH_ASYNC_MPI=ON" -configure_extra_options+=" -DCMAKE_CUDA_ARCHITECTURES='37;70'" +configure_extra_options+=" -DCMAKE_CUDA_ARCHITECTURES='70;80'" diff --git a/.jenkins/lsu/slurm-configuration-gcc-10-cuda-11.sh b/.jenkins/lsu/slurm-configuration-gcc-10-cuda-11.sh index 3dc9e8a74287..f2c6938e4437 100644 --- a/.jenkins/lsu/slurm-configuration-gcc-10-cuda-11.sh +++ b/.jenkins/lsu/slurm-configuration-gcc-10-cuda-11.sh @@ -4,5 +4,5 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -configuration_slurm_partition="jenkins-cuda" +configuration_slurm_partition="cuda-V100,cuda-A100" configuration_slurm_num_nodes="1" From 7d462387b84c5af991d505cae2f21564da71910a Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 18 May 2023 14:55:12 -0500 Subject: [PATCH 12/72] Revert "Re-enable tests" This reverts commit 9d5a4a808b9051db7a73dad63076cefa6d7e4b36. Still not working unfortunately (tested with gcc/12 and cuda 12.1) --- libs/core/async_cuda/tests/performance/synchronize.cu | 9 +++++++++ libs/core/async_cuda/tests/unit/transform_stream.cu | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/libs/core/async_cuda/tests/performance/synchronize.cu b/libs/core/async_cuda/tests/performance/synchronize.cu index adb5a9799c20..359a59568f42 100644 --- a/libs/core/async_cuda/tests/performance/synchronize.cu +++ b/libs/core/async_cuda/tests/performance/synchronize.cu @@ -6,6 +6,9 @@ #include +// NVCC fails unceremoniously with this test at least until V11.5 +#if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION > 1105) + #include #include #include @@ -266,3 +269,9 @@ int main(int argc, char* argv[]) return hpx::local::init(hpx_main, argc, argv, init_args); } +#else +int main(int, char*[]) +{ + return 0; +} +#endif diff --git a/libs/core/async_cuda/tests/unit/transform_stream.cu b/libs/core/async_cuda/tests/unit/transform_stream.cu index 657f6d8e52cb..b27f197822c6 100644 --- a/libs/core/async_cuda/tests/unit/transform_stream.cu +++ b/libs/core/async_cuda/tests/unit/transform_stream.cu @@ -6,6 +6,9 @@ #include +// NVCC fails unceremoniously with this test at least until V11.5 +#if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION > 1105) + #include #include #include @@ -299,3 +302,9 @@ int main(int argc, char* argv[]) return hpx::util::report_errors(); } +#else +int main(int, char*[]) +{ + return 0; +} +#endif From 721a7a19388b191e310c6b41843eb0e4bd6e983d Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 18 May 2023 15:38:09 -0500 Subject: [PATCH 13/72] Disable troublesome tests for current cuda version --- libs/core/async_cuda/tests/performance/synchronize.cu | 4 ++-- libs/core/async_cuda/tests/unit/transform_stream.cu | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/core/async_cuda/tests/performance/synchronize.cu b/libs/core/async_cuda/tests/performance/synchronize.cu index 359a59568f42..d206638da99a 100644 --- a/libs/core/async_cuda/tests/performance/synchronize.cu +++ b/libs/core/async_cuda/tests/performance/synchronize.cu @@ -6,8 +6,8 @@ #include -// NVCC fails unceremoniously with this test at least until V11.5 -#if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION > 1105) +// NVCC fails unceremoniously with this test at least until V12.1 +#if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION > 1201) #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 b27f197822c6..d8ad49613be9 100644 --- a/libs/core/async_cuda/tests/unit/transform_stream.cu +++ b/libs/core/async_cuda/tests/unit/transform_stream.cu @@ -6,8 +6,8 @@ #include -// NVCC fails unceremoniously with this test at least until V11.5 -#if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION > 1105) +// NVCC fails unceremoniously with this test at least until V12.1 +#if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION > 1201) #include #include From 074e11f9c377b14b90be173f1a6ee92e4194123b Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 18 May 2023 15:39:01 -0500 Subject: [PATCH 14/72] Allow jenkins hip builds with warnings --- .jenkins/lsu/env-hipcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jenkins/lsu/env-hipcc.sh b/.jenkins/lsu/env-hipcc.sh index abc09f74b40e..0977332d1105 100644 --- a/.jenkins/lsu/env-hipcc.sh +++ b/.jenkins/lsu/env-hipcc.sh @@ -17,4 +17,4 @@ configure_extra_options+=" -DHPX_WITH_FETCH_ASIO=ON" configure_extra_options+=" -DHPX_WITH_MAX_CPU_COUNT=128" configure_extra_options+=" -DHPX_WITH_DEPRECATION_WARNINGS=OFF" configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS=ON" -configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON" +configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=OFF" From 3dad652e16b1fc211743d7b3d3b9e217c870a9b8 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 18 May 2023 17:10:59 -0500 Subject: [PATCH 15/72] Remove broken node for testing --- .jenkins/lsu/entry.sh | 1 + .jenkins/lsu/slurm-configuration-gcc-10-cuda-11.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.jenkins/lsu/entry.sh b/.jenkins/lsu/entry.sh index 878e4aa9a4e8..9554137a7fa9 100755 --- a/.jenkins/lsu/entry.sh +++ b/.jenkins/lsu/entry.sh @@ -46,6 +46,7 @@ sbatch \ --job-name="${job_name}" \ --nodes="${configuration_slurm_num_nodes}" \ --partition="${configuration_slurm_partition}" \ + --exclude="bahram" \ --time="03:00:00" \ --output="jenkins-hpx-${configuration_name_with_build_type}.out" \ --error="jenkins-hpx-${configuration_name_with_build_type}.err" \ diff --git a/.jenkins/lsu/slurm-configuration-gcc-10-cuda-11.sh b/.jenkins/lsu/slurm-configuration-gcc-10-cuda-11.sh index f2c6938e4437..3dc9e8a74287 100644 --- a/.jenkins/lsu/slurm-configuration-gcc-10-cuda-11.sh +++ b/.jenkins/lsu/slurm-configuration-gcc-10-cuda-11.sh @@ -4,5 +4,5 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -configuration_slurm_partition="cuda-V100,cuda-A100" +configuration_slurm_partition="jenkins-cuda" configuration_slurm_num_nodes="1" From 2c46a0daaac2c09cbf1d85b6c8296765bc745755 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 18 May 2023 19:04:02 -0500 Subject: [PATCH 16/72] Temporarily switch to rocm/4 As all rocm/5 modules are currently broken on the machine --- .jenkins/lsu/env-hipcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jenkins/lsu/env-hipcc.sh b/.jenkins/lsu/env-hipcc.sh index 0977332d1105..fd46ce039f8b 100644 --- a/.jenkins/lsu/env-hipcc.sh +++ b/.jenkins/lsu/env-hipcc.sh @@ -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) -module load rocm +module load rocm/4 module load boost export CXX=hipcc From 203188cb4bdb42656e652ea3c7247fe2b2752da0 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Tue, 23 May 2023 14:25:16 -0500 Subject: [PATCH 17/72] Revert "Temporarily switch to rocm/4" This reverts commit 71c8ac34e334cabdd8bf4b9f872eaa79b8f7f7eb. --- .jenkins/lsu/env-hipcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jenkins/lsu/env-hipcc.sh b/.jenkins/lsu/env-hipcc.sh index fd46ce039f8b..0977332d1105 100644 --- a/.jenkins/lsu/env-hipcc.sh +++ b/.jenkins/lsu/env-hipcc.sh @@ -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) -module load rocm/4 +module load rocm module load boost export CXX=hipcc From e088782d2480d27a09373edae0d2412e9a244ec1 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Tue, 23 May 2023 23:46:18 -0500 Subject: [PATCH 18/72] Increase test timeout --- .jenkins/lsu-perftests/ctest.cmake | 2 +- .jenkins/lsu/ctest.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.jenkins/lsu-perftests/ctest.cmake b/.jenkins/lsu-perftests/ctest.cmake index f8cf66b3301f..3acd5888f32c 100644 --- a/.jenkins/lsu-perftests/ctest.cmake +++ b/.jenkins/lsu-perftests/ctest.cmake @@ -8,7 +8,7 @@ # This is a dummy file to trigger the upload of the perftests reports cmake_minimum_required(VERSION 3.1 FATAL_ERROR) -set(CTEST_TEST_TIMEOUT 300) +set(CTEST_TEST_TIMEOUT 900) set(CTEST_BUILD_PARALLELISM 20) set(CTEST_TEST_PARALLELISM 4) set(CTEST_CMAKE_GENERATOR Ninja) diff --git a/.jenkins/lsu/ctest.cmake b/.jenkins/lsu/ctest.cmake index 135f07c12025..f5be5696d025 100644 --- a/.jenkins/lsu/ctest.cmake +++ b/.jenkins/lsu/ctest.cmake @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) -set(CTEST_TEST_TIMEOUT 300) +set(CTEST_TEST_TIMEOUT 900) set(CTEST_BUILD_PARALLELISM 20) set(CTEST_TEST_PARALLELISM 4) set(CTEST_CMAKE_GENERATOR Ninja) From a49248c6268443fdf038a5502a2c9fbace746c13 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Fri, 26 May 2023 23:43:10 -0500 Subject: [PATCH 19/72] Revert "Increase test timeout" This reverts commit 087074ac3429e67004b70efcd74e74531250825e. --- .jenkins/lsu-perftests/ctest.cmake | 2 +- .jenkins/lsu/ctest.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.jenkins/lsu-perftests/ctest.cmake b/.jenkins/lsu-perftests/ctest.cmake index 3acd5888f32c..f8cf66b3301f 100644 --- a/.jenkins/lsu-perftests/ctest.cmake +++ b/.jenkins/lsu-perftests/ctest.cmake @@ -8,7 +8,7 @@ # This is a dummy file to trigger the upload of the perftests reports cmake_minimum_required(VERSION 3.1 FATAL_ERROR) -set(CTEST_TEST_TIMEOUT 900) +set(CTEST_TEST_TIMEOUT 300) set(CTEST_BUILD_PARALLELISM 20) set(CTEST_TEST_PARALLELISM 4) set(CTEST_CMAKE_GENERATOR Ninja) diff --git a/.jenkins/lsu/ctest.cmake b/.jenkins/lsu/ctest.cmake index f5be5696d025..135f07c12025 100644 --- a/.jenkins/lsu/ctest.cmake +++ b/.jenkins/lsu/ctest.cmake @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) -set(CTEST_TEST_TIMEOUT 900) +set(CTEST_TEST_TIMEOUT 300) set(CTEST_BUILD_PARALLELISM 20) set(CTEST_TEST_PARALLELISM 4) set(CTEST_CMAKE_GENERATOR Ninja) From 19dccf087f1d1e5d480207d595dd763c2481639a Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Fri, 26 May 2023 23:50:53 -0500 Subject: [PATCH 20/72] Test excluding troublesome hip alorithms test --- .jenkins/lsu/batch.sh | 2 +- .jenkins/lsu/env-common.sh | 2 ++ .jenkins/lsu/env-hipcc.sh | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.jenkins/lsu/batch.sh b/.jenkins/lsu/batch.sh index 1b24d132975f..64e4985ef554 100755 --- a/.jenkins/lsu/batch.sh +++ b/.jenkins/lsu/batch.sh @@ -21,7 +21,7 @@ ulimit -l unlimited set +e ctest \ - --verbose \ + ${ctest_extra_args} \ -S ${src_dir}/.jenkins/lsu/ctest.cmake \ -DCTEST_CONFIGURE_EXTRA_OPTIONS="${configure_extra_options}" \ -DCTEST_BUILD_CONFIGURATION_NAME="${configuration_name_with_build_type}" \ diff --git a/.jenkins/lsu/env-common.sh b/.jenkins/lsu/env-common.sh index 2d797c2acaf0..f0bd7e5dd00b 100644 --- a/.jenkins/lsu/env-common.sh +++ b/.jenkins/lsu/env-common.sh @@ -11,5 +11,7 @@ if [ "${build_type}" = "Debug" ]; then configure_extra_options+=" -DLCI_DEBUG=ON" fi +ctest_extra_args+=" --verbose " + hostname module avail diff --git a/.jenkins/lsu/env-hipcc.sh b/.jenkins/lsu/env-hipcc.sh index 0977332d1105..e31a25c4fa26 100644 --- a/.jenkins/lsu/env-hipcc.sh +++ b/.jenkins/lsu/env-hipcc.sh @@ -18,3 +18,5 @@ configure_extra_options+=" -DHPX_WITH_MAX_CPU_COUNT=128" configure_extra_options+=" -DHPX_WITH_DEPRECATION_WARNINGS=OFF" configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS=ON" configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=OFF" + +ctest_extra_args+=" -E tests.unit.modules.algorithms.detail " From 3501af7174410b4f7566f2966b7b51dad12bf2e6 Mon Sep 17 00:00:00 2001 From: Shreyas Atre Date: Thu, 25 May 2023 23:55:20 +0530 Subject: [PATCH 21/72] Cmake Tests: Delete operator check for size_t arg - Clang fails to recognize the global delete operator which has 2 arguments the second one being std::size_t Signed-off-by: Shreyas Atre --- cmake/HPX_AddConfigTest.cmake | 9 +++++++++ cmake/HPX_PerformCxxFeatureTests.cmake | 4 ++++ .../cxx_14_delete_operator_with_size.cpp | 19 +++++++++++++++++++ .../include/hpx/type_support/generator.hpp | 9 +++++++-- 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 cmake/tests/cxx_14_delete_operator_with_size.cpp diff --git a/cmake/HPX_AddConfigTest.cmake b/cmake/HPX_AddConfigTest.cmake index 8fa35e969aad..83a41984be83 100644 --- a/cmake/HPX_AddConfigTest.cmake +++ b/cmake/HPX_AddConfigTest.cmake @@ -350,6 +350,15 @@ function(hpx_check_for_cxx11_std_shared_ptr_lwg3018) ) endfunction() +# ############################################################################## +function(hpx_check_for_cxx14_delete_operator_with_size) + add_hpx_config_test( + HPX_WITH_CXX14_DELETE_OPERATOR_WITH_SIZE + SOURCE cmake/tests/cxx_14_delete_operator_with_size.cpp + FILE ${ARGN} + ) +endfunction() + # ############################################################################## function(hpx_check_for_c11_aligned_alloc) add_hpx_config_test( diff --git a/cmake/HPX_PerformCxxFeatureTests.cmake b/cmake/HPX_PerformCxxFeatureTests.cmake index 851c44f6cdd2..f3f2aea3b9b0 100644 --- a/cmake/HPX_PerformCxxFeatureTests.cmake +++ b/cmake/HPX_PerformCxxFeatureTests.cmake @@ -49,6 +49,10 @@ function(hpx_perform_cxx_feature_tests) hpx_check_for_c11_aligned_alloc(DEFINITIONS HPX_HAVE_C11_ALIGNED_ALLOC) + hpx_check_for_cxx14_delete_operator_with_size( + DEFINITIONS HPX_WITH_CXX14_DELETE_OPERATOR_WITH_SIZE + ) + hpx_check_for_cxx17_std_aligned_alloc( DEFINITIONS HPX_HAVE_CXX17_STD_ALIGNED_ALLOC ) diff --git a/cmake/tests/cxx_14_delete_operator_with_size.cpp b/cmake/tests/cxx_14_delete_operator_with_size.cpp new file mode 100644 index 000000000000..9f58e1be9177 --- /dev/null +++ b/cmake/tests/cxx_14_delete_operator_with_size.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2023 Shreyas Atre +// +// 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 + +/// clang fails to compile this with libstdc++ even though gcc does fine + +int main() +{ + using dealloc_fn = void (*)(void*, std::size_t); + dealloc_fn const dealloc = [](void* const p, std::size_t const s) { + ::operator delete[](p, s + sizeof(std::size_t) + sizeof(dealloc_fn)); + }; + (void) dealloc; +} \ No newline at end of file diff --git a/libs/core/type_support/include/hpx/type_support/generator.hpp b/libs/core/type_support/include/hpx/type_support/generator.hpp index 6bb296bb4dd1..acd529d18adc 100644 --- a/libs/core/type_support/include/hpx/type_support/generator.hpp +++ b/libs/core/type_support/include/hpx/type_support/generator.hpp @@ -64,8 +64,8 @@ namespace hpx { Allocator>::template rebind_alloc; template - concept has_real_pointers = std::is_void_v || - std::is_pointer_v< + concept has_real_pointers = + std::is_void_v || std::is_pointer_v< typename std::allocator_traits::pointer>; // clang-format off @@ -324,8 +324,13 @@ namespace hpx { dealloc_fn const dealloc = [](void* const p, std::size_t const s) { +#if defined(HPX_WITH_CXX14_DELETE_OPERATOR_WITH_SIZE) ::operator delete[]( p, s + sizeof(std::size_t) + sizeof(dealloc_fn)); +#else + ::operator delete[](p); + (void) s; +#endif }; char* address = static_cast(ptr); From 7b1fe667bffee584950e39ceb91c37a3252b3a7c Mon Sep 17 00:00:00 2001 From: Shreyas Atre <61797109+SAtacker@users.noreply.github.com> Date: Fri, 26 May 2023 12:48:52 +0530 Subject: [PATCH 22/72] Add maybe_unused attribute Co-authored-by: Hartmut Kaiser --- libs/core/type_support/include/hpx/type_support/generator.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/core/type_support/include/hpx/type_support/generator.hpp b/libs/core/type_support/include/hpx/type_support/generator.hpp index acd529d18adc..6a898d783d6f 100644 --- a/libs/core/type_support/include/hpx/type_support/generator.hpp +++ b/libs/core/type_support/include/hpx/type_support/generator.hpp @@ -323,13 +323,12 @@ namespace hpx { size + sizeof(std::size_t) + sizeof(dealloc_fn)); dealloc_fn const dealloc = [](void* const p, - std::size_t const s) { + [[maybe_unused]] std::size_t const s) { #if defined(HPX_WITH_CXX14_DELETE_OPERATOR_WITH_SIZE) ::operator delete[]( p, s + sizeof(std::size_t) + sizeof(dealloc_fn)); #else ::operator delete[](p); - (void) s; #endif }; From 2752a07abddc3af83ca242b00e837532acb54b6f Mon Sep 17 00:00:00 2001 From: Shreyas Atre Date: Fri, 26 May 2023 23:36:48 +0530 Subject: [PATCH 23/72] Fix inspect issues: Add newline to the added test Signed-off-by: Shreyas Atre --- cmake/tests/cxx_14_delete_operator_with_size.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/tests/cxx_14_delete_operator_with_size.cpp b/cmake/tests/cxx_14_delete_operator_with_size.cpp index 9f58e1be9177..e25bc7884f2d 100644 --- a/cmake/tests/cxx_14_delete_operator_with_size.cpp +++ b/cmake/tests/cxx_14_delete_operator_with_size.cpp @@ -16,4 +16,4 @@ int main() ::operator delete[](p, s + sizeof(std::size_t) + sizeof(dealloc_fn)); }; (void) dealloc; -} \ No newline at end of file +} From cc097110bc0c24997e810cb7a9799d62584e725a Mon Sep 17 00:00:00 2001 From: Shreyas Atre Date: Sat, 27 May 2023 00:37:51 +0530 Subject: [PATCH 24/72] Fix clang format formatting for Clang format 11 Signed-off-by: Shreyas Atre --- .../include/hpx/type_support/generator.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/core/type_support/include/hpx/type_support/generator.hpp b/libs/core/type_support/include/hpx/type_support/generator.hpp index 6a898d783d6f..38df3bc0bd98 100644 --- a/libs/core/type_support/include/hpx/type_support/generator.hpp +++ b/libs/core/type_support/include/hpx/type_support/generator.hpp @@ -64,8 +64,8 @@ namespace hpx { Allocator>::template rebind_alloc; template - concept has_real_pointers = - std::is_void_v || std::is_pointer_v< + concept has_real_pointers = std::is_void_v || + std::is_pointer_v< typename std::allocator_traits::pointer>; // clang-format off @@ -322,15 +322,15 @@ namespace hpx { void* const ptr = ::operator new[]( size + sizeof(std::size_t) + sizeof(dealloc_fn)); - dealloc_fn const dealloc = [](void* const p, - [[maybe_unused]] std::size_t const s) { + dealloc_fn const dealloc = + [](void* const p, [[maybe_unused]] std::size_t const s) { #if defined(HPX_WITH_CXX14_DELETE_OPERATOR_WITH_SIZE) - ::operator delete[]( - p, s + sizeof(std::size_t) + sizeof(dealloc_fn)); + ::operator delete[]( + p, s + sizeof(std::size_t) + sizeof(dealloc_fn)); #else - ::operator delete[](p); + ::operator delete[](p); #endif - }; + }; char* address = static_cast(ptr); *reinterpret_cast(address) = size; From 934a3f1ceb4878504e4c52067ed86aaefac5e061 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Sat, 27 May 2023 07:56:07 -0500 Subject: [PATCH 25/72] Fixing wrong command line options in local command line handling --- .../src/parse_command_line_local.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 09cafec8d687..77fe05bf2027 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 @@ -217,7 +217,7 @@ namespace hpx::local::detail { util::commandline_error_mode const mode = error_mode & util::commandline_error_mode::ignore_aliases; util::commandline_error_mode const notmode = - error_mode & util::commandline_error_mode::ignore_aliases; + error_mode & ~util::commandline_error_mode::ignore_aliases; store(get_commandline_parser( command_line_parser(options) From 01019cdd125c61c9596491d384489de6489c08f1 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 29 May 2023 13:42:58 -0500 Subject: [PATCH 26/72] Attempt to resolve occasional hang in run_loop -flyby: increase timeout for segmented_algorithms tests on CirclCI --- libs/core/execution/CMakeLists.txt | 2 +- .../hpx/execution/algorithms/make_future.hpp | 7 ++ .../hpx/execution/algorithms/run_loop.hpp | 88 ++++++++++++++----- libs/core/execution/src/run_loop.cpp | 24 +++++ .../synchronization/condition_variable.hpp | 2 +- 5 files changed, 100 insertions(+), 23 deletions(-) create mode 100644 libs/core/execution/src/run_loop.cpp diff --git a/libs/core/execution/CMakeLists.txt b/libs/core/execution/CMakeLists.txt index 0c7e27cb5bdd..990b2884e8ee 100644 --- a/libs/core/execution/CMakeLists.txt +++ b/libs/core/execution/CMakeLists.txt @@ -101,7 +101,7 @@ set(execution_headers ) set(execution_sources execution_parameter_callbacks.cpp - polymorphic_executor.cpp + polymorphic_executor.cpp run_loop.cpp ) # cmake-format: off diff --git a/libs/core/execution/include/hpx/execution/algorithms/make_future.hpp b/libs/core/execution/include/hpx/execution/algorithms/make_future.hpp index 9d4fb92e1c4a..f883fbbb97bb 100644 --- a/libs/core/execution/include/hpx/execution/algorithms/make_future.hpp +++ b/libs/core/execution/include/hpx/execution/algorithms/make_future.hpp @@ -37,6 +37,10 @@ namespace hpx::execution::experimental { // enforce proper formatting namespace detail { +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 110000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif template struct future_receiver_base { @@ -70,6 +74,9 @@ namespace hpx::execution::experimental { std::terminate(); } }; +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 110000 +#pragma GCC diagnostic pop +#endif template struct future_receiver diff --git a/libs/core/execution/include/hpx/execution/algorithms/run_loop.hpp b/libs/core/execution/include/hpx/execution/algorithms/run_loop.hpp index 2e8c49624b85..bd3265374b1e 100644 --- a/libs/core/execution/include/hpx/execution/algorithms/run_loop.hpp +++ b/libs/core/execution/include/hpx/execution/algorithms/run_loop.hpp @@ -1,4 +1,4 @@ -// 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 @@ -15,17 +15,52 @@ #include #include #include -#include -#include +#include +#include #include +#include #include -#include #include #include namespace hpx::execution::experimental { + namespace detail { + + struct run_loop_data; + + HPX_CORE_EXPORT void intrusive_ptr_add_ref(run_loop_data* p) noexcept; + HPX_CORE_EXPORT void intrusive_ptr_release(run_loop_data* p) noexcept; + + struct run_loop_data + { + using mutex_type = hpx::spinlock; + + run_loop_data() noexcept + : count_(1) + { + } + + run_loop_data(run_loop_data const&) = delete; + run_loop_data(run_loop_data&&) = delete; + run_loop_data& operator=(run_loop_data const&) = delete; + run_loop_data& operator=(run_loop_data&&) = delete; + + ~run_loop_data() = default; + + mutable mutex_type mtx_; + + private: + friend HPX_CORE_EXPORT void intrusive_ptr_add_ref( + run_loop_data*) noexcept; + friend HPX_CORE_EXPORT void intrusive_ptr_release( + run_loop_data*) noexcept; + + hpx::util::atomic_count count_; + }; + } // namespace detail + // A run_loop is an execution context on which work can be scheduled. It // maintains a simple, thread-safe first-in-first-out queue of work. Its // run() member function removes elements from the queue and executes them @@ -60,9 +95,14 @@ namespace hpx::execution::experimental { { } + run_loop_opstate_base(run_loop_opstate_base const&) = delete; run_loop_opstate_base(run_loop_opstate_base&&) = delete; + run_loop_opstate_base& operator=( + run_loop_opstate_base const&) = delete; run_loop_opstate_base& operator=(run_loop_opstate_base&&) = delete; + ~run_loop_opstate_base() = default; + run_loop_opstate_base* next; union { @@ -122,11 +162,6 @@ namespace hpx::execution::experimental { }); } - explicit type(run_loop_opstate_base* tail) noexcept - : run_loop_opstate_base(tail) - { - } - type(run_loop_opstate_base* next, run_loop& loop, Receiver r) : run_loop_opstate_base(next, &execute) , loop(loop) @@ -261,8 +296,8 @@ namespace hpx::execution::experimental { private: friend struct run_loop_scheduler::run_loop_sender; - hpx::spinlock mtx; - hpx::condition_variable cond_var; + hpx::intrusive_ptr mtx; + hpx::lcos::local::detail::condition_variable cond_var; // MSVC and gcc don't properly handle the friend declaration above #if defined(HPX_MSVC) || defined(HPX_GCC_VERSION) @@ -275,24 +310,32 @@ namespace hpx::execution::experimental { void push_back(run_loop_opstate_base* t) { - std::unique_lock l(mtx); + auto const local_mtx = mtx; // keep alive + std::unique_lock l(local_mtx->mtx_); + stop = false; t->next = &head; head.tail = head.tail->next = t; - cond_var.notify_one(); + cond_var.notify_one(HPX_MOVE(l)); } run_loop_opstate_base* pop_front() { - std::unique_lock l(mtx); - cond_var.wait(l, [this] { return head.next != &head || stop; }); + auto const local_mtx = mtx; // keep alive + std::unique_lock l(local_mtx->mtx_); + + while (head.next == &head && !stop) + { + cond_var.wait(l); + } + if (head.tail == head.next) { head.tail = &head; } // std::exchange(head.next, head.next->next); - auto old_val = HPX_MOVE(head.next); + auto const old_val = HPX_MOVE(head.next); head.next = HPX_MOVE(head.next->next); return old_val; } @@ -300,11 +343,14 @@ namespace hpx::execution::experimental { public: // [exec.run_loop.ctor] construct/copy/destroy run_loop() noexcept - : head(&head) //-V546 + : mtx(new detail::run_loop_data(), false) + , head(&head) //-V546 { } + run_loop(run_loop const&) = delete; run_loop(run_loop&&) = delete; + run_loop& operator=(run_loop const&) = delete; run_loop& operator=(run_loop&&) = delete; // If count is not 0 or if state is running, invokes terminate(). @@ -336,11 +382,11 @@ namespace hpx::execution::experimental { void finish() { - std::unique_lock l(mtx); - hpx::util::ignore_while_checking il(&l); - HPX_UNUSED(il); + auto const local_mtx = mtx; // keep alive + std::unique_lock l(local_mtx->mtx_); + stop = true; - cond_var.notify_all(); + cond_var.notify_all(HPX_MOVE(l)); } }; diff --git a/libs/core/execution/src/run_loop.cpp b/libs/core/execution/src/run_loop.cpp new file mode 100644 index 000000000000..3605ca77b5be --- /dev/null +++ b/libs/core/execution/src/run_loop.cpp @@ -0,0 +1,24 @@ +// 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 + +/////////////////////////////////////////////////////////////////////////////// +namespace hpx::execution::experimental::detail { + + void intrusive_ptr_add_ref(run_loop_data* p) noexcept + { + ++p->count_; + } + + void intrusive_ptr_release(run_loop_data* p) noexcept + { + if (0 == --p->count_) + { + delete p; + } + } +} // namespace hpx::execution::experimental::detail diff --git a/libs/core/synchronization/include/hpx/synchronization/condition_variable.hpp b/libs/core/synchronization/include/hpx/synchronization/condition_variable.hpp index 156ff93c5899..8111e35e5ad8 100644 --- a/libs/core/synchronization/include/hpx/synchronization/condition_variable.hpp +++ b/libs/core/synchronization/include/hpx/synchronization/condition_variable.hpp @@ -505,7 +505,7 @@ namespace hpx { /// /// \brief The \a condition_variable_any class is a generalization of /// \a hpx::condition_variable. Whereas \a hpx::condition_variable works - /// only on \a std::unique_lock, \a acondition_variable_any can + /// only on \a std::unique_lock, \a a condition_variable_any can /// operate on any lock that meets the \namedrequirement{BasicLockable} /// requirements. /// From 2a4b11625dd076931d021272bf7ba1508b400612 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Sat, 20 May 2023 10:22:38 -0500 Subject: [PATCH 27/72] Modernize set_thread_name on Windows # Conflicts: # libs/core/thread_support/include/hpx/thread_support/set_thread_name.hpp # libs/core/thread_support/src/set_thread_name.cpp --- .../include/hpx/thread_support/set_thread_name.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libs/core/thread_support/include/hpx/thread_support/set_thread_name.hpp b/libs/core/thread_support/include/hpx/thread_support/set_thread_name.hpp index 5a53913a297d..60eb688b1eaf 100644 --- a/libs/core/thread_support/include/hpx/thread_support/set_thread_name.hpp +++ b/libs/core/thread_support/include/hpx/thread_support/set_thread_name.hpp @@ -14,17 +14,14 @@ namespace hpx::util { - HPX_CORE_EXPORT void set_thread_name( - char const* /*threadName*/, DWORD /*dwThreadID*/ = DWORD(-1)); + HPX_CORE_EXPORT void set_thread_name(char const* thread_name) noexcept; } // namespace hpx::util #else namespace hpx::util { - inline constexpr void set_thread_name(char const* /*thread_name*/) noexcept - { - } + constexpr void set_thread_name(char const*) noexcept {} } // namespace hpx::util #endif From b8f3104e4b1f4a068b1ca2bbc06cc504faaa77e5 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Thu, 15 Jun 2023 08:31:01 -0500 Subject: [PATCH 28/72] Resolving merge conflicts --- libs/core/functional/tests/regressions/CMakeLists.txt | 2 -- libs/full/include/include/hpx/chrono.hpp | 9 --------- libs/full/include/include/hpx/execution.hpp | 9 --------- 3 files changed, 20 deletions(-) delete mode 100644 libs/full/include/include/hpx/chrono.hpp delete mode 100644 libs/full/include/include/hpx/execution.hpp diff --git a/libs/core/functional/tests/regressions/CMakeLists.txt b/libs/core/functional/tests/regressions/CMakeLists.txt index 7c749b67d0ff..677e7fe6b160 100644 --- a/libs/core/functional/tests/regressions/CMakeLists.txt +++ b/libs/core/functional/tests/regressions/CMakeLists.txt @@ -15,8 +15,6 @@ foreach(test ${function_tests}) add_hpx_executable( ${test}_test INTERNAL_FLAGS SOURCES ${sources} ${${test}_FLAGS} - NOLIBS - DEPENDENCIES hpx_core EXCLUDE_FROM_ALL FOLDER "Tests/Regressions/Modules/Core/Functional" ) diff --git a/libs/full/include/include/hpx/chrono.hpp b/libs/full/include/include/hpx/chrono.hpp deleted file mode 100644 index 02503c0706fc..000000000000 --- a/libs/full/include/include/hpx/chrono.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 From f7a6cd0434b221c87a4a6e0d16fb663c4f01494b Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Tue, 30 May 2023 10:30:03 -0500 Subject: [PATCH 29/72] Attempting to fix migration tests - flyby: adding missing API functions to abstract migration support types # Conflicts: # libs/core/command_line_handling_local/tests/unit/CMakeLists.txt # libs/full/async_distributed/include/hpx/async_distributed/detail/async_unwrap_result_implementations.hpp --- .../server/component_storage.hpp | 5 +- .../server/migrate_from_storage.hpp | 29 +- .../server/migrate_to_storage.hpp | 46 +- .../tests/unit/CMakeLists.txt | 31 +- .../include/hpx/actions_base/plain_action.hpp | 12 +- .../traits/action_was_object_migrated.hpp | 82 ++-- .../actions_base/traits/extract_action.hpp | 11 +- .../actions_base/traits/is_continuation.hpp | 2 +- .../include/hpx/agas/addressing_service.hpp | 36 +- libs/full/agas/src/addressing_service.cpp | 274 ++++++----- libs/full/agas/src/detail/interface.cpp | 17 +- .../agas_base/server/primary_namespace.hpp | 72 +-- .../src/server/primary_namespace_server.cpp | 110 +++-- .../server/destroy_component.hpp | 24 +- .../src/server/destroy_component.cpp | 23 +- libs/full/async_distributed/CMakeLists.txt | 10 +- .../include/hpx/async_distributed/async.hpp | 29 +- .../hpx/async_distributed/base_lco.hpp | 50 +- .../detail/async_implementations.hpp | 394 ++++++++-------- .../detail/async_implementations_fwd.hpp | 20 +- .../async_unwrap_result_implementations.hpp | 109 ++--- ...sync_unwrap_result_implementations_fwd.hpp | 13 +- .../detail/post_callback.hpp | 81 ++-- .../detail/post_continue_fwd.hpp | 3 +- .../detail/post_implementations.hpp | 430 +++++++++--------- .../detail/post_implementations_fwd.hpp | 53 ++- .../async_distributed/detail/promise_lco.hpp | 17 +- .../detail/sync_implementations.hpp | 82 ++-- .../detail/sync_implementations_fwd.hpp | 14 +- .../hpx/async_distributed/packaged_action.hpp | 255 +++++------ .../hpx/async_distributed/trigger_lco.hpp | 89 ++-- .../include/hpx/components/get_ptr.hpp | 42 +- .../hpx/components_base/agas_interface.hpp | 18 +- .../hpx/components_base/component_type.hpp | 36 +- .../components_base/components_base_fwd.hpp | 6 +- .../detail/agas_interface_functions.hpp | 10 +- .../hpx/components_base/pinned_ptr.hpp | 37 +- .../server/abstract_migration_support.hpp | 65 ++- .../hpx/components_base/server/component.hpp | 13 +- .../components_base/server/component_base.hpp | 32 +- .../server/fixed_component_base.hpp | 1 + .../server/managed_component_base.hpp | 40 +- .../server/migration_support.hpp | 202 +++++--- .../traits/component_pin_support.hpp | 6 +- .../traits/component_supports_migration.hpp | 17 +- .../components_base/src/address_ostream.cpp | 7 +- .../components_base/src/agas_interface.cpp | 19 +- .../components_base/src/component_type.cpp | 13 +- .../src/detail/agas_interface_functions.cpp | 9 +- .../src/server/component_base.cpp | 21 +- .../include/hpx/parcelset/parcelset_fwd.hpp | 2 +- .../hpx/parcelset_base/parcelset_base_fwd.hpp | 2 + .../parcelset_base/src/parcel_interface.cpp | 3 + .../server/base_performance_counter.hpp | 2 +- .../unit/components/migrate_component.cpp | 211 +++++---- .../migrate_polymorphic_component.cpp | 30 +- .../server/migrate_component.hpp | 163 +++---- .../server/runtime_support.hpp | 8 +- .../src/stubs/runtime_support_stubs.cpp | 1 - 59 files changed, 1866 insertions(+), 1573 deletions(-) diff --git a/components/component_storage/include/hpx/components/component_storage/server/component_storage.hpp b/components/component_storage/include/hpx/components/component_storage/server/component_storage.hpp index 9f08b7af32fe..d8eac03a65fc 100644 --- a/components/component_storage/include/hpx/components/component_storage/server/component_storage.hpp +++ b/components/component_storage/include/hpx/components/component_storage/server/component_storage.hpp @@ -23,7 +23,8 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { namespace server { +namespace hpx::components::server { + /////////////////////////////////////////////////////////////////////////// class HPX_MIGRATE_TO_STORAGE_EXPORT component_storage : public component_base @@ -48,7 +49,7 @@ namespace hpx { namespace components { namespace server { private: hpx::unordered_map> data_; }; -}}} // namespace hpx::components::server +} // namespace hpx::components::server HPX_REGISTER_ACTION_DECLARATION( hpx::components::server::component_storage::migrate_to_here_action, diff --git a/components/component_storage/include/hpx/components/component_storage/server/migrate_from_storage.hpp b/components/component_storage/include/hpx/components/component_storage/server/migrate_from_storage.hpp index efe585ec5393..90d554af12d8 100644 --- a/components/component_storage/include/hpx/components/component_storage/server/migrate_from_storage.hpp +++ b/components/component_storage/include/hpx/components/component_storage/server/migrate_from_storage.hpp @@ -23,7 +23,8 @@ #include #include -namespace hpx { namespace components { namespace server { +namespace hpx::components::server { + /////////////////////////////////////////////////////////////////////////// // Migrate given component from the specified storage component // @@ -58,6 +59,7 @@ namespace hpx { namespace components { namespace server { // scope. // namespace detail { + /////////////////////////////////////////////////////////////////////// template future migrate_from_storage_here_id( @@ -101,9 +103,6 @@ namespace hpx { namespace components { namespace server { archive >> ptr; } - // make sure the migration code works properly - traits::component_pin_support::pin(ptr.get()); - // if target locality is not specified, use the address of the last // locality where the object was living before if (target_locality == hpx::invalid_id) @@ -126,13 +125,12 @@ namespace hpx { namespace components { namespace server { future trigger_migrate_from_storage_here( hpx::id_type const& to_resurrect, hpx::id_type const& target_locality) { - if (!traits::component_supports_migration::call()) + if constexpr (!traits::component_supports_migration::call()) { HPX_THROW_EXCEPTION(hpx::error::invalid_status, "hpx::components::server::trigger_migrate_from_storage_here", "attempting to migrate an instance of a component which " "does not support migration"); - return make_ready_future(hpx::invalid_id); } if (naming::get_locality_id_from_id(to_resurrect) != get_locality_id()) @@ -141,22 +139,21 @@ namespace hpx { namespace components { namespace server { "hpx::components::server::trigger_migrate_from_storage_here", "this function has to be executed on the locality responsible " "for managing the address of the given object"); - return make_ready_future(hpx::invalid_id); } - auto r = agas::begin_migration(to_resurrect).get(); + auto const r = agas::begin_migration(to_resurrect).get(); // retrieve the data from the given storage - typedef typename server::component_storage::migrate_from_here_action - action_type; + using action_type = + typename server::component_storage::migrate_from_here_action; + return async(r.first, to_resurrect.get_gid()) .then(hpx::bind_back(&detail::migrate_from_storage_here, to_resurrect, r.second, target_locality)) - .then( - [to_resurrect](future&& f) -> hpx::id_type { - agas::end_migration(to_resurrect); - return f.get(); - }); + .then([to_resurrect](future&& f) -> hpx::id_type { + agas::end_migration(to_resurrect); + return f.get(); + }); } template @@ -167,4 +164,4 @@ namespace hpx { namespace components { namespace server { trigger_migrate_from_storage_here_action> { }; -}}} // namespace hpx::components::server +} // namespace hpx::components::server diff --git a/components/component_storage/include/hpx/components/component_storage/server/migrate_to_storage.hpp b/components/component_storage/include/hpx/components/component_storage/server/migrate_to_storage.hpp index 92b100f9fee5..6c15de0ff8b9 100644 --- a/components/component_storage/include/hpx/components/component_storage/server/migrate_to_storage.hpp +++ b/components/component_storage/include/hpx/components/component_storage/server/migrate_to_storage.hpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -22,7 +21,8 @@ #include #include -namespace hpx { namespace components { namespace server { +namespace hpx::components::server { + /////////////////////////////////////////////////////////////////////////// // Migrate given component to the component storage // @@ -57,6 +57,7 @@ namespace hpx { namespace components { namespace server { // scope. // namespace detail { + // clean up (source) memory of migrated object template hpx::id_type migrate_to_storage_here_cleanup(future f, @@ -70,35 +71,33 @@ namespace hpx { namespace components { namespace server { // trigger the actual migration to storage template future migrate_to_storage_here_postproc( - std::shared_ptr const& ptr, - hpx::id_type const& to_migrate, hpx::id_type const& target_storage) + [[maybe_unused]] std::shared_ptr const& ptr, + [[maybe_unused]] hpx::id_type const& to_migrate, + [[maybe_unused]] hpx::id_type const& target_storage) { #if !defined(HPX_COMPUTE_DEVICE_CODE) using components::stubs::runtime_support; - std::uint32_t pin_count = ptr->pin_count(); + std::uint32_t const pin_count = ptr->pin_count(); if (pin_count == ~0x0u) { - agas::unmark_as_migrated(to_migrate.get_gid()); + ptr->unmark_as_migrated(to_migrate); HPX_THROW_EXCEPTION(hpx::error::invalid_status, "hpx::components::server::migrate_to_storage_here", "attempting to migrate an instance of a component which " - "was " - "already migrated"); - return make_ready_future(hpx::invalid_id); + "was already migrated"); } if (pin_count > 1) { - agas::unmark_as_migrated(to_migrate.get_gid()); + ptr->unmark_as_migrated(to_migrate); HPX_THROW_EXCEPTION(hpx::error::invalid_status, "hpx::components::server::migrate_to_storage_here", "attempting to migrate an instance of a component which is " "currently pinned"); - return make_ready_future(hpx::invalid_id); } // serialize the given component @@ -111,8 +110,8 @@ namespace hpx { namespace components { namespace server { naming::address addr(ptr->get_current_address()); - typedef typename server::component_storage::migrate_to_here_action - action_type; + using action_type = + typename server::component_storage::migrate_to_here_action; return hpx::async( target_storage, HPX_MOVE(data), to_migrate, addr) @@ -121,9 +120,6 @@ namespace hpx { namespace components { namespace server { ptr, to_migrate)); #else HPX_ASSERT(false); - HPX_UNUSED(ptr); - HPX_UNUSED(to_migrate); - HPX_UNUSED(target_storage); return hpx::make_ready_future(hpx::id_type{}); #endif } @@ -136,13 +132,12 @@ namespace hpx { namespace components { namespace server { future migrate_to_storage_here(hpx::id_type const& to_migrate, naming::address const& addr, hpx::id_type const& target_storage) { - if (!traits::component_supports_migration::call()) + if constexpr (!traits::component_supports_migration::call()) { HPX_THROW_EXCEPTION(hpx::error::invalid_status, "hpx::components::server::migrate_to_storage_here", "attempting to migrate an instance of a component which " "does not support migration"); - return make_ready_future(hpx::invalid_id); } // retrieve pointer to object (must be local) @@ -168,16 +163,16 @@ namespace hpx { namespace components { namespace server { // resolution for the given object. template future trigger_migrate_to_storage_here( - hpx::id_type const& to_migrate, hpx::id_type const& target_storage) + [[maybe_unused]] hpx::id_type const& to_migrate, + [[maybe_unused]] hpx::id_type const& target_storage) { #if !defined(HPX_COMPUTE_DEVICE_CODE) - if (!traits::component_supports_migration::call()) + if constexpr (!traits::component_supports_migration::call()) { HPX_THROW_EXCEPTION(hpx::error::invalid_status, "hpx::components::server::trigger_migrate_to_storage_here", "attempting to migrate an instance of a component which " "does not support migration"); - return make_ready_future(hpx::invalid_id); } if (naming::get_locality_id_from_id(to_migrate) != get_locality_id()) @@ -186,13 +181,12 @@ namespace hpx { namespace components { namespace server { "hpx::components::server::trigger_migrate_to_storage_here", "this function has to be executed on the locality responsible " "for managing the address of the given object"); - return make_ready_future(hpx::invalid_id); } - auto r = agas::begin_migration(to_migrate).get(); + auto const r = agas::begin_migration(to_migrate).get(); // perform actual object migration - typedef server::migrate_to_storage_here_action action_type; + using action_type = server::migrate_to_storage_here_action; future f = async(r.first, to_migrate, r.second, target_storage); @@ -203,8 +197,6 @@ namespace hpx { namespace components { namespace server { }); #else HPX_ASSERT(false); - HPX_UNUSED(to_migrate); - HPX_UNUSED(target_storage); return hpx::make_ready_future(hpx::id_type{}); #endif } @@ -217,4 +209,4 @@ namespace hpx { namespace components { namespace server { trigger_migrate_to_storage_here_action> { }; -}}} // namespace hpx::components::server +} // namespace hpx::components::server diff --git a/libs/core/command_line_handling_local/tests/unit/CMakeLists.txt b/libs/core/command_line_handling_local/tests/unit/CMakeLists.txt index 0fa2cfab678a..91426727ae8c 100644 --- a/libs/core/command_line_handling_local/tests/unit/CMakeLists.txt +++ b/libs/core/command_line_handling_local/tests/unit/CMakeLists.txt @@ -1,6 +1,35 @@ -# Copyright (c) 2020 The STE||AR-Group +# Copyright (c) 2020-2023 The STE||AR-Group # 2011 Bryce Adelstein-Lelbach # # 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(tests) + +if(HPX_COMMAND_LINE_HANDLING_WITH_JSON_CONFIGURATION_FILES) + set(tests json_config_file) + + set(json_config_file_PARAMETERS + "--hpx:options-file=${CMAKE_CURRENT_SOURCE_DIR}/config_file.json" + ) +endif() + +foreach(test ${tests}) + + set(sources ${test}.cpp) + + source_group("Source Files" FILES ${sources}) + + add_hpx_executable( + ${test}_test INTERNAL_FLAGS + SOURCES ${sources} + EXCLUDE_FROM_ALL + FOLDER "Tests/Unit/Modules/Core/CommandLineHandlingLocal/" + ) + + add_hpx_unit_test( + "modules.command_line_handling_local" ${test} ${${test}_PARAMETERS} + ) + +endforeach() diff --git a/libs/full/actions_base/include/hpx/actions_base/plain_action.hpp b/libs/full/actions_base/include/hpx/actions_base/plain_action.hpp index 94481d1416ce..cf2f11026de2 100644 --- a/libs/full/actions_base/include/hpx/actions_base/plain_action.hpp +++ b/libs/full/actions_base/include/hpx/actions_base/plain_action.hpp @@ -33,7 +33,7 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace actions { +namespace hpx::actions { /// \cond NOINTERNAL namespace detail { @@ -113,9 +113,9 @@ namespace hpx { namespace actions { }; /// \endcond -}} // namespace hpx::actions +} // namespace hpx::actions -namespace hpx { namespace traits { +namespace hpx::traits { /// \cond NOINTERNAL template <> @@ -125,6 +125,7 @@ namespace hpx { namespace traits { return hpx::components::component_plain_function; } + // clang-format off template <> HPX_ALWAYS_EXPORT inline void component_type_database::set( @@ -132,8 +133,9 @@ namespace hpx { namespace traits { { HPX_ASSERT(false); // shouldn't be ever called } + // clang-format on /// \endcond -}} // namespace hpx::traits +} // namespace hpx::traits /// \def HPX_DEFINE_PLAIN_ACTION(func, name) /// \brief Defines a plain action type @@ -223,7 +225,7 @@ namespace hpx { namespace traits { /// #define HPX_DECLARE_PLAIN_ACTION(...) \ HPX_DECLARE_ACTION(__VA_ARGS__) \ - /**/ +/**/ /// \def HPX_PLAIN_ACTION(func, name) /// diff --git a/libs/full/actions_base/include/hpx/actions_base/traits/action_was_object_migrated.hpp b/libs/full/actions_base/include/hpx/actions_base/traits/action_was_object_migrated.hpp index d888b10d9607..b927638743bb 100644 --- a/libs/full/actions_base/include/hpx/actions_base/traits/action_was_object_migrated.hpp +++ b/libs/full/actions_base/include/hpx/actions_base/traits/action_was_object_migrated.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 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,58 +7,80 @@ #pragma once #include +#include #include +#include #include -#include #include #include -namespace hpx { namespace traits { +namespace hpx::traits { - /////////////////////////////////////////////////////////////////////////// - // Customization point for action capabilities namespace detail { - struct was_object_migrated_helper + HPX_HAS_MEMBER_XXX_TRAIT_DEF(supports_migration) + + template + struct does_support_migration : std::false_type { - // by default we return an empty pinned_ptr value (nothing to pin) - template - static std::pair call( - wrap_int, hpx::naming::gid_type const&, naming::address_type) - { - return std::make_pair(false, components::pinned_ptr()); - } + }; - // forward the call if the component implements the function - template - static auto call( - int, hpx::naming::gid_type const& id, naming::address_type lva) - -> decltype( - Action::component_type::was_object_migrated(id, lva)) - { - using component_type = typename Action::component_type; - return component_type::was_object_migrated(id, lva); - } + template + struct does_support_migration>> + : std::bool_constant + { }; + + template + inline constexpr bool does_support_migration_v = + does_support_migration::value; } // namespace detail + /////////////////////////////////////////////////////////////////////////// + // Customization point for action capabilities template struct action_was_object_migrated { // returns whether target was migrated to another locality static std::pair call( - hpx::naming::gid_type const& id, naming::address_type lva) + [[maybe_unused]] hpx::naming::gid_type const& id, + [[maybe_unused]] naming::address_type lva) { - return detail::was_object_migrated_helper::template call( - 0, id, lva); + if constexpr (detail::does_support_migration_v< + typename Action::component_type>) + { + using component_type = typename Action::component_type; + auto result = component_type::was_object_migrated(id, lva); + HPX_ASSERT((result.first || result.second) && + !(result.first && result.second)); + return result; + } + else + { + return std::make_pair(false, components::pinned_ptr()); + } } static std::pair call( - hpx::id_type const& id, naming::address_type lva) + [[maybe_unused]] hpx::id_type const& id, + [[maybe_unused]] naming::address_type lva) { - return detail::was_object_migrated_helper::template call( - 0, id.get_gid(), lva); + if constexpr (detail::does_support_migration_v< + typename Action::component_type>) + { + using component_type = typename Action::component_type; + auto result = + component_type::was_object_migrated(id.get_gid(), lva); + HPX_ASSERT((result.first || result.second) && + !(result.first && result.second)); + return result; + } + else + { + return std::make_pair(false, components::pinned_ptr()); + } } }; -}} // namespace hpx::traits +} // namespace hpx::traits diff --git a/libs/full/actions_base/include/hpx/actions_base/traits/extract_action.hpp b/libs/full/actions_base/include/hpx/actions_base/traits/extract_action.hpp index 369c5fed54e5..1033594a0938 100644 --- a/libs/full/actions_base/include/hpx/actions_base/traits/extract_action.hpp +++ b/libs/full/actions_base/include/hpx/actions_base/traits/extract_action.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2019 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,9 +6,7 @@ #pragma once -#include - -namespace hpx { namespace traits { +namespace hpx::traits { // This template meta function can be used to extract the action type. template @@ -19,4 +17,7 @@ namespace hpx { namespace traits { using local_result_type = typename type::local_result_type; using remote_result_type = typename type::remote_result_type; }; -}} // namespace hpx::traits + + template + using extract_action_t = typename extract_action::type; +} // namespace hpx::traits diff --git a/libs/full/actions_base/include/hpx/actions_base/traits/is_continuation.hpp b/libs/full/actions_base/include/hpx/actions_base/traits/is_continuation.hpp index 9e452f9a3b72..29dd5a830bbc 100644 --- a/libs/full/actions_base/include/hpx/actions_base/traits/is_continuation.hpp +++ b/libs/full/actions_base/include/hpx/actions_base/traits/is_continuation.hpp @@ -30,7 +30,7 @@ namespace hpx { namespace traits { template struct is_continuation - : detail::is_continuation_impl::type> + : detail::is_continuation_impl> { }; diff --git a/libs/full/agas/include/hpx/agas/addressing_service.hpp b/libs/full/agas/include/hpx/agas/addressing_service.hpp index cfd2d4c52bae..c7b4e1e3163e 100644 --- a/libs/full/agas/include/hpx/agas/addressing_service.hpp +++ b/libs/full/agas/include/hpx/agas/addressing_service.hpp @@ -176,7 +176,7 @@ namespace hpx { namespace agas { // FIXME: document (add comments) void garbage_collect(error_code& ec = throws); - std::int64_t synchronize_with_async_incref( + static std::int64_t synchronize_with_async_incref( hpx::future fut, hpx::id_type const& id, std::int64_t compensated_credit); @@ -196,16 +196,17 @@ namespace hpx { namespace agas { } server::component_namespace* get_local_component_namespace_service() + const { return component_ns_->get_service(); } - server::locality_namespace* get_local_locality_namespace_service() + server::locality_namespace* get_local_locality_namespace_service() const { return locality_ns_->get_service(); } - server::symbol_namespace& get_local_symbol_namespace_service() + server::symbol_namespace& get_local_symbol_namespace_service() const { return symbol_ns_.get_service(); } @@ -285,7 +286,7 @@ namespace hpx { namespace agas { /// \brief Get locality locality_id of the console locality. /// - /// \param locality_id [out] The locality_id value uniquely identifying the + /// \param locality [out] The locality_id value uniquely identifying the /// console locality. This is valid only, if the /// return value of this function is true. /// \param try_cache [in] If this is set to true the console is first @@ -336,7 +337,7 @@ namespace hpx { namespace agas { components::component_type type, error_code& ec = throws) const; bool get_localities(std::vector& locality_ids, - error_code& ec = throws) + error_code& ec = throws) const { return get_localities( locality_ids, components::component_invalid, ec); @@ -441,7 +442,7 @@ namespace hpx { namespace agas { /// of hpx#exception. components::component_type register_factory( naming::gid_type const& locality_id, std::string const& name, - error_code& ec = throws) + error_code& ec = throws) const { return register_factory( naming::get_locality_id_from_gid(locality_id), name, ec); @@ -621,7 +622,6 @@ namespace hpx { namespace agas { /// /// \note This function will raise an error if the global /// reference count of the given gid is not zero! - /// TODO: confirm that this happens. bool unbind_local(naming::gid_type const& id, error_code& ec = throws) { return unbind_range_local(id, 1, ec); @@ -661,7 +661,6 @@ namespace hpx { namespace agas { /// /// \note This function will raise an error if the global /// reference count of the given gid is not zero! - /// TODO: confirm that this happens. bool unbind_local(naming::gid_type const& id, naming::address& addr, error_code& ec = throws) { @@ -702,7 +701,6 @@ namespace hpx { namespace agas { /// /// \note This function will raise an error if the global /// reference count of the given gid is not zero! - /// TODO: confirm that this happens. bool unbind_range_local(naming::gid_type const& lower_id, std::uint64_t count, error_code& ec = throws) { @@ -759,7 +757,7 @@ namespace hpx { namespace agas { /// This function will test whether the given address refers to an object /// living on the locality of the caller. /// - /// \param addr [in] The address to test. + /// \param id [in] The address to test. /// \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. @@ -782,6 +780,12 @@ namespace hpx { namespace agas { bool is_local_address_cached(naming::gid_type const& id, naming::address& addr, error_code& ec = throws); + bool is_local_address_cached(naming::gid_type const& id, + naming::address& addr, std::pair& r, + hpx::move_only_function( + naming::address const&)>&& f, + error_code& ec = throws); + bool is_local_lva_encoded_address(std::uint64_t msb) const; /// \brief Resolve a given global address (\a id) to its associated local @@ -908,7 +912,6 @@ namespace hpx { namespace agas { /////////////////////////////////////////////////////////////////////////// // Bulk version. - // TODO: Add versions that take std::vector for convenience. bool resolve_local(naming::gid_type const* gids, naming::address* addrs, std::size_t size, hpx::detail::dynamic_bitset<>& locals, error_code& ec = throws) @@ -916,7 +919,7 @@ namespace hpx { namespace agas { // Try the cache. if (caching_) { - bool all_resolved = + bool const all_resolved = resolve_cached(gids, addrs, size, locals, ec); if (ec) return false; @@ -945,6 +948,7 @@ namespace hpx { namespace agas { /// /// \param p [in] this is the parcel which has to be routed to the /// AGAS service instance managing the destination GID. + /// \param local_priority [in] /// /// \note The route operation is asynchronous, thus it returns /// before the parcel has been delivered to its @@ -958,10 +962,11 @@ namespace hpx { namespace agas { /// \brief Increment the global reference count for the given id /// - /// \param id [in] The global address (id) for which the + /// \param gid [in] The global address (id) for which the /// global reference count has to be incremented. /// \param credits [in] The number of reference counts to add for /// the given id. + /// \param keep_alive [in] Id to keep alive (if valid) /// \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. @@ -1016,7 +1021,7 @@ namespace hpx { namespace agas { /// Any error results in an exception thrown (or reported) from this /// function. /// - /// \param pattern [in] pattern (poosibly using wildcards) to match + /// \param pattern [in] pattern (possibly using wildcards) to match /// all existing entries against /// hpx::future iterate_ids( @@ -1189,7 +1194,8 @@ namespace hpx { namespace agas { bool expect_to_be_marked_as_migrating); /// Remove the given object from the table of migrated objects - void unmark_as_migrated(naming::gid_type const& gid); + void unmark_as_migrated( + naming::gid_type const& gid_, hpx::move_only_function&& f); // Pre-cache locality endpoints in hosted locality namespace void pre_cache_endpoints(std::vector const&); diff --git a/libs/full/agas/src/addressing_service.cpp b/libs/full/agas/src/addressing_service.cpp index 2d2b90666a53..b2b4b053a4ee 100644 --- a/libs/full/agas/src/addressing_service.cpp +++ b/libs/full/agas/src/addressing_service.cpp @@ -33,13 +33,11 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include @@ -52,17 +50,14 @@ namespace hpx::agas { struct addressing_service::gva_cache_key - { // {{{ gva_cache_key implementation + { private: using key_type = std::pair; key_type key_; public: - gva_cache_key() - : key_() - { - } + gva_cache_key() = default; explicit gva_cache_key( naming::gid_type const& id, std::uint64_t count = 1) @@ -107,7 +102,7 @@ namespace hpx::agas { } // Is rhs in lhs? - else if (1 != lhs.get_count() && 1 == rhs.get_count()) + if (1 != lhs.get_count() && 1 == rhs.get_count()) { return lhs.key_.first <= rhs.key_.first && rhs.key_.second <= lhs.key_.second; @@ -132,7 +127,6 @@ namespace hpx::agas { , action_priority_(threads::thread_priority::boost) , rts_lva_(0) , state_(hpx::state::starting) - , locality_() { if (caching_) gva_cache_->reserve(ini_.get_agas_local_cache_size()); @@ -165,7 +159,7 @@ namespace hpx::agas { { component_ns_.reset(new detail::bootstrap_component_namespace); locality_ns_.reset(new detail::bootstrap_locality_namespace( - reinterpret_cast(primary_ns_.ptr()))); + static_cast(primary_ns_.ptr()))); naming::gid_type const here = naming::get_gid_from_locality_id(agas::booststrap_prefix); @@ -175,7 +169,7 @@ namespace hpx::agas { hpx::util::format( "hpx.locality!={1}", naming::get_locality_id_from_gid(here))); - std::uint32_t num_threads = + std::uint32_t const num_threads = hpx::util::get_entry_as(rtcfg, "hpx.os_threads", 1u); locality_ns_->allocate(endpoints, 0, num_threads, naming::invalid_gid); @@ -193,7 +187,7 @@ namespace hpx::agas { // create the hierarchy based on the topology if (caching_) { - std::size_t previous = gva_cache_->size(); + std::size_t const previous = gva_cache_->size(); gva_cache_->reserve(cache_size); LAGAS_(info).format( @@ -246,11 +240,11 @@ namespace hpx::agas { parcelset::endpoints_type const& eps) { std::lock_guard l(resolved_localities_mtx_); - std::pair res = + [[maybe_unused]] std::pair const res = resolved_localities_.emplace( naming::get_gid_from_locality_id(0), eps); HPX_ASSERT(res.second); - HPX_UNUSED(res); } bool addressing_service::has_resolved_locality(naming::gid_type const& gid) @@ -276,7 +270,7 @@ namespace hpx::agas { naming::gid_type const& gid, error_code& ec) { std::unique_lock l(resolved_localities_mtx_); - resolved_localities_type::iterator it = resolved_localities_.find(gid); + auto it = resolved_localities_.find(gid); if (it == resolved_localities_.end() || it->second.empty()) { // The locality hasn't been requested to be resolved yet. Do it now. @@ -286,7 +280,7 @@ namespace hpx::agas { endpoints = locality_ns_->resolve_locality(gid); if (endpoints.empty()) { - std::string str = hpx::util::format( + std::string const str = hpx::util::format( "couldn't resolve the given target locality ({})", gid); l.unlock(); @@ -346,9 +340,11 @@ namespace hpx::agas { naming::gid_type const& gid) { std::lock_guard l(resolved_localities_mtx_); - resolved_localities_type::iterator it = resolved_localities_.find(gid); - if (it != resolved_localities_.end()) + if (auto const it = resolved_localities_.find(gid); + it != resolved_localities_.end()) + { resolved_localities_.erase(it); + } } bool addressing_service::get_console_locality( @@ -383,12 +379,12 @@ namespace hpx::agas { } } - std::string key("/0/locality#console"); + std::string const key("/0/locality#console"); hpx::id_type resolved_prefix = resolve_name(key); if (resolved_prefix != hpx::invalid_id) { - std::uint32_t console = + std::uint32_t const console = naming::get_locality_id_from_id(resolved_prefix); prefix = resolved_prefix.get_gid(); @@ -436,7 +432,7 @@ namespace hpx::agas { return false; locality_ids.clear(); - for (unsigned int i : p) + for (unsigned int const i : p) { locality_ids.emplace_back( naming::get_gid_from_locality_id(i)); @@ -602,12 +598,14 @@ namespace hpx::agas { { // parcelset::endpoints_type() is an obsolete, dummy argument - std::pair rep( + std::pair const rep( primary_ns_.allocate(count)); if (rep.first == naming::invalid_gid || rep.second == naming::invalid_gid) + { return false; + } lower_bound = rep.first; upper_bound = rep.second; @@ -735,27 +733,63 @@ namespace hpx::agas { naming::gid_type const& gid, naming::address& addr, error_code& ec) { // Assume non-local operation if the gid is known to have been migrated - naming::gid_type id( + naming::gid_type const id( naming::detail::get_stripped_gid_except_dont_cache(gid)); + // migratable objects should be handled by the function below + HPX_ASSERT(!naming::detail::is_migratable(gid)); + + // Try to resolve the address of the GID from the locally available + // information. + + // NOTE: We do not throw here for a reason; it is perfectly valid for the + // GID to not be found in the cache. + if (!resolve_cached(id, addr, ec) || ec) + { + if (ec) + return false; + + // try also the local part of AGAS before giving up + if (!resolve_full_local(id, addr, ec) || ec) + return false; + } + + return addr.locality_ == get_local_locality(); + } + + bool addressing_service::is_local_address_cached( + naming::gid_type const& gid, naming::address& addr, + std::pair& r, + hpx::move_only_function( + naming::address const&)>&& f, + error_code& ec) + { + if (!naming::detail::is_migratable(gid)) + { + return is_local_address_cached(gid, addr, ec); + } + #if defined(HPX_HAVE_NETWORKING) - if (naming::detail::is_migratable(gid)) + // Assume non-local operation if the gid is known to have been migrated + naming::gid_type const id( + naming::detail::get_stripped_gid_except_dont_cache(gid)); + { - std::lock_guard lock(migrated_objects_mtx_); - if (was_object_migrated_locked(id)) + std::unique_lock lock(migrated_objects_mtx_); + if (was_object_migrated_locked(gid)) { + r = std::make_pair(true, components::pinned_ptr()); if (&ec != &throws) ec = make_success_code(); return false; } } -#endif // Try to resolve the address of the GID from the locally available // information. - // NOTE: We do not throw here for a reason; it is perfectly valid for the - // GID to not be found in the cache. + // NOTE: We do not throw here for a reason; it is perfectly valid for + // the GID to not be found in the cache. if (!resolve_cached(id, addr, ec) || ec) { if (ec) @@ -766,7 +800,29 @@ namespace hpx::agas { return false; } - return addr.locality_ == get_local_locality(); + if (&ec != &throws) + ec = make_success_code(); + + if (addr.locality_ == get_local_locality()) + { + // if the object is local, acquire the pin count for the migratable + // object + r = f(addr); + HPX_ASSERT((r.first || r.second) && !(r.first && r.second)); + if (!r.first) + { + return true; // object was not migrated and address is known + } + + // fall through + } + + // make sure to force re-resolving the address + addr = naming::address(); + return false; +#else + return is_local_address_cached(gid, addr, ec); +#endif } // Return true if at least one address is local. @@ -782,7 +838,7 @@ namespace hpx::agas { naming::gid_type const& id, naming::address& addr) const { // LVA-encoded GIDs (located on this machine) - std::uint64_t lsb = id.get_lsb(); + std::uint64_t const lsb = id.get_lsb(); std::uint64_t msb = id.get_msb(); if (is_local_lva_encoded_address(msb)) @@ -833,7 +889,7 @@ namespace hpx::agas { return true; } - naming::gid_type dest = naming::get_locality_from_gid(id); + naming::gid_type const dest = naming::get_locality_from_gid(id); if (agas::primary_ns_lsb == lsb) { // primary AGAS service on locality 0? @@ -886,7 +942,7 @@ namespace hpx::agas { // Resolve the gva to the real resolved address (which is just a gva // with as fully resolved LVA and an offset of zero). - naming::gid_type base_gid = get<0>(rep); + naming::gid_type const base_gid = get<0>(rep); gva const base_gva = get<1>(rep); gva const g = base_gva.resolve(id, base_gid); @@ -928,7 +984,7 @@ namespace hpx::agas { bool addressing_service::resolve_cached( naming::gid_type const& gid, naming::address& addr, error_code& ec) { - naming::gid_type id = + naming::gid_type const id = naming::detail::get_stripped_gid_except_dont_cache(gid); // special cases @@ -978,8 +1034,7 @@ namespace hpx::agas { // first look up the requested item in the cache gva g; - naming::gid_type idbase; - if (get_cache_entry(id, g, idbase, ec)) + if (naming::gid_type idbase; get_cache_entry(id, g, idbase, ec)) { addr.locality_ = g.prefix; addr.type_ = g.type; @@ -1008,7 +1063,6 @@ namespace hpx::agas { { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "addressing_service::resolve_async", "invalid reference id"); - return make_ready_future(naming::address()); } // Try the cache. @@ -1038,7 +1092,6 @@ namespace hpx::agas { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "addressing_service::get_colocation_id_async", "invalid reference id"); - return make_ready_future(hpx::invalid_id); } return primary_ns_.colocate(id.get_gid()); @@ -1059,12 +1112,11 @@ namespace hpx::agas { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "addressing_service::resolve_full_postproc", "could no resolve global id"); - return addr; } // Resolve the gva to the real resolved address (which is just a gva // with as fully resolved LVA and and offset of zero). - naming::gid_type base_gid = get<0>(rep); + naming::gid_type const base_gid = get<0>(rep); gva const base_gva = get<1>(rep); gva const g = base_gva.resolve(id, base_gid); @@ -1098,7 +1150,6 @@ namespace hpx::agas { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "addressing_service::resolve_full_async", "invalid reference id"); - return make_ready_future(naming::address()); } // ask server @@ -1191,7 +1242,7 @@ namespace hpx::agas { { if (!addrs[i] && !locals.test(i)) { - bool was_resolved = resolve_cached(gids[i], addrs[i], ec); + bool const was_resolved = resolve_cached(gids[i], addrs[i], ec); if (ec) return false; if (was_resolved) @@ -1242,10 +1293,11 @@ namespace hpx::agas { #endif /////////////////////////////////////////////////////////////////////////// - // The parameter 'compensated_credit' holds the amount of credits to be added - // to the acknowledged number of credits. The compensated credits are non-zero - // if there was a pending decref request at the point when the incref was sent. - // The pending decref was subtracted from the amount of credits to incref. + // The parameter 'compensated_credit' holds the amount of credits to be + // added to the acknowledged number of credits. The compensated credits are + // non-zero if there was a pending decref request at the point when the + // incref was sent. The pending decref was subtracted from the amount of + // credits to incref. std::int64_t addressing_service::synchronize_with_async_incref( hpx::future fut, hpx::id_type const&, std::int64_t compensated_credit) @@ -1274,7 +1326,6 @@ namespace hpx::agas { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "addressing_service::incref_async", "invalid credit count of {1}", credit); - return hpx::future(); } HPX_ASSERT(keep_alive != hpx::invalid_id); @@ -1298,10 +1349,8 @@ namespace hpx::agas { { std::lock_guard l(refcnt_requests_mtx_); - using iterator = refcnt_requests_type::iterator; - - iterator matches = refcnt_requests_->find(raw); - if (matches != refcnt_requests_->end()) + if (auto const matches = refcnt_requests_->find(raw); + matches != refcnt_requests_->end()) { pending_decrefs = matches->second; matches->second += credit; @@ -1309,12 +1358,12 @@ namespace hpx::agas { // Increment requests need to be handled immediately. // If the given incref was fully compensated by a pending decref - // (i.e. match_data is less than 0) then there is no need - // to do anything more. + // (i.e. match_data is less than 0) then there is no need to do + // anything more. if (matches->second > 0) { - // credit > decrefs (case no 4): store the remaining incref to - // be handled below. + // credit > decrefs (case no 4): store the remaining incref + // to be handled below. pending_incref = mapping(matches->first, matches->second); has_pending_incref = true; @@ -1351,11 +1400,10 @@ namespace hpx::agas { pending_incref.second, e_lower, e_lower); // pass the amount of compensated decrefs to the callback - using placeholders::_1; return f.then(hpx::launch::sync, util::one_shot( hpx::bind(&addressing_service::synchronize_with_async_incref, - this, _1, keep_alive, pending_decrefs))); + hpx::placeholders::_1, keep_alive, pending_decrefs))); } /////////////////////////////////////////////////////////////////////////// @@ -1393,17 +1441,17 @@ namespace hpx::agas { std::unique_lock l(refcnt_requests_mtx_); // Match the decref request with entries in the incref table - using iterator = refcnt_requests_type::iterator; - using mapping = refcnt_requests_type::value_type; - - iterator matches = refcnt_requests_->find(raw); - if (matches != refcnt_requests_->end()) + if (auto const matches = refcnt_requests_->find(raw); + matches != refcnt_requests_->end()) { matches->second -= credit; } else { - std::pair p = + using iterator = refcnt_requests_type::iterator; + using mapping = refcnt_requests_type::value_type; + + std::pair const p = refcnt_requests_->insert(mapping(raw, -credit)); if (HPX_UNLIKELY(!p.second)) @@ -1458,9 +1506,10 @@ namespace hpx::agas { { // We need to modify the reference count. naming::gid_type& mutable_gid = const_cast(id).get_gid(); - naming::gid_type new_gid = + naming::gid_type const new_gid = naming::detail::split_gid_if_needed(mutable_gid).get(); - std::int64_t new_credit = naming::detail::get_credit_from_gid(new_gid); + std::int64_t const new_credit = + naming::detail::get_credit_from_gid(new_gid); try { @@ -1604,7 +1653,7 @@ namespace hpx::agas { return; } - naming::gid_type gid = naming::detail::get_stripped_gid(id); + naming::gid_type const gid = naming::detail::get_stripped_gid(id); // don't look at the cache if the id is locally managed if (naming::get_locality_id_from_gid(gid) == @@ -1622,6 +1671,7 @@ namespace hpx::agas { { return; } + threads::thread_init_data data( threads::make_thread_function_nullary( [HPX_CXX20_CAPTURE_THIS(=)]() -> void { @@ -1637,8 +1687,8 @@ namespace hpx::agas { try { - // The entry in AGAS for a locality's RTS component has a count of 0, - // so we convert it to 1 here so that the cache doesn't break. + // The entry in AGAS for a locality's RTS component has a count of + // 0, so we convert it to 1 here so that the cache doesn't break. std::uint64_t const count = (g.count ? g.count : 1); LAGAS_(debug).format( @@ -1695,11 +1745,11 @@ namespace hpx::agas { { return false; } - gva_cache_key k(gid); - gva_cache_key idbase_key; + + gva_cache_key const k(gid); std::unique_lock lock(gva_cache_mtx_); - if (gva_cache_->get_entry(k, idbase_key, gva)) + if (gva_cache_key idbase_key; gva_cache_->get_entry(k, idbase_key, gva)) { std::uint64_t const id_msb = naming::detail::strip_internal_bits_from_gid(gid.get_msb()); @@ -1713,6 +1763,7 @@ namespace hpx::agas { "match"); return false; } + idbase = idbase_key.get_gid(); return true; } @@ -1900,7 +1951,7 @@ namespace hpx::agas { void addressing_service::register_server_instances() { // register root server - std::uint32_t locality_id = + std::uint32_t const locality_id = naming::get_locality_id_from_gid(get_local_locality()); locality_ns_->register_server_instance(locality_id); primary_ns_.register_server_instance(locality_id); @@ -1974,7 +2025,8 @@ namespace hpx::agas { #endif void addressing_service::send_refcnt_requests_non_blocking( - std::unique_lock& l, error_code& ec) + [[maybe_unused]] std::unique_lock& l, + [[maybe_unused]] error_code& ec) { #if !defined(HPX_COMPUTE_DEVICE_CODE) HPX_ASSERT_OWNS_LOCK(l); @@ -2024,8 +2076,8 @@ namespace hpx::agas { } // send requests to all locality - requests_type::iterator end = requests.end(); - for (requests_type::iterator it = requests.begin(); it != end; ++it) + auto const end = requests.end(); + for (auto it = requests.begin(); it != end; ++it) { server::primary_namespace::decrement_credit_action action; hpx::post(action, it->first, HPX_MOVE(it->second)); @@ -2041,15 +2093,13 @@ namespace hpx::agas { ec, e, "addressing_service::send_refcnt_requests_non_blocking"); } #else - HPX_UNUSED(l); - HPX_UNUSED(ec); HPX_ASSERT(false); #endif } std::vector>> addressing_service::send_refcnt_requests_async( - std::unique_lock& l) + [[maybe_unused]] std::unique_lock& l) { #if !defined(HPX_COMPUTE_DEVICE_CODE) HPX_ASSERT_OWNS_LOCK(l); @@ -2097,8 +2147,8 @@ namespace hpx::agas { } // send requests to all locality - requests_type::iterator end = requests.end(); - for (requests_type::iterator it = requests.begin(); it != end; ++it) + auto const end = requests.end(); + for (auto it = requests.begin(); it != end; ++it) { server::primary_namespace::decrement_credit_action action; lazy_results.push_back( @@ -2107,7 +2157,6 @@ namespace hpx::agas { return lazy_results; #else - HPX_UNUSED(l); HPX_ASSERT(false); std::vector>> lazy_results; return lazy_results; @@ -2153,8 +2202,7 @@ namespace hpx::agas { using lock_type = std::unique_lock; lock_type lock(migrated_objects_mtx_); - util::ignore_while_checking ignore(&lock); - HPX_UNUSED(ignore); + [[maybe_unused]] util::ignore_while_checking const ignore(&lock); // call the user code for the component instance to be migrated, the // returned future becomes ready whenever the component instance can be @@ -2166,13 +2214,11 @@ namespace hpx::agas { // locality and the locality managing the address resolution for the object if (result.first) { - naming::gid_type gid(naming::detail::get_stripped_gid(gid_)); - - migrated_objects_table_type::iterator it = - migrated_objects_table_.find(gid); + naming::gid_type const gid(naming::detail::get_stripped_gid(gid_)); // insert the object into the map of migrated objects - if (it == migrated_objects_table_.end()) + if (auto const it = migrated_objects_table_.find(gid); + it == migrated_objects_table_.end()) { HPX_ASSERT(!expect_to_be_marked_as_migrating); migrated_objects_table_.insert(gid); @@ -2192,7 +2238,8 @@ namespace hpx::agas { return HPX_MOVE(result.second); } - void addressing_service::unmark_as_migrated(naming::gid_type const& gid_) + void addressing_service::unmark_as_migrated( + naming::gid_type const& gid_, hpx::move_only_function&& f) { if (!gid_) { @@ -2203,28 +2250,34 @@ namespace hpx::agas { HPX_ASSERT(naming::detail::is_migratable(gid_)); - naming::gid_type gid(naming::detail::get_stripped_gid(gid_)); + naming::gid_type const gid(naming::detail::get_stripped_gid(gid_)); std::unique_lock lock(migrated_objects_mtx_); - migrated_objects_table_type::iterator it = - migrated_objects_table_.find(gid); - // remove the object from the map of migrated objects - if (it != migrated_objects_table_.end()) + bool remove_from_cache = false; + if (auto const it = migrated_objects_table_.find(gid); + it != migrated_objects_table_.end()) { migrated_objects_table_.erase(it); // remove entry from cache if (caching_ && naming::detail::store_in_cache(gid_)) { - // avoid interactions with the locking in the cache - lock.unlock(); - - // remove entry from cache - remove_cache_entry(gid_); + remove_from_cache = true; } } + + f(); // call the user code for the component instance to be migrated + + if (remove_from_cache) + { + // avoid interactions with the locking in the cache + lock.unlock(); + + // remove entry from cache + remove_cache_entry(gid_); + } } hpx::future> @@ -2238,7 +2291,8 @@ namespace hpx::agas { HPX_ASSERT(naming::detail::is_migratable(id.get_gid())); - naming::gid_type gid(naming::detail::get_stripped_gid(id.get_gid())); + naming::gid_type const gid( + naming::detail::get_stripped_gid(id.get_gid())); return primary_ns_.begin_migration(gid); } @@ -2253,7 +2307,8 @@ namespace hpx::agas { HPX_ASSERT(naming::detail::is_migratable(id.get_gid())); - naming::gid_type gid(naming::detail::get_stripped_gid(id.get_gid())); + naming::gid_type const gid( + naming::detail::get_stripped_gid(id.get_gid())); return primary_ns_.end_migration(gid); } @@ -2261,7 +2316,7 @@ namespace hpx::agas { bool addressing_service::was_object_migrated_locked( naming::gid_type const& gid_) { - naming::gid_type gid(naming::detail::get_stripped_gid(gid_)); + naming::gid_type const gid(naming::detail::get_stripped_gid(gid_)); return migrated_objects_table_.find(gid) != migrated_objects_table_.end(); @@ -2279,11 +2334,6 @@ namespace hpx::agas { "invalid reference gid"); } - if (!naming::detail::is_migratable(gid)) - { - return std::make_pair(false, f()); - } - // Always first grab the AGAS lock before invoking the user supplied // function. The user supplied code will grab another lock. Both locks // have to be acquired and always in the same sequence. The AGAS lock @@ -2293,13 +2343,17 @@ namespace hpx::agas { // locality is to query the migrated objects table in AGAS. using lock_type = std::unique_lock; - lock_type lock(migrated_objects_mtx_); + lock_type const lock(migrated_objects_mtx_); + + if (!naming::detail::is_migratable(gid)) + { + return std::make_pair(false, f()); + } if (was_object_migrated_locked(gid)) return std::make_pair(true, components::pinned_ptr()); - util::ignore_while_checking ignore(&lock); - HPX_UNUSED(ignore); + [[maybe_unused]] util::ignore_while_checking const ignore(&lock); return std::make_pair(false, f()); } diff --git a/libs/full/agas/src/detail/interface.cpp b/libs/full/agas/src/detail/interface.cpp index 16b297e8ffe6..727b8f970c85 100644 --- a/libs/full/agas/src/detail/interface.cpp +++ b/libs/full/agas/src/detail/interface.cpp @@ -129,6 +129,16 @@ namespace hpx::agas::detail::impl { return naming::get_agas_client().is_local_address_cached(gid, addr, ec); } + bool is_local_address_cached_addr_pinned_ptr(naming::gid_type const& gid, + naming::address& addr, std::pair& r, + hpx::move_only_function( + naming::address const&)>&& f, + error_code& ec) + { + return naming::get_agas_client().is_local_address_cached( + gid, addr, r, HPX_MOVE(f), ec); + } + void update_cache_entry(naming::gid_type const& gid, naming::address const& addr, std::uint64_t count, std::uint64_t offset, error_code& ec) @@ -463,9 +473,10 @@ namespace hpx::agas::detail::impl { return naming::get_agas_client().was_object_migrated(gid, HPX_MOVE(f)); } - void unmark_as_migrated(naming::gid_type const& gid) + void unmark_as_migrated( + naming::gid_type const& gid, hpx::move_only_function&& f) { - return naming::get_agas_client().unmark_as_migrated(gid); + return naming::get_agas_client().unmark_as_migrated(gid, HPX_MOVE(f)); } hpx::future find_symbols_async( @@ -562,6 +573,8 @@ namespace hpx::agas { &detail::impl::is_local_address_cached; detail::is_local_address_cached_addr = &detail::impl::is_local_address_cached_addr; + detail::is_local_address_cached_addr_pinned_ptr = + &detail::impl::is_local_address_cached_addr_pinned_ptr; detail::update_cache_entry = &detail::impl::update_cache_entry; detail::is_local_lva_encoded_address = diff --git a/libs/full/agas_base/include/hpx/agas_base/server/primary_namespace.hpp b/libs/full/agas_base/include/hpx/agas_base/server/primary_namespace.hpp index 3ce203371594..0c39dc21db0b 100644 --- a/libs/full/agas_base/include/hpx/agas_base/server/primary_namespace.hpp +++ b/libs/full/agas_base/include/hpx/agas_base/server/primary_namespace.hpp @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2011 Bryce Adelstein-Lelbach -// Copyright (c) 2012-2020 Hartmut Kaiser +// Copyright (c) 2012-2023 Hartmut Kaiser // Copyright (c) 2016 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 @@ -146,7 +146,8 @@ namespace hpx::agas::server { struct update_time_on_exit; public: - // data structure holding all counters for the omponent_namespace component + // data structure holding all counters for the component_namespace + // component struct counter_data { public: @@ -210,16 +211,22 @@ namespace hpx::agas::server { api_counter_data route_; // primary_ns_ #endif - api_counter_data bind_gid_; // primary_ns_bind_gid - api_counter_data resolve_gid_; // primary_ns_resolve_gid - api_counter_data unbind_gid_; // primary_ns_unbind_gid - api_counter_data - increment_credit_; // primary_ns_increment_credit - api_counter_data - decrement_credit_; // primary_ns_decrement_credit - api_counter_data allocate_; // primary_ns_allocate - api_counter_data begin_migration_; // primary_ns_begin_migration - api_counter_data end_migration_; // primary_ns_end_migration + // primary_ns_bind_gid + api_counter_data bind_gid_; + // primary_ns_resolve_gid + api_counter_data resolve_gid_; + // primary_ns_unbind_gid + api_counter_data unbind_gid_; + // primary_ns_increment_credit + api_counter_data increment_credit_; + // primary_ns_decrement_credit + api_counter_data decrement_credit_; + // primary_ns_allocate + api_counter_data allocate_; + // primary_ns_begin_migration + api_counter_data begin_migration_; + // primary_ns_end_migration + api_counter_data end_migration_; }; counter_data counter_data_; @@ -241,14 +248,12 @@ namespace hpx::agas::server { public: primary_namespace() : base_type(agas::primary_ns_msb, agas::primary_ns_lsb) - , mutex_() - , instance_name_() , next_id_(naming::invalid_gid) , locality_(naming::invalid_gid) { } - void finalize(); + void finalize() const; void set_local_locality(naming::gid_type const& g) { @@ -260,7 +265,7 @@ namespace hpx::agas::server { std::uint32_t locality_id = naming::invalid_locality_id, error_code& ec = throws); - void unregister_server_instance(error_code& ec = throws); + void unregister_server_instance(error_code& ec = throws) const; #if defined(HPX_HAVE_NETWORKING) void route(parcelset::parcel&& p); @@ -299,13 +304,13 @@ namespace hpx::agas::server { error_code& ec); void increment(naming::gid_type const& lower, - naming::gid_type const& upper, std::int64_t& credits, + naming::gid_type const& upper, std::int64_t const& credits, error_code& ec); /////////////////////////////////////////////////////////////////////////// struct free_entry { - free_entry(agas::gva gva, naming::gid_type const& gid, + free_entry(agas::gva const& gva, naming::gid_type const& gid, naming::gid_type const& loc) : gva_(gva) , gid_(gid) @@ -332,9 +337,9 @@ namespace hpx::agas::server { naming::gid_type const& lower, naming::gid_type const& upper, std::int64_t credits, error_code& ec); - void free_components_sync(free_entry_list_type& free_list, + void free_components_sync(free_entry_list_type const& free_list, naming::gid_type const& lower, naming::gid_type const& upper, - error_code& ec); + error_code& ec) const; public: HPX_DEFINE_COMPONENT_ACTION(primary_namespace, allocate) @@ -439,22 +444,19 @@ HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION( std::vector, vector_std_int64_type) #if !defined(HPX_COMPUTE_DEVICE_CODE) && defined(HPX_HAVE_NETWORKING) -namespace hpx::traits { - - // Parcel routing forwards the binary filter request to the routed action - template <> - struct action_get_embedded_parcel< - agas::server::primary_namespace::route_action> +// Parcel routing forwards the binary filter request to the routed action +template <> +struct hpx::traits::action_get_embedded_parcel< + hpx::agas::server::primary_namespace::route_action> +{ + static hpx::optional call( + hpx::actions::transfer_base_action< + hpx::agas::server::primary_namespace::route_action> const& act) { - static hpx::optional call( - hpx::actions::transfer_base_action< - agas::server::primary_namespace::route_action> const& act) - { - auto p = hpx::actions::get<0>(act); - return hpx::optional(HPX_MOVE(p)); - } - }; -} // namespace hpx::traits + auto p = hpx::actions::get<0>(act); + return hpx::optional(HPX_MOVE(p)); + } +}; // namespace hpx::traits #endif #include diff --git a/libs/full/agas_base/src/server/primary_namespace_server.cpp b/libs/full/agas_base/src/server/primary_namespace_server.cpp index b497118393e4..f91819e3917e 100644 --- a/libs/full/agas_base/src/server/primary_namespace_server.cpp +++ b/libs/full/agas_base/src/server/primary_namespace_server.cpp @@ -9,8 +9,6 @@ #include #include #include -#include -#include #include #include #include @@ -23,7 +21,6 @@ #include #include -#include #include #include #include @@ -42,8 +39,8 @@ namespace hpx::agas { hpx::id_type bootstrap_primary_namespace_id() { - return hpx::id_type(agas::primary_ns_msb, agas::primary_ns_lsb, - hpx::id_type::management_type::unmanaged); + return {agas::primary_ns_msb, agas::primary_ns_lsb, + hpx::id_type::management_type::unmanaged}; } } // namespace hpx::agas @@ -69,13 +66,13 @@ namespace hpx::agas::server { launch::sync, instance_name_, get_unmanaged_id().get_gid(), ec); } - void primary_namespace::unregister_server_instance(error_code& ec) + void primary_namespace::unregister_server_instance(error_code& ec) const { agas::unregister_name(launch::sync, instance_name_, ec); this->base_type::finalize(); } - void primary_namespace::finalize() + void primary_namespace::finalize() const { if (!instance_name_.empty()) { @@ -109,10 +106,10 @@ namespace hpx::agas::server { return std::make_pair(hpx::invalid_id, naming::address()); } - migration_table_type::iterator it = migrating_objects_.find(id); + auto it = migrating_objects_.find(id); if (it == migrating_objects_.end()) { - std::pair p = + std::pair const p = migrating_objects_.emplace(std::piecewise_construct, std::forward_as_tuple(id), std::forward_as_tuple()); HPX_ASSERT(p.second); @@ -120,7 +117,7 @@ namespace hpx::agas::server { } else { - HPX_ASSERT(hpx::get<0>(it->second) == false); + HPX_ASSERT(!hpx::get<0>(it->second)); } // flag this id as being migrated @@ -145,8 +142,8 @@ namespace hpx::agas::server { using hpx::get; - migration_table_type::iterator it = migrating_objects_.find(id); - if (it != migrating_objects_.end()) + if (auto const it = migrating_objects_.find(id); + it != migrating_objects_.end()) { // flag this id as not being migrated anymore get<0>(it->second) = false; @@ -172,8 +169,8 @@ namespace hpx::agas::server { using hpx::get; - migration_table_type::iterator it = migrating_objects_.find(id); - if (it != migrating_objects_.end()) + if (auto const it = migrating_objects_.find(id); + it != migrating_objects_.end()) { if (get<0>(it->second)) { @@ -204,15 +201,15 @@ namespace hpx::agas::server { counter_data_.increment_bind_gid_count(); using hpx::get; - naming::gid_type gid = id; + naming::gid_type const gid = id; naming::detail::strip_internal_bits_from_gid(id); std::unique_lock l(mutex_); - gva_table_type::iterator it = gvas_.lower_bound(id), - begin = gvas_.begin(), end = gvas_.end(); + auto const begin = gvas_.begin(); + auto const end = gvas_.end(); - if (it != end) + if (auto it = gvas_.lower_bound(id); it != end) { // If we got an exact match, this is a request to update an existing // binding (e.g. move semantics). @@ -227,8 +224,6 @@ namespace hpx::agas::server { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "primary_namespace::bind_gid", "cannot rebind gids for non-migratable objects"); - - return false; } gva& gaddr = it->second.first; @@ -333,7 +328,7 @@ namespace hpx::agas::server { return true; } - naming::gid_type upper_bound(id + (g.count - 1)); + naming::gid_type const upper_bound(id + (g.count - 1)); if (HPX_UNLIKELY(id.get_msb() != upper_bound.get_msb())) { @@ -382,8 +377,9 @@ namespace hpx::agas::server { { naming::gid_type locality = naming::get_locality_from_gid(id); gva addr(locality, - naming::detail::get_component_type_from_gid(id.get_msb()), 1, - id.get_lsb()); + static_cast( + naming::detail::get_component_type_from_gid(id.get_msb())), + 1, id.get_lsb()); return primary_namespace::resolved_type(id, addr, locality); } @@ -438,8 +434,8 @@ namespace hpx::agas::server { hpx::id_type primary_namespace::colocate(naming::gid_type const& id) { - return hpx::id_type(hpx::get<2>(resolve_gid(id)), - hpx::id_type::management_type::unmanaged); + return {hpx::get<2>(resolve_gid(id)), + hpx::id_type::management_type::unmanaged}; } naming::address primary_namespace::unbind_gid( @@ -454,9 +450,8 @@ namespace hpx::agas::server { std::unique_lock l(mutex_); - gva_table_type::iterator it = gvas_.find(id), end = gvas_.end(); - - if (it != end) + auto const it = gvas_.find(id); + if (auto const end = gvas_.end(); it != end) { if (HPX_UNLIKELY(it->second.first.count != count)) { @@ -466,7 +461,7 @@ namespace hpx::agas::server { "primary_namespace::unbind_gid", "block sizes must match"); } - gva_table_data_type data = it->second; + gva_table_data_type const data = it->second; gvas_.erase(it); @@ -477,24 +472,25 @@ namespace hpx::agas::server { id, count, data.first, data.second); gva g = data.first; - return naming::address(g.prefix, g.type, g.lva()); + return {g.prefix, g.type, g.lva()}; } // non-migratable gids are not bound if (naming::refers_to_local_lva(id) && !naming::refers_to_virtual_memory(id)) { - naming::gid_type locality = naming::get_locality_from_gid(id); + naming::gid_type const locality = naming::get_locality_from_gid(id); gva g(locality, - naming::detail::get_component_type_from_gid(id.get_msb()), 0, - id.get_lsb()); + static_cast( + naming::detail::get_component_type_from_gid(id.get_msb())), + 0, id.get_lsb()); LAGAS_(info).format( "primary_namespace::unbind_gid, gid({1}), count({2}), " "gva({3}), locality({4})", id, count, g, g.prefix); - return naming::address(g.prefix, g.type, g.lva()); + return {g.prefix, g.type, g.lva()}; } l.unlock(); @@ -504,7 +500,7 @@ namespace hpx::agas::server { "response(no_success)", id, count); - return naming::address(); + return {}; } // }}} std::int64_t primary_namespace::increment_credit( @@ -525,17 +521,12 @@ namespace hpx::agas::server { if (credits > 0) { increment(lower, upper, credits, hpx::throws); - return 0; - } - else - { - HPX_THROW_EXCEPTION(hpx::error::bad_parameter, - "primary_namespace::increment_credit", - "invalid credit count of {1}", credits); - return 0; + return credits; } - return credits; + HPX_THROW_EXCEPTION(hpx::error::bad_parameter, + "primary_namespace::increment_credit", + "invalid credit count of {1}", credits); } std::vector primary_namespace::decrement_credit( @@ -677,7 +668,8 @@ namespace hpx::agas::server { /////////////////////////////////////////////////////////////////////////////// void primary_namespace::increment(naming::gid_type const& lower, - naming::gid_type const& upper, std::int64_t& credits, error_code& ec) + naming::gid_type const& upper, std::int64_t const& credits, + error_code& ec) { // {{{ increment implementation std::unique_lock l(mutex_); @@ -716,14 +708,14 @@ namespace hpx::agas::server { for (naming::gid_type raw = lower; raw != upper; ++raw) { - refcnt_table_type::iterator it = refcnts_.find(raw); + auto it = refcnts_.find(raw); if (it == refcnts_.end()) { std::int64_t count = static_cast(HPX_GLOBALCREDIT_INITIAL) + credits; - std::pair p = + std::pair const p = refcnts_.insert(refcnt_table_type::value_type(raw, count)); if (!p.second) { @@ -764,11 +756,11 @@ namespace hpx::agas::server { using hpx::get; - typedef refcnt_table_type::iterator iterator; + using iterator = refcnt_table_type::iterator; for (iterator const& it : free_list) { - typedef refcnt_table_type::key_type key_type; + using key_type = refcnt_table_type::key_type; // The mapping's key space. key_type gid = it->first; @@ -891,7 +883,7 @@ namespace hpx::agas::server { std::list free_list; //-V826 for (naming::gid_type raw = lower; raw != upper; ++raw) { - refcnt_table_type::iterator it = refcnts_.find(raw); + auto it = refcnts_.find(raw); if (it == refcnts_.end()) { if (credits > @@ -904,7 +896,9 @@ namespace hpx::agas::server { "negative entry in reference count table, " "raw({1}), refcount({2})", raw, - std::int64_t(HPX_GLOBALCREDIT_INITIAL) - credits); + static_cast( + HPX_GLOBALCREDIT_INITIAL) - + credits); return; } @@ -962,8 +956,8 @@ namespace hpx::agas::server { /////////////////////////////////////////////////////////////////////////////// void primary_namespace::free_components_sync( - free_entry_list_type& free_list, naming::gid_type const& lower, - naming::gid_type const& upper, error_code& ec) + free_entry_list_type const& free_list, naming::gid_type const& lower, + naming::gid_type const& upper, error_code& ec) const { using hpx::get; @@ -993,7 +987,7 @@ namespace hpx::agas::server { naming::address addr(e.locality_, e.gva_.type, e.gva_.lva()); if (e.locality_ == locality_) { - auto deleter = components::deleter(e.gva_.type); + auto const deleter = components::deleter(e.gva_.type); if (deleter == nullptr) { HPX_THROWS_IF(ec, hpx::error::internal_server_error, @@ -1048,10 +1042,10 @@ namespace hpx::agas::server { naming::gid_type id = gid; naming::detail::strip_internal_bits_from_gid(id); - gva_table_type::const_iterator it = gvas_.lower_bound(id), - begin = gvas_.begin(), end = gvas_.end(); + gva_table_type::const_iterator it = gvas_.lower_bound(id); + gva_table_type::const_iterator const begin = gvas_.begin(); - if (it != end) + if (gva_table_type::const_iterator const end = gvas_.end(); it != end) { // Check for exact match if (it->first == id) @@ -1065,7 +1059,7 @@ namespace hpx::agas::server { // We need to decrement the iterator, first we check that it's safe // to do this. - else if (it != begin) + if (it != begin) { --it; diff --git a/libs/full/async_colocated/include/hpx/async_colocated/server/destroy_component.hpp b/libs/full/async_colocated/include/hpx/async_colocated/server/destroy_component.hpp index aa46b9b7f7b9..c0bc5a6d79b5 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/server/destroy_component.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/server/destroy_component.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011-2017 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 @@ -11,13 +11,11 @@ #include #include #include -#include #include - -#include +#include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { namespace server { +namespace hpx::components::server { /////////////////////////////////////////////////////////////////////////// HPX_EXPORT void destroy_component( @@ -31,31 +29,30 @@ namespace hpx { namespace components { namespace server { if (agas::get_locality_id() != naming::get_locality_id_from_gid(addr.locality_)) { - // This component might have been migrated, find out where it is - // and instruct that locality to delete it. + // This component might have been migrated, find out where it is and + // instruct that locality to delete it. destroy_component(gid, addr); return; } // make sure it's the correct component type - components::component_type type = + components::component_type const type = components::get_component_type(); if (!types_are_compatible(type, addr.type_)) { // FIXME: should the component be re-bound ? HPX_THROW_EXCEPTION(hpx::error::unknown_component_address, "destroy", - "global id: {} is not bound to a component " - "instance of type: {} (it is bound to a {})", + "global id: {} is not bound to a component instance of type: " + "{} (it is bound to a {})", gid, get_component_type_name(type), get_component_type_name(addr.type_)); - return; } --instance_count(type); // delete the local instances - Component* c = reinterpret_cast(addr.address_); + Component* c = hpx::bit_cast(addr.address_); c->finalize(); std::destroy_at(c); component_heap().free(c, 1); @@ -70,9 +67,8 @@ namespace hpx { namespace components { namespace server { HPX_THROW_EXCEPTION(hpx::error::unknown_component_address, "destroy", "global id: {} is not bound to any component instance", gid); - return; } destroy(gid, addr); } -}}} // namespace hpx::components::server +} // namespace hpx::components::server diff --git a/libs/full/async_colocated/src/server/destroy_component.cpp b/libs/full/async_colocated/src/server/destroy_component.cpp index 7c4d41fe4b21..17d08642d582 100644 --- a/libs/full/async_colocated/src/server/destroy_component.cpp +++ b/libs/full/async_colocated/src/server/destroy_component.cpp @@ -1,4 +1,4 @@ -// 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 @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -20,7 +21,7 @@ HPX_PLAIN_ACTION_ID(hpx::components::server::destroy_component, hpx_destroy_component_action, hpx::actions::free_component_action_id) /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { namespace server { +namespace hpx::components::server { /////////////////////////////////////////////////////////////////////////// void destroy_component( @@ -31,19 +32,19 @@ namespace hpx { namespace components { namespace server { agas::get_locality_id() || agas::is_local_address_cached(gid, addr)) { - // Check if component was migrated, we are not interested in - // pinning the object as it is supposed to be destroyed anyways - // that is, no one else has a handle to it anymore - auto r = - agas::was_object_migrated(gid, []() { return pinned_ptr(); }); + // Check if component was migrated, we are not interested in pinning + // the object as it is supposed to be destroyed anyways that is, no + // one else has a handle to it anymore // The object is local, we can destroy it locally... - if (!r.first) + if (auto const r = agas::was_object_migrated( + gid, []() { return pinned_ptr(); }); + !r.first) { if (naming::refers_to_virtual_memory(gid)) { // simply delete the memory - delete[] reinterpret_cast(gid.get_lsb()); + delete[] hpx::bit_cast(gid.get_lsb()); return; } @@ -58,7 +59,7 @@ namespace hpx { namespace components { namespace server { } // apply remotely (only if runtime is not stopping) - hpx::id_type id = get_colocation_id(launch::sync, + hpx::id_type const id = get_colocation_id(launch::sync, hpx::id_type(gid, hpx::id_type::management_type::unmanaged)); hpx_destroy_component_action()(id, gid, addr); @@ -75,4 +76,4 @@ namespace hpx { namespace components { namespace server { }; destroy_interface_function destroy_init; -}}} // namespace hpx::components::server +} // namespace hpx::components::server diff --git a/libs/full/async_distributed/CMakeLists.txt b/libs/full/async_distributed/CMakeLists.txt index 208052ba4a80..8be2723538a8 100644 --- a/libs/full/async_distributed/CMakeLists.txt +++ b/libs/full/async_distributed/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 @@ -29,6 +29,10 @@ set(async_headers hpx/async_distributed/continuation2_impl.hpp hpx/async_distributed/make_continuation.hpp hpx/async_distributed/dataflow.hpp + hpx/async_distributed/detail/async_implementations_fwd.hpp + hpx/async_distributed/detail/async_implementations.hpp + hpx/async_distributed/detail/async_unwrap_result_implementations_fwd.hpp + hpx/async_distributed/detail/async_unwrap_result_implementations.hpp hpx/async_distributed/detail/post_callback.hpp hpx/async_distributed/detail/post_continue_callback.hpp hpx/async_distributed/detail/post_continue_fwd.hpp @@ -36,10 +40,6 @@ set(async_headers hpx/async_distributed/detail/post_implementations_fwd.hpp hpx/async_distributed/detail/post_implementations.hpp hpx/async_distributed/detail/post.hpp - hpx/async_distributed/detail/async_implementations_fwd.hpp - hpx/async_distributed/detail/async_implementations.hpp - hpx/async_distributed/detail/async_unwrap_result_implementations_fwd.hpp - hpx/async_distributed/detail/async_unwrap_result_implementations.hpp hpx/async_distributed/detail/sync_implementations_fwd.hpp hpx/async_distributed/detail/sync_implementations.hpp hpx/async_distributed/detail/trigger.hpp diff --git a/libs/full/async_distributed/include/hpx/async_distributed/async.hpp b/libs/full/async_distributed/include/hpx/async_distributed/async.hpp index ce7fdba7c137..e695c953f874 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/async.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/async.hpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -299,20 +298,16 @@ namespace hpx::detail { #include -namespace hpx::detail { - - // bound action - template - struct async_dispatch>> +// bound action +template +struct hpx::detail::async_dispatch>> +{ + template + HPX_FORCEINLINE static hpx::future< + typename hpx::detail::bound_action::result_type> + call(hpx::detail::bound_action const& bound, Us&&... vs) { - template - HPX_FORCEINLINE static hpx::future< - typename hpx::detail::bound_action::result_type> - call(hpx::detail::bound_action const& bound, - Us&&... vs) - { - return bound.async(HPX_FORWARD(Us, vs)...); - } - }; -} // namespace hpx::detail + return bound.async(HPX_FORWARD(Us, vs)...); + } +}; diff --git a/libs/full/async_distributed/include/hpx/async_distributed/base_lco.hpp b/libs/full/async_distributed/include/hpx/async_distributed/base_lco.hpp index ca985b6a3e73..8b7f5e652a71 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/base_lco.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/base_lco.hpp @@ -22,7 +22,7 @@ #include #include -namespace hpx { namespace lcos { +namespace hpx::lcos { /// The \a base_lco class is the common base class for all LCO's /// implementing a simple set_event action @@ -115,33 +115,31 @@ namespace hpx { namespace lcos { HPX_DEFINE_COMPONENT_DIRECT_ACTION( base_lco, disconnect_nonvirt, disconnect_action) }; -}} // namespace hpx::lcos +} // namespace hpx::lcos /////////////////////////////////////////////////////////////////////////////// -namespace hpx { - - template <> - struct get_lva +template <> +struct hpx::get_lva +{ + constexpr static hpx::lcos::base_lco* call( + hpx::naming::address_type lva) noexcept { - constexpr static lcos::base_lco* call(naming::address_type lva) noexcept - { - using wrapping_type = typename lcos::base_lco::wrapping_type; - return static_cast(lva)->get(); - } - }; - - template <> - struct get_lva + using wrapping_type = hpx::lcos::base_lco::wrapping_type; + return static_cast(lva)->get(); + } +}; + +template <> +struct hpx::get_lva +{ + constexpr static hpx::lcos::base_lco const* call( + hpx::naming::address_type lva) noexcept { - constexpr static lcos::base_lco const* call( - naming::address_type lva) noexcept - { - using wrapping_type = - std::add_const_t; - return static_cast(lva)->get(); - } - }; -} // namespace hpx + using wrapping_type = + std::add_const_t; + return static_cast(lva)->get(); + } +}; /////////////////////////////////////////////////////////////////////////////// // Declaration of serialization support for the base LCO actions @@ -157,7 +155,7 @@ HPX_REGISTER_ACTION_DECLARATION( /////////////////////////////////////////////////////////////////////////////// HPX_ACTION_USES_MESSAGE_COALESCING_NOTHROW_DECLARATION( hpx::lcos::base_lco::set_event_action, "lco_set_value_action", - std::size_t(-1), std::size_t(-1)) + static_cast(-1), static_cast(-1)) HPX_ACTION_USES_MESSAGE_COALESCING_NOTHROW_DECLARATION( hpx::lcos::base_lco::set_exception_action, "lco_set_value_action", - std::size_t(-1), std::size_t(-1)) + static_cast(-1), static_cast(-1)) diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/async_implementations.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/async_implementations.hpp index b17d434258e5..3de3887381fb 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/async_implementations.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/async_implementations.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 @@ -14,13 +14,12 @@ #include #include #include +#include #include #include -#include #include #include #include -#include #include #include #include @@ -31,28 +30,29 @@ #include #include -namespace hpx { namespace detail { +namespace hpx::detail { + /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////////// struct keep_id_alive { - explicit keep_id_alive(hpx::id_type const& id) - : id_(id) + explicit keep_id_alive(hpx::id_type&& id) noexcept + : id_(HPX_MOVE(id)) { } - void operator()() const {} + constexpr void operator()() const noexcept {} hpx::id_type id_; }; template - future keep_alive(future&& f, id_type const& id) + future keep_alive(future&& f, id_type id) { if (id.get_management_type() == hpx::id_type::management_type::managed) { traits::detail::get_shared_state(f)->set_on_completed( - hpx::detail::keep_id_alive(id)); + hpx::detail::keep_id_alive(HPX_MOVE(id))); } return HPX_MOVE(f); } @@ -60,26 +60,25 @@ namespace hpx { namespace detail { struct keep_id_and_ptr_alive { explicit keep_id_and_ptr_alive( - hpx::id_type const& id, components::pinned_ptr&& p) - : id_(id) + hpx::id_type&& id, components::pinned_ptr&& p) noexcept + : id_(HPX_MOVE(id)) , p_(HPX_MOVE(p)) { } - void operator()() const {} + constexpr void operator()() const noexcept {} hpx::id_type id_; components::pinned_ptr p_; }; template - future keep_alive( - future&& f, id_type const& id, components::pinned_ptr&& p) + future keep_alive(future&& f, id_type id, components::pinned_ptr&& p) { if (id.get_management_type() == hpx::id_type::management_type::managed) { traits::detail::get_shared_state(f)->set_on_completed( - hpx::detail::keep_id_and_ptr_alive(id, HPX_MOVE(p))); + hpx::detail::keep_id_and_ptr_alive(HPX_MOVE(id), HPX_MOVE(p))); } return HPX_MOVE(f); } @@ -88,9 +87,11 @@ namespace hpx { namespace detail { class handle_managed_target { public: - HPX_NON_COPYABLE(handle_managed_target); + handle_managed_target(handle_managed_target const&) = delete; + handle_managed_target(handle_managed_target&&) = delete; + handle_managed_target& operator=(handle_managed_target const&) = delete; + handle_managed_target& operator=(handle_managed_target&&) = delete; - public: handle_managed_target(hpx::id_type const& id, future& f) : target_is_managed_(false) , id_(id) @@ -115,7 +116,8 @@ namespace hpx { namespace detail { { HPX_ASSERT(id_); HPX_ASSERT(unmanaged_id_); - state->set_on_completed(hpx::detail::keep_id_alive(id_)); + state->set_on_completed( + hpx::detail::keep_id_alive(HPX_MOVE(id_))); } } } @@ -126,7 +128,7 @@ namespace hpx { namespace detail { } bool target_is_managed_; - hpx::id_type const& id_; + hpx::id_type id_; hpx::id_type unmanaged_id_; future& f_; }; @@ -141,10 +143,9 @@ namespace hpx { namespace detail { { try { - typedef typename Action::remote_result_type remote_result_type; - - typedef traits::get_remote_result - get_remote_result_type; + using remote_result_type = typename Action::remote_result_type; + using get_remote_result_type = + traits::get_remote_result; return make_ready_future( get_remote_result_type::call(Action::execute_function( @@ -161,7 +162,7 @@ namespace hpx { namespace detail { template bool can_invoke_locally() { - std::ptrdiff_t requested_stack_size = + std::ptrdiff_t const requested_stack_size = threads::get_stack_size(static_cast( traits::action_stacksize::value)); constexpr bool df = traits::action_decorate_function::value; @@ -215,12 +216,12 @@ namespace hpx { namespace detail { /////////////////////////////////////////////////////////////////////////// template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_remote_impl(launch::sync_policy, hpx::id_type const& id, naming::address&& addr, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; + using action_type = hpx::traits::extract_action_t; + using result_type = typename action_type::local_result_type; future f; { @@ -235,12 +236,12 @@ namespace hpx { namespace detail { template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_remote_impl(launch::async_policy, hpx::id_type const& id, naming::address&& addr, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; + using action_type = hpx::traits::extract_action_t; + using result_type = typename action_type::local_result_type; hpx::future f; { @@ -254,12 +255,12 @@ namespace hpx { namespace detail { template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_remote_impl(launch::deferred_policy, hpx::id_type const& id, naming::address&& addr, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; + using action_type = hpx::traits::extract_action_t; + using result_type = typename action_type::local_result_type; hpx::future f; { @@ -275,7 +276,7 @@ namespace hpx { namespace detail { // generic function for dynamic launch policy template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_remote_impl(launch policy, hpx::id_type const& id, naming::address&& addr, Ts&&... vs) { @@ -304,10 +305,10 @@ namespace hpx { namespace detail { template struct action_invoker { - typedef typename Action::remote_result_type remote_result_type; - typedef typename Action::local_result_type result_type; - typedef traits::get_remote_result - get_remote_result_type; + using remote_result_type = typename Action::remote_result_type; + using result_type = typename Action::local_result_type; + using get_remote_result_type = + traits::get_remote_result; template HPX_FORCEINLINE result_type operator()( @@ -318,11 +319,11 @@ namespace hpx { namespace detail { Action::invoker(lva, comptype, HPX_FORWARD(Ts, vs)...)); } }; -}} // namespace hpx::detail +} // namespace hpx::detail #if defined(HPX_HAVE_THREAD_DESCRIPTION) /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace traits { +namespace hpx::traits { template struct get_function_address> @@ -355,21 +356,21 @@ namespace hpx { namespace traits { } }; #endif -}} // namespace hpx::traits +} // namespace hpx::traits #endif -namespace hpx { namespace detail { +namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_local_impl(launch policy, hpx::id_type const& id, naming::address& addr, std::pair& r, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; + using action_type = hpx::traits::extract_action_t; + using result_type = typename action_type::local_result_type; if (policy == launch::sync || action_type::direct_execution::value) { @@ -393,80 +394,60 @@ namespace hpx { namespace detail { } /////////////////////////////////////////////////////////////////////////// - template - bool async_local_impl_all(launch policy, hpx::id_type const& id, - naming::address& addr, std::pair& r, - hpx::future& f, Ts&&... vs) + template + hpx::future< + typename hpx::traits::extract_action_t::local_result_type> + async_impl(Launch&& policy, hpx::id_type const& id, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - //typedef typename action_type::local_result_type result_type; - typedef typename action_type::component_type component_type; + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; - // route launch policy through component - policy = traits::action_select_direct_execution::call( - policy, addr.address_); + [[maybe_unused]] std::pair r; + naming::address addr; - if (traits::component_supports_migration::call()) + if constexpr (traits::component_supports_migration< + component_type>::call()) { - r = traits::action_was_object_migrated::call( - id, addr.address_); + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( + id, addr.address_); + }; - if (!r.first) + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + can_invoke_locally() && !r.first) { - f = async_local_impl( - policy, id, addr, r, HPX_FORWARD(Ts, vs)...); - return true; + // route launch policy through component + launch const adapted_policy = + traits::action_select_direct_execution::call( + policy, addr.address_); + + return async_local_impl( + adapted_policy, id, addr, r, HPX_FORWARD(Ts, vs)...); } - // can't locally handle object if it is currently being migrated - return false; + // fall through } - - f = async_local_impl( - policy, id, addr, r, HPX_FORWARD(Ts, vs)...); - - return true; - } - - /////////////////////////////////////////////////////////////////////////// - template - hpx::future< - typename hpx::traits::extract_action::type::local_result_type> - async_impl(Launch&& policy, hpx::id_type const& id, Ts&&... vs) - { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; - - std::pair r; - - naming::address addr; - if (agas::is_local_address_cached(id, addr) && - can_invoke_locally()) + else { - hpx::future f; - if (async_local_impl_all( - policy, id, addr, r, f, HPX_FORWARD(Ts, vs)...)) + // non-migratable objects + if (agas::is_local_address_cached(id, addr) && + can_invoke_locally()) { - return f; + // route launch policy through component + launch const adapted_policy = + traits::action_select_direct_execution::call( + policy, addr.address_); + + return async_local_impl( + adapted_policy, id, addr, r, HPX_FORWARD(Ts, vs)...); } - } - // Use of a moved from object: '(*)' - // - // We can safely disable the warning as we know that - // async_local_impl_all() has not touched the arguments if it returns - // false. -#if defined(HPX_MSVC) -#pragma warning(push) -#pragma warning(disable : 26800) -#endif + // fall through + } + // Note: the pinned_ptr is still being held, if necessary return async_remote_impl(HPX_FORWARD(Launch, policy), id, HPX_MOVE(addr), HPX_FORWARD(Ts, vs)...); - -#if defined(HPX_MSVC) -#pragma warning(pop) -#endif } /////////////////////////////////////////////////////////////////////////// @@ -474,48 +455,68 @@ namespace hpx { namespace detail { /// this class template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_cb_impl( launch policy, hpx::id_type const& id, Callback&& cb, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; - typedef typename action_type::component_type component_type; - - std::pair r; + using action_type = hpx::traits::extract_action_t; + using result_type = typename action_type::local_result_type; + using component_type = typename action_type::component_type; + [[maybe_unused]] std::pair r; naming::address addr; - if (agas::is_local_address_cached(id, addr) && - can_invoke_locally()) + + if constexpr (traits::component_supports_migration< + component_type>::call()) { - // route launch policy through component - policy = traits::action_select_direct_execution::call( - policy, addr.address_); + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( + id, addr.address_); + }; - if (traits::component_supports_migration::call()) + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + can_invoke_locally() && !r.first) { - r = traits::action_was_object_migrated::call( - id, addr.address_); - if (!r.first) + // route launch policy through component + policy = + traits::action_select_direct_execution::call( + policy, addr.address_); + + if (policy == launch::sync || + action_type::direct_execution::value) { - if (policy == launch::sync || - action_type::direct_execution::value) - { - return hpx::detail::sync_local_invoke_cb::call(id, HPX_MOVE(addr), - HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); - } + return sync_local_invoke_cb::call( + id, HPX_MOVE(addr), HPX_FORWARD(Callback, cb), + HPX_FORWARD(Ts, vs)...); } } - else if (policy == launch::sync || - action_type::direct_execution::value) + + // fall through + } + else + { + // non-migratable objects + if (agas::is_local_address_cached(id, addr) && + can_invoke_locally()) { - return hpx::detail::sync_local_invoke_cb::call(id, HPX_MOVE(addr), - HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); + // route launch policy through component + policy = + traits::action_select_direct_execution::call( + policy, addr.address_); + + if (policy == launch::sync || + action_type::direct_execution::value) + { + return sync_local_invoke_cb::call( + id, HPX_MOVE(addr), HPX_FORWARD(Callback, cb), + HPX_FORWARD(Ts, vs)...); + } } + + // fall through } + // Note: the pinned_ptr is still being held, if necessary future f; { handle_managed_target hmt(id, f); @@ -542,7 +543,6 @@ namespace hpx { namespace detail { { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "async_cb_impl", "unknown launch policy"); - return f; } } return f; @@ -550,38 +550,50 @@ namespace hpx { namespace detail { template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_cb_impl(hpx::detail::sync_policy, hpx::id_type const& id, Callback&& cb, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; - typedef typename action_type::component_type component_type; - - std::pair r; + using action_type = hpx::traits::extract_action_t; + using result_type = typename action_type::local_result_type; + using component_type = typename action_type::component_type; + [[maybe_unused]] std::pair r; naming::address addr; - if (agas::is_local_address_cached(id, addr)) + + if constexpr (traits::component_supports_migration< + component_type>::call()) { - if (traits::component_supports_migration::call()) - { - r = traits::action_was_object_migrated::call( + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( id, addr.address_); - if (!r.first) - { - return hpx::detail::sync_local_invoke_cb::call(id, HPX_MOVE(addr), - HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); - } + }; + + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + can_invoke_locally() && !r.first) + { + return sync_local_invoke_cb::call(id, + HPX_MOVE(addr), HPX_FORWARD(Callback, cb), + HPX_FORWARD(Ts, vs)...); } - else + + // fall through + } + else + { + // non-migratable objects + if (agas::is_local_address_cached(id, addr) && + can_invoke_locally()) { - return hpx::detail::sync_local_invoke_cb::call(id, HPX_MOVE(addr), - HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); + return sync_local_invoke_cb::call(id, + HPX_MOVE(addr), HPX_FORWARD(Callback, cb), + HPX_FORWARD(Ts, vs)...); } + + // fall through } + // Note: the pinned_ptr is still being held, if necessary future f; { handle_managed_target hmt(id, f); @@ -597,48 +609,66 @@ namespace hpx { namespace detail { template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_cb_impl(hpx::detail::async_policy async_policy, hpx::id_type const& id, Callback&& cb, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; - typedef typename action_type::component_type component_type; - - std::pair r; + using action_type = hpx::traits::extract_action_t; + using result_type = typename action_type::local_result_type; + using component_type = typename action_type::component_type; + [[maybe_unused]] std::pair r; naming::address addr; - if (agas::is_local_address_cached(id, addr)) + + if constexpr (traits::component_supports_migration< + component_type>::call()) { - // route launch policy through component - launch policy = - traits::action_select_direct_execution::call( - async_policy, addr.address_); + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( + id, addr.address_); + }; - if (traits::component_supports_migration::call()) + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + can_invoke_locally() && !r.first) { - r = traits::action_was_object_migrated::call( - id, addr.address_); - if (!r.first) + launch const policy = + traits::action_select_direct_execution::call( + async_policy, addr.address_); + + if (policy == launch::sync || + action_type::direct_execution::value) { - if (policy == launch::sync || - action_type::direct_execution::value) - { - return hpx::detail::sync_local_invoke_cb::call(id, HPX_MOVE(addr), - HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); - } + return sync_local_invoke_cb::call( + id, HPX_MOVE(addr), HPX_FORWARD(Callback, cb), + HPX_FORWARD(Ts, vs)...); } } - else if (policy == launch::sync || - action_type::direct_execution::value) + + // fall through + } + else + { + // non-migratable objects + if (agas::is_local_address_cached(id, addr) && + can_invoke_locally()) { - return hpx::detail::sync_local_invoke_cb::call(id, HPX_MOVE(addr), - HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); + launch const policy = + traits::action_select_direct_execution::call( + async_policy, addr.address_); + + if (policy == launch::sync || + action_type::direct_execution::value) + { + return sync_local_invoke_cb::call( + id, HPX_MOVE(addr), HPX_FORWARD(Callback, cb), + HPX_FORWARD(Ts, vs)...); + } } + + // fall through } + // Note: the pinned_ptr is still being held, if necessary future f; { handle_managed_target hmt(id, f); @@ -653,12 +683,12 @@ namespace hpx { namespace detail { template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_cb_impl(hpx::detail::deferred_policy, hpx::id_type const& id, Callback&& cb, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; + using action_type = hpx::traits::extract_action_t; + using result_type = typename action_type::local_result_type; naming::address addr; [[maybe_unused]] bool result = agas::is_local_address_cached(id, addr); @@ -675,4 +705,4 @@ namespace hpx { namespace detail { return f; } /// \endcond -}} // namespace hpx::detail +} // namespace hpx::detail diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/async_implementations_fwd.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/async_implementations_fwd.hpp index 1cc5735a1a34..c147014f4e53 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/async_implementations_fwd.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/async_implementations_fwd.hpp @@ -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,42 +6,42 @@ #pragma once -#include #include #include #include #include -#include +#include + +namespace hpx::detail { -namespace hpx { namespace detail { /////////////////////////////////////////////////////////////////////////// template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_impl(Launch&& policy, hpx::id_type const& id, Ts&&... vs); /////////////////////////////////////////////////////////////////////////// template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_cb_impl( launch policy, hpx::id_type const& id, Callback&& cb, Ts&&... vs); template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_cb_impl(hpx::detail::sync_policy, hpx::id_type const& id, Callback&& cb, Ts&&... vs); template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_cb_impl(hpx::detail::async_policy, hpx::id_type const& id, Callback&& cb, Ts&&... vs); template hpx::future< - typename hpx::traits::extract_action::type::local_result_type> + typename hpx::traits::extract_action_t::local_result_type> async_cb_impl(hpx::detail::deferred_policy, hpx::id_type const& id, Callback&& cb, Ts&&... vs); -}} // namespace hpx::detail +} // namespace hpx::detail 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 59eeff718abc..5607a801d803 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 @@ -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 @@ -15,39 +15,33 @@ #include #include #include -#include -#include +#include #include -#include -#include -#include -#include -#include #include #include -#include -#include #include -namespace hpx { namespace detail { +namespace hpx::detail { + /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////////// template - typename hpx::traits::extract_action::type::local_result_type + typename hpx::traits::extract_action_t::local_result_type async_local_unwrap_impl(launch policy, hpx::id_type const& id, naming::address& addr, std::pair& r, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; + using action_type = hpx::traits::extract_action_t; + using result_type = typename action_type::local_result_type; if (policy == launch::sync || action_type::direct_execution::value) { return hpx::detail::sync_local_invoke_direct::call(id, HPX_MOVE(addr), HPX_FORWARD(Ts, vs)...); } - else if (hpx::detail::has_async_policy(policy)) + + if (hpx::detail::has_async_policy(policy)) { return keep_alive( hpx::async(policy, action_invoker(), addr.address_, @@ -64,69 +58,62 @@ namespace hpx { namespace detail { } /////////////////////////////////////////////////////////////////////////// - template - bool async_local_unwrap_impl_all(launch policy, hpx::id_type const& id, - naming::address& addr, std::pair& r, - Result& result, Ts&&... vs) + template + typename hpx::traits::extract_action_t::local_result_type + async_unwrap_result_impl( + Launch&& policy, hpx::id_type const& id, Ts&&... vs) { - typedef typename hpx::traits::extract_action::type action_type; - //typedef typename action_type::local_result_type result_type; - typedef typename action_type::component_type component_type; + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; - // route launch policy through component - policy = traits::action_select_direct_execution::call( - policy, addr.address_); + [[maybe_unused]] std::pair r; + naming::address addr; - if (traits::component_supports_migration::call()) + if constexpr (traits::component_supports_migration< + component_type>::call()) { - r = traits::action_was_object_migrated::call( - id, addr.address_); + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( + id, addr.address_); + }; - if (!r.first) + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + can_invoke_locally() && !r.first) { - result = async_local_unwrap_impl( - policy, id, addr, r, HPX_FORWARD(Ts, vs)...); + // route launch policy through component + launch const adapted_policy = + traits::action_select_direct_execution::call( + policy, addr.address_); - return true; + return async_local_unwrap_impl( + adapted_policy, id, addr, r, HPX_FORWARD(Ts, vs)...); } - // can't locally handle object if it is currently being migrated - return false; + // fall through } - - result = async_local_unwrap_impl( - policy, id, addr, r, HPX_FORWARD(Ts, vs)...); - - return true; - } - - /////////////////////////////////////////////////////////////////////////// - template - typename hpx::traits::extract_action::type::local_result_type - async_unwrap_result_impl( - Launch&& policy, hpx::id_type const& id, Ts&&... vs) - { - typedef typename hpx::traits::extract_action::type action_type; - typedef typename action_type::local_result_type result_type; - //typedef typename action_type::component_type component_type; - - std::pair r; - - naming::address addr; - if (agas::is_local_address_cached(id, addr) && - can_invoke_locally()) + else { - result_type result; - if (async_local_unwrap_impl_all( - policy, id, addr, r, result, HPX_FORWARD(Ts, vs)...)) + // non-migratable objects + if (agas::is_local_address_cached(id, addr) && + can_invoke_locally()) { - return result; + // route launch policy through component + launch const adapted_policy = + traits::action_select_direct_execution::call( + policy, addr.address_); + + return async_local_unwrap_impl( + adapted_policy, id, addr, r, HPX_FORWARD(Ts, vs)...); } + + // fall through } + // Note: the pinned_ptr is still being held, if necessary + // the asynchronous result is auto-unwrapped by the return type return async_remote_impl(HPX_FORWARD(Launch, policy), id, HPX_MOVE(addr), HPX_FORWARD(Ts, vs)...); } /// \endcond -}} // namespace hpx::detail +} // namespace hpx::detail diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/async_unwrap_result_implementations_fwd.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/async_unwrap_result_implementations_fwd.hpp index 3a48812642bc..b01805aec53c 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/async_unwrap_result_implementations_fwd.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/async_unwrap_result_implementations_fwd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2018 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,16 +6,15 @@ #pragma once -#include #include -#include #include -#include +#include + +namespace hpx::detail { -namespace hpx { namespace detail { /////////////////////////////////////////////////////////////////////////// template - typename hpx::traits::extract_action::type::local_result_type + typename hpx::traits::extract_action_t::local_result_type async_unwrap_result_impl( Launch&& policy, hpx::id_type const& id, Ts&&... vs); -}} // namespace hpx::detail +} // namespace hpx::detail diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/post_callback.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/post_callback.hpp index eea900cfd806..eef5e379100c 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/post_callback.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/post_callback.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 @@ -19,14 +19,15 @@ #include #include -#include #include #include namespace hpx { + #if defined(HPX_HAVE_NETWORKING) /////////////////////////////////////////////////////////////////////////// namespace detail { + template bool post_r_p_cb(naming::address&& addr, hpx::id_type const& id, threads::thread_priority priority, Callback&& cb, Ts&&... vs) @@ -108,6 +109,7 @@ namespace hpx { #if defined(HPX_HAVE_NETWORKING) /////////////////////////////////////////////////////////////////////////// namespace detail { + template bool post_r_p_cb(naming::address&& addr, Continuation&& c, @@ -146,24 +148,19 @@ namespace hpx { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "post_p_cb", "the target (destination) does not match the action type ({})", hpx::actions::detail::get_action_name()); - return false; } // Determine whether the gid is local or remote - if (naming::get_locality_id_from_gid(addr.locality_) == - agas::get_locality_id()) + if (addr && + naming::get_locality_id_from_gid(addr.locality_) == + agas::get_locality_id()) { // apply locally - bool result = + bool const result = hpx::detail::post_l_p(HPX_FORWARD(Continuation, c), gid, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); - // invoke callback -#if defined(HPX_HAVE_NETWORKING) - cb(std::error_code(), parcelset::parcel()); -#else - cb(); -#endif + detail::invoke_callback(HPX_FORWARD(Callback, cb)); return result; } @@ -249,17 +246,16 @@ namespace hpx { #if defined(HPX_HAVE_NETWORKING) /////////////////////////////////////////////////////////////////////////// namespace detail { + template bool post_c_p_cb(naming::address&& addr, hpx::id_type const& contgid, hpx::id_type const& gid, threads::thread_priority priority, Callback&& cb, Ts&&... vs) { - typedef - typename hpx::traits::extract_action::remote_result_type - remote_result_type; - typedef - typename hpx::traits::extract_action::local_result_type - local_result_type; + using remote_result_type = typename hpx::traits::extract_action< + Action>::remote_result_type; + using local_result_type = + typename hpx::traits::extract_action::local_result_type; return post_r_p_cb(HPX_MOVE(addr), actions::typed_continuation::remote_result_type - remote_result_type; - typedef - typename hpx::traits::extract_action::local_result_type - local_result_type; + using remote_result_type = typename hpx::traits::extract_action< + Action>::remote_result_type; + using local_result_type = + typename hpx::traits::extract_action::local_result_type; return post_r_p_cb(HPX_MOVE(addr), actions::typed_continuation::remote_result_type - remote_result_type; - typedef typename hpx::traits::extract_action::local_result_type - local_result_type; + using remote_result_type = + typename hpx::traits::extract_action::remote_result_type; + using local_result_type = + typename hpx::traits::extract_action::local_result_type; return hpx::post_p_cb( actions::typed_continuation( @@ -308,10 +302,10 @@ namespace hpx { bool post_c_cb(hpx::id_type const& contgid, hpx::id_type const& gid, Callback&& cb, Ts&&... vs) { - typedef typename hpx::traits::extract_action::remote_result_type - remote_result_type; - typedef typename hpx::traits::extract_action::local_result_type - local_result_type; + using remote_result_type = + typename hpx::traits::extract_action::remote_result_type; + using local_result_type = + typename hpx::traits::extract_action::local_result_type; return hpx::post_p_cb( actions::typed_continuation( @@ -325,10 +319,10 @@ namespace hpx { hpx::id_type const& gid, threads::thread_priority priority, Callback&& cb, Ts&&... vs) { - typedef typename hpx::traits::extract_action::remote_result_type - remote_result_type; - typedef typename hpx::traits::extract_action::local_result_type - local_result_type; + using remote_result_type = + typename hpx::traits::extract_action::remote_result_type; + using local_result_type = + typename hpx::traits::extract_action::local_result_type; return hpx::post_p_cb( actions::typed_continuation( @@ -341,10 +335,10 @@ namespace hpx { bool post_c_cb(hpx::id_type const& contgid, naming::address&& addr, hpx::id_type const& gid, Callback&& cb, Ts&&... vs) { - typedef typename hpx::traits::extract_action::remote_result_type - remote_result_type; - typedef typename hpx::traits::extract_action::local_result_type - local_result_type; + using remote_result_type = + typename hpx::traits::extract_action::remote_result_type; + using local_result_type = + typename hpx::traits::extract_action::local_result_type; return hpx::post_p_cb( actions::typed_continuation( @@ -358,7 +352,7 @@ namespace hpx { struct post_c_p_cb_impl { public: - typedef hpx::tuple tuple_type; + using tuple_type = hpx::tuple; template post_c_p_cb_impl(hpx::id_type const& contid, naming::address&& addr, @@ -432,9 +426,8 @@ namespace hpx { hpx::id_type const& id, threads::thread_priority p, Callback&& cb, Ts&&... vs) { - typedef post_c_p_cb_impl, - std::decay_t...> - result_type; + using result_type = post_c_p_cb_impl, + std::decay_t...>; return result_type(contid, HPX_MOVE(addr), id, p, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/post_continue_fwd.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/post_continue_fwd.hpp index 3e7715d6f8ed..b85226d11267 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/post_continue_fwd.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/post_continue_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 @@ -11,6 +11,7 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx { + template bool post_continue(Cont&& cont, hpx::id_type const& gid, Ts&&... vs); diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/post_implementations.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/post_implementations.hpp index fa3eaeed0bbf..deb232ee0f60 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/post_implementations.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/post_implementations.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,62 +10,75 @@ #include #include #include +#include #include #include +#include #include #include #include #include -#include -#include #include #include -namespace hpx { namespace detail { +namespace hpx::detail { + template - std::enable_if_t::value, bool> - post_impl(Continuation&& c, hpx::id_type const& id, + std::enable_if_t, bool> post_impl( + Continuation&& c, hpx::id_type const& id, threads::thread_priority priority, Ts&&... vs) { - if (!traits::action_is_target_valid::call(id)) + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; + + if (!traits::action_is_target_valid::call(id)) { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "hpx::detail::post_impl", "the target (destination) does not match the action type ({})", - hpx::actions::detail::get_action_name()); - return false; + hpx::actions::detail::get_action_name()); } - std::pair r; - - // Determine whether the id is local or remote + [[maybe_unused]] std::pair r; naming::address addr; - if (agas::is_local_address_cached(id, addr)) + + if constexpr (traits::component_supports_migration< + component_type>::call()) { - using component_type = typename Action::component_type; - if (traits::component_supports_migration::call()) - { - r = traits::action_was_object_migrated::call( + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( id, addr.address_); - if (!r.first) - { - return hpx::detail::post_l_p( - HPX_FORWARD(Continuation, c), id, HPX_MOVE(addr), - priority, HPX_FORWARD(Ts, vs)...); - } + }; + + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + !r.first) + { + return hpx::detail::post_l_p( + HPX_FORWARD(Continuation, c), id, HPX_MOVE(addr), priority, + HPX_FORWARD(Ts, vs)...); } - else + + // fall through + } + else + { + // non-migratable objects + if (agas::is_local_address_cached(id, addr)) { - return hpx::detail::post_l_p( + return hpx::detail::post_l_p( HPX_FORWARD(Continuation, c), id, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); } + + // fall through } #if defined(HPX_HAVE_NETWORKING) + // Note: the pinned_ptr is still being held, if necessary + // apply remotely - return hpx::detail::post_r_p(HPX_MOVE(addr), + return hpx::detail::post_r_p(HPX_MOVE(addr), HPX_FORWARD(Continuation, c), id, priority, HPX_FORWARD(Ts, vs)...); #else HPX_THROW_EXCEPTION(hpx::error::invalid_status, "hpx::post_impl", @@ -74,107 +87,108 @@ namespace hpx { namespace detail { } template - std::enable_if_t::value, bool> - post_impl(Continuation&& c, hpx::id_type const& id, naming::address&& addr, + std::enable_if_t, bool> post_impl( + Continuation&& c, hpx::id_type const& id, naming::address&& addr, threads::thread_priority priority, Ts&&... vs) { + if (!addr) + { + return post_impl(HPX_FORWARD(Continuation, c), id, priority, + HPX_FORWARD(Ts, vs)...); + } + + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; + // Determine whether the id is local or remote - if (addr) + if (!traits::action_is_target_valid::call(id)) { - if (!traits::action_is_target_valid::call(id)) - { - HPX_THROW_EXCEPTION(hpx::error::bad_parameter, - "hpx::detail::post_impl", - "the target (destination) does not match the action type " - "({})", - hpx::actions::detail::get_action_name()); - return false; - } + HPX_THROW_EXCEPTION(hpx::error::bad_parameter, + "hpx::detail::post_impl", + "the target (destination) does not match the action type ({})", + hpx::actions::detail::get_action_name()); + } - std::pair r; - if (naming::get_locality_id_from_gid(addr.locality_) == - agas::get_locality_id()) + if (naming::get_locality_id_from_gid(addr.locality_) == + agas::get_locality_id()) + { + if constexpr (traits::component_supports_migration< + component_type>::call()) { - using component_type = typename Action::component_type; - if (traits::component_supports_migration< - component_type>::call()) - { - r = traits::action_was_object_migrated::call( - id, addr.address_); - if (!r.first) - { - return hpx::detail::post_l_p( - HPX_FORWARD(Continuation, c), id, HPX_MOVE(addr), - priority, HPX_FORWARD(Ts, vs)...); - } - } - else - { - return hpx::detail::post_l_p( - HPX_FORWARD(Continuation, c), id, HPX_MOVE(addr), - priority, HPX_FORWARD(Ts, vs)...); - } - } - // object was migrated or is not local - else - { - // apply remotely -#if defined(HPX_HAVE_NETWORKING) - return hpx::detail::post_r_p(HPX_MOVE(addr), - HPX_FORWARD(Continuation, c), id, priority, - HPX_FORWARD(Ts, vs)...); -#else - HPX_THROW_EXCEPTION(hpx::error::invalid_status, - "hpx::detail::post_impl", - "unexpected attempt to send a parcel with networking " - "disabled"); -#endif + HPX_ASSERT( + !traits::action_was_object_migrated::call( + id, addr.address_) + .first); + HPX_ASSERT(pin_count_is_valid(addr.address_)); } + + return hpx::detail::post_l_p( + HPX_FORWARD(Continuation, c), id, HPX_MOVE(addr), priority, + HPX_FORWARD(Ts, vs)...); } - return post_impl( +#if defined(HPX_HAVE_NETWORKING) + // object was migrated or is not local, apply remotely + return hpx::detail::post_r_p(HPX_MOVE(addr), HPX_FORWARD(Continuation, c), id, priority, HPX_FORWARD(Ts, vs)...); +#else + HPX_THROW_EXCEPTION(hpx::error::invalid_status, + "hpx::detail::post_impl", + "unexpected attempt to send a parcel with networking disabled"); +#endif } template bool post_impl( hpx::id_type const& id, threads::thread_priority priority, Ts&&... vs) { - if (!traits::action_is_target_valid::call(id)) + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; + + if (!traits::action_is_target_valid::call(id)) { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "hpx::detail::post_impl", "the target (destination) does not match the action type ({})", - hpx::actions::detail::get_action_name()); - return false; + hpx::actions::detail::get_action_name()); } - std::pair r; - - // Determine whether the id is local or remote + [[maybe_unused]] std::pair r; naming::address addr; - if (agas::is_local_address_cached(id, addr)) + + if constexpr (traits::component_supports_migration< + component_type>::call()) { - using component_type = typename Action::component_type; - if (traits::component_supports_migration::call()) - { - r = traits::action_was_object_migrated::call( + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( id, addr.address_); - if (!r.first) - { - return hpx::detail::post_l_p( - id, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); - } + }; + + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + !r.first) + { + return hpx::detail::post_l_p( + id, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); } - else + + // fall through + } + else + { + // non-migratable objects + if (agas::is_local_address_cached(id, addr)) { - return hpx::detail::post_l_p( + return hpx::detail::post_l_p( id, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); } + + // fall through } #if defined(HPX_HAVE_NETWORKING) - // apply remotely + // Note: the pinned_ptr is still being held, if necessary + + // object was migrated or is not local, apply remotely return hpx::detail::post_r_p( HPX_MOVE(addr), id, priority, HPX_FORWARD(Ts, vs)...); #else @@ -187,119 +201,113 @@ namespace hpx { namespace detail { bool post_impl(hpx::id_type const& id, naming::address&& addr, threads::thread_priority priority, Ts&&... vs) { + if (!addr) + { + return post_impl(id, priority, HPX_FORWARD(Ts, vs)...); + } + + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; + // Determine whether the id is local or remote - if (addr) + if (!traits::action_is_target_valid::call(id)) { - if (!traits::action_is_target_valid::call(id)) - { - HPX_THROW_EXCEPTION(hpx::error::bad_parameter, - "hpx::detail::post_impl", - "the target (destination) does not match the action type " - "({})", - hpx::actions::detail::get_action_name()); - return false; - } + HPX_THROW_EXCEPTION(hpx::error::bad_parameter, + "hpx::detail::post_impl", + "the target (destination) does not match the action type ({})", + hpx::actions::detail::get_action_name()); + } - std::pair r; - if (naming::get_locality_id_from_gid(addr.locality_) == - agas::get_locality_id()) + if (naming::get_locality_id_from_gid(addr.locality_) == + agas::get_locality_id()) + { + if constexpr (traits::component_supports_migration< + component_type>::call()) { - using component_type = typename Action::component_type; - if (traits::component_supports_migration< - component_type>::call()) - { - r = traits::action_was_object_migrated::call( - id, addr.address_); - if (!r.first) - { - return hpx::detail::post_l_p(id, HPX_MOVE(addr), - priority, HPX_FORWARD(Ts, vs)...); - } - } - else - { - return hpx::detail::post_l_p( - id, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); - } + HPX_ASSERT( + !traits::action_was_object_migrated::call( + id, addr.address_) + .first); + HPX_ASSERT(pin_count_is_valid(addr.address_)); } - // object was migrated or is not local - else - { - // apply remotely + + return hpx::detail::post_l_p( + id, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); + } + #if defined(HPX_HAVE_NETWORKING) - return hpx::detail::post_r_p( - HPX_MOVE(addr), id, priority, HPX_FORWARD(Ts, vs)...); + // object was migrated or is not local, apply remotely + return hpx::detail::post_r_p( + HPX_MOVE(addr), id, priority, HPX_FORWARD(Ts, vs)...); #else - HPX_THROW_EXCEPTION(hpx::error::invalid_status, - "hpx::detail::post_impl", - "unexpected attempt to send a parcel with networking " - "disabled"); + HPX_THROW_EXCEPTION(hpx::error::invalid_status, + "hpx::detail::post_impl", + "unexpected attempt to send a parcel with networking disabled"); #endif - } - } - return post_impl(id, priority, HPX_FORWARD(Ts, vs)...); } template - std::enable_if_t::value, bool> + std::enable_if_t, bool> post_cb_impl(Continuation&& c, hpx::id_type const& id, threads::thread_priority priority, Callback&& cb, Ts&&... vs) { - if (!traits::action_is_target_valid::call(id)) + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; + + if (!traits::action_is_target_valid::call(id)) { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "hpx::detail::post_cb_impl", "the target (destination) does not match the action type ({})", - hpx::actions::detail::get_action_name()); - return false; + hpx::actions::detail::get_action_name()); } - std::pair r; - - // Determine whether the id is local or remote + [[maybe_unused]] std::pair r; naming::address addr; - if (agas::is_local_address_cached(id, addr)) + + if constexpr (traits::component_supports_migration< + component_type>::call()) { - using component_type = typename Action::component_type; - if (traits::component_supports_migration::call()) - { - r = traits::action_was_object_migrated::call( + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( id, addr.address_); - if (!r.first) - { - bool result = hpx::detail::post_l_p( - HPX_FORWARD(Continuation, c), id, HPX_MOVE(addr), - priority, HPX_FORWARD(Ts, vs)...); + }; - // invoke callback -#if defined(HPX_HAVE_NETWORKING) - cb(std::error_code(), parcelset::parcel()); -#else - cb(); -#endif - return result; - } + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + !r.first) + { + bool const result = hpx::detail::post_l_p( + HPX_FORWARD(Continuation, c), id, HPX_MOVE(addr), priority, + HPX_FORWARD(Ts, vs)...); + + invoke_callback(HPX_FORWARD(Callback, cb)); + return result; } - else + + // fall through + } + else + { + // non-migratable objects + if (agas::is_local_address_cached(id, addr)) { - bool result = - hpx::detail::post_l_p(HPX_FORWARD(Continuation, c), - id, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); + bool const result = hpx::detail::post_l_p( + HPX_FORWARD(Continuation, c), id, HPX_MOVE(addr), priority, + HPX_FORWARD(Ts, vs)...); - // invoke callback -#if defined(HPX_HAVE_NETWORKING) - cb(std::error_code(), parcelset::parcel()); -#else - cb(); -#endif + invoke_callback(HPX_FORWARD(Callback, cb)); return result; } + + // fall through } #if defined(HPX_HAVE_NETWORKING) - // apply remotely - return hpx::detail::post_r_p_cb(HPX_MOVE(addr), + // Note: the pinned_ptr is still being held, if necessary + + // object was migrated or is not local, apply remotely + return hpx::detail::post_r_p_cb(HPX_MOVE(addr), HPX_FORWARD(Continuation, c), id, priority, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); #else @@ -313,63 +321,65 @@ namespace hpx { namespace detail { bool post_cb_impl(hpx::id_type const& id, threads::thread_priority priority, Callback&& cb, Ts&&... vs) { - if (!traits::action_is_target_valid::call(id)) + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; + + if (!traits::action_is_target_valid::call(id)) { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "hpx::detail::post_cb_impl", "the target (destination) does not match the action type ({})", - hpx::actions::detail::get_action_name()); - return false; + hpx::actions::detail::get_action_name()); } - std::pair r; - - // Determine whether the id is local or remote + [[maybe_unused]] std::pair r; naming::address addr; - if (agas::is_local_address_cached(id, addr)) + + if constexpr (traits::component_supports_migration< + component_type>::call()) { - using component_type = typename Action::component_type; - if (traits::component_supports_migration::call()) - { - r = traits::action_was_object_migrated::call( + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( id, addr.address_); - if (!r.first) - { - bool result = hpx::detail::post_l_p( - id, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); + }; - // invoke callback -#if defined(HPX_HAVE_NETWORKING) - cb(std::error_code(), parcelset::parcel()); -#else - cb(); -#endif - return result; - } + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + !r.first) + { + bool const result = hpx::detail::post_l_p( + id, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); + + invoke_callback(HPX_FORWARD(Callback, cb)); + return result; } - else + + // fall through + } + else + { + // Determine whether the id is local or remote + if (agas::is_local_address_cached(id, addr)) { - bool result = hpx::detail::post_l_p( + bool const result = hpx::detail::post_l_p( id, HPX_MOVE(addr), priority, HPX_FORWARD(Ts, vs)...); - // invoke callback -#if defined(HPX_HAVE_NETWORKING) - cb(std::error_code(), parcelset::parcel()); -#else - cb(); -#endif + invoke_callback(HPX_FORWARD(Callback, cb)); return result; } + + // fall through } #if defined(HPX_HAVE_NETWORKING) - // apply remotely - return hpx::detail::post_r_p_cb(HPX_MOVE(addr), id, priority, - HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); + // Note: the pinned_ptr is still being held, if necessary + + // object was migrated or is not local, apply remotely + return hpx::detail::post_r_p_cb(HPX_MOVE(addr), id, + priority, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); #else HPX_THROW_EXCEPTION(hpx::error::invalid_status, "hpx::detail::post_cb_impl", "unexpected attempt to send a parcel with networking disabled"); #endif } -}} // namespace hpx::detail +} // namespace hpx::detail diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/post_implementations_fwd.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/post_implementations_fwd.hpp index 6734949e4f65..80b11f911459 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/post_implementations_fwd.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/post_implementations_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 @@ -8,56 +8,60 @@ #include #include +#include +#include #include #include #include +#include +#include #include -namespace hpx { namespace detail { +namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// // forward declaration only template - inline bool post_l_p(Continuation&& c, hpx::id_type const& target, + bool post_l_p(Continuation&& c, hpx::id_type const& target, naming::address&& addr, threads::thread_priority priority, Ts&&... vs); template - inline bool post_l_p(hpx::id_type const& target, naming::address&& addr, + bool post_l_p(hpx::id_type const& target, naming::address&& addr, threads::thread_priority priority, Ts&&... vs); template - inline bool post_r_p(naming::address&& addr, Continuation&& c, + bool post_r_p(naming::address&& addr, Continuation&& c, hpx::id_type const& id, threads::thread_priority priority, Ts&&... vs); template - inline bool post_r_p(naming::address&& addr, hpx::id_type const& id, + bool post_r_p(naming::address&& addr, hpx::id_type const& id, threads::thread_priority priority, Ts&&... vs); template - inline bool post_r_p_cb(naming::address&& addr, Continuation&& c, + bool post_r_p_cb(naming::address&& addr, Continuation&& c, hpx::id_type const& id, threads::thread_priority priority, Callback&& cb, Ts&&... vs); template - inline bool post_r_p_cb(naming::address&& addr, hpx::id_type const& id, + bool post_r_p_cb(naming::address&& addr, hpx::id_type const& id, threads::thread_priority priority, Callback&& cb, Ts&&... vs); /////////////////////////////////////////////////////////////////////////// template - std::enable_if_t::value, bool> - post_impl(Continuation&& c, hpx::id_type const& id, + std::enable_if_t, bool> post_impl( + Continuation&& c, hpx::id_type const& id, threads::thread_priority priority, Ts&&... vs); template - std::enable_if_t::value, bool> - post_impl(Continuation&& c, hpx::id_type const& id, naming::address&& addr, + std::enable_if_t, bool> post_impl( + Continuation&& c, hpx::id_type const& id, naming::address&& addr, threads::thread_priority priority, Ts&&... vs); template - std::enable_if_t::value, bool> + std::enable_if_t, bool> post_cb_impl(Continuation&& c, hpx::id_type const& id, threads::thread_priority priority, Callback&& cb, Ts&&... vs); @@ -72,4 +76,25 @@ namespace hpx { namespace detail { template bool post_cb_impl(hpx::id_type const& id, threads::thread_priority priority, Callback&& cb, Ts&&... vs); -}} // namespace hpx::detail + + /////////////////////////////////////////////////////////////////////////// + template + constexpr bool pin_count_is_valid(naming::address_type lva) noexcept + { + auto const pin_count = + traits::component_pin_support::pin_count( + get_lva::call(lva)); + return pin_count != ~0x0u && pin_count != 0; + } + + template + void invoke_callback(Callback&& cb) + { + // invoke callback +#if defined(HPX_HAVE_NETWORKING) + cb(std::error_code(), parcelset::empty_parcel); +#else + cb(); +#endif + } +} // namespace hpx::detail diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/promise_lco.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/promise_lco.hpp index 320d140b05f6..01076b638c41 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/promise_lco.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/promise_lco.hpp @@ -24,14 +24,14 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace lcos { namespace detail { +namespace hpx::lcos::detail { template class promise_lco; -}}} // namespace hpx::lcos::detail +} /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace traits { +namespace hpx::traits { template struct managed_component_dtor_policy< @@ -39,10 +39,10 @@ namespace hpx { namespace traits { { typedef managed_object_is_lifetime_controlled type; }; -}} // namespace hpx::traits +} // namespace hpx::traits /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace lcos { namespace detail { +namespace hpx::lcos::detail { template class promise_lco_base @@ -170,7 +170,7 @@ namespace hpx { namespace lcos { namespace detail { HPX_UNUSED(bp); } }; -}}} // namespace hpx::lcos::detail +} // namespace hpx::lcos::detail /////////////////////////////////////////////////////////////////////////////// namespace hpx { @@ -210,7 +210,7 @@ namespace hpx { components::component_invalid; } // namespace traits - namespace components { namespace detail { + namespace components::detail { // Forward declare promise_lco to avoid duplicate instantiations template <> @@ -237,5 +237,6 @@ namespace hpx { return heap.get(); } }; - }} // namespace components::detail + } // namespace components::detail + // namespace components::detail } // namespace hpx diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/sync_implementations.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/sync_implementations.hpp index 1e1cf90473b9..d9e79b406539 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/sync_implementations.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/sync_implementations.hpp @@ -1,4 +1,4 @@ -// 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 @@ -15,14 +15,12 @@ #include #include #include -#include #include #include -#include #include -namespace hpx { namespace detail { +namespace hpx::detail { /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////////// @@ -56,51 +54,71 @@ namespace hpx { namespace detail { /////////////////////////////////////////////////////////////////////////// template - typename hpx::traits::extract_action::type::local_result_type - sync_impl(Launch&& policy, hpx::id_type const& id, Ts&&... vs) + typename hpx::traits::extract_action_t::local_result_type sync_impl( + Launch&& policy, hpx::id_type const& id, Ts&&... vs) { - using action_type = typename hpx::traits::extract_action::type; + using action_type = hpx::traits::extract_action_t; using result_type = typename action_type::local_result_type; using component_type = typename action_type::component_type; - std::pair r; - + [[maybe_unused]] std::pair r; naming::address addr; - if (agas::is_local_address_cached(id, addr) && - can_invoke_locally()) + + if constexpr (traits::component_supports_migration< + component_type>::call()) { - // route launch policy through component - launch adapted_policy = - traits::action_select_direct_execution::call( - policy, addr.address_); + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( + id, addr.address_); + }; - if (traits::component_supports_migration::call()) + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + can_invoke_locally()) { - r = traits::action_was_object_migrated::call( - id, addr.address_); - if (!r.first) + // route launch policy through component + launch const adapted_policy = + traits::action_select_direct_execution::call( + policy, addr.address_); + + if (!r.first && + (adapted_policy == launch::sync || + action_type::direct_execution::value)) { - if (adapted_policy == launch::sync || - action_type::direct_execution::value) - { - return hpx::detail::sync_local_invoke_direct< - action_type, result_type>::call(id, HPX_MOVE(addr), - HPX_FORWARD(Ts, vs)...); - } + return hpx::detail::sync_local_invoke_direct::call(id, HPX_MOVE(addr), + HPX_FORWARD(Ts, vs)...); } + + // fall through } - else if (adapted_policy == launch::sync || - action_type::direct_execution::value) + } + else + { + // non-migratable objects + if (agas::is_local_address_cached(id, addr) && + can_invoke_locally()) { - return hpx::detail::sync_local_invoke_direct::call(id, HPX_MOVE(addr), - HPX_FORWARD(Ts, vs)...); + // route launch policy through component + launch const adapted_policy = + traits::action_select_direct_execution::call( + policy, addr.address_); + + if (adapted_policy == launch::sync || + action_type::direct_execution::value) + { + return hpx::detail::sync_local_invoke_direct::call(id, HPX_MOVE(addr), + HPX_FORWARD(Ts, vs)...); + } + + // fall through } } + // Note: the pinned_ptr is still being held, if necessary return async_remote_impl(HPX_FORWARD(Launch, policy), id, HPX_MOVE(addr), HPX_FORWARD(Ts, vs)...) .get(); } /// \endcond -}} // namespace hpx::detail +} // namespace hpx::detail diff --git a/libs/full/async_distributed/include/hpx/async_distributed/detail/sync_implementations_fwd.hpp b/libs/full/async_distributed/include/hpx/async_distributed/detail/sync_implementations_fwd.hpp index b97fb024c27b..dbf9efbe22c2 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/detail/sync_implementations_fwd.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/detail/sync_implementations_fwd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2021 Hartmut Kaiser +// Copyright (c) 2018-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,14 +6,14 @@ #pragma once -#include #include #include -#include +#include + +namespace hpx::detail { -namespace hpx { namespace detail { /////////////////////////////////////////////////////////////////////////// template - typename hpx::traits::extract_action::type::local_result_type - sync_impl(Launch&& policy, hpx::id_type const& id, Ts&&... vs); -}} // namespace hpx::detail + typename hpx::traits::extract_action_t::local_result_type sync_impl( + Launch&& policy, hpx::id_type const& id, Ts&&... vs); +} // namespace hpx::detail diff --git a/libs/full/async_distributed/include/hpx/async_distributed/packaged_action.hpp b/libs/full/async_distributed/include/hpx/async_distributed/packaged_action.hpp index 35d732a74633..f60e7a565d2e 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/packaged_action.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/packaged_action.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,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,7 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace lcos { +namespace hpx::lcos { #if defined(HPX_HAVE_NETWORKING) namespace detail { @@ -156,21 +157,11 @@ namespace hpx { namespace lcos { hpx::id_type cont_id(this->get_id(false)); naming::detail::set_dont_store_in_cache(cont_id); - if (addr) - { - hpx::post_p_cb( - actions::typed_continuation( - HPX_MOVE(cont_id), HPX_MOVE(resolved_addr)), - HPX_MOVE(addr), id, priority, HPX_MOVE(f), - HPX_FORWARD(Ts, vs)...); - } - else - { - hpx::post_p_cb( - actions::typed_continuation( - HPX_MOVE(cont_id), HPX_MOVE(resolved_addr)), - id, priority, HPX_MOVE(f), HPX_FORWARD(Ts, vs)...); - } + hpx::post_p_cb( + actions::typed_continuation( + HPX_MOVE(cont_id), HPX_MOVE(resolved_addr)), + HPX_MOVE(addr), id, priority, HPX_MOVE(f), + HPX_FORWARD(Ts, vs)...); this->shared_state_->mark_as_started(); } @@ -212,7 +203,7 @@ namespace hpx { namespace lcos { sizeof...(Ts)); #if defined(HPX_HAVE_NETWORKING) - using callback_type = typename std::decay::type; + using callback_type = std::decay_t; auto&& f = detail::parcel_write_handler_cb{ this->shared_state_, HPX_FORWARD(Callback, cb)}; #else @@ -253,7 +244,7 @@ namespace hpx { namespace lcos { sizeof...(Ts)); #if defined(HPX_HAVE_NETWORKING) - using callback_type = typename std::decay::type; + using callback_type = std::decay_t; auto&& f = detail::parcel_write_handler_cb{ this->shared_state_, HPX_FORWARD(Callback, cb)}; #else @@ -387,7 +378,7 @@ namespace hpx { namespace lcos { sizeof...(Ts)); #if defined(HPX_HAVE_NETWORKING) - using callback_type = typename std::decay::type; + using callback_type = std::decay_t; auto&& f = detail::parcel_write_handler_cb{ this->shared_state_, HPX_FORWARD(Callback, cb)}; #else @@ -435,33 +426,44 @@ namespace hpx { namespace lcos { template void post(hpx::id_type const& id, Ts&&... vs) { - std::pair r; + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; + [[maybe_unused]] std::pair r; naming::address addr; - if (agas::is_local_address_cached(id, addr)) + + if constexpr (traits::component_supports_migration< + component_type>::call()) { - using component_type = typename Action::component_type; - HPX_ASSERT( - traits::component_type_is_compatible::call( - addr)); + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( + id, addr.address_); + }; - if (traits::component_supports_migration< - component_type>::call()) + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + !r.first) { - r = traits::action_was_object_migrated::call( - id, addr.address_); - if (!r.first) - { - // local, direct execution - auto&& result = action_type::execute_function( - addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); - this->shared_state_->mark_as_started(); - this->shared_state_->set_remote_data(HPX_MOVE(result)); - return; - } + HPX_ASSERT(traits::component_type_is_compatible< + component_type>::call(addr)); + + // local, direct execution + auto&& result = action_type::execute_function( + addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); + this->shared_state_->mark_as_started(); + this->shared_state_->set_remote_data(HPX_MOVE(result)); + return; } - else + + // fall through + } + else + { + // non-migratable objects + if (agas::is_local_address_cached(id, addr)) { + HPX_ASSERT(traits::component_type_is_compatible< + component_type>::call(addr)); + // local, direct execution auto&& result = action_type::execute_function( addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); @@ -469,6 +471,8 @@ namespace hpx { namespace lcos { this->shared_state_->set_remote_data(HPX_MOVE(result)); return; } + + // fall through } // remote execution @@ -479,40 +483,34 @@ namespace hpx { namespace lcos { template void post(naming::address&& addr, hpx::id_type const& id, Ts&&... vs) { - std::pair r; + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; - if (naming::get_locality_id_from_gid(addr.locality_) == - agas::get_locality_id()) + if (addr && + naming::get_locality_id_from_gid(addr.locality_) == + agas::get_locality_id()) { - using component_type = typename Action::component_type; HPX_ASSERT( traits::component_type_is_compatible::call( addr)); - if (traits::component_supports_migration< - component_type>::call()) - { - r = traits::action_was_object_migrated::call( - id, addr.address_); - if (!r.first) - { - // local, direct execution - auto&& result = action_type::execute_function( - addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); - this->shared_state_->mark_as_started(); - this->shared_state_->set_remote_data(HPX_MOVE(result)); - return; - } - } - else + if constexpr (traits::component_supports_migration< + component_type>::call()) { - // local, direct execution - auto&& result = action_type::execute_function( - addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); - this->shared_state_->mark_as_started(); - this->shared_state_->set_remote_data(HPX_MOVE(result)); - return; + HPX_ASSERT( + !traits::action_was_object_migrated::call( + id, addr.address_) + .first); + HPX_ASSERT(hpx::detail::pin_count_is_valid( + addr.address_)); } + + // local, direct execution + auto&& result = action_type::execute_function( + addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); + this->shared_state_->mark_as_started(); + this->shared_state_->set_remote_data(HPX_MOVE(result)); + return; } // remote execution @@ -524,55 +522,54 @@ namespace hpx { namespace lcos { template void post_cb(hpx::id_type const& id, Callback&& cb, Ts&&... vs) { - std::pair r; + using action_type = hpx::traits::extract_action_t; + using component_type = typename action_type::component_type; + [[maybe_unused]] std::pair r; naming::address addr; - if (agas::is_local_address_cached(id, addr)) - { - using component_type = typename Action::component_type; - HPX_ASSERT( - traits::component_type_is_compatible::call( - addr)); - if (traits::component_supports_migration< - component_type>::call()) - { - r = traits::action_was_object_migrated::call( + if constexpr (traits::component_supports_migration< + component_type>::call()) + { + auto f = [id](naming::address const& addr) { + return traits::action_was_object_migrated::call( id, addr.address_); - if (!r.first) - { - // local, direct execution - auto&& result = action_type::execute_function( - addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); - this->shared_state_->mark_as_started(); - this->shared_state_->set_remote_data(HPX_MOVE(result)); + }; - // invoke callback -#if defined(HPX_HAVE_NETWORKING) - cb(std::error_code(), parcelset::parcel()); -#else - cb(); -#endif + if (agas::is_local_address_cached(id, addr, r, HPX_MOVE(f)) && + !r.first) + { + // local, direct execution + auto&& result = action_type::execute_function( + addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); + this->shared_state_->mark_as_started(); + this->shared_state_->set_remote_data(HPX_MOVE(result)); - return; - } + hpx::detail::invoke_callback(HPX_FORWARD(Callback, cb)); + return; } - else + + // fall through + } + else + { + // non-migratable objects + if (agas::is_local_address_cached(id, addr)) { + HPX_ASSERT(traits::component_type_is_compatible< + component_type>::call(addr)); + // local, direct execution auto&& result = action_type::execute_function( addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); this->shared_state_->mark_as_started(); this->shared_state_->set_remote_data(HPX_MOVE(result)); - // invoke callback -#if defined(HPX_HAVE_NETWORKING) - cb(std::error_code(), parcelset::parcel()); -#else - cb(); -#endif + hpx::detail::invoke_callback(HPX_FORWARD(Callback, cb)); return; } + + // fall through } // remote execution @@ -584,54 +581,34 @@ namespace hpx { namespace lcos { void post_cb(naming::address&& addr, hpx::id_type const& id, Callback&& cb, Ts&&... vs) { - std::pair r; - - if (naming::get_locality_id_from_gid(addr.locality_) == - agas::get_locality_id()) + if (addr && + naming::get_locality_id_from_gid(addr.locality_) == + agas::get_locality_id()) { using component_type = typename Action::component_type; HPX_ASSERT( traits::component_type_is_compatible::call( addr)); - if (traits::component_supports_migration< - component_type>::call()) + if constexpr (traits::component_supports_migration< + component_type>::call()) { - r = traits::action_was_object_migrated::call( - id, addr.address_); - if (!r.first) - { - // local, direct execution - auto&& result = action_type::execute_function( - addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); - this->shared_state_->mark_as_started(); - this->shared_state_->set_remote_data(HPX_MOVE(result)); - - // invoke callback -#if defined(HPX_HAVE_NETWORKING) - cb(std::error_code(), parcelset::parcel()); -#else - cb(); -#endif - return; - } + HPX_ASSERT( + !traits::action_was_object_migrated::call( + id, addr.address_) + .first); + HPX_ASSERT(hpx::detail::pin_count_is_valid( + addr.address_)); } - else - { - // local, direct execution - auto&& result = action_type::execute_function( - addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); - this->shared_state_->mark_as_started(); - this->shared_state_->set_remote_data(HPX_MOVE(result)); - // invoke callback -#if defined(HPX_HAVE_NETWORKING) - cb(std::error_code(), parcelset::parcel()); -#else - cb(); -#endif - return; - } + // local, direct execution + auto&& result = action_type::execute_function( + addr.address_, addr.type_, HPX_FORWARD(Ts, vs)...); + this->shared_state_->mark_as_started(); + this->shared_state_->set_remote_data(HPX_MOVE(result)); + + hpx::detail::invoke_callback(HPX_FORWARD(Callback, cb)); + return; } // remote execution @@ -640,4 +617,4 @@ namespace hpx { namespace lcos { HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); } }; -}} // namespace hpx::lcos +} // namespace hpx::lcos diff --git a/libs/full/async_distributed/include/hpx/async_distributed/trigger_lco.hpp b/libs/full/async_distributed/include/hpx/async_distributed/trigger_lco.hpp index bde4affb4647..3e404bb535fe 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/trigger_lco.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/trigger_lco.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 @@ -20,9 +20,7 @@ #include #include #include -#include -#include #include #include @@ -34,23 +32,18 @@ namespace hpx { // forward declare the required overload of post. template bool post(hpx::id_type const& gid, Ts&&... vs); - - template - inline bool post_c_p( - hpx::actions::basic_action, - hpx::id_type const& contgid, hpx::id_type const& gid, Ts&&... vs); /// \endcond /// \cond NOINTERNAL namespace detail { + template struct make_rvalue_impl { - typedef T&& type; + using type = T&&; template - HPX_FORCEINLINE static T&& call(U& u) + HPX_FORCEINLINE static T&& call(U& u) noexcept { return HPX_MOVE(u); } @@ -59,7 +52,7 @@ namespace hpx { template struct make_rvalue_impl { - typedef T type; + using type = T; template HPX_FORCEINLINE static T call(U const& u) @@ -71,7 +64,7 @@ namespace hpx { template struct make_rvalue_impl { - typedef T type; + using type = T; HPX_FORCEINLINE static T call(T& u) { @@ -82,7 +75,7 @@ namespace hpx { template struct make_rvalue_impl { - typedef T type; + using type = T; HPX_FORCEINLINE static T call(T const& u) { @@ -92,14 +85,14 @@ namespace hpx { template HPX_FORCEINLINE typename detail::make_rvalue_impl::type make_rvalue( - typename std::remove_reference::type& v) + std::remove_reference_t& v) { return detail::make_rvalue_impl::call(v); } template HPX_FORCEINLINE typename detail::make_rvalue_impl::type make_rvalue( - typename std::remove_reference::type&& v) + std::remove_reference_t&& v) { return detail::make_rvalue_impl::call(v); } @@ -161,21 +154,22 @@ namespace hpx { /// \cond NOINTERNAL template - void set_lco_value(hpx::id_type const& id, naming::address&& addr, - Result&& t, bool move_credits) + void set_lco_value([[maybe_unused]] hpx::id_type const& id, + [[maybe_unused]] naming::address&& addr, [[maybe_unused]] Result&& t, + [[maybe_unused]] bool move_credits) { #if !defined(HPX_COMPUTE_DEVICE_CODE) - typedef typename std::decay::type remote_result_type; - typedef typename traits::promise_local_result::type - local_result_type; + using remote_result_type = std::decay_t; + using local_result_type = + typename traits::promise_local_result::type; if (components::get_base_type(addr.type_) == components::component_base_lco_with_value_unmanaged) { - typedef typename lcos::base_lco_with_value::set_value_action - set_value_action; + using set_value_action = + typename lcos::base_lco_with_value::set_value_action; detail::set_lco_value( id, HPX_MOVE(addr), HPX_FORWARD(Result, t), move_credits); @@ -187,39 +181,37 @@ namespace hpx { components::get_base_type(addr.type_) == components::component_base_lco_with_value); - typedef typename lcos::base_lco_with_value::set_value_action - set_value_action; + using set_value_action = + typename lcos::base_lco_with_value::set_value_action; detail::set_lco_value( id, HPX_MOVE(addr), HPX_FORWARD(Result, t), move_credits); } #else - HPX_UNUSED(id); - HPX_UNUSED(addr); - HPX_UNUSED(t); - HPX_UNUSED(move_credits); HPX_ASSERT(false); #endif } template - void set_lco_value(hpx::id_type const& id, naming::address&& addr, - Result&& t, hpx::id_type const& cont, bool move_credits) + void set_lco_value([[maybe_unused]] hpx::id_type const& id, + [[maybe_unused]] naming::address&& addr, [[maybe_unused]] Result&& t, + [[maybe_unused]] hpx::id_type const& cont, + [[maybe_unused]] bool move_credits) { #if !defined(HPX_COMPUTE_DEVICE_CODE) - typedef typename std::decay::type remote_result_type; - typedef typename traits::promise_local_result::type - local_result_type; + using remote_result_type = std::decay_t; + using local_result_type = + typename traits::promise_local_result::type; if (components::get_base_type(addr.type_) == components::component_base_lco_with_value_unmanaged) { - typedef typename lcos::base_lco_with_value::set_value_action - set_value_action; + using set_value_action = + typename lcos::base_lco_with_value::set_value_action; detail::set_lco_value( @@ -231,21 +223,16 @@ namespace hpx { components::get_base_type(addr.type_) == components::component_base_lco_with_value); - typedef typename lcos::base_lco_with_value::set_value_action - set_value_action; + using set_value_action = + typename lcos::base_lco_with_value::set_value_action; detail::set_lco_value( id, HPX_MOVE(addr), HPX_FORWARD(Result, t), cont, move_credits); } #else - HPX_UNUSED(id); - HPX_UNUSED(addr); - HPX_UNUSED(t); - HPX_UNUSED(cont); - HPX_UNUSED(move_credits); HPX_ASSERT(false); #endif } diff --git a/libs/full/components/include/hpx/components/get_ptr.hpp b/libs/full/components/include/hpx/components/get_ptr.hpp index 30ed91605947..c39a6dee9b14 100644 --- a/libs/full/components/include/hpx/components/get_ptr.hpp +++ b/libs/full/components/include/hpx/components/get_ptr.hpp @@ -33,8 +33,8 @@ namespace hpx { /////////////////////////////////////////////////////////////////////// struct get_ptr_deleter { - explicit get_ptr_deleter(hpx::id_type const& id) noexcept - : id_(id) + explicit get_ptr_deleter(hpx::id_type id) noexcept + : id_(HPX_MOVE(id)) { } @@ -50,8 +50,8 @@ namespace hpx { struct get_ptr_no_unpin_deleter { - explicit get_ptr_no_unpin_deleter(hpx::id_type const& id) noexcept - : id_(id) + explicit get_ptr_no_unpin_deleter(hpx::id_type id) noexcept + : id_(HPX_MOVE(id)) { } @@ -66,21 +66,20 @@ namespace hpx { struct get_ptr_for_migration_deleter { - explicit get_ptr_for_migration_deleter( - hpx::id_type const& id) noexcept - : id_(id) + explicit get_ptr_for_migration_deleter(hpx::id_type id) noexcept + : id_(HPX_MOVE(id)) { } template void operator()(Component* p) { - bool was_migrated = - traits::component_pin_support::unpin(p); - - if (was_migrated) + // delete the object once the shared_ptr goes out of scope + auto const pin_count = + traits::component_pin_support::pin_count(p); + if (pin_count == ~0x0u) { - components::component_type type = + components::component_type const type = components::get_component_type(); components::deleter(type)(id_.get_gid(), naming::address(naming::get_gid_from_locality_id( @@ -94,8 +93,8 @@ namespace hpx { }; template - std::shared_ptr get_ptr_postproc( - naming::address const& addr, hpx::id_type const& id) + std::shared_ptr get_ptr_postproc(naming::address const& addr, + hpx::id_type const& id, bool pin_object = true) { if (agas::get_locality_id() != naming::get_locality_id_from_gid(addr.locality_)) @@ -103,7 +102,6 @@ namespace hpx { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "hpx::get_ptr_postproc", "the given component id does not belong to a local object"); - return std::shared_ptr(); } if (!traits::component_type_is_compatible::call(addr)) @@ -112,14 +110,16 @@ namespace hpx { "hpx::get_ptr_postproc", "requested component type does not match the given " "component id"); - return std::shared_ptr(); } Component* p = get_lva::call(addr.address_); std::shared_ptr ptr(p, Deleter(id)); - // the shared_ptr pins the component - traits::component_pin_support::pin(ptr.get()); + // the shared_ptr pins the component, if requested + if (pin_object) + { + traits::component_pin_support::pin(ptr.get()); + } return ptr; } @@ -130,8 +130,9 @@ namespace hpx { std::shared_ptr get_ptr_for_migration( naming::address const& addr, hpx::id_type const& id) { + // do not pin/unpin the object return get_ptr_postproc( - addr, id); + addr, id, false); } } // namespace detail /// \endcond @@ -145,8 +146,7 @@ namespace hpx { /// \param id [in] The global id of the component for which the pointer /// to the underlying memory should be retrieved. /// - /// \tparam The only template parameter has to be the type of the - /// server side component. + /// \tparam Component The type of the server side component. /// /// \returns This function returns a future representing the pointer to /// the underlying memory for the component instance with the diff --git a/libs/full/components_base/include/hpx/components_base/agas_interface.hpp b/libs/full/components_base/include/hpx/components_base/agas_interface.hpp index 29b3132e4763..6349abe92c74 100644 --- a/libs/full/components_base/include/hpx/components_base/agas_interface.hpp +++ b/libs/full/components_base/include/hpx/components_base/agas_interface.hpp @@ -125,6 +125,12 @@ namespace hpx::agas { HPX_EXPORT bool is_local_address_cached(naming::gid_type const& gid, naming::address& addr, error_code& ec = throws); + HPX_EXPORT bool is_local_address_cached(naming::gid_type const& gid, + naming::address& addr, std::pair& r, + hpx::move_only_function( + naming::address const&)>&& f, + error_code& ec = throws); + inline bool is_local_address_cached( hpx::id_type const& id, error_code& ec = throws) { @@ -137,6 +143,15 @@ namespace hpx::agas { return is_local_address_cached(id.get_gid(), addr, ec); } + inline bool is_local_address_cached(hpx::id_type const& id, + naming::address& addr, std::pair& r, + hpx::move_only_function( + naming::address const&)>&& f, + error_code& ec = throws) + { + return is_local_address_cached(id.get_gid(), addr, r, HPX_MOVE(f), ec); + } + HPX_EXPORT void update_cache_entry(naming::gid_type const& gid, naming::address const& addr, std::uint64_t count = 0, std::uint64_t offset = 0, error_code& ec = throws); @@ -261,7 +276,8 @@ namespace hpx::agas { naming::gid_type const& gid, hpx::move_only_function&& f); - HPX_EXPORT void unmark_as_migrated(naming::gid_type const& gid); + HPX_EXPORT void unmark_as_migrated( + naming::gid_type const& gid, hpx::move_only_function&& f); HPX_EXPORT hpx::future> find_symbols( std::string const& pattern = "*"); diff --git a/libs/full/components_base/include/hpx/components_base/component_type.hpp b/libs/full/components_base/include/hpx/components_base/component_type.hpp index 711ba3c60508..4080de057949 100644 --- a/libs/full/components_base/include/hpx/components_base/component_type.hpp +++ b/libs/full/components_base/include/hpx/components_base/component_type.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2017 Thomas Heller // Copyright (c) 2011 Bryce Lelbach // @@ -22,14 +22,12 @@ #include #include #include -#include -#include #include #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { +namespace hpx::components { // declared in hpx/modules/naming.hpp // using component_type = std::int32_t; @@ -98,31 +96,31 @@ namespace hpx { namespace components { hpx::move_only_function const& f); /// \brief Return the string representation for a given component type id - HPX_EXPORT std::string const get_component_type_name(component_type type); + HPX_EXPORT std::string get_component_type_name(component_type type); /// The lower short word of the component type is the type of the component /// exposing the actions. - inline constexpr component_type get_base_type(component_type t) noexcept + constexpr component_type get_base_type(component_type t) noexcept { - return component_type(t & 0x3FF); + return static_cast(t & 0x3FF); } /// The upper short word of the component is the actual component type - inline constexpr component_type get_derived_type(component_type t) noexcept + constexpr component_type get_derived_type(component_type t) noexcept { - return component_type((t >> 10) & 0x3FF); + return static_cast((t >> 10) & 0x3FF); } /// A component derived from a base component exposing the actions needs to /// have a specially formatted component type. - inline constexpr component_type derived_component_type( + constexpr component_type derived_component_type( component_type derived, component_type base) noexcept { - return component_type(derived << 10 | base); + return static_cast(derived << 10 | base); } /// \brief Verify the two given component types are matching (compatible) - inline constexpr bool types_are_compatible( + constexpr bool types_are_compatible( component_type lhs, component_type rhs) noexcept { // don't compare types if one of them is unknown @@ -138,8 +136,8 @@ namespace hpx { namespace components { return true; } - component_type lhs_base = get_base_type(lhs); - component_type rhs_base = get_base_type(rhs); + component_type const lhs_base = get_base_type(lhs); + component_type const rhs_base = get_base_type(rhs); if (lhs_base == rhs_base) { @@ -193,24 +191,24 @@ namespace hpx { namespace components { HPX_ALWAYS_EXPORT const char* get_component_base_name() noexcept; template - inline component_type get_component_type() noexcept + component_type get_component_type() noexcept { return traits::component_type_database::get(); } template - inline void set_component_type(component_type type) + void set_component_type(component_type type) { traits::component_type_database::set(type); } -}} // namespace hpx::components +} // namespace hpx::components -namespace hpx { namespace naming { +namespace hpx::naming { // this is defined in this module as its implementation relies on // components::get_component_type_name() HPX_EXPORT std::ostream& operator<<(std::ostream&, address const&); -}} // namespace hpx::naming +} // namespace hpx::naming /////////////////////////////////////////////////////////////////////////////// #define HPX_DEFINE_GET_COMPONENT_TYPE(component) \ diff --git a/libs/full/components_base/include/hpx/components_base/components_base_fwd.hpp b/libs/full/components_base/include/hpx/components_base/components_base_fwd.hpp index 0b6df8442366..184415d55517 100644 --- a/libs/full/components_base/include/hpx/components_base/components_base_fwd.hpp +++ b/libs/full/components_base/include/hpx/components_base/components_base_fwd.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 @@ -15,13 +15,13 @@ namespace hpx { /// \namespace components namespace components { - /// \ cond NODETAIL + /// \cond NODETAIL namespace detail { struct this_type { }; } // namespace detail - /// \ endcond + /// \endcond /////////////////////////////////////////////////////////////////////// class pinned_ptr; diff --git a/libs/full/components_base/include/hpx/components_base/detail/agas_interface_functions.hpp b/libs/full/components_base/include/hpx/components_base/detail/agas_interface_functions.hpp index 78b1afdc450b..ec6044dbf322 100644 --- a/libs/full/components_base/include/hpx/components_base/detail/agas_interface_functions.hpp +++ b/libs/full/components_base/include/hpx/components_base/detail/agas_interface_functions.hpp @@ -99,6 +99,13 @@ namespace hpx::agas::detail { extern HPX_EXPORT bool (*is_local_address_cached_addr)( naming::gid_type const& gid, naming::address& addr, error_code& ec); + extern HPX_EXPORT bool (*is_local_address_cached_addr_pinned_ptr)( + naming::gid_type const& gid, naming::address& addr, + std::pair& r, + hpx::move_only_function( + naming::address const&)>&& f, + error_code& ec); + extern HPX_EXPORT void (*update_cache_entry)(naming::gid_type const& gid, naming::address const& addr, std::uint64_t count, std::uint64_t offset, error_code& ec); @@ -213,7 +220,8 @@ namespace hpx::agas::detail { *was_object_migrated)(naming::gid_type const& gid, hpx::move_only_function&& f); - extern HPX_EXPORT void (*unmark_as_migrated)(naming::gid_type const& gid); + extern HPX_EXPORT void (*unmark_as_migrated)( + naming::gid_type const& gid, hpx::move_only_function&& f); /////////////////////////////////////////////////////////////////////////// extern HPX_EXPORT hpx::future> ( diff --git a/libs/full/components_base/include/hpx/components_base/pinned_ptr.hpp b/libs/full/components_base/include/hpx/components_base/pinned_ptr.hpp index 34b804a46bd5..8c424b610312 100644 --- a/libs/full/components_base/include/hpx/components_base/pinned_ptr.hpp +++ b/libs/full/components_base/include/hpx/components_base/pinned_ptr.hpp @@ -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 @@ -13,19 +13,13 @@ #include #include -#include -#include - -namespace hpx { namespace components { +namespace hpx::components { /////////////////////////////////////////////////////////////////////////// namespace detail { + class pinned_ptr_base { - public: - pinned_ptr_base(pinned_ptr_base const&) = delete; - pinned_ptr_base& operator=(pinned_ptr_base const&) = delete; - public: constexpr pinned_ptr_base() noexcept = default; @@ -35,6 +29,11 @@ namespace hpx { namespace components { { } + pinned_ptr_base(pinned_ptr_base const&) = delete; + pinned_ptr_base(pinned_ptr_base&&) = delete; + pinned_ptr_base& operator=(pinned_ptr_base const&) = delete; + pinned_ptr_base& operator=(pinned_ptr_base&&) = delete; + virtual ~pinned_ptr_base() = default; protected: @@ -42,7 +41,7 @@ namespace hpx { namespace components { }; template - class pinned_ptr : public pinned_ptr_base + class pinned_ptr final : public pinned_ptr_base { public: explicit pinned_ptr(naming::address_type lva) noexcept @@ -55,6 +54,11 @@ namespace hpx { namespace components { get_lva::call(this->lva_)); } + pinned_ptr(pinned_ptr const&) = delete; + pinned_ptr(pinned_ptr&&) = delete; + pinned_ptr& operator=(pinned_ptr const&) = delete; + pinned_ptr& operator=(pinned_ptr&&) = delete; + ~pinned_ptr() override { // unpin associated component instance @@ -67,7 +71,6 @@ namespace hpx { namespace components { /////////////////////////////////////////////////////////////////////////// class pinned_ptr { - private: template struct id { @@ -80,7 +83,7 @@ namespace hpx { namespace components { } public: - constexpr pinned_ptr() = default; + constexpr pinned_ptr() noexcept = default; ~pinned_ptr() { @@ -105,8 +108,13 @@ namespace hpx { namespace components { return *this; } + explicit constexpr operator bool() const noexcept + { + return data_ != nullptr; + } + template - static pinned_ptr create(naming::address_type lva) + static pinned_ptr create([[maybe_unused]] naming::address_type lva) { using component_type = std::remove_cv_t; if constexpr (traits::component_decorates_action_v) @@ -117,7 +125,6 @@ namespace hpx { namespace components { else { // created pinned_ptr does not pin object it refers to - (void) lva; return pinned_ptr{}; } } @@ -125,4 +132,4 @@ namespace hpx { namespace components { private: detail::pinned_ptr_base* data_ = nullptr; }; -}} // namespace hpx::components +} // namespace hpx::components diff --git a/libs/full/components_base/include/hpx/components_base/server/abstract_migration_support.hpp b/libs/full/components_base/include/hpx/components_base/server/abstract_migration_support.hpp index 6d4a3630fa6a..de3b86219869 100644 --- a/libs/full/components_base/include/hpx/components_base/server/abstract_migration_support.hpp +++ b/libs/full/components_base/include/hpx/components_base/server/abstract_migration_support.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2021 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 @@ -19,7 +19,7 @@ #include #include -namespace hpx { namespace components { +namespace hpx::components { /////////////////////////////////////////////////////////////////////////// /// This hook has to be inserted into the derivation chain of any @@ -32,21 +32,45 @@ namespace hpx { namespace components { using this_component_type = typename base_type::this_component_type; public: + abstract_base_migration_support() = default; + + abstract_base_migration_support( + abstract_base_migration_support const&) = delete; + abstract_base_migration_support( + abstract_base_migration_support&&) = delete; + abstract_base_migration_support& operator=( + abstract_base_migration_support const&) = delete; + abstract_base_migration_support& operator=( + abstract_base_migration_support&&) = delete; + virtual ~abstract_base_migration_support() = default; // This component type supports migration. - // static constexpr bool supports_migration() { return true; } + [[nodiscard]] static constexpr bool supports_migration() noexcept + { + return true; + } // Pinning functionality virtual void pin() = 0; virtual bool unpin() = 0; - virtual std::uint32_t pin_count() const = 0; + [[nodiscard]] virtual std::uint32_t pin_count() const = 0; virtual void mark_as_migrated() = 0; // migration support virtual hpx::future mark_as_migrated( hpx::id_type const& to_migrate) = 0; + virtual void unmark_as_migrated(hpx::id_type const& to_migrate) = 0; virtual void on_migrated() = 0; + virtual std::pair was_object_migrated_v( + hpx::naming::gid_type const& id, naming::address_type lva) = 0; + + static std::pair was_object_migrated( + hpx::naming::gid_type const& id, naming::address_type lva) + { + return get_lva::call(lva) + ->was_object_migrated_v(id, lva); + } using decorates_action = void; @@ -103,27 +127,46 @@ namespace hpx { namespace components { template , abstract_migration_support>>> - abstract_migration_support(T&& t, Ts&&... ts) + explicit abstract_migration_support(T&& t, Ts&&... ts) : abstract_base_type(HPX_FORWARD(T, t), HPX_FORWARD(Ts, ts)...) { } + abstract_migration_support(abstract_migration_support const&) = delete; + abstract_migration_support(abstract_migration_support&&) = delete; + abstract_migration_support& operator=( + abstract_migration_support const&) = delete; + abstract_migration_support& operator=( + abstract_migration_support&&) = delete; + ~abstract_migration_support() = default; - constexpr void finalize() noexcept {} + // Disambiguate supports_migration() function. + [[nodiscard]] static constexpr bool supports_migration() noexcept + { + return true; + } + + using decorates_action = void; + + static constexpr void finalize() noexcept {} hpx::future mark_as_migrated( hpx::id_type const& to_migrate) override { return this->base_type::mark_as_migrated(to_migrate); } + void unmark_as_migrated(hpx::id_type const& to_migrate) override + { + return this->base_type::unmark_as_migrated(to_migrate); + } void mark_as_migrated() override { this->base_type::mark_as_migrated(); } - std::uint32_t pin_count() const override + [[nodiscard]] std::uint32_t pin_count() const override { return this->base_type::pin_count(); } @@ -141,5 +184,11 @@ namespace hpx { namespace components { { return this->base_type::on_migrated(); } + + std::pair was_object_migrated_v( + hpx::naming::gid_type const& id, naming::address_type lva) override + { + return this->base_type::was_object_migrated(id, lva); + } }; -}} // namespace hpx::components +} // namespace hpx::components diff --git a/libs/full/components_base/include/hpx/components_base/server/component.hpp b/libs/full/components_base/include/hpx/components_base/server/component.hpp index 6b4f8d153d6e..bbfbbf849278 100644 --- a/libs/full/components_base/include/hpx/components_base/server/component.hpp +++ b/libs/full/components_base/include/hpx/components_base/server/component.hpp @@ -16,11 +16,10 @@ #include #include -#include #include #include -namespace hpx { namespace components { namespace detail { +namespace hpx::components::detail { /////////////////////////////////////////////////////////////////////// template @@ -42,9 +41,9 @@ namespace hpx { namespace components { namespace detail { template util::internal_allocator simple_heap::alloc_; -}}} // namespace hpx::components::detail +} // namespace hpx::components::detail -namespace hpx { namespace traits { +namespace hpx::traits { /////////////////////////////////////////////////////////////////////////// template @@ -52,9 +51,9 @@ namespace hpx { namespace traits { { using type = hpx::components::detail::simple_heap; }; -}} // namespace hpx::traits +} // namespace hpx::traits -namespace hpx { namespace components { +namespace hpx::components { /////////////////////////////////////////////////////////////////////////// template @@ -77,4 +76,4 @@ namespace hpx { namespace components { { } }; -}} // namespace hpx::components +} // namespace hpx::components diff --git a/libs/full/components_base/include/hpx/components_base/server/component_base.hpp b/libs/full/components_base/include/hpx/components_base/server/component_base.hpp index 399186b4ac48..2ad5123d0753 100644 --- a/libs/full/components_base/include/hpx/components_base/server/component_base.hpp +++ b/libs/full/components_base/include/hpx/components_base/server/component_base.hpp @@ -1,5 +1,5 @@ // Copyright (c) 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 @@ -13,20 +13,14 @@ #include #include #include -#include #include #include #include #include #include -#include -#include -#include -#include -#include -namespace hpx { namespace components { +namespace hpx::components { namespace detail { @@ -42,12 +36,13 @@ namespace hpx { namespace components { base_component(base_component&& rhs) noexcept = default; base_component& operator=(base_component&& rhs) noexcept = default; - // finalize() will be called just before the instance gets destructed + // finalize() will be called just before the instance gets + // destructed static constexpr void finalize() noexcept {} - HPX_EXPORT hpx::id_type get_id(naming::gid_type gid) const; - HPX_EXPORT hpx::id_type get_unmanaged_id( - naming::gid_type const& gid) const; + HPX_EXPORT static hpx::id_type get_id(naming::gid_type gid); + HPX_EXPORT static hpx::id_type get_unmanaged_id( + naming::gid_type const& gid); static void mark_as_migrated() noexcept { @@ -66,11 +61,12 @@ namespace hpx { namespace components { } protected: - // Create a new GID (if called for the first time), assign this - // GID to this instance of a component and register this gid - // with the AGAS service + // Create a new GID (if called for the first time), assign this GID + // to this instance of a component and register this gid with the + // AGAS service // - // Returns he global id (GID) assigned to this instance of a component + // Returns the global id (GID) assigned to this instance of a + // component HPX_EXPORT naming::gid_type get_base_gid_dynamic( naming::gid_type const& assign_gid, naming::address const& addr, naming::gid_type (*f)(naming::gid_type) = nullptr) const; @@ -79,7 +75,6 @@ namespace hpx { namespace components { naming::address const& addr, naming::gid_type (*f)(naming::gid_type) = nullptr) const; - protected: mutable naming::gid_type gid_; }; } // namespace detail @@ -110,7 +105,6 @@ namespace hpx { namespace components { component_base& operator=(component_base const&) = default; component_base& operator=(component_base&& rhs) noexcept = default; - public: naming::address get_current_address() const { return naming::address( @@ -141,4 +135,4 @@ namespace hpx { namespace components { static_cast(*this).get_current_address()); } }; -}} // namespace hpx::components +} // namespace hpx::components diff --git a/libs/full/components_base/include/hpx/components_base/server/fixed_component_base.hpp b/libs/full/components_base/include/hpx/components_base/server/fixed_component_base.hpp index 32114e4274b4..7e8d696d647a 100644 --- a/libs/full/components_base/include/hpx/components_base/server/fixed_component_base.hpp +++ b/libs/full/components_base/include/hpx/components_base/server/fixed_component_base.hpp @@ -67,6 +67,7 @@ namespace hpx::components { { error_code ec(throwmode::lightweight); // ignore errors agas::unbind_gid_local(gid_, ec); + gid_ = naming::gid_type(); // invalidate GID } } diff --git a/libs/full/components_base/include/hpx/components_base/server/managed_component_base.hpp b/libs/full/components_base/include/hpx/components_base/server/managed_component_base.hpp index a8e5564ce5b8..282c5ecf259a 100644 --- a/libs/full/components_base/include/hpx/components_base/server/managed_component_base.hpp +++ b/libs/full/components_base/include/hpx/components_base/server/managed_component_base.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2023 Hartmut Kaiser // Copyright (c) 2011-2017 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 @@ -18,19 +18,15 @@ #include #include #include -#include #include #include #include -#include -#include #include #include -#include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { +namespace hpx::components { /////////////////////////////////////////////////////////////////////////// namespace detail_adl_barrier { @@ -195,9 +191,9 @@ namespace hpx { namespace components { HPX_NON_COPYABLE(managed_component_base); public: - using this_component_type = typename std::conditional< - std::is_same::value, - managed_component_base, Component>::type; + using this_component_type = + std::conditional_t, + managed_component_base, Component>; using wrapped_type = this_component_type; @@ -299,19 +295,21 @@ namespace hpx { namespace components { /// full network round trip to the AGAS service for each of the allocated /// instances. /// - /// \tparam Component - /// \tparam Derived + /// \tparam Component Component type + /// \tparam Derived Most derived component type /// template class managed_component { public: - HPX_NON_COPYABLE(managed_component); + managed_component(managed_component const&) = delete; + managed_component(managed_component&&) = delete; + managed_component& operator=(managed_component const&) = delete; + managed_component& operator=(managed_component&&) = delete; - public: - using derived_type = typename std::conditional< - std::is_same::value, managed_component, - Derived>::type; + using derived_type = + std::conditional_t, + managed_component, Derived>; using wrapped_type = Component; using type_holder = Component; @@ -325,7 +323,7 @@ namespace hpx { namespace components { /// wrapped instance. This constructor takes ownership of the /// passed pointer. /// - /// \param c [in] The pointer to the wrapped instance. The + /// \param comp [in] The pointer to the wrapped instance. The /// managed_component takes ownership of this pointer. explicit managed_component(Component* comp) : component_(comp) @@ -336,7 +334,6 @@ namespace hpx { namespace components { intrusive_ptr_add_ref(this); } - public: // Construct a managed_component instance holding a new wrapped instance managed_component() : component_(nullptr) @@ -358,7 +355,6 @@ namespace hpx { namespace components { intrusive_ptr_add_ref(this); } - public: // The destructor releases any wrapped instances ~managed_component() { @@ -410,7 +406,6 @@ namespace hpx { namespace components { return get(); } - public: /////////////////////////////////////////////////////////////////////// // The managed_component behaves just like the wrapped object Component* operator->() @@ -442,7 +437,6 @@ namespace hpx { namespace components { get_base_gid(), hpx::id_type::management_type::unmanaged); } - public: naming::gid_type get_base_gid( naming::gid_type const& assign_gid = naming::invalid_gid) const { @@ -451,14 +445,12 @@ namespace hpx { namespace components { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "managed_component::get_base_gid", "managed_components must be assigned new gids on creation"); - return naming::invalid_gid; } return component_heap().get_gid( const_cast(this)); } - public: // reference counting template friend void intrusive_ptr_add_ref(managed_component* p) noexcept; @@ -507,4 +499,4 @@ namespace hpx { namespace components { HPX_ASSERT(back_ptr_); return back_ptr_->get_base_gid(); } -}} // namespace hpx::components +} // namespace hpx::components diff --git a/libs/full/components_base/include/hpx/components_base/server/migration_support.hpp b/libs/full/components_base/include/hpx/components_base/server/migration_support.hpp index a89397ca7241..9cc6d7a5508a 100644 --- a/libs/full/components_base/include/hpx/components_base/server/migration_support.hpp +++ b/libs/full/components_base/include/hpx/components_base/server/migration_support.hpp @@ -1,4 +1,4 @@ -// 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 @@ -13,10 +13,11 @@ #include #include #include +#include #include #include #include -#include +#include #include #include @@ -25,20 +26,65 @@ namespace hpx::components { + namespace detail { + + template + struct migration_support_data + { + migration_support_data() noexcept + : count_(1) + { + } + + migration_support_data(migration_support_data const&) = delete; + migration_support_data(migration_support_data&&) = delete; + migration_support_data& operator=( + migration_support_data const&) = delete; + migration_support_data& operator=( + migration_support_data&&) = delete; + + ~migration_support_data() + { + // make sure object is deleted only after all pin-counts have + // been given back + HPX_ASSERT(pin_count_ == ~0x0u || pin_count_ == 0); + } + + mutable Mutex mtx_; + std::uint32_t pin_count_ = 0; + + private: + friend void intrusive_ptr_add_ref( + migration_support_data* p) noexcept + { + ++p->count_; + } + friend void intrusive_ptr_release( + migration_support_data* p) noexcept + { + if (0 == --p->count_) + { + delete p; + } + } + + hpx::util::atomic_count count_; + }; + } // namespace detail + /// \endcond + /// This hook has to be inserted into the derivation chain of any component /// for it to support migration. template struct migration_support : BaseComponent { private: - using mutex_type = Mutex; using base_type = BaseComponent; using this_component_type = typename base_type::this_component_type; public: migration_support() noexcept - : pin_count_(0) - , was_marked_for_migration_(false) + : data_(new detail::migration_support_data(), false) { } @@ -47,20 +93,16 @@ namespace hpx::components { !std::is_same_v, migration_support>>> explicit migration_support(T&& t, Ts&&... ts) : base_type(HPX_FORWARD(T, t), HPX_FORWARD(Ts, ts)...) - , pin_count_(0) - , was_marked_for_migration_(false) + , data_(new detail::migration_support_data(), false) { } - ~migration_support() - { - // prevent base destructor from unregistering the gid if this - // instance has been migrated - if (pin_count_ == ~0x0u) - { - this->gid_ = naming::invalid_gid; - } - } + migration_support(migration_support const&) = default; + migration_support(migration_support&&) = default; + migration_support& operator=(migration_support const&) = default; + migration_support& operator=(migration_support&&) = default; + + ~migration_support() = default; naming::gid_type get_base_gid( naming::gid_type const& assign_gid = naming::invalid_gid) const @@ -78,7 +120,7 @@ namespace hpx::components { } // This component type supports migration. - static constexpr bool supports_migration() noexcept + [[nodiscard]] static constexpr bool supports_migration() noexcept { return true; } @@ -86,34 +128,70 @@ namespace hpx::components { // Pinning functionality void pin() noexcept { - std::lock_guard l(mtx_); - HPX_ASSERT(pin_count_ != ~0x0u); - if (pin_count_ != ~0x0u) + intrusive_ptr_add_ref(data_.get()); // keep alive + + std::unique_lock l(data_->mtx_); + + HPX_ASSERT_LOCKED(l, data_->pin_count_ != ~0x0u); + if (data_->pin_count_ != ~0x0u) { - ++pin_count_; + // there shouldn't be any pinning happening once the pin-count + // has gone to zero and has triggered a migration + HPX_ASSERT_LOCKED(l, + data_->pin_count_ != 0 || + (!started_migration_ && !was_marked_for_migration_)); + ++data_->pin_count_; } } + + private: + struct release_on_exit + { + explicit release_on_exit( + detail::migration_support_data* data) noexcept + : data_(data) + { + } + + release_on_exit(release_on_exit const&) = delete; + release_on_exit(release_on_exit&&) = delete; + release_on_exit& operator=(release_on_exit const&) = delete; + release_on_exit& operator=(release_on_exit&&) = delete; + + ~release_on_exit() + { + intrusive_ptr_release(data_); + } + + detail::migration_support_data* data_; + }; + + public: bool unpin() { + // pin() acquired an additional reference count that needs to be + // released after unpinning. + release_on_exit _(data_.get()); + { // no need to go through AGAS if the object is currently pinned // more than once - std::unique_lock l(this->mtx_); + std::unique_lock l(data_->mtx_); - if (pin_count_ != ~0x0u && pin_count_ > 1) + if (data_->pin_count_ != ~0x0u && data_->pin_count_ > 1) { - --pin_count_; + --data_->pin_count_; return false; } // no need to go through AGAS either if this object is not // currently being migrated (unpin will be called for each - // action run on this object) + // action that runs on this object) if (!was_marked_for_migration_) { - if (pin_count_ != ~0x0u) + if (data_->pin_count_ != ~0x0u) { - --pin_count_; + --data_->pin_count_; } return false; } @@ -123,27 +201,21 @@ namespace hpx::components { bool was_migrated = false; agas::mark_as_migrated( this->gid_, - [this, &was_migrated]() mutable - -> std::pair> { - std::unique_lock l(this->mtx_); + [this, &was_migrated]() -> std::pair> { + std::unique_lock l(data_->mtx_); - // avoid locking errors while handling asserts below - util::ignore_while_checking il(&l); - HPX_UNUSED(il); + was_migrated = data_->pin_count_ == ~0x0u; - was_migrated = this->pin_count_ == ~0x0u; - HPX_ASSERT(this->pin_count_ != 0); - if (this->pin_count_ != ~0x0u) + HPX_ASSERT_LOCKED(l, data_->pin_count_ != 0); + if (data_->pin_count_ != ~0x0u) { - if (--this->pin_count_ == 0) + if (--data_->pin_count_ == 0) { // trigger pending migration if this was the last // unpin and a migration operation is pending - HPX_ASSERT(trigger_migration_.valid()); + HPX_ASSERT_LOCKED(l, trigger_migration_.valid()); if (was_marked_for_migration_) { - was_marked_for_migration_ = false; - hpx::promise p; std::swap(p, trigger_migration_); @@ -163,22 +235,24 @@ namespace hpx::components { return was_migrated; } - std::uint32_t pin_count() const noexcept + [[nodiscard]] std::uint32_t pin_count() const noexcept { - std::lock_guard l(mtx_); - return pin_count_; + auto const data = data_; // keep alive + std::unique_lock l(data->mtx_); + + return data->pin_count_; } void mark_as_migrated() { - std::unique_lock l(mtx_); + auto const data = data_; // keep alive + std::unique_lock l(data->mtx_); - // avoid locking errors while handling asserts below - util::ignore_while_checking il(&l); - HPX_UNUSED(il); + HPX_ASSERT_LOCKED(l, 0 == data->pin_count_); + data->pin_count_ = ~0x0u; - HPX_ASSERT(1 == pin_count_); - - pin_count_ = ~0x0u; + // prevent base destructor from unregistering the gid if this + // instance was migrated + this->gid_ = naming::invalid_gid; } hpx::future mark_as_migrated(hpx::id_type const& to_migrate) @@ -188,7 +262,8 @@ namespace hpx::components { return agas::mark_as_migrated( to_migrate.get_gid(), [this]() mutable -> std::pair> { - std::unique_lock l(mtx_); + auto const data = data_; // keep alive + std::unique_lock l(data->mtx_); // make sure that no migration is currently in flight if (was_marked_for_migration_) @@ -202,9 +277,10 @@ namespace hpx::components { "migration operation is already in flight"))); } - if (1 == pin_count_) + if (1 == data->pin_count_) { // all is well, migration can be triggered now + started_migration_ = true; return std::make_pair(true, make_ready_future()); } @@ -218,6 +294,22 @@ namespace hpx::components { false); } + // This hook is invoked if a migration step is being cancelled + void unmark_as_migrated(hpx::id_type const& to_migrate) + { + // we need to first lock the AGAS migrated objects table, only then + // access (lock) the object + agas::unmark_as_migrated(to_migrate.get_gid(), [this] { + auto const data = data_; // keep alive + std::unique_lock l(data->mtx_); + + HPX_ASSERT_LOCKED(l, 0 == data->pin_count_); + + started_migration_ = false; + was_marked_for_migration_ = false; + }); + } + // This hook is invoked on the newly created object after the migration // has been finished static constexpr void on_migrated() noexcept {} @@ -265,9 +357,9 @@ namespace hpx::components { } private: - mutable mutex_type mtx_; - std::uint32_t pin_count_; + hpx::intrusive_ptr> data_; hpx::promise trigger_migration_; - bool was_marked_for_migration_; + bool started_migration_ = false; + bool was_marked_for_migration_ = false; }; } // namespace hpx::components diff --git a/libs/full/components_base/include/hpx/components_base/traits/component_pin_support.hpp b/libs/full/components_base/include/hpx/components_base/traits/component_pin_support.hpp index 5fa5a37269b3..855d18f3f545 100644 --- a/libs/full/components_base/include/hpx/components_base/traits/component_pin_support.hpp +++ b/libs/full/components_base/include/hpx/components_base/traits/component_pin_support.hpp @@ -11,7 +11,7 @@ #include -namespace hpx { namespace traits { +namespace hpx::traits { /////////////////////////////////////////////////////////////////////////// // Customization point for component pinning @@ -28,7 +28,7 @@ namespace hpx { namespace traits { static constexpr auto call(int, Component* p) noexcept -> decltype(p->pin()) { - p->pin(); + return p->pin(); } }; @@ -85,4 +85,4 @@ namespace hpx { namespace traits { return detail::pin_count_helper::call(0, p); } }; -}} // namespace hpx::traits +} // namespace hpx::traits diff --git a/libs/full/components_base/include/hpx/components_base/traits/component_supports_migration.hpp b/libs/full/components_base/include/hpx/components_base/traits/component_supports_migration.hpp index 5b66f336cebc..a0816bde6418 100644 --- a/libs/full/components_base/include/hpx/components_base/traits/component_supports_migration.hpp +++ b/libs/full/components_base/include/hpx/components_base/traits/component_supports_migration.hpp @@ -1,4 +1,4 @@ -// 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 @@ -6,17 +6,14 @@ #pragma once -#include #include -#include -#include - -namespace hpx { namespace traits { +namespace hpx::traits { /////////////////////////////////////////////////////////////////////////// // Customization point for component capabilities namespace detail { + struct supports_migration_helper { // by default we return 'false' (component does not support @@ -29,7 +26,7 @@ namespace hpx { namespace traits { // forward the call if the component implements the function template - static constexpr auto call(int) + static constexpr auto call(int) noexcept -> decltype(Component::supports_migration()) { return Component::supports_migration(); @@ -37,7 +34,7 @@ namespace hpx { namespace traits { }; template - constexpr bool call_supports_migration() + constexpr bool call_supports_migration() noexcept { return supports_migration_helper::template call(0); } @@ -47,9 +44,9 @@ namespace hpx { namespace traits { struct component_supports_migration { // returns whether target supports migration - static constexpr bool call() + static constexpr bool call() noexcept { return detail::call_supports_migration(); } }; -}} // namespace hpx::traits +} // namespace hpx::traits diff --git a/libs/full/components_base/src/address_ostream.cpp b/libs/full/components_base/src/address_ostream.cpp index eb5b1fe446a0..e0160f4bb3c3 100644 --- a/libs/full/components_base/src/address_ostream.cpp +++ b/libs/full/components_base/src/address_ostream.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020 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 @@ -7,11 +7,10 @@ #include #include #include -#include #include -namespace hpx { namespace naming { +namespace hpx::naming { // this is defined in this module as its implementation relies on // components::get_component_type_name() @@ -20,4 +19,4 @@ namespace hpx { namespace naming { return hpx::util::format_to(os, "({}:{}:{:#x})", addr.locality_, components::get_component_type_name(addr.type_), addr.address_); } -}} // namespace hpx::naming +} // namespace hpx::naming diff --git a/libs/full/components_base/src/agas_interface.cpp b/libs/full/components_base/src/agas_interface.cpp index 59201ba4f98e..1f9562ab3dff 100644 --- a/libs/full/components_base/src/agas_interface.cpp +++ b/libs/full/components_base/src/agas_interface.cpp @@ -25,7 +25,7 @@ #include #include -namespace hpx { namespace agas { +namespace hpx::agas { /////////////////////////////////////////////////////////////////////////// bool is_console() @@ -127,6 +127,16 @@ namespace hpx { namespace agas { return detail::is_local_address_cached_addr(gid, addr, ec); } + bool is_local_address_cached(naming::gid_type const& gid, + naming::address& addr, std::pair& r, + hpx::move_only_function( + naming::address const&)>&& f, + error_code& ec) + { + return detail::is_local_address_cached_addr_pinned_ptr( + gid, addr, r, HPX_MOVE(f), ec); + } + void update_cache_entry(naming::gid_type const& gid, naming::address const& addr, std::uint64_t count, std::uint64_t offset, error_code& ec) @@ -357,9 +367,10 @@ namespace hpx { namespace agas { return detail::was_object_migrated(gid, HPX_MOVE(f)); } - void unmark_as_migrated(naming::gid_type const& gid) + void unmark_as_migrated( + naming::gid_type const& gid, hpx::move_only_function&& f) { - return detail::unmark_as_migrated(gid); + return detail::unmark_as_migrated(gid, HPX_MOVE(f)); } hpx::future> find_symbols( @@ -420,4 +431,4 @@ namespace hpx { namespace agas { { return detail::get_runtime_support_lva(); } -}} // namespace hpx::agas +} // namespace hpx::agas diff --git a/libs/full/components_base/src/component_type.cpp b/libs/full/components_base/src/component_type.cpp index 6d3580f30070..17cca6e3b8b9 100644 --- a/libs/full/components_base/src/component_type.cpp +++ b/libs/full/components_base/src/component_type.cpp @@ -1,4 +1,4 @@ -// 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 @@ -14,7 +14,6 @@ #include #include -#include #include #include #include @@ -22,7 +21,7 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { +namespace hpx::components { namespace detail { @@ -155,7 +154,7 @@ namespace hpx { namespace components { } // namespace detail // Return the string representation for a given component type id - std::string const get_component_type_name(std::int32_t type) + std::string get_component_type_name(std::int32_t type) { std::string result; @@ -199,8 +198,8 @@ namespace hpx { namespace components { namespace detail { - component_type get_agas_component_type(const char* name, - const char* base_name, component_type base_type, bool enabled) + component_type get_agas_component_type(char const* name, + char const* base_name, component_type base_type, bool enabled) { component_type type = component_invalid; if (enabled) @@ -231,4 +230,4 @@ namespace hpx { namespace components { return type; } } // namespace detail -}} // namespace hpx::components +} // namespace hpx::components diff --git a/libs/full/components_base/src/detail/agas_interface_functions.cpp b/libs/full/components_base/src/detail/agas_interface_functions.cpp index f48f93263fe7..8aa6bb325079 100644 --- a/libs/full/components_base/src/detail/agas_interface_functions.cpp +++ b/libs/full/components_base/src/detail/agas_interface_functions.cpp @@ -95,6 +95,12 @@ namespace hpx::agas::detail { bool (*is_local_address_cached_addr)(naming::gid_type const& gid, naming::address& addr, error_code& ec) = nullptr; + bool (*is_local_address_cached_addr_pinned_ptr)(naming::gid_type const& gid, + naming::address& addr, std::pair& r, + hpx::move_only_function( + naming::address const&)>&& f, + error_code& ec) = nullptr; + void (*update_cache_entry)(naming::gid_type const& gid, naming::address const& addr, std::uint64_t count, std::uint64_t offset, error_code& ec) = nullptr; @@ -205,7 +211,8 @@ namespace hpx::agas::detail { naming::gid_type const& gid, hpx::move_only_function&& f) = nullptr; - void (*unmark_as_migrated)(naming::gid_type const& gid) = nullptr; + void (*unmark_as_migrated)(naming::gid_type const& gid, + hpx::move_only_function&& f) = nullptr; /////////////////////////////////////////////////////////////////////////// hpx::future> (*find_symbols_async)( diff --git a/libs/full/components_base/src/server/component_base.cpp b/libs/full/components_base/src/server/component_base.cpp index c3bab3b56718..d126233ed6c8 100644 --- a/libs/full/components_base/src/server/component_base.cpp +++ b/libs/full/components_base/src/server/component_base.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2015 Thomas Heller -// Copyright (c) 2018-2021 Hartmut Kaiser +// Copyright (c) 2018-2023 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -18,7 +18,7 @@ #include #include -namespace hpx { namespace components { namespace detail { +namespace hpx::components::detail { base_component::~base_component() { @@ -48,7 +48,7 @@ namespace hpx { namespace components { namespace detail { if (!agas::bind_gid_local(gid_, addr)) { - naming::gid_type g = gid_; + naming::gid_type const g = gid_; gid_ = naming::invalid_gid; // invalidate GID HPX_THROW_EXCEPTION(hpx::error::duplicate_component_address, @@ -65,7 +65,7 @@ namespace hpx { namespace components { namespace detail { if (!agas::bind( launch::sync, gid_, addr, agas::get_locality_id())) { - naming::gid_type g = gid_; + naming::gid_type const g = gid_; gid_ = naming::invalid_gid; // invalidate GID HPX_THROW_EXCEPTION(hpx::error::duplicate_component_address, @@ -112,7 +112,7 @@ namespace hpx { namespace components { namespace detail { } naming::detail::set_credit_for_gid( - gid_, std::int64_t(HPX_GLOBALCREDIT_INITIAL)); + gid_, static_cast(HPX_GLOBALCREDIT_INITIAL)); gid_ = naming::replace_component_type(gid_, addr.type_); gid_ = naming::replace_locality_id(gid_, agas::get_locality_id()); @@ -140,19 +140,18 @@ namespace hpx { namespace components { namespace detail { return gid; } - hpx::id_type base_component::get_id(naming::gid_type gid) const + hpx::id_type base_component::get_id(naming::gid_type gid) { // all credits should have been taken already HPX_ASSERT(!naming::detail::has_credits(gid)); // any (subsequent) invocation causes the credits to be replenished agas::replenish_credits(gid); - return hpx::id_type(gid, hpx::id_type::management_type::managed); + return {gid, hpx::id_type::management_type::managed}; } - hpx::id_type base_component::get_unmanaged_id( - naming::gid_type const& gid) const + hpx::id_type base_component::get_unmanaged_id(naming::gid_type const& gid) { - return hpx::id_type(gid, hpx::id_type::management_type::managed); + return {gid, hpx::id_type::management_type::managed}; } -}}} // namespace hpx::components::detail +} // namespace hpx::components::detail diff --git a/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp b/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp index 8e5dfb98c5bd..3e3e235fd64d 100644 --- a/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp +++ b/libs/full/parcelset/include/hpx/parcelset/parcelset_fwd.hpp @@ -32,7 +32,7 @@ namespace hpx::parcelset { namespace detail { struct create_parcel; - } + } // namespace detail //////////////////////////////////////////////////////////////////////// /// \brief Return boolean value when thread processing is completed. 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 0cd07d074cbe..94721b656f01 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 @@ -17,6 +17,8 @@ namespace hpx::parcelset { class HPX_EXPORT locality; class HPX_EXPORT parcel; + extern HPX_EXPORT parcel empty_parcel; + /// The type of a function that can be registered as a parcel write handler /// using the function \a hpx::set_parcel_write_handler. /// diff --git a/libs/full/parcelset_base/src/parcel_interface.cpp b/libs/full/parcelset_base/src/parcel_interface.cpp index 69c0998d58cf..f80f0e295d94 100644 --- a/libs/full/parcelset_base/src/parcel_interface.cpp +++ b/libs/full/parcelset_base/src/parcel_interface.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -29,6 +30,8 @@ namespace hpx::parcelset { + parcel empty_parcel; + bool parcel::is_valid() const { return data_ && data_->is_valid(); diff --git a/libs/full/performance_counters/include/hpx/performance_counters/server/base_performance_counter.hpp b/libs/full/performance_counters/include/hpx/performance_counters/server/base_performance_counter.hpp index ac4630b20793..4b5509d7fec2 100644 --- a/libs/full/performance_counters/include/hpx/performance_counters/server/base_performance_counter.hpp +++ b/libs/full/performance_counters/include/hpx/performance_counters/server/base_performance_counter.hpp @@ -48,7 +48,7 @@ namespace hpx { namespace performance_counters { namespace server { using base_type_holder = base_performance_counter; // finalize() will be called just before the instance gets destructed - constexpr void finalize() {} + static constexpr void finalize() noexcept {} static components::component_type get_component_type() noexcept { diff --git a/libs/full/runtime_components/tests/unit/components/migrate_component.cpp b/libs/full/runtime_components/tests/unit/components/migrate_component.cpp index 1e335d87b2ff..d3c0355df12b 100644 --- a/libs/full/runtime_components/tests/unit/components/migrate_component.cpp +++ b/libs/full/runtime_components/tests/unit/components/migrate_component.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2016 Hartmut Kaiser +// Copyright (c) 2014-2023 Hartmut Kaiser // Copyright (c) 2016 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 @@ -22,12 +22,14 @@ #include #include +constexpr std::size_t N = 50; + /////////////////////////////////////////////////////////////////////////////// struct dummy_server : hpx::components::component_base { dummy_server() = default; - hpx::id_type call() const + [[nodiscard]] hpx::id_type call() const { return hpx::find_here(); } @@ -35,19 +37,19 @@ struct dummy_server : hpx::components::component_base HPX_DEFINE_COMPONENT_ACTION(dummy_server, call) }; -typedef hpx::components::component dummy_server_type; +using dummy_server_type = hpx::components::component; HPX_REGISTER_COMPONENT(dummy_server_type, dummy_server) -typedef dummy_server::call_action dummy_action; +using dummy_action = dummy_server::call_action; HPX_REGISTER_ACTION(dummy_action) struct dummy_client : hpx::components::client_base { - typedef hpx::components::client_base base_type; + using base_type = hpx::components::client_base; dummy_client() = default; - dummy_client(hpx::id_type const& id) + explicit dummy_client(hpx::id_type const& id) : base_type(id) { } @@ -56,7 +58,7 @@ struct dummy_client : hpx::components::client_base { } - hpx::id_type call() const + [[nodiscard]] hpx::id_type call() const { return hpx::async(this->get_id()).get(); } @@ -67,90 +69,90 @@ struct test_server : hpx::components::migration_support< hpx::components::component_base> { - typedef hpx::components::migration_support< - hpx::components::component_base> - base_type; + using base_type = hpx::components::migration_support< + hpx::components::component_base>; - test_server(int data = 0) + explicit test_server(int data = 0) : data_(data) { } - ~test_server() {} + ~test_server() = default; - hpx::id_type call() const + [[nodiscard]] hpx::id_type call() const { - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); return hpx::find_here(); } void busy_work() const { - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); hpx::this_thread::sleep_for(std::chrono::seconds(1)); - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); } - hpx::future lazy_busy_work() const + [[nodiscard]] hpx::future lazy_busy_work() const { - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); auto f = hpx::make_ready_future_after(std::chrono::seconds(1)); return f.then([this](hpx::future&& f) -> void { - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); f.get(); - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); }); } - int get_data() const + [[nodiscard]] int get_data() const { - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); return data_; } - hpx::future lazy_get_data() const + [[nodiscard]] hpx::future lazy_get_data() const { - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); auto f = hpx::make_ready_future(data_); return f.then([this](hpx::future&& f) -> int { - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); - auto result = f.get(); - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); + auto const result = f.get(); + HPX_TEST_NEQ(pin_count(), static_cast(0)); return result; }); } - dummy_client lazy_get_client(hpx::id_type there) const + [[nodiscard]] dummy_client lazy_get_client(hpx::id_type const& there) const { - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); auto f = dummy_client(hpx::new_(there)); return f.then([this](dummy_client&& f) -> hpx::id_type { - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); auto result = f.get(); - HPX_TEST_NEQ(pin_count(), std::uint32_t(0)); + HPX_TEST_NEQ(pin_count(), static_cast(0)); return result; }); } - // Components which should be migrated using hpx::migrate<> need to - // be Serializable and CopyConstructable. Components can be - // MoveConstructable in which case the serialized data is moved into the - // component's constructor. + // Components that should be migrated using hpx::migrate<> need to be + // Serializable and CopyConstructable. Components can be MoveConstructable + // in which case the serialized data is moved into the component's + // constructor. test_server(test_server const& rhs) : base_type(rhs) , data_(rhs.data_) { } - test_server(test_server&& rhs) + test_server(test_server&& rhs) noexcept : base_type(std::move(rhs)) , data_(rhs.data_) { + rhs.data_ = 0; } test_server& operator=(test_server const& rhs) @@ -158,9 +160,10 @@ struct test_server data_ = rhs.data_; return *this; } - test_server& operator=(test_server&& rhs) + test_server& operator=(test_server&& rhs) noexcept { data_ = rhs.data_; + rhs.data_ = 0; return *this; } @@ -187,83 +190,84 @@ struct test_server int data_; }; -typedef hpx::components::component server_type; +using server_type = hpx::components::component; HPX_REGISTER_COMPONENT(server_type, test_server) -typedef test_server::call_action call_action; +using call_action = test_server::call_action; HPX_REGISTER_ACTION_DECLARATION(call_action) HPX_REGISTER_ACTION(call_action) -typedef test_server::busy_work_action busy_work_action; +using busy_work_action = test_server::busy_work_action; HPX_REGISTER_ACTION_DECLARATION(busy_work_action) HPX_REGISTER_ACTION(busy_work_action) -typedef test_server::lazy_busy_work_action lazy_busy_work_action; +using lazy_busy_work_action = test_server::lazy_busy_work_action; HPX_REGISTER_ACTION_DECLARATION(lazy_busy_work_action) HPX_REGISTER_ACTION(lazy_busy_work_action) -typedef test_server::get_data_action get_data_action; +using get_data_action = test_server::get_data_action; HPX_REGISTER_ACTION_DECLARATION(get_data_action) HPX_REGISTER_ACTION(get_data_action) -typedef test_server::lazy_get_data_action lazy_get_data_action; +using lazy_get_data_action = test_server::lazy_get_data_action; HPX_REGISTER_ACTION_DECLARATION(lazy_get_data_action) HPX_REGISTER_ACTION(lazy_get_data_action) -typedef test_server::lazy_get_client_action lazy_get_client_action; +using lazy_get_client_action = test_server::lazy_get_client_action; HPX_REGISTER_ACTION_DECLARATION(lazy_get_client_action) HPX_REGISTER_ACTION(lazy_get_client_action) struct test_client : hpx::components::client_base { - typedef hpx::components::client_base base_type; + using base_type = hpx::components::client_base; - test_client() {} + test_client() = default; test_client(hpx::shared_future const& id) : base_type(id) { } - test_client(hpx::id_type&& id) + explicit test_client(hpx::id_type&& id) : base_type(std::move(id)) { } - hpx::id_type call() const + [[nodiscard]] hpx::id_type call() const { return call_action()(this->get_id()); } - hpx::future busy_work() const + [[nodiscard]] hpx::future busy_work() const { return hpx::async(this->get_id()); } - hpx::future lazy_busy_work() const + [[nodiscard]] hpx::future lazy_busy_work() const { return hpx::async(this->get_id()); } - int get_data() const + [[nodiscard]] int get_data() const { return get_data_action()(this->get_id()); } - int lazy_get_data() const + [[nodiscard]] int lazy_get_data() const { return lazy_get_data_action()(this->get_id()).get(); } - dummy_client lazy_get_client(hpx::id_type there) const + [[nodiscard]] dummy_client lazy_get_client(hpx::id_type const& there) const { return lazy_get_client_action()(this->get_id(), there); } }; /////////////////////////////////////////////////////////////////////////////// -bool test_migrate_component(hpx::id_type source, hpx::id_type target) +bool test_migrate_component( + hpx::id_type const& source, hpx::id_type const& target) { // create component on given locality - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality @@ -273,7 +277,7 @@ bool test_migrate_component(hpx::id_type source, hpx::id_type target) try { // migrate t1 to the target - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); // wait for migration to be done HPX_TEST_NEQ(hpx::invalid_id, t2.get_id()); @@ -294,10 +298,11 @@ bool test_migrate_component(hpx::id_type source, hpx::id_type target) return true; } -bool test_migrate_lazy_component(hpx::id_type source, hpx::id_type target) +bool test_migrate_lazy_component( + hpx::id_type const& source, hpx::id_type const& target) { // create component on given locality - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality @@ -307,7 +312,7 @@ bool test_migrate_lazy_component(hpx::id_type source, hpx::id_type target) try { // migrate t1 to the target - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); // wait for migration to be done HPX_TEST_NEQ(hpx::invalid_id, t2.get_id()); @@ -329,10 +334,10 @@ bool test_migrate_lazy_component(hpx::id_type source, hpx::id_type target) } bool test_migrate_lazy_component_client( - hpx::id_type source, hpx::id_type target) + hpx::id_type const& source, hpx::id_type const& target) { // create component on given locality - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality @@ -342,7 +347,7 @@ bool test_migrate_lazy_component_client( try { // migrate t1 to the target - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); // wait for migration to be done HPX_TEST_NEQ(hpx::invalid_id, t2.get_id()); @@ -364,10 +369,11 @@ bool test_migrate_lazy_component_client( } /////////////////////////////////////////////////////////////////////////////// -bool test_migrate_busy_component(hpx::id_type source, hpx::id_type target) +bool test_migrate_busy_component( + hpx::id_type const& source, hpx::id_type const& target) { // create component on given locality - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality @@ -375,12 +381,12 @@ bool test_migrate_busy_component(hpx::id_type source, hpx::id_type target) HPX_TEST_EQ(t1.get_data(), 42); // add some concurrent busy work - hpx::future busy_work = t1.busy_work(); + hpx::future const busy_work = t1.busy_work(); try { // migrate t1 to the target - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); HPX_TEST_EQ(t1.get_data(), 42); @@ -407,10 +413,11 @@ bool test_migrate_busy_component(hpx::id_type source, hpx::id_type target) } /////////////////////////////////////////////////////////////////////////////// -bool test_migrate_lazy_busy_component(hpx::id_type source, hpx::id_type target) +bool test_migrate_lazy_busy_component( + hpx::id_type const& source, hpx::id_type const& target) { // create component on given locality - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality @@ -418,12 +425,12 @@ bool test_migrate_lazy_busy_component(hpx::id_type source, hpx::id_type target) HPX_TEST_EQ(t1.lazy_get_data(), 42); // add some concurrent busy work - hpx::future lazy_busy_work = t1.lazy_busy_work(); + hpx::future const lazy_busy_work = t1.lazy_busy_work(); try { // migrate t1 to the target - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); HPX_TEST_EQ(t1.lazy_get_data(), 42); @@ -450,10 +457,10 @@ bool test_migrate_lazy_busy_component(hpx::id_type source, hpx::id_type target) } bool test_migrate_lazy_busy_component_client( - hpx::id_type source, hpx::id_type target) + hpx::id_type const& source, hpx::id_type const& target) { // create component on given locality - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality @@ -461,12 +468,12 @@ bool test_migrate_lazy_busy_component_client( HPX_TEST_EQ(t1.lazy_get_client(target).call(), target); // add some concurrent busy work - hpx::future lazy_busy_work = t1.lazy_busy_work(); + hpx::future const lazy_busy_work = t1.lazy_busy_work(); try { // migrate t1 to the target - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); HPX_TEST_EQ(t1.lazy_get_client(target).call(), target); @@ -495,15 +502,13 @@ bool test_migrate_lazy_busy_component_client( //////////////////////////////////////////////////////////////////////////////// bool test_migrate_component2(hpx::id_type source, hpx::id_type target) { - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality HPX_TEST_EQ(t1.call(), source); HPX_TEST_EQ(t1.get_data(), 42); - std::size_t N = 100; - try { // migrate an object back and forth between 2 localities a couple of @@ -511,7 +516,7 @@ bool test_migrate_component2(hpx::id_type source, hpx::id_type target) for (std::size_t i = 0; i < N; ++i) { // migrate t1 to the target (loc2) - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); HPX_TEST_EQ(t1.get_data(), 42); @@ -543,15 +548,13 @@ bool test_migrate_component2(hpx::id_type source, hpx::id_type target) bool test_migrate_lazy_component2(hpx::id_type source, hpx::id_type target) { - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality HPX_TEST_EQ(t1.call(), source); HPX_TEST_EQ(t1.lazy_get_data(), 42); - std::size_t N = 100; - try { // migrate an object back and forth between 2 localities a couple of @@ -559,7 +562,7 @@ bool test_migrate_lazy_component2(hpx::id_type source, hpx::id_type target) for (std::size_t i = 0; i < N; ++i) { // migrate t1 to the target (loc2) - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); HPX_TEST_EQ(t1.lazy_get_data(), 42); @@ -592,15 +595,13 @@ bool test_migrate_lazy_component2(hpx::id_type source, hpx::id_type target) bool test_migrate_lazy_component_client2( hpx::id_type source, hpx::id_type target) { - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality HPX_TEST_EQ(t1.call(), source); HPX_TEST_EQ(t1.lazy_get_client(target).call(), target); - std::size_t N = 100; - try { // migrate an object back and forth between 2 localities a couple of @@ -608,7 +609,7 @@ bool test_migrate_lazy_component_client2( for (std::size_t i = 0; i < N; ++i) { // migrate t1 to the target (loc2) - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); HPX_TEST_EQ(t1.lazy_get_client(target).call(), target); @@ -641,23 +642,21 @@ bool test_migrate_lazy_component_client2( bool test_migrate_busy_component2(hpx::id_type source, hpx::id_type target) { - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality HPX_TEST_EQ(t1.call(), source); HPX_TEST_EQ(t1.get_data(), 42); - std::size_t N = 100; - // First, spawn a thread (locally) that will migrate the object between // source and target a few times hpx::future migrate_future = - hpx::async([source, target, t1, N]() mutable { + hpx::async([source, target, t1]() mutable { for (std::size_t i = 0; i < N; ++i) { // migrate t1 to the target (loc2) - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); HPX_TEST_EQ(t1.get_data(), 42); @@ -679,9 +678,9 @@ bool test_migrate_busy_component2(hpx::id_type source, hpx::id_type target) hpx::cout << std::endl; }); - // Second, we generate tons of work which should automatically follow + // Second, we generate tons of work that should automatically follow // the migration. - hpx::future create_work = hpx::async([t1, N]() { + hpx::future create_work = hpx::async([t1]() { for (std::size_t i = 0; i < 2 * N; ++i) { hpx::cout << hpx::naming::get_locality_id_from_id(t1.call()) @@ -711,23 +710,21 @@ bool test_migrate_busy_component2(hpx::id_type source, hpx::id_type target) bool test_migrate_lazy_busy_component2(hpx::id_type source, hpx::id_type target) { - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality HPX_TEST_EQ(t1.call(), source); HPX_TEST_EQ(t1.get_data(), 42); - std::size_t N = 100; - // First, spawn a thread (locally) that will migrate the object between // source and target a few times hpx::future migrate_future = - hpx::async([source, target, t1, N]() mutable { + hpx::async([source, target, t1]() mutable { for (std::size_t i = 0; i < N; ++i) { // migrate t1 to the target (loc2) - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); HPX_TEST_EQ(t1.lazy_get_data(), 42); @@ -749,9 +746,9 @@ bool test_migrate_lazy_busy_component2(hpx::id_type source, hpx::id_type target) hpx::cout << std::endl; }); - // Second, we generate tons of work which should automatically follow + // Second, we generate tons of work that should automatically follow // the migration. - hpx::future create_work = hpx::async([t1, N]() { + hpx::future create_work = hpx::async([t1]() { for (std::size_t i = 0; i < 2 * N; ++i) { hpx::cout << hpx::naming::get_locality_id_from_id(t1.call()) @@ -782,23 +779,21 @@ bool test_migrate_lazy_busy_component2(hpx::id_type source, hpx::id_type target) bool test_migrate_lazy_busy_component_client2( hpx::id_type source, hpx::id_type target) { - test_client t1 = hpx::new_(source, 42); + test_client const t1 = hpx::new_(source, 42); HPX_TEST_NEQ(hpx::invalid_id, t1.get_id()); // the new object should live on the source locality HPX_TEST_EQ(t1.call(), source); HPX_TEST_EQ(t1.get_data(), 42); - std::size_t N = 100; - // First, spawn a thread (locally) that will migrate the object between // source and target a few times hpx::future migrate_future = - hpx::async([source, target, t1, N]() mutable { + hpx::async([source, target, t1]() mutable { for (std::size_t i = 0; i < N; ++i) { // migrate t1 to the target (loc2) - test_client t2(hpx::components::migrate(t1, target)); + test_client const t2(hpx::components::migrate(t1, target)); HPX_TEST_EQ(t1.lazy_get_client(target).call(), target); @@ -820,9 +815,9 @@ bool test_migrate_lazy_busy_component_client2( hpx::cout << std::endl; }); - // Second, we generate tons of work which should automatically follow + // Second, we generate tons of work that should automatically follow // the migration. - hpx::future create_work = hpx::async([t1, N, target]() { + hpx::future create_work = hpx::async([t1, target]() { for (std::size_t i = 0; i < 2 * N; ++i) { hpx::cout << hpx::naming::get_locality_id_from_id(t1.call()) @@ -853,7 +848,7 @@ bool test_migrate_lazy_busy_component_client2( /////////////////////////////////////////////////////////////////////////////// int main() { - std::vector localities = hpx::find_all_localities(); + std::vector const localities = hpx::find_all_localities(); for (hpx::id_type const& id : localities) { diff --git a/libs/full/runtime_components/tests/unit/components/migrate_polymorphic_component.cpp b/libs/full/runtime_components/tests/unit/components/migrate_polymorphic_component.cpp index 2a8c6d834e3e..2018ced9e62b 100644 --- a/libs/full/runtime_components/tests/unit/components/migrate_polymorphic_component.cpp +++ b/libs/full/runtime_components/tests/unit/components/migrate_polymorphic_component.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2019 Maximilian Bremer -// Copyright (c) 2019 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 @@ -22,6 +22,8 @@ #include #include +constexpr std::size_t N = 50; + /////////////////////////////////////////////////////////////////////////////// struct test_server_base : hpx::components::abstract_base_migration_support< @@ -211,13 +213,13 @@ struct test_server // be Serializable and CopyConstructable. Components can be // MoveConstructable in which case the serialized data is moved into the // component's constructor. - test_server(test_server&& rhs) + test_server(test_server&& rhs) noexcept : base_type(std::move(rhs)) , data_(rhs.data_) { } - test_server& operator=(test_server&& rhs) + test_server& operator=(test_server&& rhs) noexcept { this->test_server_base::operator=( std::move(static_cast(rhs))); @@ -488,8 +490,6 @@ bool test_migrate_polymorphic_component2( HPX_TEST_EQ(t1.get_data(), 42); HPX_TEST_EQ(t1.get_base_data(), 7); - std::size_t N = 100; - try { // migrate an object back and forth between 2 localities a couple of @@ -540,8 +540,6 @@ bool test_migrate_lazy_polymorphic_component2( HPX_TEST_EQ(t1.lazy_get_data(), 42); HPX_TEST_EQ(t1.lazy_get_base_data(), 7); - std::size_t N = 100; - try { // migrate an object back and forth between 2 localities a couple of @@ -593,12 +591,10 @@ bool test_migrate_busy_polymorphic_component2( HPX_TEST_EQ(t1.get_data(), 42); HPX_TEST_EQ(t1.get_base_data(), 7); - std::size_t N = 100; - // First, spawn a thread (locally) that will migrate the object between // source and target a few times - hpx::future migrate_future = hpx::async([source, target, t1, - N]() mutable { + hpx::future migrate_future = hpx::async([source, target, + t1]() mutable { for (std::size_t i = 0; i < N; ++i) { // migrate t1 to the target (loc2) @@ -628,7 +624,7 @@ bool test_migrate_busy_polymorphic_component2( // Second, we generate tons of work which should automatically follow // the migration. - hpx::future create_work = hpx::async([t1, N]() { + hpx::future create_work = hpx::async([t1]() { for (std::size_t i = 0; i < 2 * N; ++i) { hpx::cout << hpx::naming::get_locality_id_from_id(t1.call()) @@ -666,12 +662,10 @@ bool test_migrate_lazy_busy_polymorphic_component2( HPX_TEST_EQ(t1.get_data(), 42); HPX_TEST_EQ(t1.get_base_data(), 7); - std::size_t N = 100; - // First, spawn a thread (locally) that will migrate the object between // source and target a few times - hpx::future migrate_future = hpx::async([source, target, t1, - N]() mutable { + hpx::future migrate_future = hpx::async([source, target, + t1]() mutable { for (std::size_t i = 0; i < N; ++i) { // migrate t1 to the target (loc2) @@ -701,7 +695,7 @@ bool test_migrate_lazy_busy_polymorphic_component2( // Second, we generate tons of work which should automatically follow // the migration. - hpx::future create_work = hpx::async([t1, N]() { + hpx::future create_work = hpx::async([t1]() { for (std::size_t i = 0; i < 2 * N; ++i) { hpx::cout << hpx::naming::get_locality_id_from_id(t1.call()) @@ -731,7 +725,7 @@ bool test_migrate_lazy_busy_polymorphic_component2( /////////////////////////////////////////////////////////////////////////////// int main() { - std::vector localities = hpx::find_remote_localities(); + std::vector const localities = hpx::find_remote_localities(); for (hpx::id_type const& id : localities) { diff --git a/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/migrate_component.hpp b/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/migrate_component.hpp index 2ba553e19e3e..8f1035d7b929 100644 --- a/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/migrate_component.hpp +++ b/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/migrate_component.hpp @@ -1,4 +1,4 @@ -// 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 @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -20,7 +19,7 @@ #include #include -namespace hpx { namespace components { namespace server { +namespace hpx::components::server { /////////////////////////////////////////////////////////////////////////// // @@ -52,7 +51,7 @@ namespace hpx { namespace components { namespace server { // a) It will delay the start of the migration operation until no more // actions (threads) are pending or currently running for the object // to be migrated (the object is unpinned). - // b) It marks the object which is about to be migrated as 'was + // b) It marks the object that is about to be migrated as 'was // migrated'. This information is stored in the AGAS client side // representation on locality B. It is used to forward all incoming // parcels to the object's new locality. It is also used to force any @@ -62,15 +61,15 @@ namespace hpx { namespace components { namespace server { // c) It will trigger the actual migration operation (see step 2). // // In order to keep track of any pending and currently running actions - // (threads) for the object to migrate, any thread which is being + // (threads) for the object to migrate, any thread that is being // scheduled will pin the object. The object will be unpinned only once // the scheduled thread has executed to completion. Any last unpinning // of the object will release any possibly pending migration operations // (see step 1a). // // 2) The migration is triggered by invoking the action - // `trigger_migration_component_action` on the locality which is - // responsible for managing the address resolution for the object which + // `trigger_migration_component_action` on the locality that is + // responsible for managing the address resolution for the object that // has to be migrated (locality D). // // The action `trigger_migration_component_action` performs 3 steps: @@ -114,6 +113,7 @@ namespace hpx { namespace components { namespace server { // This will be executed on the locality where the object lives which is // to be migrated namespace detail { + // trigger the actual migration template future migrate_component_postproc( @@ -122,11 +122,11 @@ namespace hpx { namespace components { namespace server { { using components::stubs::runtime_support; - std::uint32_t pin_count = ptr->pin_count(); + std::uint32_t const pin_count = ptr->pin_count(); if (pin_count == ~0x0u) { - agas::unmark_as_migrated(to_migrate.get_gid()); + ptr->unmark_as_migrated(to_migrate); return hpx::make_exceptional_future( HPX_GET_EXCEPTION(hpx::error::invalid_status, @@ -135,9 +135,9 @@ namespace hpx { namespace components { namespace server { "that was already migrated")); } - if (pin_count > 1) + if (pin_count != 0) { - agas::unmark_as_migrated(to_migrate.get_gid()); + ptr->unmark_as_migrated(to_migrate); return hpx::make_exceptional_future( HPX_GET_EXCEPTION(hpx::error::migration_needs_retry, @@ -152,7 +152,7 @@ namespace hpx { namespace components { namespace server { ptr->mark_as_migrated(); if (f.has_exception()) { - agas::unmark_as_migrated(to_migrate.get_gid()); + ptr->unmark_as_migrated(to_migrate); } return f.get(); }); @@ -163,17 +163,21 @@ namespace hpx { namespace components { namespace server { future migrate_component(id_type const& to_migrate, naming::address const& addr, DistPolicy const& policy) { + // retrieve pointer to object (must be local) + // NOTE: this does not pin the object + std::shared_ptr ptr = + hpx::detail::get_ptr_for_migration(addr, to_migrate); + // 'migration' to same locality as before is a no-op if (policy.get_next_target() == hpx::find_here()) { - agas::unmark_as_migrated(to_migrate.get_gid()); + ptr->unmark_as_migrated(to_migrate); return make_ready_future(to_migrate); } - if (!traits::component_supports_migration::call()) + if constexpr (!traits::component_supports_migration::call()) { - agas::unmark_as_migrated(to_migrate.get_gid()); - + ptr->unmark_as_migrated(to_migrate); return hpx::make_exceptional_future( HPX_GET_EXCEPTION(hpx::error::invalid_status, "hpx::components::server::migrate_component", @@ -181,10 +185,6 @@ namespace hpx { namespace components { namespace server { "does not support migration")); } - // retrieve pointer to object (must be local) - std::shared_ptr ptr = - hpx::detail::get_ptr_for_migration(addr, to_migrate); - // perform actual migration by sending data over to target locality return detail::migrate_component_postproc( ptr, to_migrate, policy); @@ -209,7 +209,7 @@ namespace hpx { namespace components { namespace server { DistPolicy const& policy, hpx::id_type const& id, naming::address const& addr) { - if (!traits::component_supports_migration::call()) + if constexpr (!traits::component_supports_migration::call()) { return hpx::make_exceptional_future( HPX_GET_EXCEPTION(hpx::error::invalid_status, @@ -228,19 +228,19 @@ namespace hpx { namespace components { namespace server { } // perform actual object migration - typedef migrate_component_action action_type; + using action_type = migrate_component_action; - // force unwrapping outer future - future f = async(id, to_migrate, addr, policy); + // force unwrapping of the outer future + future f = async(action_type(), id, to_migrate, addr, policy); return f.then( - launch::sync, [=](future&& f) -> future { + launch::sync, [=](future&& fut) -> future { agas::end_migration(to_migrate); - if (f.has_exception()) + if (fut.has_exception()) { try { - f.get(); // rethrow exception + fut.get(); // rethrow exception } catch (hpx::exception const& e) { @@ -259,7 +259,7 @@ namespace hpx { namespace components { namespace server { throw; } } - return HPX_MOVE(f); + return HPX_MOVE(fut); }); } @@ -282,7 +282,7 @@ namespace hpx { namespace components { namespace server { future perform_migrate_component( id_type const& to_migrate, DistPolicy const& policy) { - if (!traits::component_supports_migration::call()) + if constexpr (!traits::component_supports_migration::call()) { return hpx::make_exceptional_future( HPX_GET_EXCEPTION(hpx::error::invalid_status, @@ -291,59 +291,60 @@ namespace hpx { namespace components { namespace server { "does not support migration")); } + auto start_migration_op = + [=](future>&& f) -> future { + std::shared_ptr ptr = f.get(); + + using bm_result = std::pair; + + auto begin_migration_op = + [ptr = HPX_MOVE(ptr), to_migrate, policy]( + hpx::future&& bmf) mutable -> future { + auto r = bmf.get(); // propagate exceptions + + // Delay the start of the migration operation until no more + // actions (threads) are pending or currently running for the + // given object (until the object is unpinned). + future trigger_migration = + ptr->mark_as_migrated(to_migrate); + + // Unpin the object, will trigger migration if this is the only + // pin-count. + ptr.reset(); + + // Once the migration is possible (object is not pinned anymore + // trigger the necessary actions) + auto migration_op = [=](future&& f) -> future { + // end migration operation in case of error + if (f.has_exception()) + { + agas::end_migration(to_migrate); + } + + f.get(); // rethrow exception + + // now trigger 2nd step of migration + using action_type = + trigger_migrate_component_action; + + return async(action_type(), + naming::get_locality_from_id(to_migrate), to_migrate, + policy, r.first, r.second); + }; + + // run on separate thread + return trigger_migration.then( + launch::async, HPX_MOVE(migration_op)); + }; + + // mark object in AGAS as being migrated first + return agas::begin_migration(to_migrate) + .then(launch::sync, HPX_MOVE(begin_migration_op)); + }; + // retrieve pointer to object (must be local) return hpx::get_ptr(to_migrate) - .then(launch::sync, - [=](future>&& f) -> future { - std::shared_ptr ptr = f.get(); - - using bm_result = std::pair; - - // mark object in AGAS as being migrated first - return agas::begin_migration(to_migrate) - .then(launch::sync, - [ptr = HPX_MOVE(ptr), to_migrate, policy]( - hpx::future&& bmf) mutable - -> future { - auto r = bmf.get(); // propagate exceptions - - // Delay the start of the migration operation until no - // more actions (threads) are pending or currently - // running for the given object (until the object is - // unpinned). - future trigger_migration = - ptr->mark_as_migrated(to_migrate); - - // Unpin the object, will trigger migration if this is - // the only pin-count. - ptr = std::shared_ptr{}; - - // Once the migration is possible (object is not pinned - // anymore trigger the necessary actions) - return trigger_migration.then( - launch::async, // run on separate thread - [=](future&& f) -> future { - // end migration operation in case of error - if (f.has_exception()) - { - agas::end_migration(to_migrate); - } - - f.get(); // rethrow exception - - // now trigger 2nd step of migration - typedef trigger_migrate_component_action< - Component, DistPolicy> - action_type; - - return async( - naming::get_locality_from_id( - to_migrate), - to_migrate, policy, r.first, - r.second); - }); - }); - }); + .then(launch::sync, HPX_MOVE(start_migration_op)); } template @@ -354,4 +355,4 @@ namespace hpx { namespace components { namespace server { perform_migrate_component_action> { }; -}}} // namespace hpx::components::server +} // namespace hpx::components::server diff --git a/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/runtime_support.hpp b/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/runtime_support.hpp index 9cc9a58d88fd..1c11d40039ba 100644 --- a/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/runtime_support.hpp +++ b/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/runtime_support.hpp @@ -526,14 +526,14 @@ namespace hpx::components::server { "successfully migrated component {} of type: {} to locality: {}", id, components::get_component_type_name(type), find_here()); - // inform the newly created component that it has been migrated - new_instance->on_migrated(); - // At this point the object has been fully migrated. We now remove // the object from the AGAS table of migrated objects. This is // necessary as this object might have been migrated off this locality // before it was migrated back. - agas::unmark_as_migrated(id); + agas::unmark_as_migrated(id, [&] { + // inform the newly created component that it has been migrated + new_instance->on_migrated(); + }); to_migrate.make_unmanaged(); diff --git a/libs/full/runtime_distributed/src/stubs/runtime_support_stubs.cpp b/libs/full/runtime_distributed/src/stubs/runtime_support_stubs.cpp index 47e8ac7ce2a0..bd752703169e 100644 --- a/libs/full/runtime_distributed/src/stubs/runtime_support_stubs.cpp +++ b/libs/full/runtime_distributed/src/stubs/runtime_support_stubs.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include From d0376683c71e6971656f1d1cfc1f044cf70714bc Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Thu, 15 Jun 2023 08:51:27 -0500 Subject: [PATCH 30/72] Making sure the future's shared state doesn't go out of scope prematurely --- .../hpx/futures/detail/future_data.hpp | 63 ++++++++++++------- libs/core/futures/src/future_data.cpp | 37 +++++++---- 2 files changed, 65 insertions(+), 35 deletions(-) diff --git a/libs/core/futures/include/hpx/futures/detail/future_data.hpp b/libs/core/futures/include/hpx/futures/detail/future_data.hpp index 39bd00b5023d..32fd7747c4a8 100644 --- a/libs/core/futures/include/hpx/futures/detail/future_data.hpp +++ b/libs/core/futures/include/hpx/futures/detail/future_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 @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -22,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -33,7 +31,6 @@ #include #include #include -#include #include #include @@ -242,7 +239,12 @@ namespace hpx::lcos::detail { using result_type = util::unused_type; using init_no_addref = future_data_refcnt_base::init_no_addref; - virtual ~future_data_base(); + future_data_base(future_data_base const&) = delete; + future_data_base(future_data_base&&) = delete; + future_data_base& operator=(future_data_base const&) = delete; + future_data_base& operator=(future_data_base&&) = delete; + + ~future_data_base() override; enum state { @@ -319,6 +321,7 @@ namespace hpx::lcos::detail { protected: mutable mutex_type mtx_; std::atomic state_; // current state + completed_callback_vector_type on_completed_; local::detail::condition_variable cond_; // threads waiting in read }; @@ -375,7 +378,7 @@ namespace hpx::lcos::detail { future_data_base(init_no_addref no_addref, std::in_place_t, Ts&&... ts) : base_type(no_addref) { - result_type* value_ptr = reinterpret_cast(&storage_); + auto* value_ptr = reinterpret_cast(&storage_); construct(value_ptr, HPX_FORWARD(Ts, ts)...); state_.store(value, std::memory_order_relaxed); } @@ -384,12 +387,17 @@ namespace hpx::lcos::detail { init_no_addref no_addref, std::exception_ptr e) noexcept : base_type(no_addref) { - std::exception_ptr* exception_ptr = + auto* exception_ptr = reinterpret_cast(&storage_); hpx::construct_at(exception_ptr, HPX_MOVE(e)); state_.store(exception, std::memory_order_relaxed); } + future_data_base(future_data_base const&) = delete; + future_data_base(future_data_base&&) = delete; + future_data_base& operator=(future_data_base const&) = delete; + future_data_base& operator=(future_data_base&&) = delete; + ~future_data_base() noexcept override { reset(); @@ -430,6 +438,8 @@ namespace hpx::lcos::detail { template void set_value(Ts&&... ts) { + hpx::intrusive_ptr this_(this); // keep alive + // Note: it is safe to access the data store as no other thread // should access it concurrently. There shouldn't be any // threads attempting to read the value as the state is still @@ -437,7 +447,7 @@ namespace hpx::lcos::detail { // attempting to set the value by definition. // set the data - result_type* value_ptr = reinterpret_cast(&storage_); + auto* value_ptr = reinterpret_cast(&storage_); construct(value_ptr, HPX_FORWARD(Ts, ts)...); // At this point the lock needs to be acquired to safely access the @@ -460,7 +470,6 @@ namespace hpx::lcos::detail { HPX_THROW_EXCEPTION(hpx::error::promise_already_satisfied, "future_data_base::set_value", "data has already been set for this future"); - return; } // 26111: Caller failing to release lock 'this->mtx_' @@ -501,6 +510,8 @@ namespace hpx::lcos::detail { void set_exception(std::exception_ptr data) override { + hpx::intrusive_ptr this_(this); // keep alive + // Note: it is safe to access the data store as no other thread // should access it concurrently. There shouldn't be any // threads attempting to read the value as the state is still @@ -508,7 +519,7 @@ namespace hpx::lcos::detail { // attempting to set the value by definition. // set the data - std::exception_ptr* exception_ptr = + auto* exception_ptr = reinterpret_cast(&storage_); hpx::construct_at(exception_ptr, HPX_MOVE(data)); @@ -532,7 +543,6 @@ namespace hpx::lcos::detail { HPX_THROW_EXCEPTION(hpx::error::promise_already_satisfied, "future_data_base::set_exception", "data has already been set for this future"); - return; } // 26111: Caller failing to release lock 'this->mtx_' @@ -620,14 +630,13 @@ namespace hpx::lcos::detail { { case value: { - result_type* value_ptr = - reinterpret_cast(&storage_); + auto* value_ptr = reinterpret_cast(&storage_); std::destroy_at(value_ptr); break; } case exception: { - std::exception_ptr* exception_ptr = + auto* exception_ptr = reinterpret_cast(&storage_); std::destroy_at(exception_ptr); break; @@ -684,6 +693,11 @@ namespace hpx::lcos::detail { { } + future_data(future_data const&) = delete; + future_data(future_data&&) = delete; + future_data& operator=(future_data const&) = delete; + future_data& operator=(future_data&&) = delete; + ~future_data() noexcept override = default; }; @@ -775,7 +789,8 @@ namespace hpx::lcos::detail { threads::thread_schedule_hint(), threads::thread_stacksize::current, threads::thread_schedule_state::suspended, true); - threads::thread_id_ref_type id = threads::register_thread(data, ec); + threads::thread_id_ref_type const id = + threads::register_thread(data, ec); if (ec) { // thread creation failed, report error to the new future @@ -893,7 +908,6 @@ namespace hpx::lcos::detail { HPX_THROW_EXCEPTION(hpx::error::task_already_started, "task_base::check_started", "this task has already been started"); - return; } started_ = true; } @@ -1010,6 +1024,9 @@ namespace hpx::lcos::detail { void cancel() override { + hpx::intrusive_ptr this_( + this); // keep alive + std::unique_lock l(mtx_); hpx::detail::try_catch_exception_ptr( [&]() { @@ -1056,13 +1073,11 @@ namespace hpx::lcos::detail { }; } // namespace hpx::lcos::detail -namespace hpx::traits::detail { - - template - struct shared_state_allocator, Allocator> - { - using type = lcos::detail::future_data_allocator; - }; -} // namespace hpx::traits::detail +template +struct hpx::traits::detail::shared_state_allocator< + hpx::lcos::detail::future_data, Allocator> +{ + using type = hpx::lcos::detail::future_data_allocator; +}; #include diff --git a/libs/core/futures/src/future_data.cpp b/libs/core/futures/src/future_data.cpp index a0d0591dd64a..220e337d2020 100644 --- a/libs/core/futures/src/future_data.cpp +++ b/libs/core/futures/src/future_data.cpp @@ -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 @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -44,6 +43,16 @@ namespace hpx::lcos::detail { { ++count_; } + + handle_continuation_recursion_count( + handle_continuation_recursion_count const&) = delete; + handle_continuation_recursion_count( + handle_continuation_recursion_count&&) = delete; + handle_continuation_recursion_count& operator=( + handle_continuation_recursion_count const&) = delete; + handle_continuation_recursion_count& operator=( + handle_continuation_recursion_count&&) = delete; + ~handle_continuation_recursion_count() { --count_; @@ -58,7 +67,7 @@ namespace hpx::lcos::detail { { lcos::local::futures_factory p(HPX_FORWARD(Callback, f)); - bool is_hpx_thread = nullptr != hpx::threads::get_self_ptr(); + bool const is_hpx_thread = nullptr != hpx::threads::get_self_ptr(); hpx::launch policy = launch::fork; if (!is_hpx_thread) { @@ -69,7 +78,7 @@ namespace hpx::lcos::detail { policy.set_stacksize(threads::thread_stacksize::current); // launch a new thread executing the given function - threads::thread_id_ref_type tid = //-V821 + threads::thread_id_ref_type const tid = //-V821 p.post("run_on_completed_on_new_thread", policy); // wait for the task to run @@ -135,7 +144,7 @@ namespace hpx::lcos::detail { // and promise::set_exception). if (s == exception) { - std::exception_ptr const* exception_ptr = + auto const* exception_ptr = static_cast(storage); // an error has been reported in the meantime, throw or set @@ -145,10 +154,8 @@ namespace hpx::lcos::detail { std::rethrow_exception(*exception_ptr); // never reached } - else - { - ec = make_error_code(*exception_ptr); - } + + ec = make_error_code(*exception_ptr); } return nullptr; @@ -199,7 +206,7 @@ namespace hpx::lcos::detail { bool recurse_asynchronously = !this_thread::has_sufficient_stack_space(); #else - handle_continuation_recursion_count cnt; + handle_continuation_recursion_count const cnt; bool recurse_asynchronously = cnt.count_ > HPX_CONTINUATION_MAX_RECURSION_DEPTH || (hpx::threads::get_self_ptr() == nullptr); @@ -215,8 +222,10 @@ namespace hpx::lcos::detail { hpx::detail::try_catch_exception_ptr( [&]() { - constexpr void (*p)(Callback &&) noexcept = + // clang-format off + constexpr void (*p)(Callback&&) noexcept = &future_data_base::run_on_completed; + // clang-format on run_on_completed_on_new_thread(util::deferred_call( p, HPX_FORWARD(Callback, on_completed))); }, @@ -260,6 +269,8 @@ namespace hpx::lcos::detail { } else { + hpx::intrusive_ptr this_(this); // keep alive + std::unique_lock l(mtx_); if (is_ready()) { @@ -282,6 +293,8 @@ namespace hpx::lcos::detail { state s = state_.load(std::memory_order_acquire); if (s == empty) { + hpx::intrusive_ptr this_(this); // keep alive + std::unique_lock l(mtx_); s = state_.load(std::memory_order_relaxed); if (s == empty) @@ -311,6 +324,8 @@ namespace hpx::lcos::detail { // block if this entry is empty if (state_.load(std::memory_order_acquire) == empty) { + hpx::intrusive_ptr this_(this); // keep alive + std::unique_lock l(mtx_); if (state_.load(std::memory_order_relaxed) == empty) { From 2a2b801a9fbce01459920244ecb30209a56cc015 Mon Sep 17 00:00:00 2001 From: dimitraka Date: Thu, 25 May 2023 22:58:40 +0200 Subject: [PATCH 31/72] Add migration guide to manual --- docs/sphinx/manual.rst | 1 + docs/sphinx/manual/migration_guide.rst | 256 +++++++++++++++++++++++++ 2 files changed, 257 insertions(+) create mode 100644 docs/sphinx/manual/migration_guide.rst diff --git a/docs/sphinx/manual.rst b/docs/sphinx/manual.rst index e4c67b1d6ad8..256456efd864 100644 --- a/docs/sphinx/manual.rst +++ b/docs/sphinx/manual.rst @@ -21,6 +21,7 @@ information on how to build and use |hpx| in different scenarios. manual/getting_hpx manual/building_hpx manual/cmake_variables + manual/migration_guide manual/building_tests_examples manual/creating_hpx_projects manual/starting_the_hpx_runtime diff --git a/docs/sphinx/manual/migration_guide.rst b/docs/sphinx/manual/migration_guide.rst new file mode 100644 index 000000000000..8f5e0014023a --- /dev/null +++ b/docs/sphinx/manual/migration_guide.rst @@ -0,0 +1,256 @@ +.. + Copyright (c) 2021 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) + +.. _migration_guide: + +=============== +Migration guide +=============== + +The Migration Guide serves as a valuable resource for developers seeking to transition their +parallel computing applications from different APIs (i.e. |openmp|) to |hpx|. |hpx|, an advanced C++ +library, offers a versatile and high-performance platform for parallel and distributed computing, +providing a wide range of features and capabilities. This guide aims to assist developers in +understanding the key differences between different APIs and |hpx|, and it provides step-by-step +instructions for converting code to |hpx| code effectively. + +Some general steps that can be used to migrate code to |hpx| code are the following: + +1. Install |hpx| using the :ref:`quickstart` guide. + +2. Include the |hpx| header files: + + Add the necessary header files for HPX at the beginning of your code, such as: + + .. code-block:: c++ + + #include + +3. Replace your code with |hpx| code using the guide that follows. + +4. Use HPX-specific features and APIs: + + |hpx| provides additional features and APIs that can be used to take advantage of the library's + capabilities. For example, you can use the HPX asynchronous execution to express fine-grained + tasks and dependencies, or utilize HPX's distributed computing features for distributed memory systems. + +5. Compile and run the |hpx| code: + + Compile the converted code with the |hpx| library and run it using the appropriate HPX runtime environment. + +|openmp| +======== + +The |openmp| API supports multi-platform shared-memory parallel programming in C/C++. Typically it is used for +loop-level parallelism, but it also supports function-level parallelism. Below are some examples on how to +convert |openmp| to |hpx| code: + +|openmp| parallel for loop +-------------------------- + +Parallel for loop +^^^^^^^^^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + #pragma omp parallel for + for (int i = 0; i < n; ++i) { + // loop body + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + + hpx::experimental::for_loop(hpx::execution::par, 0, n, [&](int i) { + // loop body + }); + + +In the above code, the |openmp| `#pragma omp parallel for` directive is replaced with +`hpx::experimental::for_loop` from the |hpx| library. The loop body within the lambda +function will be executed in parallel for each iteration. + +Private variables +^^^^^^^^^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + int x = 0; + + #pragma omp parallel for private(x) + for (int i = 0; i < n; ++i) { + // loop body + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + + hpx::experimental::for_loop(hpx::execution::par, 0, n, [&](int i) { + int x = 0; // Declare 'x' as a local variable inside the loop body + // loop body + }); + +The variable `x` is declared as a local variable inside the loop body, ensuring that +it is private to each thread. + + +Shared variables +^^^^^^^^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + int x = 0; + + #pragma omp parallel for shared(x) + for (int i = 0; i < n; ++i) { + // loop body + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + + std::atomic x = 0; // Declare 'x' as a shared variable outside the loop + + hpx::experimental::for_loop(hpx::execution::par, 0, n, [&](int i) { + // loop body + }); + +To ensure variable `x` is shared among all threads, you simply have to declare it as an +atomic variable outside the `for_loop`. + +Number of threads +^^^^^^^^^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + #pragma omp parallel for num_threads(2) + for (int i = 0; i < n; ++i) { + // loop body + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + #include + + hpx::execution::experimental::num_cores nc(2); + + hpx::experimental::for_loop(hpx::execution::par.with(nc), 0, n, [&](int i) { + // loop body + }); + + +To declare the number of threads to be used for the parallel region, you can use +`hpx::execution::experimental::num_cores` and pass the number of cores (`nc`) to the `for_loop` +using `hpx::execution::par.with(nc)`. This example uses 2 threads for the parallel loop. + +Reduction +^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + int s = 0; + + #pragma omp parallel for reduction(+: s) + for (int i = 0; i < n; ++i) { + s += i; + // loop body + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + #include + + int s = 0; + + hpx::experimental::for_loop(hpx::execution::par, 0, n, reduction(s, 0, plus<>()), [&](int i, int accum) { + accum += i; + // loop body + }); + + +The reduction clause specifies that the variable `s`` should be reduced across iterations using the `plus<>`` operation. +It initializes `s` to `0` at the beginning of the loop and accumulates the values of `s` from each iteration using the +`+` operator. The lambda function representing the loop body takes two parameters: `i`, which represents the loop index, +and `accum`, which is the reduction variable `s`. The lambda function is executed for each iteration of the loop. +The reduction ensures that the `accum` value is correctly accumulated across different iterations and threads. + +Schedule +^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + int s = 0; + + // static scheduling with chunk size 1000 + #pragma omp parallel for schedule(static, 1000) + for (int i = 0; i < n; ++i) { + // loop body + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + #include + + hpx::execution::experimental::static_chunk_size cs(1000); + + hpx::experimental::for_loop(hpx::execution::par.with(cs), 0, n, [&](int i) { + // loop body + }); + +To define the scheduling type, you can use the corresponding execution policy from +`hpx::execution::experimental`, define the chunk size (cs, here declared as 1000) and pass +it to the `for_loop` using `hpx::execution::par.with(cs)`. + +Accordingly, other types of scheduling are available and can be used in a similar manner: + +.. code-block:: c++ + + #include + hpx::execution::experimental::dynamic_chunk_size cs(1000); + +.. code-block:: c++ + + #include + hpx::execution::experimental::guided_chunk_size cs(1000); + +.. code-block:: c++ + + #include + hpx::execution::experimental::auto_chunk_size cs(1000); + + + From f4a33091cbe5ae92606784ad658a4704ebe8aa10 Mon Sep 17 00:00:00 2001 From: dimitraka Date: Thu, 1 Jun 2023 22:38:15 +0200 Subject: [PATCH 32/72] Add openmp tasks migration guide --- docs/sphinx/manual/migration_guide.rst | 400 ++++++++++++++++++++++++- docs/sphinx/quickstart.rst | 21 +- 2 files changed, 414 insertions(+), 7 deletions(-) diff --git a/docs/sphinx/manual/migration_guide.rst b/docs/sphinx/manual/migration_guide.rst index 8f5e0014023a..5e02a3409301 100644 --- a/docs/sphinx/manual/migration_guide.rst +++ b/docs/sphinx/manual/migration_guide.rst @@ -191,7 +191,7 @@ Reduction int s = 0; - hpx::experimental::for_loop(hpx::execution::par, 0, n, reduction(s, 0, plus<>()), [&](int i, int accum) { + hpx::experimental::for_loop(hpx::execution::par, 0, n, reduction(s, 0, plus<>()), [&](int i, int& accum) { accum += i; // loop body }); @@ -253,4 +253,402 @@ Accordingly, other types of scheduling are available and can be used in a simila hpx::execution::experimental::auto_chunk_size cs(1000); +|openmp| single thread +---------------------- +|openmp| code: + +.. code-block:: c++ + + { // parallel code + #pragma omp single + { + // single-threaded code + } + // more parallel code + } + +|hpx| equivalent: + +.. code-block:: c++ + + hpx::mutex mtx; + + { // parallel code + { // single-threaded code + std::scoped_lock l(mtx); + } + // more parallel code + } + +To make sure that only one thread accesses a specific code within a parallel section +you can use `hpx::mutex` and `std::scoped_lock` to take ownership of the given mutex `mtx`. +For more information about mutexes please refer to :ref:`mutex`. + +|openmp| tasks +-------------- + +Simple tasks +^^^^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + // executed asynchronously by any available thread + #pragma omp task + { + // task code + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + + auto future = hpx::async([](){ + // task code + }); + +or + +.. code-block:: c++ + + #include + + hpx::post([](){ + // task code + }); // fire and forget + +The tasks in |hpx| can be defined simply by using the `async` function and passing as argument +the code you wish to run asynchronously. Another alternative is to use `post` which is a +fire-and-forget method. + +.. note:: + + If you think you will like to synchronize your tasks later on, we suggest you use + `hpx::async` which provides synchronization options, while `hpx::post` explicitly states + that there is no return value or way to synchronize with the function execution. + Synchronization options are listed below. + +Task wait +^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + #pragma omp task + { + // task code + } + + #pragma omp taskwait + // code after completion of task + +|hpx| equivalent: + +.. code-block:: c++ + + #include + + hpx::async([](){ + // task code + }).get(); // wait for the task to complete + + // code after completion of task + +The `get()` function can be used to ensure that the task created with `hpx::async` +is completed before the code continues executing beyond that point. + +Multiple tasks synchronization +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + #pragma omp task + { + // task 1 code + } + + #pragma omp task + { + // task 2 code + } + + #pragma omp taskwait + // code after completion of both tasks 1 and 2 + +|hpx| equivalent: + +.. code-block:: c++ + + #include + + auto future1 = hpx::async([](){ + // task 1 code + }); + + auto future2 = hpx::async([](){ + // task 2 code + }); + + auto future = hpx::when_all(future1, future2).then([](auto&&){ + // code after completion of both tasks 1 and 2 + }); + + +If you would like to synchronize multiple tasks, you can use the `hpx::when_all` function +to define which futures have to be ready and the `then()` function to declare what should +be executed once these futures are ready. + + +Dependencies +^^^^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + int a = 10; + int b = 20; + int c = 0; + + #pragma omp task depend(in: a, b) depend(out: c) + { + // task code + c = 100; + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + #include + + int a = 10; + int b = 20; + int c = 0; + + // Create a future representing 'a' + auto future_a = hpx::make_ready_future(a); + + // Create a future representing 'b' + auto future_b = hpx::make_ready_future(b); + + // Create a task that depends on 'a' and 'b' and executes 'task_code' + auto future_c = hpx::dataflow([](){ + // task code + return 100; + }, + future_a, + future_b); + + c = future_c.get(); + +If one of the arguments of `hpx::dataflow` is a future, then it will wait for the +future to be ready to launch the thread. Hence, to define the dependencies of tasks +you have to create futures representing the variables that create dependencies and pass +them as arguments to `hpx::dataflow`. `get()` is used to save the result of the future +to the desired variable. + + +Nested tasks +^^^^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + #pragma omp task + { + // Outer task code + #pragma omp task + { + // Inner task code + } + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + + auto future_outer = hpx::async([](){ + // Outer task code + + hpx::async([](){ + // Inner task code + }); + }); + +or + +.. code-block:: c++ + + #include + + auto future_outer = hpx::post([](){ // fire and forget + // Outer task code + + hpx::post([](){ // fire and forget + // Inner task code + }); + }); + +If you have nested tasks, you can simply use nested `hpx::async` or `hpx::post` calls. +The implementation is similar if you want to take care of synchronization: + +|openmp| code: + +.. code-block:: c++ + + #pragma omp taskwait + { + // Outer task code + #pragma omp taskwait + { + // Inner task code + } + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + + auto future_outer = hpx::async([](){ + // Outer task code + + hpx::async([](){ + // Inner task code + }).get(); // Wait for the inner task to complete + }); + + future_outer.get(); // Wait for the outer task to complete + + +Task yield +^^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + #pragma omp task + { + // code before yielding + #pragma omp taskyield + // code after yielding + } + +|hpx| equivalent: + +.. code-block:: c++ + + #include + #include + + auto future = hpx::async([](){ + // code before yielding + }); + + // yield execution to potentially allow other tasks to run + hpx::this_thread::yield(); + + // code after yielding + +After creating a task using `hpx::async`, `hpx::this_thread::yield()` can be used to +reschedule the execution of threads, allowing other threads to run. + +Task group +^^^^^^^^^^ + +|openmp| code: + +.. code-block:: c++ + + #pragma omp taskgroup + { + #pragma omp task + { + // task 1 code + } + + #pragma omp task + { + // task 2 code + } + } + + +|hpx| equivalent: + +.. code-block:: c++ + + #include + + // Declare a task group + hpx::experimental::task_group tg; + + // Run the tasks + tg.run([](){ + // task 1 code + }); + tg.run( + // task 2 code + }); + + // Wait for the task group + tg.wait(); + +To create task groups, you can use `hpx::experimental::task_group`. The function +`run()` can be used to run each task within the task group, while `wait()` can be used to +achieve synchronization. If you do not care about waiting for the task group to complete +its execution, you can simply remove the `wait()` function. + +|openmp| sections +----------------- + +|openmp| code: + +.. code-block:: c++ + + #pragma omp sections + { + #pragma omp section + // section 1 code + #pragma omp section + // section 2 code + } // implicit synchronization + + +|hpx| equivalent: + +.. code-block:: c++ + + #include + + auto future_section1 = hpx::async([](){ + // section 1 code + }); + auto future_section2 = hpx::async([](){ + // section 2 code + ); + + // synchronization: wait for both sections to complete + hpx::wait_all(future_section1, future_section2); + +Unlike tasks, there is an implicit synchronization barrier at the end of each `sections`` +directive in |openmp|. This synchronization is achieved using `hpx::wait_all` function. + +.. note:: + + If the `nowait` clause is used in the `sections` directive, then you can just remove + the `hpx::wait_all` function while keeping the rest of the code as it is. diff --git a/docs/sphinx/quickstart.rst b/docs/sphinx/quickstart.rst index 912107b3ab9f..17ec0141e4c4 100644 --- a/docs/sphinx/quickstart.rst +++ b/docs/sphinx/quickstart.rst @@ -11,8 +11,13 @@ Quick start =========== -The following steps will help you get started with |hpx|. +The following steps will help you get started with |hpx|. After :ref:`installing_hpx`, you +can check how to run a simple example :ref:`hello_world`. :ref:`writing_task_based_applications` +explains how you can get started with |hpx|. You can refer to our :ref:`migration_guide` if you use +other APIs for parallelism (like |openmp|, |mpi| or |tbb|) and you would like to convert your code to +|hpx| code. +.. _installing_hpx: Installing |hpx| ================ @@ -57,6 +62,8 @@ More information or alternatives regarding the installation can be found in the :ref:`building_hpx`, a detailed guide with thorough explanation of ways to build and use |hpx|. +.. _hello_world: + Hello, World! ============= @@ -94,15 +101,15 @@ Then, in your project directory run the following: Hello World! The program looks almost like a regular C++ hello world with the exception of -the two includes and ``hpx::cout``. +the two includes and ``hpx::cout``. * When you include ``hpx_main.hpp`` |hpx| makes sure that ``main`` actually gets launched on the |hpx| runtime. So while it looks almost the same you can now use futures, ``async``, parallel algorithms and more which make use of the |hpx| - runtime with lightweight threads. + runtime with lightweight threads. -* ``hpx::cout`` is a replacement for ``std::cout`` to make sure printing never blocks - a lightweight thread. You can read more about ``hpx::cout`` in :ref:`iostreams`. +* ``hpx::cout`` is a replacement for ``std::cout`` to make sure printing never blocks + a lightweight thread. You can read more about ``hpx::cout`` in :ref:`iostreams`. .. note:: @@ -118,7 +125,7 @@ the two includes and ``hpx::cout``. functionality in our application. * You do not have to let |hpx| take over your main function like in the - example. See :ref:`starting_hpx` for more details on how to initialize and run + example. See :ref:`starting_hpx` for more details on how to initialize and run the |hpx| runtime. .. caution:: @@ -130,6 +137,8 @@ the two includes and ``hpx::cout``. confusing compile time errors mentioning ``user_main`` or even runtime errors. +.. _writing_task_based_applications: + Writing task-based applications =============================== From b598287d1b5c28e4589aec6fa37165c638460203 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Thu, 15 Jun 2023 10:36:54 -0500 Subject: [PATCH 33/72] Re-expose error names --- libs/core/errors/include/hpx/errors/error.hpp | 3 +++ libs/core/errors/src/error_code.cpp | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libs/core/errors/include/hpx/errors/error.hpp b/libs/core/errors/include/hpx/errors/error.hpp index 7bc900582d07..16b62c7f1b9a 100644 --- a/libs/core/errors/include/hpx/errors/error.hpp +++ b/libs/core/errors/include/hpx/errors/error.hpp @@ -328,6 +328,9 @@ namespace hpx { #undef HPX_ERROR_UNSCOPED_ENUM_DEPRECATION_MSG + // Return a textual representation of a given error code + HPX_CORE_EXPORT char const* get_error_name(error e) noexcept; + } // namespace hpx /// \cond NOEXTERNAL diff --git a/libs/core/errors/src/error_code.cpp b/libs/core/errors/src/error_code.cpp index 8fa79c0b5094..709bcfc1762d 100644 --- a/libs/core/errors/src/error_code.cpp +++ b/libs/core/errors/src/error_code.cpp @@ -79,6 +79,20 @@ namespace hpx { /* */ ""}; /// \endcond + // Return a textual representation of a given error code + char const* get_error_name(error value) noexcept + { + if (value >= hpx::error::success && value < hpx::error::last_error) + { + return error_names[static_cast(value)]; + } + if (value & hpx::error::system_error_flag) + { + return "system_error"; + } + return "unknown"; + } + namespace detail { class hpx_category : public std::error_category @@ -99,7 +113,7 @@ namespace hpx { } if (value & hpx::error::system_error_flag) { - return std::string("HPX(system_error)"); + return "HPX(system_error)"; } return "HPX(unknown_error)"; } From 2c38814526fd38c1a1466bc9c745d5cbebc543db Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Fri, 16 Jun 2023 08:14:57 -0500 Subject: [PATCH 34/72] Creating directory for file copy --- cmake/HPX_AddModule.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/HPX_AddModule.cmake b/cmake/HPX_AddModule.cmake index 02657dd136db..b9bef074f0d6 100644 --- a/cmake/HPX_AddModule.cmake +++ b/cmake/HPX_AddModule.cmake @@ -166,8 +166,9 @@ function(add_hpx_module libname modulename) set(generated_file_base "${CMAKE_CURRENT_BINARY_DIR}/include") if(NOT HPX_WITH_DISTRIBUTED_RUNTIME) foreach(file_to_generate ${${modulename}_GENERATED_HEADERS}) - file(COPY_FILE include/${file_to_generate}.in - ${generated_file_base}/${file_to_generate} ONLY_IF_DIFFERENT + configure_file( + ${HEADER_ROOT}/${file_to_generate}.in + ${generated_file_base}/${file_to_generate} COPYONLY ) set(generated_headers ${generated_headers} ${generated_file_base}/${file_to_generate} From 442e60ae3cddcc7d9197abfd2c9e99f9af934655 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Fri, 16 Jun 2023 20:53:58 -0500 Subject: [PATCH 35/72] Consistently #include unistd.h for _POSIX_VERSION --- .../src/command_line_handling_local.cpp | 4 ++++ .../src/parse_command_line_local.cpp | 4 ++++ .../include/hpx/coroutines/detail/context_impl.hpp | 4 ++++ libs/core/coroutines/src/detail/context_posix.cpp | 4 ++++ libs/core/topology/src/topology.cpp | 8 ++++---- 5 files changed, 20 insertions(+), 4 deletions(-) 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 956e099dca2e..71f286d596d5 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 @@ -35,6 +35,10 @@ #include #include +#if defined(HPX_HAVE_UNISTD_H) +#include +#endif + namespace hpx::local::detail { std::string runtime_configuration_string(command_line_handling const& cfg) 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 77fe05bf2027..5550801bd84e 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 @@ -17,6 +17,10 @@ #include #include +#if defined(HPX_HAVE_UNISTD_H) +#include +#endif + /////////////////////////////////////////////////////////////////////////////// namespace hpx::local::detail { diff --git a/libs/core/coroutines/include/hpx/coroutines/detail/context_impl.hpp b/libs/core/coroutines/include/hpx/coroutines/detail/context_impl.hpp index 71076b329113..8171d148e287 100644 --- a/libs/core/coroutines/include/hpx/coroutines/detail/context_impl.hpp +++ b/libs/core/coroutines/include/hpx/coroutines/detail/context_impl.hpp @@ -35,6 +35,10 @@ #include +#if defined(HPX_HAVE_UNISTD_H) +#include +#endif + /* ContextImpl concept documentation. A ContextImpl holds a context plus its stack. diff --git a/libs/core/coroutines/src/detail/context_posix.cpp b/libs/core/coroutines/src/detail/context_posix.cpp index 60c10e90bf76..ff10a688b6b1 100644 --- a/libs/core/coroutines/src/detail/context_posix.cpp +++ b/libs/core/coroutines/src/detail/context_posix.cpp @@ -7,6 +7,10 @@ #include #include +#if defined(HPX_HAVE_UNISTD_H) +#include +#endif + // The preprocessor conditions below are kept in sync with those used in // context_impl.hpp diff --git a/libs/core/topology/src/topology.cpp b/libs/core/topology/src/topology.cpp index ba734c52c0ac..9ecf3b59e5c8 100644 --- a/libs/core/topology/src/topology.cpp +++ b/libs/core/topology/src/topology.cpp @@ -43,15 +43,15 @@ #include #endif +#if defined(HPX_HAVE_UNISTD_H) +#include +#endif + #if defined(_POSIX_VERSION) #include #include #endif -#if defined(HPX_HAVE_UNISTD_H) -#include -#endif - namespace hpx::threads::detail { std::size_t hwloc_hardware_concurrency() noexcept From 79cb710a304174e7c1fc639dad5fcba3cf82462c Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 19 Jun 2023 13:00:48 -0500 Subject: [PATCH 36/72] Update release notes --- docs/sphinx/quickstart.rst | 2 +- docs/sphinx/releases/whats_new_1_9_1.rst | 52 +++++++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/docs/sphinx/quickstart.rst b/docs/sphinx/quickstart.rst index 17ec0141e4c4..c689c7309fcb 100644 --- a/docs/sphinx/quickstart.rst +++ b/docs/sphinx/quickstart.rst @@ -73,7 +73,7 @@ build an executable using |cmake| and |hpx|: .. code-block:: cmake - cmake_minimum_required(VERSION 3.18) + cmake_minimum_required(VERSION 3.19) project(my_hpx_project CXX) find_package(HPX REQUIRED) add_executable(my_hpx_program main.cpp) diff --git a/docs/sphinx/releases/whats_new_1_9_1.rst b/docs/sphinx/releases/whats_new_1_9_1.rst index a0379f4d25c2..1ce207212654 100644 --- a/docs/sphinx/releases/whats_new_1_9_1.rst +++ b/docs/sphinx/releases/whats_new_1_9_1.rst @@ -18,7 +18,21 @@ This point release fixes a couple of problems reported for the V1.9.0 release. Most importantly, we fixed various occasional hanging during startup and shutdown in distributed scenarios. We also added support for zero-copy serialization on the receiving side to the TCP, MPI, and LCI parcelports. Last but not least, we -have added support for Visual Studio 2019 and gcc using MINGW on Windows. +have added support for Visual Studio 2019 and gcc using MINGW on Windows, and +also support for gcc V13 and clang V15. + +HPX headers are now made consistently named the same as their standard library +counterparts, e.g. `#include ` now corresponds to `#include `. +This significantly simplifies porting existing standards conforming codes to HPX. + +A lot of work has been done to improve and optimize our network communication +layers. Primary focus of this work was on the LCI parcelport, but we have also +cleaned up and improved the MPI parcelport. + +Additionally, we have continued working on our documentation. The main focus +here was on completing the API documentation of the most important API functions. +We have started adding migration guides for people interested in moving their +codes away from other, commonplace parallelization frameworks like OpenMP. Breaking changes @@ -29,7 +43,43 @@ None Closed issues ============= +* :hpx-issue:`6155` - hpxcxx and hpxrun.py do not work if HPX_WITH_TESTS=OFF +* :hpx-issue:`6164` - HPX_WITH_DATAPAR_BACKEND=EVE causes compile errors with C++17 +* :hpx-issue:`6175` - Make sure all our parallel algorithms accept the predicates by value +* :hpx-issue:`6194` - tests.regressions.threads.threads_all_1422 failed at Perlmutter +* :hpx-issue:`6198` - set_intersection/set_difference fails when run with execution::par +* :hpx-issue:`6214` - Broken Links to the Documentation page in readme.rst +* :hpx-issue:`6217` - hpx::make_heap does not terminate when exPolicy is par (or par_unseq) and size of vector is 4 +* :hpx-issue:`6246` - HPX fails to compile under cxx 20 (fresh system) +* :hpx-issue:`6247` - HPX 1.9.0 does not compile with GCC on Windows +* :hpx-issue:`6282` - The "attach-debugger" option is broken on the current master branch. + Closed pull requests ==================== +* :hpx-pr:`6219` - Cleaning up #includes in hpx/ folder +* :hpx-pr:`6223` - Move documentation from README.rst to index.rst files under libs directory +* :hpx-pr:`6229` - Adding zero-copy support on the receiving end of the TCP and MPI parcel ports +* :hpx-pr:`6231` - Remove deprecated email from release procedure +* :hpx-pr:`6235` - Modernize more modules (levels 12-16) +* :hpx-pr:`6236` - Attempt to resolve occasional shutdown hangs in distributed operation +* :hpx-pr:`6239` - Fix Optimizing HPX applications page of Manual +* :hpx-pr:`6241` - LCI parcelport: Refactor, add more variants, zero copy receives. +* :hpx-pr:`6242` - updated deprecated headers +* :hpx-pr:`6243` - Adding github action builders using VS2019 +* :hpx-pr:`6248` - Fix CUDA/HIP Jenkins pipelines +* :hpx-pr:`6250` - Resolve gcc problems on Windows +* :hpx-pr:`6251` - Attempting to fix problems in barrier causing hangs +* :hpx-pr:`6253` - Modernize set_thread_name on Windows +* :hpx-pr:`6256` - Fix nvcc/gcc-10 (Octo-Tiger) compilation issue +* :hpx-pr:`6257` - Cmake Tests: Delete operator check for size_t arg +* :hpx-pr:`6258` - Rewriting wait_some to circumvent data races causing hangs +* :hpx-pr:`6260` - Add migration guide to manual +* :hpx-pr:`6262` - Fixing wrong command line options in local command line handling +* :hpx-pr:`6266` - Attempt to resolve occasional hang in run_loop +* :hpx-pr:`6267` - Attempting to fix migration tests +* :hpx-pr:`6278` - Making sure the future's shared state doesn't go out of scope prematurely +* :hpx-pr:`6279` - Re-expose error names +* :hpx-pr:`6281` - Creating directory for file copy +* :hpx-pr:`6283` - Consistently #include unistd.h for _POSIX_VERSION From 92e782d037dfd9ca3b14c37d3c9138fe5e6764c8 Mon Sep 17 00:00:00 2001 From: Alireza Kheirkhahan Date: Wed, 14 Jun 2023 08:51:10 -0500 Subject: [PATCH 37/72] add llvm/15, gcc/13 and boost/1.82 to jenkins # Conflicts: # .jenkins/lsu/Jenkinsfile --- .jenkins/lsu/Jenkinsfile | 3 +- .jenkins/lsu/env-clang-15.sh | 36 ++++++++++++++++++++ .jenkins/lsu/env-gcc-13.sh | 31 +++++++++++++++++ .jenkins/lsu/slurm-configuration-clang-15.sh | 8 +++++ .jenkins/lsu/slurm-configuration-gcc-13.sh | 8 +++++ 5 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 .jenkins/lsu/env-clang-15.sh create mode 100644 .jenkins/lsu/env-gcc-13.sh create mode 100644 .jenkins/lsu/slurm-configuration-clang-15.sh create mode 100644 .jenkins/lsu/slurm-configuration-gcc-13.sh diff --git a/.jenkins/lsu/Jenkinsfile b/.jenkins/lsu/Jenkinsfile index 3ef8428caf16..ad8517829d7d 100644 --- a/.jenkins/lsu/Jenkinsfile +++ b/.jenkins/lsu/Jenkinsfile @@ -35,7 +35,8 @@ pipeline { axes { axis { name 'configuration_name' - values 'gcc-9', 'gcc-10', 'gcc-11', 'gcc-12', 'clang-11', 'clang-12', 'clang-13', 'clang-14', 'gcc-10-cuda-11', 'hipcc' + values 'gcc-9', 'gcc-10', 'gcc-11', 'gcc-12', 'clang-11', 'clang-12', 'clang-13', 'clang-14', 'gcc-10-cuda-11', 'gcc-12-cuda-12-dgx', 'hipcc' + values 'gcc-10', 'gcc-11', 'gcc-12', 'gcc-13', 'clang-12', 'clang-13', 'clang-14', 'clang-15', 'gcc-10-cuda-11', 'gcc-12-cuda-12-dgx', 'hipcc' } axis { name 'build_type' diff --git a/.jenkins/lsu/env-clang-15.sh b/.jenkins/lsu/env-clang-15.sh new file mode 100644 index 000000000000..a18f45524e26 --- /dev/null +++ b/.jenkins/lsu/env-clang-15.sh @@ -0,0 +1,36 @@ +# 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) + +module purge +module load cmake +module load llvm/15 +module load boost/1.82.0-${build_type,,} +module load hwloc +module load openmpi +module load pwrapi/1.1.1 + +export HPXRUN_RUNWRAPPER=srun +export CXX_STD="20" + +configure_extra_options+=" -DCMAKE_BUILD_TYPE=${build_type}" +configure_extra_options+=" -DHPX_WITH_CXX_STANDARD=${CXX_STD}" +configure_extra_options+=" -DHPX_WITH_MALLOC=system" +configure_extra_options+=" -DHPX_WITH_FETCH_ASIO=ON" +configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS=ON" +configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON" +configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON" +configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON" +configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON" +configure_extra_options+=" -DHPX_WITH_LOGGING=OFF" +configure_extra_options+=" -DHPX_WITH_DATAPAR_BACKEND=EVE" +configure_extra_options+=" -DHPX_WITH_FETCH_EVE=ON" + +# The pwrapi library still needs to be set up properly on rostam +# configure_extra_options+=" -DHPX_WITH_POWER_COUNTER=ON" + +# Make sure HWLOC does not report 'cores'. This is purely an option to enable +# testing the topology code under conditions close to those on FreeBSD. +configure_extra_options+=" -DHPX_TOPOLOGY_WITH_ADDITIONAL_HWLOC_TESTING=ON" diff --git a/.jenkins/lsu/env-gcc-13.sh b/.jenkins/lsu/env-gcc-13.sh new file mode 100644 index 000000000000..e49b301c5cc0 --- /dev/null +++ b/.jenkins/lsu/env-gcc-13.sh @@ -0,0 +1,31 @@ +# 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) + +module purge +module load cmake +module load gcc/13 +module load boost/1.82.0-${build_type,,} +module load hwloc +module load openmpi +module load pwrapi/1.1.1 + +export HPXRUN_RUNWRAPPER=srun +export CXX_STD="20" + +configure_extra_options+=" -DHPX_WITH_CXX_STANDARD=${CXX_STD}" +configure_extra_options+=" -DHPX_WITH_MALLOC=system" +configure_extra_options+=" -DHPX_WITH_FETCH_ASIO=ON" +configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS=ON" +configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON" +configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON" +configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON" +configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON" +configure_extra_options+=" -DHPX_WITH_DATAPAR_BACKEND=EVE" +configure_extra_options+=" -DHPX_WITH_FETCH_EVE=ON" +configure_extra_options+=" -DHPX_WITH_EVE_TAG=main" + +# The pwrapi library still needs to be set up properly on rostam +# configure_extra_options+=" -DHPX_WITH_POWER_COUNTER=ON" diff --git a/.jenkins/lsu/slurm-configuration-clang-15.sh b/.jenkins/lsu/slurm-configuration-clang-15.sh new file mode 100644 index 000000000000..fa04df0a3fb8 --- /dev/null +++ b/.jenkins/lsu/slurm-configuration-clang-15.sh @@ -0,0 +1,8 @@ +# 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) + +configuration_slurm_partition="jenkins-compute" +configuration_slurm_num_nodes="1" diff --git a/.jenkins/lsu/slurm-configuration-gcc-13.sh b/.jenkins/lsu/slurm-configuration-gcc-13.sh new file mode 100644 index 000000000000..fa04df0a3fb8 --- /dev/null +++ b/.jenkins/lsu/slurm-configuration-gcc-13.sh @@ -0,0 +1,8 @@ +# 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) + +configuration_slurm_partition="jenkins-compute" +configuration_slurm_num_nodes="1" From d6a0ffbb27675e47a663623f26f11742f1b07a26 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Wed, 14 Jun 2023 14:21:34 -0500 Subject: [PATCH 38/72] Fixing problems reported by clang-15 --- .../regressions/protect_with_nullary_pfo.cpp | 2 -- libs/core/threading/tests/unit/jthread1.cpp | 21 ++++++++++--------- libs/core/threading/tests/unit/jthread2.cpp | 2 +- libs/core/threadmanager/src/threadmanager.cpp | 21 +++++++++++-------- .../type_support/tests/unit/generator.cpp | 6 ++++-- .../duplicate_id_registration_1596.cpp | 2 +- .../src/putva/sender_connection_putva.cpp | 5 ++--- .../sendrecv/sender_connection_sendrecv.cpp | 5 ++--- 8 files changed, 33 insertions(+), 31 deletions(-) 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 42e39936f416..44d2eee73998 100644 --- a/libs/core/functional/tests/regressions/protect_with_nullary_pfo.cpp +++ b/libs/core/functional/tests/regressions/protect_with_nullary_pfo.cpp @@ -52,11 +52,9 @@ int hpx_main() iterator_type itr_o = v2.begin(); (void) itr_o; - std::size_t i = 0; for (std::size_t const& v : my_range) { hpx::async(hpx::util::protect(print_obj()), v); - ++i; } return hpx::local::finalize(); // Handles HPX shutdown diff --git a/libs/core/threading/tests/unit/jthread1.cpp b/libs/core/threading/tests/unit/jthread1.cpp index fb3169774668..040e696e236a 100644 --- a/libs/core/threading/tests/unit/jthread1.cpp +++ b/libs/core/threading/tests/unit/jthread1.cpp @@ -46,7 +46,7 @@ void test_jthread_without_token() }); // wait until t has set all initial values - for (int i = 0; !all_set.load(); ++i) + for ([[maybe_unused]] int i = 0; !all_set.load(); ++i) { hpx::this_thread::sleep_for(std::chrono::milliseconds(10)); } @@ -80,7 +80,8 @@ void test_jthread_with_token() all_set.store(true); // wait until interrupt is signaled - for (int i = 0; !stoptoken.stop_requested(); ++i) + for ([[maybe_unused]] int i = 0; !stoptoken.stop_requested(); + ++i) { hpx::this_thread::sleep_for(std::chrono::milliseconds(100)); } @@ -90,7 +91,7 @@ void test_jthread_with_token() ssource.get_token()); // wait until t has set all initial values - for (int i = 0; !all_set.load(); ++i) + for ([[maybe_unused]] int i = 0; !all_set.load(); ++i) { hpx::this_thread::sleep_for(std::chrono::milliseconds(10)); } @@ -133,7 +134,7 @@ void test_join() hpx::jthread t([](hpx::stop_token stoken) { // wait until interrupt is signaled (due to calling request_stop() // for the token) - for (int i = 0; !stoken.stop_requested(); ++i) + for ([[maybe_unused]] int i = 0; !stoken.stop_requested(); ++i) { hpx::this_thread::sleep_for(std::chrono::milliseconds(100)); } @@ -186,7 +187,7 @@ void test_detach() // wait until interrupt is signaled (due to calling request_stop() // for the token) - for (int i = 0; !stoken.stop_requested(); ++i) + for ([[maybe_unused]] int i = 0; !stoken.stop_requested(); ++i) { hpx::this_thread::sleep_for(std::chrono::milliseconds(100)); } @@ -195,7 +196,7 @@ void test_detach() }); // wait until t has set all initial values - for (int i = 0; !all_set.load(); ++i) + for ([[maybe_unused]] int i = 0; !all_set.load(); ++i) { hpx::this_thread::sleep_for(std::chrono::milliseconds(10)); } @@ -246,7 +247,7 @@ void test_hpx_thread() bool caught_exception = false; try { - for (int i = 0;; ++i) + for ([[maybe_unused]] int i = 0;; ++i) { if (shall_die.stop_requested()) { @@ -274,7 +275,7 @@ void test_hpx_thread() }); // wait until t has set all initial values - for (int i = 0; !all_set.load(); ++i) + for ([[maybe_unused]] int i = 0; !all_set.load(); ++i) { hpx::this_thread::sleep_for(std::chrono::milliseconds(10)); } @@ -424,14 +425,14 @@ void test_jthread_api() all_set.store(true); // wait until interrupt is signaled (due to destructor of t) - for (int i = 0; !stoken.stop_requested(); ++i) + for ([[maybe_unused]] int i = 0; !stoken.stop_requested(); ++i) { hpx::this_thread::sleep_for(std::chrono::milliseconds(100)); } }); // wait until t has set all initial values - for (int i = 0; !all_set.load(); ++i) + for ([[maybe_unused]] int i = 0; !all_set.load(); ++i) { hpx::this_thread::sleep_for(std::chrono::milliseconds(10)); } diff --git a/libs/core/threading/tests/unit/jthread2.cpp b/libs/core/threading/tests/unit/jthread2.cpp index bf403014f5b2..2c099c474936 100644 --- a/libs/core/threading/tests/unit/jthread2.cpp +++ b/libs/core/threading/tests/unit/jthread2.cpp @@ -212,7 +212,7 @@ void test_concurrent_interrupt() try { bool stop_requested = false; - for (int i = 0; !it.stop_requested(); ++i) + for ([[maybe_unused]] int i = 0; !it.stop_requested(); ++i) { // should never switch back once requested if (stoken.stop_requested()) diff --git a/libs/core/threadmanager/src/threadmanager.cpp b/libs/core/threadmanager/src/threadmanager.cpp index 303f3776f901..5b75a11bf9d5 100644 --- a/libs/core/threadmanager/src/threadmanager.cpp +++ b/libs/core/threadmanager/src/threadmanager.cpp @@ -232,9 +232,10 @@ namespace hpx { namespace threads { } void threadmanager::create_scheduler_local_priority_lifo( - thread_pool_init_parameters const& thread_pool_init, - policies::thread_queue_init_parameters const& thread_queue_init, - std::size_t numa_sensitive) + [[maybe_unused]] thread_pool_init_parameters const& thread_pool_init, + [[maybe_unused]] policies::thread_queue_init_parameters const& + thread_queue_init, + [[maybe_unused]] std::size_t numa_sensitive) { #if defined(HPX_HAVE_CXX11_STD_ATOMIC_128BIT) // set parameters for scheduler and pool instantiation and perform @@ -373,9 +374,10 @@ namespace hpx { namespace threads { } void threadmanager::create_scheduler_abp_priority_fifo( - thread_pool_init_parameters const& thread_pool_init, - policies::thread_queue_init_parameters const& thread_queue_init, - std::size_t numa_sensitive) + [[maybe_unused]] thread_pool_init_parameters const& thread_pool_init, + [[maybe_unused]] policies::thread_queue_init_parameters const& + thread_queue_init, + [[maybe_unused]] std::size_t numa_sensitive) { #if defined(HPX_HAVE_CXX11_STD_ATOMIC_128BIT) // set parameters for scheduler and pool instantiation and perform @@ -421,9 +423,10 @@ namespace hpx { namespace threads { } void threadmanager::create_scheduler_abp_priority_lifo( - thread_pool_init_parameters const& thread_pool_init, - policies::thread_queue_init_parameters const& thread_queue_init, - std::size_t numa_sensitive) + [[maybe_unused]] thread_pool_init_parameters const& thread_pool_init, + [[maybe_unused]] policies::thread_queue_init_parameters const& + thread_queue_init, + [[maybe_unused]] std::size_t numa_sensitive) { #if defined(HPX_HAVE_CXX11_STD_ATOMIC_128BIT) // set parameters for scheduler and pool instantiation and perform diff --git a/libs/core/type_support/tests/unit/generator.cpp b/libs/core/type_support/tests/unit/generator.cpp index 8853532eae61..c41ccbb7a6e3 100644 --- a/libs/core/type_support/tests/unit/generator.cpp +++ b/libs/core/type_support/tests/unit/generator.cpp @@ -40,7 +40,9 @@ namespace tests { { while (i != j) { - co_yield i++; + // gcc reports -Werrer,-Wunsequenced without retval + int retval = i++; + co_yield retval; } } @@ -114,7 +116,7 @@ namespace tests { hpx::generator const_lvalue_example() { - co_yield X{1}; // OK + co_yield X{1}; // OK X const x{2}; co_yield x; // OK co_yield std::move(x); // OK: same as above diff --git a/libs/full/agas/tests/regressions/duplicate_id_registration_1596.cpp b/libs/full/agas/tests/regressions/duplicate_id_registration_1596.cpp index a8f7f9ef43aa..8ff2a67c5322 100644 --- a/libs/full/agas/tests/regressions/duplicate_id_registration_1596.cpp +++ b/libs/full/agas/tests/regressions/duplicate_id_registration_1596.cpp @@ -76,7 +76,7 @@ namespace tests { namespace client { base_type; ViewRegistrationListener(hpx::future gid) - : base_type(move(gid)) + : base_type(std::move(gid)) { cout << "constructed listener client by future" << endl; } diff --git a/libs/full/parcelport_lci/src/putva/sender_connection_putva.cpp b/libs/full/parcelport_lci/src/putva/sender_connection_putva.cpp index d1ad8d60ebcb..adb7906eb18a 100644 --- a/libs/full/parcelport_lci/src/putva/sender_connection_putva.cpp +++ b/libs/full/parcelport_lci/src/putva/sender_connection_putva.cpp @@ -53,9 +53,8 @@ namespace hpx::parcelset::policies::lci { HPX_ASSERT(!handler_); HPX_ASSERT(!postprocess_handler_); HPX_ASSERT(!buffer_.data_.empty()); - handler_ = HPX_FORWARD(Handler, handler); - postprocess_handler_ = - HPX_FORWARD(ParcelPostprocess, parcel_postprocess); + handler_ = HPX_MOVE(handler); + postprocess_handler_ = HPX_MOVE(parcel_postprocess); // build header header header_; diff --git a/libs/full/parcelport_lci/src/sendrecv/sender_connection_sendrecv.cpp b/libs/full/parcelport_lci/src/sendrecv/sender_connection_sendrecv.cpp index 5793bc6f7788..6d9dfee675c3 100644 --- a/libs/full/parcelport_lci/src/sendrecv/sender_connection_sendrecv.cpp +++ b/libs/full/parcelport_lci/src/sendrecv/sender_connection_sendrecv.cpp @@ -40,9 +40,8 @@ namespace hpx::parcelset::policies::lci { HPX_ASSERT(!handler_); HPX_ASSERT(!postprocess_handler_); HPX_ASSERT(!buffer_.data_.empty()); - handler_ = HPX_FORWARD(Handler, handler); - postprocess_handler_ = - HPX_FORWARD(ParcelPostprocess, parcel_postprocess); + handler_ = HPX_MOVE(handler); + postprocess_handler_ = HPX_MOVE(parcel_postprocess); // build header while (LCI_mbuffer_alloc(pp_->device_eager, &header_buffer) != LCI_OK) From 71f77885c9ad37e8e00f199c5b64bb829db47990 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Wed, 14 Jun 2023 14:51:44 -0500 Subject: [PATCH 39/72] Fixing problems reported by gcc-13 --- .../datastructures/tests/unit/bitset_test.hpp | 9 ++++++++ .../hpx/executors/guided_pool_executor.hpp | 16 ++++++++++++++ .../functional/tests/unit/bind_dm3_test.cpp | 11 +++++++++- .../tests/unit/pack_traversal.cpp | 12 ++++++++-- .../examples/async_customization.cpp | 8 +++++++ .../tests/unit/local_mutex.cpp | 3 ++- .../include/hpx/type_support/generator.hpp | 22 ++++++++++++++----- .../type_support/tests/unit/generator.cpp | 4 ++-- .../hpx/async_distributed/base_lco.hpp | 4 ---- libs/full/async_distributed/src/base_lco.cpp | 2 -- 10 files changed, 73 insertions(+), 18 deletions(-) diff --git a/libs/core/datastructures/tests/unit/bitset_test.hpp b/libs/core/datastructures/tests/unit/bitset_test.hpp index 7426d9d87296..1d446015c592 100644 --- a/libs/core/datastructures/tests/unit/bitset_test.hpp +++ b/libs/core/datastructures/tests/unit/bitset_test.hpp @@ -315,9 +315,18 @@ struct bitset_test Bitset c(rhs); b = std::move(c); +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Werror=self-move" +#endif + // NOLINTNEXTLINE(clang-diagnostic-self-assign-overloaded) b = std::move(b); // self assignment check +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic pop +#endif + // NOLINTNEXTLINE(bugprone-use-after-move) HPX_TEST(b == rhs); } diff --git a/libs/core/executors/include/hpx/executors/guided_pool_executor.hpp b/libs/core/executors/include/hpx/executors/guided_pool_executor.hpp index 1830205bf097..7ac10a1d1d07 100644 --- a/libs/core/executors/include/hpx/executors/guided_pool_executor.hpp +++ b/libs/core/executors/include/hpx/executors/guided_pool_executor.hpp @@ -196,9 +196,17 @@ namespace hpx::parallel::execution { #ifdef GUIDED_POOL_EXECUTOR_FAKE_NOOP int domain = -1; #else +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Werror=dangling-reference" +#endif // get the argument for the numa hint function from the predecessor future auto const& predecessor_value = detail::future_extract_value()( HPX_FORWARD(Future, predecessor)); + +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic pop +#endif int domain = numa_function_(predecessor_value, ts...); #endif @@ -407,10 +415,18 @@ namespace hpx::parallel::execution { OuterFuture>&& predecessor, Ts&&... ts) { #ifdef GUIDED_EXECUTOR_DEBUG +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Werror=dangling-reference" +#endif // get the tuple of futures from the predecessor future auto const& predecessor_value = detail::future_extract_value()(predecessor); +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic pop +#endif + // create a tuple of the unwrapped future values auto unwrapped_futures_tuple = hpx::util::map_pack( detail::future_extract_value{}, predecessor_value); diff --git a/libs/core/functional/tests/unit/bind_dm3_test.cpp b/libs/core/functional/tests/unit/bind_dm3_test.cpp index eb78f2758c88..2a644cce6ee5 100644 --- a/libs/core/functional/tests/unit/bind_dm3_test.cpp +++ b/libs/core/functional/tests/unit/bind_dm3_test.cpp @@ -15,7 +15,7 @@ #pragma warning(disable : 4786) // identifier truncated in debug info #pragma warning(disable : 4710) // function not inlined #pragma warning( \ - disable : 4711) // function selected for automatic inline expansion + disable : 4711) // function selected for automatic inline expansion #pragma warning(disable : 4514) // unreferenced inline removed #endif @@ -34,8 +34,17 @@ int main() pair_type pair(10, 20); +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Werror=dangling-reference" +#endif + int const& x = hpx::bind(&pair_type::first, placeholders::_1)(pair); +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic pop +#endif + HPX_TEST_EQ(&pair.first, &x); return hpx::util::report_errors(); diff --git a/libs/core/pack_traversal/tests/unit/pack_traversal.cpp b/libs/core/pack_traversal/tests/unit/pack_traversal.cpp index e403a2e06165..6660e854aedb 100644 --- a/libs/core/pack_traversal/tests/unit/pack_traversal.cpp +++ b/libs/core/pack_traversal/tests/unit/pack_traversal.cpp @@ -483,6 +483,10 @@ static void test_strategic_traverse() { std::unique_ptr ptr(new int(7)); +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Werror=dangling-reference" +#endif std::unique_ptr const& ref = map_pack( [](std::unique_ptr const& ref) -> std::unique_ptr const& { // ... @@ -490,6 +494,10 @@ static void test_strategic_traverse() }, ptr); +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic pop +#endif + HPX_TEST_EQ(*ref, 7); *ptr = 0; HPX_TEST_EQ(*ref, 0); @@ -804,8 +812,8 @@ static void test_spread_tuple_like_traverse() // 1:0 mappings { - using Result = decltype( - map_pack(zero_mapper{}, make_tuple(make_tuple(1, 2), 1), 1)); + using Result = decltype(map_pack( + zero_mapper{}, make_tuple(make_tuple(1, 2), 1), 1)); static_assert(std::is_void::value, "Failed..."); } diff --git a/libs/core/resource_partitioner/examples/async_customization.cpp b/libs/core/resource_partitioner/examples/async_customization.cpp index 93269debc08c..2ad06e1cdd16 100644 --- a/libs/core/resource_partitioner/examples/async_customization.cpp +++ b/libs/core/resource_partitioner/examples/async_customization.cpp @@ -152,10 +152,18 @@ struct test_async_executor using result_type = util::detail::invoke_deferred_result_t>, Ts...>; +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Werror=dangling-reference" +#endif // get the tuple of futures from the predecessor future const auto& predecessor_value = future_extract_value().operator()(predecessor); +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic pop +#endif + // create a tuple of the unwrapped future values auto unwrapped_futures_tuple = util::map_pack(future_extract_value{}, predecessor_value); diff --git a/libs/core/synchronization/tests/unit/local_mutex.cpp b/libs/core/synchronization/tests/unit/local_mutex.cpp index b6f4c415eca3..cf9f1b4835b2 100644 --- a/libs/core/synchronization/tests/unit/local_mutex.cpp +++ b/libs/core/synchronization/tests/unit/local_mutex.cpp @@ -124,7 +124,8 @@ struct test_lock_times_out_if_other_thread_has_lock void locking_thread() { Lock lock(m, std::defer_lock); - lock.try_lock_for(std::chrono::milliseconds(50)); + [[maybe_unused]] bool retval = + lock.try_lock_for(std::chrono::milliseconds(50)); std::lock_guard lk(done_mutex); locked = lock.owns_lock(); diff --git a/libs/core/type_support/include/hpx/type_support/generator.hpp b/libs/core/type_support/include/hpx/type_support/generator.hpp index 38df3bc0bd98..75952a74c630 100644 --- a/libs/core/type_support/include/hpx/type_support/generator.hpp +++ b/libs/core/type_support/include/hpx/type_support/generator.hpp @@ -636,16 +636,26 @@ namespace hpx { ++*this; } - [[nodiscard]] bool operator==( - hpx::default_sentinel_t) const noexcept + [[nodiscard]] friend bool operator==( + gen_iter lhs, hpx::default_sentinel_t) noexcept { - return coro.done(); + return lhs.coro.done(); + } + [[nodiscard]] friend bool operator!=( + gen_iter lhs, hpx::default_sentinel_t rhs) noexcept + { + return !(lhs == rhs); } - [[nodiscard]] bool operator!=( - hpx::default_sentinel_t) const noexcept + [[nodiscard]] friend bool operator==( + hpx::default_sentinel_t, gen_iter rhs) noexcept + { + return rhs.coro.done(); + } + [[nodiscard]] friend bool operator!=( + hpx::default_sentinel_t lhs, gen_iter rhs) noexcept { - return !coro.done(); + return !(lhs == rhs); } private: diff --git a/libs/core/type_support/tests/unit/generator.cpp b/libs/core/type_support/tests/unit/generator.cpp index c41ccbb7a6e3..998d1eee924a 100644 --- a/libs/core/type_support/tests/unit/generator.cpp +++ b/libs/core/type_support/tests/unit/generator.cpp @@ -202,7 +202,7 @@ namespace tests { }; // gcc V11/V12 are complaining about mismatched-new-delete -#if !defined(HPX_GCC_VERSION) || HPX_GCC_VERSION >= 130000 +#if !defined(HPX_GCC_VERSION) || HPX_GCC_VERSION >= 140000 hpx::generator> stateless_example() { co_yield 42; @@ -313,7 +313,7 @@ int main() } // gcc V11/V12 are complaining about mismatched-new-delete -#if !defined(HPX_GCC_VERSION) || HPX_GCC_VERSION >= 130000 +#if !defined(HPX_GCC_VERSION) || HPX_GCC_VERSION >= 140000 { std::vector const expected = {42}; std::size_t i = 0; diff --git a/libs/full/async_distributed/include/hpx/async_distributed/base_lco.hpp b/libs/full/async_distributed/include/hpx/async_distributed/base_lco.hpp index 8b7f5e652a71..221f13395c4f 100644 --- a/libs/full/async_distributed/include/hpx/async_distributed/base_lco.hpp +++ b/libs/full/async_distributed/include/hpx/async_distributed/base_lco.hpp @@ -52,10 +52,6 @@ namespace hpx::lcos { /// derived objects virtual ~base_lco(); - /// \brief finalize() will be called just before the instance gets - /// destructed - virtual void finalize(); - /// The \a function set_event_nonvirt is called whenever a /// \a set_event_action is applied on a instance of a LCO. This function /// just forwards to the virtual function \a set_event, which is diff --git a/libs/full/async_distributed/src/base_lco.cpp b/libs/full/async_distributed/src/base_lco.cpp index d5581e330154..0fe0e48a2d44 100644 --- a/libs/full/async_distributed/src/base_lco.cpp +++ b/libs/full/async_distributed/src/base_lco.cpp @@ -39,8 +39,6 @@ namespace hpx { namespace lcos { base_lco::~base_lco() = default; - void base_lco::finalize() {} - void base_lco::set_event_nonvirt() { set_event(); From 72dec0fda56ab5c8f9170b30d804a75cde38389a Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Sun, 18 Jun 2023 12:16:06 -0500 Subject: [PATCH 40/72] Fixing various feature tests --- CMakeLists.txt | 12 +++++-- cmake/HPX_AddConfigTest.cmake | 27 +++++++++++++--- cmake/HPX_PerformCxxFeatureTests.cmake | 3 +- cmake/tests/c11_aligned_alloc.cpp | 4 +-- cmake/tests/cxx11_std_atomic.cpp | 7 ++++ cmake/tests/cxx17_std_aligned_alloc.cpp | 4 +-- cmake/tests/cxx20_perfect_pack_capture.cpp | 4 +-- cmake/tests/cxx20_std_construct_at.cpp | 4 +-- .../datastructures/tests/unit/bitset_test.hpp | 9 +----- .../hpx/executors/guided_pool_executor.hpp | 32 ++++--------------- .../functional/tests/unit/bind_dm3_test.cpp | 16 +++------- .../detail/pack_traversal_async_impl.hpp | 7 ++++ .../tests/unit/pack_traversal.cpp | 14 ++++---- .../examples/async_customization.cpp | 16 ++-------- .../type_support/tests/unit/generator.cpp | 3 +- 15 files changed, 79 insertions(+), 83 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9cf51e680c9..bb4bd1aa04c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1840,8 +1840,6 @@ if(HPX_WITH_COMPILER_WARNINGS) else() # Trial and error approach for any other compiler ... hpx_add_compile_flag_if_available(-Wall) - hpx_add_compile_flag_if_available(-Wextra) - hpx_add_compile_flag_if_available(-Wpedantic) hpx_add_compile_flag_if_available(-Wno-strict-aliasing) hpx_add_compile_flag_if_available(-Wno-sign-promo) hpx_add_compile_flag_if_available(-Wno-attributes) @@ -1854,6 +1852,16 @@ if(HPX_WITH_COMPILER_WARNINGS) # caused by the use of std::destructive_interference_size hpx_add_compile_flag_if_available(-Wno-interference-size) endif() + if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL "13.0") + # gcc V13.x is overeager to report dangling references where there are + # none + hpx_add_compile_flag_if_available(-Wextra) + hpx_add_compile_flag_if_available(-Wpedantic) + hpx_add_compile_flag_if_available(-Wno-self-move) + endif() + else() + hpx_add_compile_flag_if_available(-Wextra) + hpx_add_compile_flag_if_available(-Wpedantic) endif() # We do not in general guarantee ABI compatibility between C++ standards, so diff --git a/cmake/HPX_AddConfigTest.cmake b/cmake/HPX_AddConfigTest.cmake index 83a41984be83..e876888b6e31 100644 --- a/cmake/HPX_AddConfigTest.cmake +++ b/cmake/HPX_AddConfigTest.cmake @@ -278,6 +278,15 @@ function(hpx_check_for_cxx11_std_atomic) unset(HPX_CXX11_STD_ATOMIC_LIBRARIES CACHE) endif() + # we shouldn't delete this key if the user has pre-set the atomic libraries to + # use + if(HPX_CXX11_STD_ATOMIC_LIBRARIES) + set(__std_atomic_libraries + TRUE + CACHE STRING "std::atomics need separate library" FORCE + ) + endif() + # first see if we can build atomics with no -latomics add_hpx_config_test( HPX_WITH_CXX11_ATOMIC @@ -301,12 +310,18 @@ function(hpx_check_for_cxx11_std_atomic) LIBRARIES ${HPX_CXX11_STD_ATOMIC_LIBRARIES} FILE ${ARGN} ) - if(NOT HPX_WITH_CXX11_ATOMIC) - unset(HPX_CXX11_STD_ATOMIC_LIBRARIES CACHE) - unset(HPX_WITH_CXX11_ATOMIC CACHE) + if(HPX_WITH_CXX11_ATOMIC) + set(__std_atomic_libraries + TRUE + CACHE STRING "std::atomics need separate library" FORCE + ) endif() endif() endif() + + if(NOT HPX_WITH_CXX11_ATOMIC) + hpx_error("HPX needs support for C++11 std::atomic") + endif() endfunction() # Separately check for 128 bit atomics @@ -334,11 +349,15 @@ function(hpx_check_for_cxx11_std_atomic_128bit) ) if(NOT HPX_WITH_CXX11_ATOMIC_128BIT) # Adding -latomic did not help, so we don't attempt to link to it later - unset(HPX_CXX11_STD_ATOMIC_LIBRARIES CACHE) + # but only if normal atomics don't require it + if(NOT __std_atomic_libraries) + unset(HPX_CXX11_STD_ATOMIC_LIBRARIES CACHE) + endif() unset(HPX_WITH_CXX11_ATOMIC_128BIT CACHE) endif() endif() endif() + unset(__std_atomic_libraries CACHE) endfunction() # ############################################################################## diff --git a/cmake/HPX_PerformCxxFeatureTests.cmake b/cmake/HPX_PerformCxxFeatureTests.cmake index f3f2aea3b9b0..5eaf53e455ab 100644 --- a/cmake/HPX_PerformCxxFeatureTests.cmake +++ b/cmake/HPX_PerformCxxFeatureTests.cmake @@ -32,8 +32,7 @@ function(hpx_perform_cxx_feature_tests) endif() hpx_check_for_cxx11_std_atomic( - REQUIRED "HPX needs support for C++11 std::atomic" - ${atomics_additional_flags} + DEFINITIONS HPX_HAVE_CXX11_STD_ATOMIC ${atomics_additional_flags} ) # Separately check for 128 bit atomics diff --git a/cmake/tests/c11_aligned_alloc.cpp b/cmake/tests/c11_aligned_alloc.cpp index efed08c23f7b..0d68a689a457 100644 --- a/cmake/tests/c11_aligned_alloc.cpp +++ b/cmake/tests/c11_aligned_alloc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020 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 @@ -10,7 +10,7 @@ int main() { - char* s = aligned_alloc(1024, 1024 * sizeof(char)); + char* s = static_cast(aligned_alloc(1024, 1024 * sizeof(char))); free(s); return 0; diff --git a/cmake/tests/cxx11_std_atomic.cpp b/cmake/tests/cxx11_std_atomic.cpp index 110175968cac..9199d628c630 100644 --- a/cmake/tests/cxx11_std_atomic.cpp +++ b/cmake/tests/cxx11_std_atomic.cpp @@ -18,6 +18,12 @@ void test_atomic() (void) i; } +struct index_data +{ + std::uint16_t first; + std::uint16_t second; +}; + int main() { // ATOMIC_FLAG_INIT is deprecated starting C++20 @@ -34,6 +40,7 @@ int main() test_atomic(); test_atomic(); test_atomic(); + test_atomic(); std::memory_order mo; mo = std::memory_order_relaxed; diff --git a/cmake/tests/cxx17_std_aligned_alloc.cpp b/cmake/tests/cxx17_std_aligned_alloc.cpp index bfbce10adf91..11272a799ae8 100644 --- a/cmake/tests/cxx17_std_aligned_alloc.cpp +++ b/cmake/tests/cxx17_std_aligned_alloc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020 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 @@ -10,7 +10,7 @@ int main() { - char* s = std::aligned_alloc(1024, 1024 * sizeof(char)); + char* s = static_cast(std::aligned_alloc(1024, 1024 * sizeof(char))); std::free(s); return 0; diff --git a/cmake/tests/cxx20_perfect_pack_capture.cpp b/cmake/tests/cxx20_perfect_pack_capture.cpp index f9d361cf2fdc..8f46d5629514 100644 --- a/cmake/tests/cxx20_perfect_pack_capture.cpp +++ b/cmake/tests/cxx20_perfect_pack_capture.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 @@ -10,7 +10,7 @@ #include template -void foo(Ts&&... ts) +auto foo(Ts&&... ts) { return [... ts = std::forward(ts)]() {}; } diff --git a/cmake/tests/cxx20_std_construct_at.cpp b/cmake/tests/cxx20_std_construct_at.cpp index 545f616a8ac1..9cc233d981e0 100644 --- a/cmake/tests/cxx20_std_construct_at.cpp +++ b/cmake/tests/cxx20_std_construct_at.cpp @@ -1,4 +1,4 @@ -// 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 @@ -17,7 +17,7 @@ int main() { unsigned char buffer[sizeof(A)]; - A* ptr = hpx::construct_at(reinterpret_cast(buffer), 42); + A* ptr = std::construct_at(reinterpret_cast(buffer), 42); std::destroy_at(ptr); return 0; diff --git a/libs/core/datastructures/tests/unit/bitset_test.hpp b/libs/core/datastructures/tests/unit/bitset_test.hpp index 1d446015c592..e9304192ca4e 100644 --- a/libs/core/datastructures/tests/unit/bitset_test.hpp +++ b/libs/core/datastructures/tests/unit/bitset_test.hpp @@ -315,16 +315,9 @@ struct bitset_test Bitset c(rhs); b = std::move(c); -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Werror=self-move" -#endif - +#if !defined(HPX_GCC_VERSION) || HPX_GCC_VERSION >= 130000 // NOLINTNEXTLINE(clang-diagnostic-self-assign-overloaded) b = std::move(b); // self assignment check - -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic pop #endif // NOLINTNEXTLINE(bugprone-use-after-move) diff --git a/libs/core/executors/include/hpx/executors/guided_pool_executor.hpp b/libs/core/executors/include/hpx/executors/guided_pool_executor.hpp index 7ac10a1d1d07..924a18bcb1e3 100644 --- a/libs/core/executors/include/hpx/executors/guided_pool_executor.hpp +++ b/libs/core/executors/include/hpx/executors/guided_pool_executor.hpp @@ -196,18 +196,11 @@ namespace hpx::parallel::execution { #ifdef GUIDED_POOL_EXECUTOR_FAKE_NOOP int domain = -1; #else -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Werror=dangling-reference" -#endif // get the argument for the numa hint function from the predecessor future - auto const& predecessor_value = detail::future_extract_value()( - HPX_FORWARD(Future, predecessor)); - -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic pop -#endif - int domain = numa_function_(predecessor_value, ts...); + int domain = + numa_function_(detail::future_extract_value()( + HPX_FORWARD(Future, predecessor)), + ts...); #endif gpx_deb.debug(debug::str<>("then_schedule"), "domain ", domain); @@ -415,21 +408,10 @@ namespace hpx::parallel::execution { OuterFuture>&& predecessor, Ts&&... ts) { #ifdef GUIDED_EXECUTOR_DEBUG -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Werror=dangling-reference" -#endif - // get the tuple of futures from the predecessor future - auto const& predecessor_value = - detail::future_extract_value()(predecessor); - -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic pop -#endif - // create a tuple of the unwrapped future values - auto unwrapped_futures_tuple = hpx::util::map_pack( - detail::future_extract_value{}, predecessor_value); + auto unwrapped_futures_tuple = + hpx::util::map_pack(detail::future_extract_value{}, + detail::future_extract_value()(predecessor)); using result_type = hpx::util::detail::invoke_deferred_result_t>, Ts...>; diff --git a/libs/core/functional/tests/unit/bind_dm3_test.cpp b/libs/core/functional/tests/unit/bind_dm3_test.cpp index 2a644cce6ee5..2f1f54f91423 100644 --- a/libs/core/functional/tests/unit/bind_dm3_test.cpp +++ b/libs/core/functional/tests/unit/bind_dm3_test.cpp @@ -14,8 +14,8 @@ #if defined(HPX_MSVC) #pragma warning(disable : 4786) // identifier truncated in debug info #pragma warning(disable : 4710) // function not inlined -#pragma warning( \ - disable : 4711) // function selected for automatic inline expansion +// function selected for automatic inline expansion +#pragma warning(disable : 4711) #pragma warning(disable : 4514) // unreferenced inline removed #endif @@ -30,22 +30,16 @@ namespace placeholders = hpx::placeholders; int main() { + // gcc V13 over-eagerly reports a dangling reference here +#if !defined(HPX_GCC_VERSION) || HPX_GCC_VERSION < 130000 typedef std::pair pair_type; pair_type pair(10, 20); -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Werror=dangling-reference" -#endif - int const& x = hpx::bind(&pair_type::first, placeholders::_1)(pair); -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic pop -#endif - HPX_TEST_EQ(&pair.first, &x); +#endif return hpx::util::report_errors(); } diff --git a/libs/core/pack_traversal/include/hpx/pack_traversal/detail/pack_traversal_async_impl.hpp b/libs/core/pack_traversal/include/hpx/pack_traversal/detail/pack_traversal_async_impl.hpp index e853ff4d2b21..38f81700175b 100644 --- a/libs/core/pack_traversal/include/hpx/pack_traversal/detail/pack_traversal_async_impl.hpp +++ b/libs/core/pack_traversal/include/hpx/pack_traversal/detail/pack_traversal_async_impl.hpp @@ -531,7 +531,14 @@ namespace hpx::util::detail { { for (/**/; !range.is_finished(); ++range) { +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif async_traverse_one(range); +#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 +#pragma GCC diagnostic pop +#endif if (is_detached()) // test before increment break; } diff --git a/libs/core/pack_traversal/tests/unit/pack_traversal.cpp b/libs/core/pack_traversal/tests/unit/pack_traversal.cpp index 6660e854aedb..47038f41533c 100644 --- a/libs/core/pack_traversal/tests/unit/pack_traversal.cpp +++ b/libs/core/pack_traversal/tests/unit/pack_traversal.cpp @@ -478,15 +478,14 @@ static void test_strategic_traverse() HPX_TEST_EQ(res, 1); } + // gcc V13 over-eagerly reports a dangling reference here +#if !defined(HPX_GCC_VERSION) || HPX_GCC_VERSION < 130000 + // Make it possible to pass move only objects in as reference, // while returning those as reference. { std::unique_ptr ptr(new int(7)); -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Werror=dangling-reference" -#endif std::unique_ptr const& ref = map_pack( [](std::unique_ptr const& ref) -> std::unique_ptr const& { // ... @@ -494,14 +493,11 @@ static void test_strategic_traverse() }, ptr); -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic pop -#endif - HPX_TEST_EQ(*ref, 7); *ptr = 0; HPX_TEST_EQ(*ref, 0); } +#endif // Multiple args: Make it possible to pass move only objects in // as reference, while returning those as reference. @@ -812,8 +808,10 @@ static void test_spread_tuple_like_traverse() // 1:0 mappings { + // clang-format off using Result = decltype(map_pack( zero_mapper{}, make_tuple(make_tuple(1, 2), 1), 1)); + // clang-format on static_assert(std::is_void::value, "Failed..."); } diff --git a/libs/core/resource_partitioner/examples/async_customization.cpp b/libs/core/resource_partitioner/examples/async_customization.cpp index 2ad06e1cdd16..f407b95f0605 100644 --- a/libs/core/resource_partitioner/examples/async_customization.cpp +++ b/libs/core/resource_partitioner/examples/async_customization.cpp @@ -152,21 +152,9 @@ struct test_async_executor using result_type = util::detail::invoke_deferred_result_t>, Ts...>; -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Werror=dangling-reference" -#endif - // get the tuple of futures from the predecessor future - const auto& predecessor_value = - future_extract_value().operator()(predecessor); - -#if defined(HPX_GCC_VERSION) && HPX_GCC_VERSION >= 130000 -#pragma GCC diagnostic pop -#endif - // create a tuple of the unwrapped future values - auto unwrapped_futures_tuple = - util::map_pack(future_extract_value{}, predecessor_value); + auto unwrapped_futures_tuple = util::map_pack(future_extract_value{}, + future_extract_value().operator()(predecessor)); using namespace hpx::util::debug; std::cout << "when_all(fut) : Predecessor : " diff --git a/libs/core/type_support/tests/unit/generator.cpp b/libs/core/type_support/tests/unit/generator.cpp index 998d1eee924a..0bb35a2d0302 100644 --- a/libs/core/type_support/tests/unit/generator.cpp +++ b/libs/core/type_support/tests/unit/generator.cpp @@ -116,8 +116,9 @@ namespace tests { hpx::generator const_lvalue_example() { - co_yield X{1}; // OK + co_yield X{1}; // OK X const x{2}; + co_yield x; // OK co_yield std::move(x); // OK: same as above } From d702bf8f8840b061a07537484fd01c8106dd5b68 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Sat, 24 Jun 2023 11:06:32 -0500 Subject: [PATCH 41/72] Re-enable compiling with HPX_WITH_NETWORKING=OFF --- .jenkins/lsu/env-gcc-11.sh | 4 +--- examples/quickstart/custom_serialization.cpp | 10 +++++++++- libs/full/agas/src/addressing_service.cpp | 2 ++ .../hpx/runtime_distributed/migrate_component.hpp | 14 +++++++++----- .../src/runtime_distributed.cpp | 1 + 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.jenkins/lsu/env-gcc-11.sh b/.jenkins/lsu/env-gcc-11.sh index e711bd7bce10..b9f7be125f7f 100644 --- a/.jenkins/lsu/env-gcc-11.sh +++ b/.jenkins/lsu/env-gcc-11.sh @@ -20,9 +20,7 @@ configure_extra_options+=" -DHPX_WITH_MALLOC=system" configure_extra_options+=" -DHPX_WITH_FETCH_ASIO=ON" configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS=ON" configure_extra_options+=" -DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=ON" -configure_extra_options+=" -DHPX_WITH_PARCELPORT_MPI=ON" -configure_extra_options+=" -DHPX_WITH_PARCELPORT_LCI=ON" -configure_extra_options+=" -DHPX_WITH_FETCH_LCI=ON" +configure_extra_options+=" -DHPX_WITH_NETWORKING=OFF" configure_extra_options+=" -DHPX_WITH_DATAPAR_BACKEND=STD_EXPERIMENTAL_SIMD" # The pwrapi library still needs to be set up properly on rostam diff --git a/examples/quickstart/custom_serialization.cpp b/examples/quickstart/custom_serialization.cpp index 06f885e3e0b5..02253df59d35 100644 --- a/examples/quickstart/custom_serialization.cpp +++ b/examples/quickstart/custom_serialization.cpp @@ -203,8 +203,16 @@ int main() send_gravity_action gravityAction; auto gravity = planet_weight_calculator(9.81); - hpx::async(gravityAction, hpx::find_remote_localities()[0], gravity).get(); + auto remote_localities = hpx::find_remote_localities(); + if (!remote_localities.empty()) + { + hpx::async(gravityAction, remote_localities[0], gravity).get(); + } + else + { + hpx::async(gravityAction, hpx::find_here(), gravity).get(); + } return 0; } //] diff --git a/libs/full/agas/src/addressing_service.cpp b/libs/full/agas/src/addressing_service.cpp index b2b4b053a4ee..d4a7a1a0a238 100644 --- a/libs/full/agas/src/addressing_service.cpp +++ b/libs/full/agas/src/addressing_service.cpp @@ -736,8 +736,10 @@ namespace hpx::agas { naming::gid_type const id( naming::detail::get_stripped_gid_except_dont_cache(gid)); +#if defined(HPX_HAVE_NETWORKING) // migratable objects should be handled by the function below HPX_ASSERT(!naming::detail::is_migratable(gid)); +#endif // Try to resolve the address of the GID from the locally available // information. diff --git a/libs/full/runtime_distributed/include/hpx/runtime_distributed/migrate_component.hpp b/libs/full/runtime_distributed/include/hpx/runtime_distributed/migrate_component.hpp index afa025492e5e..feb59b815d28 100644 --- a/libs/full/runtime_distributed/include/hpx/runtime_distributed/migrate_component.hpp +++ b/libs/full/runtime_distributed/include/hpx/runtime_distributed/migrate_component.hpp @@ -49,16 +49,21 @@ namespace hpx { namespace components { #if defined(DOXYGEN) future #else - inline std::enable_if_t::value && - traits::is_distribution_policy::value, + std::enable_if_t && + traits::is_distribution_policy_v, future> #endif - migrate(hpx::id_type const& to_migrate, DistPolicy const& policy) + migrate(hpx::id_type const& to_migrate, + [[maybe_unused]] DistPolicy const& policy) { +#if defined(HPX_HAVE_NETWORKING) using action_type = server::perform_migrate_component_action; return hpx::detail::async_colocated( to_migrate, to_migrate, policy); +#else + return hpx::make_ready_future(to_migrate); +#endif } /// Migrate the given component to the specified target locality @@ -133,8 +138,7 @@ namespace hpx { namespace components { #if defined(DOXYGEN) future #else - inline std::enable_if_t::value, - future> + std::enable_if_t, future> #endif migrate(hpx::id_type const& to_migrate, hpx::id_type const& target_locality) { diff --git a/libs/full/runtime_distributed/src/runtime_distributed.cpp b/libs/full/runtime_distributed/src/runtime_distributed.cpp index 9f56911bcf80..4ee4e2a25872 100644 --- a/libs/full/runtime_distributed/src/runtime_distributed.cpp +++ b/libs/full/runtime_distributed/src/runtime_distributed.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include From 2208f1ea70b237c789d663cb8f903c56e0dfaa29 Mon Sep 17 00:00:00 2001 From: Jiakun Yan Date: Sat, 27 May 2023 12:48:58 -0500 Subject: [PATCH 42/72] Improve LCI parcelport and new performance tests. Optimize the case of preposting one receive for new header messages. Add new progress type: pthread_worker. Add the option of using multiple rp progress threads. Remove the option two_device. Remove the option progress_thread_core. Change the default configuration from putva to putsendrecv. improve the sync_single completion manager Add new performance tests: pingpong_performance2. --- libs/full/parcelport_lci/CMakeLists.txt | 1 + .../completion_manager_sync_single.hpp | 60 +++++ .../include/hpx/parcelport_lci/config.hpp | 13 +- .../hpx/parcelport_lci/parcelport_lci.hpp | 52 +++-- .../sendrecv/receiver_sendrecv.hpp | 4 +- libs/full/parcelport_lci/src/config.cpp | 27 +-- .../parcelport_lci/src/parcelport_lci.cpp | 91 ++++---- .../src/putva/sender_connection_putva.cpp | 8 +- .../src/sender_connection_base.cpp | 6 +- .../src/sendrecv/receiver_sendrecv.cpp | 5 +- .../sendrecv/sender_connection_sendrecv.cpp | 9 +- tests/performance/network/CMakeLists.txt | 2 +- .../network/pingpong_performance2.cpp | 205 ++++++++++++++++++ 13 files changed, 366 insertions(+), 117 deletions(-) create mode 100644 libs/full/parcelport_lci/include/hpx/parcelport_lci/completion_manager/completion_manager_sync_single.hpp create mode 100644 tests/performance/network/pingpong_performance2.cpp diff --git a/libs/full/parcelport_lci/CMakeLists.txt b/libs/full/parcelport_lci/CMakeLists.txt index 021e338a58c3..0a1a6bbe760d 100644 --- a/libs/full/parcelport_lci/CMakeLists.txt +++ b/libs/full/parcelport_lci/CMakeLists.txt @@ -29,6 +29,7 @@ set(parcelport_lci_headers hpx/parcelport_lci/completion_manager_base.hpp hpx/parcelport_lci/completion_manager/completion_manager_queue.hpp hpx/parcelport_lci/completion_manager/completion_manager_sync.hpp + hpx/parcelport_lci/completion_manager/completion_manager_sync_single.hpp ) # cmake-format: off diff --git a/libs/full/parcelport_lci/include/hpx/parcelport_lci/completion_manager/completion_manager_sync_single.hpp b/libs/full/parcelport_lci/include/hpx/parcelport_lci/completion_manager/completion_manager_sync_single.hpp new file mode 100644 index 000000000000..bf8ab3f9dc8c --- /dev/null +++ b/libs/full/parcelport_lci/include/hpx/parcelport_lci/completion_manager/completion_manager_sync_single.hpp @@ -0,0 +1,60 @@ +// Copyright (c) 2014-2023 Thomas Heller +// +// 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 + +#if defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_LCI) + +#include + +namespace hpx::parcelset::policies::lci { + struct completion_manager_sync_single : public completion_manager_base + { + completion_manager_sync_single() + { + LCI_sync_create(LCI_UR_DEVICE, 1, &sync); + } + + ~completion_manager_sync_single() + { + LCI_sync_free(&sync); + } + + LCI_comp_t alloc_completion() + { + return sync; + } + + void enqueue_completion(LCI_comp_t comp) + { + HPX_UNUSED(comp); + lock.unlock(); + } + + LCI_request_t poll() + { + LCI_request_t request; + request.flag = LCI_ERR_RETRY; + + bool succeed = lock.try_lock(); + if (succeed) + { + LCI_error_t ret = LCI_sync_test(sync, &request); + if (ret == LCI_ERR_RETRY) + lock.unlock(); + } + return request; + } + + private: + hpx::spinlock lock; + LCI_comp_t sync; + }; +} // namespace hpx::parcelset::policies::lci + +#endif diff --git a/libs/full/parcelport_lci/include/hpx/parcelport_lci/config.hpp b/libs/full/parcelport_lci/include/hpx/parcelport_lci/config.hpp index 5d224f7b52c8..376a78b70019 100644 --- a/libs/full/parcelport_lci/include/hpx/parcelport_lci/config.hpp +++ b/libs/full/parcelport_lci/include/hpx/parcelport_lci/config.hpp @@ -17,8 +17,6 @@ namespace hpx::parcelset::policies::lci { { // whether init_config has been called static bool is_initialized; - // whether to use separate devices/progress threads for eager and iovec messages. - static bool use_two_device; // whether to bypass the parcel queue and connection cache. static bool enable_send_immediate; // whether to enable the backlog queue and eager message aggregation @@ -36,13 +34,14 @@ namespace hpx::parcelset::policies::lci { // how to run LCI_progress enum class progress_type_t { - rp, // HPX resource partitioner - pthread, // Normal pthread - worker, // HPX worker thread + rp, // HPX resource partitioner + pthread, // Normal progress pthread + worker, // HPX worker thread + pthread_worker, // Normal progress pthread + worker thread }; static progress_type_t progress_type; - // Which core to pin the progress threads - static int progress_thread_core; + // How many progress threads to create + static int progress_thread_num; // How many pre-posted receives for new messages // (can only be applied to `sendrecv` protocol). static int prepost_recv_num; diff --git a/libs/full/parcelport_lci/include/hpx/parcelport_lci/parcelport_lci.hpp b/libs/full/parcelport_lci/include/hpx/parcelport_lci/parcelport_lci.hpp index 2852f69ebb98..7f84f7455897 100644 --- a/libs/full/parcelport_lci/include/hpx/parcelport_lci/parcelport_lci.hpp +++ b/libs/full/parcelport_lci/include/hpx/parcelport_lci/parcelport_lci.hpp @@ -26,6 +26,7 @@ #include #include #include +#include namespace hpx::parcelset { namespace policies::lci { @@ -123,16 +124,13 @@ namespace hpx::parcelset { std::atomic is_sending_early_parcel = false; // LCI objects - LCI_device_t device_eager; - LCI_device_t device_iovec; - LCI_endpoint_t endpoint_new_eager; + LCI_device_t device; + LCI_endpoint_t endpoint_new; LCI_endpoint_t endpoint_followup; - LCI_endpoint_t endpoint_new_iovec; // Parcelport objects static std::atomic prg_thread_flag; - std::unique_ptr prg_thread_eager_p; - std::unique_ptr prg_thread_iovec_p; + std::unique_ptr prg_thread_p; std::shared_ptr send_completion_manager; std::shared_ptr recv_new_completion_manager; @@ -195,20 +193,35 @@ namespace hpx::traits { "wrong!\n"); exit(1); } - rp.create_thread_pool("lci-progress-pool-eager", + rp.create_thread_pool("lci-progress-pool", hpx::resource::scheduling_policy::static_, hpx::threads::policies::scheduler_mode:: do_background_work_only); - if (parcelset::policies::lci::config_t::use_two_device) - rp.create_thread_pool("lci-progress-pool-iovec", - hpx::resource::scheduling_policy::static_, - hpx::threads::policies::scheduler_mode:: - do_background_work_only); - rp.add_resource(rp.numa_domains()[0].cores()[0].pus()[0], - "lci-progress-pool-eager"); - if (parcelset::policies::lci::config_t::use_two_device) - rp.add_resource(rp.numa_domains()[0].cores()[1].pus()[0], - "lci-progress-pool-iovec"); + + size_t ncores_to_add = + parcelset::policies::lci::config_t::progress_thread_num; + std::vector cores; + for (auto& numa_domain : rp.numa_domains()) + { + for (auto& core : numa_domain.cores()) + { + cores.push_back(&core); + } + } + if (cores.size() <= 1) + { + fprintf(stderr, "We don't have enough cores!\n"); + exit(1); + } + if ((size_t) ncores_to_add > cores.size() / 2) + { + ncores_to_add = cores.size() / 2; + } + for (size_t i = 0; i < ncores_to_add; ++i) + { + size_t next_core = i * cores.size() / ncores_to_add; + rp.add_resource(*cores[next_core], "lci-progress-pool"); + } } } @@ -232,9 +245,8 @@ namespace hpx::traits { "log_level = none\n" "log_outfile = stderr\n" "backlog_queue = 0\n" - "use_two_device = 0\n" - "prg_thread_core = -1\n" - "protocol = putva\n" + "prg_thread_num = 1\n" + "protocol = putsendrecv\n" "comp_type = queue\n" "progress_type = rp\n" "prepost_recv_num = 1\n"; diff --git a/libs/full/parcelport_lci/include/hpx/parcelport_lci/sendrecv/receiver_sendrecv.hpp b/libs/full/parcelport_lci/include/hpx/parcelport_lci/sendrecv/receiver_sendrecv.hpp index 8b2e084c3ae6..47dda2c04c47 100644 --- a/libs/full/parcelport_lci/include/hpx/parcelport_lci/sendrecv/receiver_sendrecv.hpp +++ b/libs/full/parcelport_lci/include/hpx/parcelport_lci/sendrecv/receiver_sendrecv.hpp @@ -46,8 +46,8 @@ namespace hpx::parcelset::policies::lci { { LCI_comp_t completion = pp_->recv_new_completion_manager->alloc_completion(); - LCI_recvmn(pp_->endpoint_new_eager, LCI_RANK_ANY, 0, - completion, nullptr); + LCI_recvmn(pp_->endpoint_new, LCI_RANK_ANY, 0, completion, + nullptr); pp_->recv_new_completion_manager->enqueue_completion( completion); } diff --git a/libs/full/parcelport_lci/src/config.cpp b/libs/full/parcelport_lci/src/config.cpp index 7859e4980448..ace852670da3 100644 --- a/libs/full/parcelport_lci/src/config.cpp +++ b/libs/full/parcelport_lci/src/config.cpp @@ -18,13 +18,12 @@ namespace hpx::parcelset::policies::lci { bool config_t::is_initialized = false; - bool config_t::use_two_device; bool config_t::enable_send_immediate; bool config_t::enable_lci_backlog_queue; config_t::protocol_t config_t::protocol; LCI_comp_type_t config_t::completion_type; config_t::progress_type_t config_t::progress_type; - int config_t::progress_thread_core; + int config_t::progress_thread_num; int config_t::prepost_recv_num; void config_t::init_config(util::runtime_configuration const& rtcfg) @@ -37,8 +36,6 @@ namespace hpx::parcelset::policies::lci { rtcfg, "hpx.parcel.lci.sendimm", false /* Does not matter*/); enable_lci_backlog_queue = util::get_entry_as( rtcfg, "hpx.parcel.lci.backlog_queue", false /* Does not matter*/); - use_two_device = util::get_entry_as( - rtcfg, "hpx.parcel.lci.use_two_device", false); // set protocol to use std::string protocol_str = util::get_entry_as( rtcfg, "hpx.parcel.lci.protocol", ""); @@ -89,24 +86,20 @@ namespace hpx::parcelset::policies::lci { { progress_type = progress_type_t::worker; } + else if (progress_type_str == "pthread_worker") + { + progress_type = progress_type_t::pthread_worker; + } else { throw std::runtime_error( "Unknown progress type " + progress_type_str); } - progress_thread_core = - util::get_entry_as(rtcfg, "hpx.parcel.lci.prg_thread_core", -1); + progress_thread_num = + util::get_entry_as(rtcfg, "hpx.parcel.lci.prg_thread_num", -1); prepost_recv_num = util::get_entry_as(rtcfg, "hpx.parcel.lci.prepost_recv_num", 1); - if (protocol == protocol_t::sendrecv) - { - if (use_two_device) - { - use_two_device = false; - fprintf(stderr, "WARNING: set use_two_device to false!\n"); - } - } if (!enable_send_immediate && enable_lci_backlog_queue) { enable_lci_backlog_queue = false; @@ -120,12 +113,6 @@ namespace hpx::parcelset::policies::lci { progress_type = progress_type_t::pthread; fprintf(stderr, "WARNING: set progress_type to pthread!\n"); } - if (use_two_device && progress_type == progress_type_t::rp && - num_threads <= 2) - { - use_two_device = false; - fprintf(stderr, "WARNING: set use_two_device to false!\n"); - } } } // namespace hpx::parcelset::policies::lci #endif diff --git a/libs/full/parcelport_lci/src/parcelport_lci.cpp b/libs/full/parcelport_lci/src/parcelport_lci.cpp index 8addd5611b0f..8d96e8b61551 100644 --- a/libs/full/parcelport_lci/src/parcelport_lci.cpp +++ b/libs/full/parcelport_lci/src/parcelport_lci.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -77,7 +78,9 @@ namespace hpx::parcelset::policies::lci { void parcelport::initialized() { if (util::lci_environment::enabled() && - config_t::progress_type != config_t::progress_type_t::pthread) + config_t::progress_type != config_t::progress_type_t::pthread && + config_t::progress_type != + config_t::progress_type_t::pthread_worker) { join_prg_thread_if_running(); } @@ -156,13 +159,8 @@ namespace hpx::parcelset::policies::lci { hpx::threads::get_self_id() != hpx::threads::invalid_thread_id) { if (hpx::this_thread::get_pool() == - &hpx::resource::get_thread_pool("lci-progress-pool-eager")) + &hpx::resource::get_thread_pool("lci-progress-pool")) do_lci_progress = 1; - else if (config_t::use_two_device && - hpx::this_thread::get_pool() == - &hpx::resource::get_thread_pool( - "lci-progress-pool-iovec")) - do_lci_progress = 2; } } @@ -174,7 +172,7 @@ namespace hpx::parcelset::policies::lci { int idle_loop_count = 0; while (idle_loop_count < max_idle_loop_count) { - while (util::lci_environment::do_progress(device_eager)) + while (util::lci_environment::do_progress(device)) { has_work = true; idle_loop_count = 0; @@ -187,7 +185,7 @@ namespace hpx::parcelset::policies::lci { int idle_loop_count = 0; while (idle_loop_count < max_idle_loop_count) { - while (util::lci_environment::do_progress(device_iovec)) + while (util::lci_environment::do_progress(device)) { has_work = true; idle_loop_count = 0; @@ -212,7 +210,9 @@ namespace hpx::parcelset::policies::lci { if (mode & parcelport_background_mode_send) { has_work = sender_p->background_work(num_thread); - if (config_t::progress_type == config_t::progress_type_t::worker) + if (config_t::progress_type == config_t::progress_type_t::worker || + config_t::progress_type == + config_t::progress_type_t::pthread_worker) do_progress(); if (config_t::enable_lci_backlog_queue) // try to send pending messages @@ -223,7 +223,9 @@ namespace hpx::parcelset::policies::lci { if (mode & parcelport_background_mode_receive) { has_work = receiver_p->background_work() || has_work; - if (config_t::progress_type == config_t::progress_type_t::worker) + if (config_t::progress_type == config_t::progress_type_t::worker || + config_t::progress_type == + config_t::progress_type_t::pthread_worker) do_progress(); } return has_work; @@ -253,7 +255,9 @@ namespace hpx::parcelset::policies::lci { { bool has_work = sender_p->background_work(0); has_work = receiver_p->background_work() || has_work; - if (config_t::progress_type == config_t::progress_type_t::worker) + if (config_t::progress_type == config_t::progress_type_t::worker || + config_t::progress_type == + config_t::progress_type_t::pthread_worker) while (do_progress()) continue; if (has_work) @@ -297,18 +301,22 @@ namespace hpx::parcelset::policies::lci { { HPX_UNUSED(rtcfg); // Create device - device_eager = LCI_UR_DEVICE; - if (config_t::use_two_device) - LCI_device_init(&device_iovec); - else - device_iovec = LCI_UR_DEVICE; + device = LCI_UR_DEVICE; // Create completion objects if (config_t::protocol == config_t::protocol_t::sendrecv && config_t::completion_type == LCI_COMPLETION_SYNC) { - recv_new_completion_manager = - std::make_shared(); + if (config_t::prepost_recv_num == 1) + { + recv_new_completion_manager = + std::make_shared(); + } + else + { + recv_new_completion_manager = + std::make_shared(); + } } else { @@ -340,7 +348,7 @@ namespace hpx::parcelset::policies::lci { plist_, LCI_PORT_COMMAND, config_t::completion_type); LCI_plist_set_comp_type( plist_, LCI_PORT_MESSAGE, config_t::completion_type); - LCI_endpoint_init(&endpoint_followup, device_eager, plist_); + LCI_endpoint_init(&endpoint_followup, device, plist_); LCI_plist_set_default_comp( plist_, recv_new_completion_manager->get_completion_object()); if (config_t::protocol == config_t::protocol_t::sendrecv && @@ -354,28 +362,15 @@ namespace hpx::parcelset::policies::lci { } if (config_t::protocol == config_t::protocol_t::sendrecv) LCI_plist_set_match_type(plist_, LCI_MATCH_TAG); - LCI_endpoint_init(&endpoint_new_eager, device_eager, plist_); - LCI_endpoint_init(&endpoint_new_iovec, device_iovec, plist_); + LCI_endpoint_init(&endpoint_new, device, plist_); LCI_plist_free(&plist_); // Create progress threads HPX_ASSERT(prg_thread_flag == false); - HPX_ASSERT(prg_thread_eager_p == nullptr); - HPX_ASSERT(prg_thread_iovec_p == nullptr); + HPX_ASSERT(prg_thread_p == nullptr); prg_thread_flag = true; - prg_thread_eager_p = - std::make_unique(progress_thread_fn, device_eager); - if (config_t::use_two_device) - prg_thread_iovec_p = - std::make_unique(progress_thread_fn, device_iovec); - if (config_t::progress_thread_core >= 0) - { - set_affinity(prg_thread_eager_p->native_handle(), - config_t::progress_thread_core); - if (config_t::use_two_device) - set_affinity(prg_thread_iovec_p->native_handle(), - config_t::progress_thread_core + 1); - } + prg_thread_p = + std::make_unique(progress_thread_fn, device); // Create the sender and receiver switch (config_t::protocol) @@ -398,27 +393,19 @@ namespace hpx::parcelset::policies::lci { { join_prg_thread_if_running(); // free ep, rcq - LCI_endpoint_free(&endpoint_new_iovec); LCI_endpoint_free(&endpoint_followup); - LCI_endpoint_free(&endpoint_new_eager); - if (config_t::use_two_device) - LCI_device_free(&device_iovec); + LCI_endpoint_free(&endpoint_new); } void parcelport::join_prg_thread_if_running() { - if (prg_thread_eager_p || prg_thread_iovec_p) + if (prg_thread_p) { prg_thread_flag = false; - if (prg_thread_eager_p) - { - prg_thread_eager_p->join(); - prg_thread_eager_p.reset(); - } - if (prg_thread_iovec_p) + if (prg_thread_p) { - prg_thread_iovec_p->join(); - prg_thread_iovec_p.reset(); + prg_thread_p->join(); + prg_thread_p.reset(); } } } @@ -426,9 +413,7 @@ namespace hpx::parcelset::policies::lci { bool parcelport::do_progress() { bool ret = false; - ret = util::lci_environment::do_progress(device_eager) || ret; - if (config_t::use_two_device) - ret = util::lci_environment::do_progress(device_iovec) || ret; + ret = util::lci_environment::do_progress(device) || ret; return ret; } } // namespace hpx::parcelset::policies::lci diff --git a/libs/full/parcelport_lci/src/putva/sender_connection_putva.cpp b/libs/full/parcelport_lci/src/putva/sender_connection_putva.cpp index adb7906eb18a..1b13cac06738 100644 --- a/libs/full/parcelport_lci/src/putva/sender_connection_putva.cpp +++ b/libs/full/parcelport_lci/src/putva/sender_connection_putva.cpp @@ -62,7 +62,7 @@ namespace hpx::parcelset::policies::lci { int num_zero_copy_chunks = static_cast(buffer_.num_chunks_.first); if (is_eager) { - while (LCI_mbuffer_alloc(pp_->device_eager, &mbuffer) != LCI_OK) + while (LCI_mbuffer_alloc(pp_->device, &mbuffer) != LCI_OK) continue; HPX_ASSERT(mbuffer.length == (size_t) LCI_MEDIUM_SIZE); header_ = header(buffer_, (char*) mbuffer.address, mbuffer.length); @@ -172,7 +172,7 @@ namespace hpx::parcelset::policies::lci { int ret; if (is_eager) { - ret = LCI_putmna(pp_->endpoint_new_eager, mbuffer, dst_rank, 0, + ret = LCI_putmna(pp_->endpoint_new, mbuffer, dst_rank, 0, LCI_DEFAULT_COMP_REMOTE); if (ret == LCI_OK) { @@ -191,8 +191,8 @@ namespace hpx::parcelset::policies::lci { // We will get this pointer back via the send completion queue // after this send completes. state.store(connection_state::locked, std::memory_order_relaxed); - ret = LCI_putva(pp_->endpoint_new_iovec, iovec, completion, - dst_rank, 0, LCI_DEFAULT_COMP_REMOTE, sharedPtr_p); + ret = LCI_putva(pp_->endpoint_new, iovec, completion, dst_rank, 0, + LCI_DEFAULT_COMP_REMOTE, sharedPtr_p); // After this point, if ret == OK, this object can be shared by // two threads (the sending thread and the thread polling the // completion queue). Care must be taken to avoid data race. diff --git a/libs/full/parcelport_lci/src/sender_connection_base.cpp b/libs/full/parcelport_lci/src/sender_connection_base.cpp index 3f6cdd837cd3..f24a39b9a075 100644 --- a/libs/full/parcelport_lci/src/sender_connection_base.cpp +++ b/libs/full/parcelport_lci/src/sender_connection_base.cpp @@ -55,8 +55,10 @@ namespace hpx::parcelset::policies::lci { { ret = send_nb(); if (ret.status == return_status_t::retry && - config_t::progress_type == - config_t::progress_type_t::worker) + (config_t::progress_type == + config_t::progress_type_t::worker || + config_t::progress_type == + config_t::progress_type_t::pthread_worker)) while (pp_->do_progress()) continue; } while (ret.status == return_status_t::retry); diff --git a/libs/full/parcelport_lci/src/sendrecv/receiver_sendrecv.cpp b/libs/full/parcelport_lci/src/sendrecv/receiver_sendrecv.cpp index 0e002ee7c888..6f9cfbd06b8c 100644 --- a/libs/full/parcelport_lci/src/sendrecv/receiver_sendrecv.cpp +++ b/libs/full/parcelport_lci/src/sendrecv/receiver_sendrecv.cpp @@ -47,12 +47,11 @@ namespace hpx::parcelset::policies::lci { { LCI_comp_t completion = pp_->recv_new_completion_manager->alloc_completion(); - LCI_recvmn(pp_->endpoint_new_eager, LCI_RANK_ANY, 0, completion, - nullptr); + LCI_recvmn( + pp_->endpoint_new, LCI_RANK_ANY, 0, completion, nullptr); pp_->recv_new_completion_manager->enqueue_completion( completion); } - HPX_ASSERT(request.request.flag == LCI_OK); util::lci_environment::log( util::lci_environment::log_level_t::debug, "accept_new (%d, %d, %d) length %lu\n", request.request.rank, diff --git a/libs/full/parcelport_lci/src/sendrecv/sender_connection_sendrecv.cpp b/libs/full/parcelport_lci/src/sendrecv/sender_connection_sendrecv.cpp index 6d9dfee675c3..dd421c9028b1 100644 --- a/libs/full/parcelport_lci/src/sendrecv/sender_connection_sendrecv.cpp +++ b/libs/full/parcelport_lci/src/sendrecv/sender_connection_sendrecv.cpp @@ -44,7 +44,7 @@ namespace hpx::parcelset::policies::lci { postprocess_handler_ = HPX_MOVE(parcel_postprocess); // build header - while (LCI_mbuffer_alloc(pp_->device_eager, &header_buffer) != LCI_OK) + while (LCI_mbuffer_alloc(pp_->device, &header_buffer) != LCI_OK) continue; HPX_ASSERT(header_buffer.length == (size_t) LCI_MEDIUM_SIZE); header_ = header( @@ -138,14 +138,13 @@ namespace hpx::parcelset::policies::lci { LCI_error_t ret; if (config_t::protocol == config_t::protocol_t::putsendrecv) { - ret = LCI_putmna(pp_->endpoint_new_eager, header_buffer, dst_rank, - 0, LCI_DEFAULT_COMP_REMOTE); + ret = LCI_putmna(pp_->endpoint_new, header_buffer, dst_rank, 0, + LCI_DEFAULT_COMP_REMOTE); } else { HPX_ASSERT(config_t::protocol == config_t::protocol_t::sendrecv); - ret = - LCI_sendmn(pp_->endpoint_new_eager, header_buffer, dst_rank, 0); + ret = LCI_sendmn(pp_->endpoint_new, header_buffer, dst_rank, 0); } if (ret == LCI_OK) { diff --git a/tests/performance/network/CMakeLists.txt b/tests/performance/network/CMakeLists.txt index 6b48f777720d..9e3342987369 100644 --- a/tests/performance/network/CMakeLists.txt +++ b/tests/performance/network/CMakeLists.txt @@ -14,7 +14,7 @@ foreach(subdir ${subdirs}) ) endforeach() -set(benchmarks pingpong_performance) +set(benchmarks pingpong_performance pingpong_performance2) foreach(benchmark ${benchmarks}) diff --git a/tests/performance/network/pingpong_performance2.cpp b/tests/performance/network/pingpong_performance2.cpp new file mode 100644 index 000000000000..57f0772a3df6 --- /dev/null +++ b/tests/performance/network/pingpong_performance2.cpp @@ -0,0 +1,205 @@ +// Copyright (c) 2023 Jiakun Yan +// +// 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 +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +const std::size_t nbytes_default = 8; +const std::size_t nsteps_default = 1; +const std::size_t window_default = 10000; +const std::size_t inject_rate_default = 0; +const std::size_t batch_size_default = 10; + +size_t window; +size_t inject_rate; +size_t batch_size; + +/////////////////////////////////////////////////////////////////////////////// + +void set_window(std::size_t window); +HPX_PLAIN_ACTION(set_window, set_window_action) + +void on_inject(hpx::id_type to, size_t nbytes, std::size_t nsteps); +HPX_PLAIN_ACTION(on_inject, on_inject_action) + +void on_recv(hpx::id_type to, std::vector const& in, std::size_t counter); +HPX_PLAIN_ACTION(on_recv, on_recv_action) + +void on_done(); +HPX_PLAIN_ACTION(on_done, on_done_action) + +void set_window(std::size_t window_) +{ + window = window_; +} + +void on_inject(hpx::id_type to, std::size_t nbytes, std::size_t nsteps) +{ + hpx::chrono::high_resolution_timer timer; + for (size_t i = 0; i < batch_size; ++i) + { + while (inject_rate > 0 && + static_cast(i) / timer.elapsed() > + static_cast(inject_rate)) + { + hpx::this_thread::yield(); + } + std::vector data(nbytes, 'a'); + hpx::post(to, hpx::find_here(), data, nsteps); + } +} + +std::atomic done_counter(0); + +void on_recv(hpx::id_type to, std::vector const& in, std::size_t counter) +{ + // received vector in + if (--counter == 0) + { + size_t result = done_counter.fetch_add(1, std::memory_order_relaxed); + if (result + 1 == window) + { + hpx::post(hpx::find_root_locality()); + } + return; + } + + // send it to remote locality (to) + std::vector data(in); + hpx::post(to, hpx::find_here(), std::move(data), counter); +} + +hpx::counting_semaphore_var<> semaphore; + +void on_done() +{ + semaphore.signal(); +} + +/////////////////////////////////////////////////////////////////////////////// +int hpx_main(hpx::program_options::variables_map& b_arg) +{ + std::size_t const nbytes = b_arg["nbytes"].as(); + std::size_t const nsteps = b_arg["nsteps"].as(); + bool verbose = b_arg["verbose"].as(); + window = b_arg["window"].as(); + inject_rate = b_arg["inject-rate"].as(); + batch_size = b_arg["batch-size"].as(); + + if (nsteps == 0) + { + std::cout << "nsteps is 0!" << std::endl; + return 0; + } + + std::vector localities = hpx::find_remote_localities(); + + hpx::id_type to; + if (localities.size() == 0) + { + to = hpx::find_here(); + } + else + { + to = localities[0]; // send to first remote locality + } + + set_window_action act; + act(to, window); + + hpx::chrono::high_resolution_timer timer_total; + + for (size_t i = 0; i < window; i += batch_size) + { + while (inject_rate > 0 && + static_cast(i) / timer_total.elapsed() > + static_cast(inject_rate)) + { + continue; + } + hpx::post(hpx::find_here(), to, nbytes, nsteps); + } + double achieved_inject_rate = + static_cast(window) / timer_total.elapsed() / 1e3; + + semaphore.wait(); + + double time = timer_total.elapsed(); + double latency = time * 1e6 / static_cast(nsteps); + double msg_rate = static_cast(nsteps * window) / time / 1e3; + double bandwidth = + static_cast(nbytes * nsteps * window) / time / 1e6; + if (verbose) + { + std::cout << "[hpx_pingpong]" << std::endl + << "total_time(secs)=" << time << std::endl + << "nbytes=" << nbytes << std::endl + << "window=" << window << std::endl + << "latency(us)=" << latency << std::endl + << "inject_rate(K/s)=" << achieved_inject_rate << std::endl + << "msg_rate(K/s)=" << msg_rate << std::endl + << "bandwidth(MB/s)=" << bandwidth << std::endl + << "localities=" << localities.size() << std::endl + << "nsteps=" << nsteps << std::endl; + } + else + { + std::cout << "[hpx_pingpong]" + << ":total_time(secs)=" << time << ":nbytes=" << nbytes + << ":window=" << window << ":latency(us)=" << latency + << ":inject_rate(K/s)=" << achieved_inject_rate + << ":msg_rate(M/s)=" << msg_rate + << ":bandwidth(MB/s)=" << bandwidth + << ":localities=" << localities.size() << ":nsteps=" << nsteps + << std::endl; + } + + hpx::finalize(); + return 0; +} + +int main(int argc, char* argv[]) +{ + namespace po = hpx::program_options; + po::options_description description("HPX pingpong example"); + + description.add_options()("nbytes", + po::value()->default_value(nbytes_default), + "number of elements (doubles) to send/receive (integer)")("nsteps", + po::value()->default_value(nsteps_default), + "number of ping-pong iterations")("window", + po::value()->default_value(window_default), + "window size of ping-pong")("inject-rate", + po::value()->default_value(inject_rate_default), + "the rate of injecting the first message of ping-pong")("batch-size", + po::value()->default_value(batch_size_default), + "the number of messages to inject per inject thread")("verbose", + po::value()->default_value(true), + "verbosity of output,if false output is for awk"); + + hpx::init_params init_args; + init_args.desc_cmdline = description; + + return hpx::init(argc, argv, init_args); +} + +#endif From bad3b6fd7151158edc399a0edf296380836c5d0a Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 26 Jun 2023 11:11:59 -0500 Subject: [PATCH 43/72] Adding user supplied on_finalize --- .../init_runtime_local/init_runtime_local.hpp | 3 ++ .../src/init_runtime_local.cpp | 9 ++++ .../tests/unit/CMakeLists.txt | 4 +- .../tests/unit/on_finalize.cpp | 40 ++++++++++++++++++ libs/full/init_runtime/CMakeLists.txt | 2 +- libs/full/init_runtime/src/hpx_init.cpp | 42 ++++++++++--------- 6 files changed, 78 insertions(+), 22 deletions(-) create mode 100644 libs/core/init_runtime_local/tests/unit/on_finalize.cpp diff --git a/libs/core/init_runtime_local/include/hpx/init_runtime_local/init_runtime_local.hpp b/libs/core/init_runtime_local/include/hpx/init_runtime_local/init_runtime_local.hpp index 7c10bcca5dbf..8adec133a794 100644 --- a/libs/core/init_runtime_local/include/hpx/init_runtime_local/init_runtime_local.hpp +++ b/libs/core/init_runtime_local/include/hpx/init_runtime_local/init_runtime_local.hpp @@ -221,4 +221,7 @@ namespace hpx { HPX_CORE_EXPORT int suspend(error_code& ec = throws); HPX_CORE_EXPORT int resume(error_code& ec = throws); } // namespace local + + // Allow applications to add a finalizer if HPX_MAIN is set + HPX_CORE_EXPORT extern void (*on_finalize)(); } // namespace hpx diff --git a/libs/core/init_runtime_local/src/init_runtime_local.cpp b/libs/core/init_runtime_local/src/init_runtime_local.cpp index baa175d889f8..2e0f9eb3a2b6 100644 --- a/libs/core/init_runtime_local/src/init_runtime_local.cpp +++ b/libs/core/init_runtime_local/src/init_runtime_local.cpp @@ -69,6 +69,9 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx { + + void (*on_finalize)() = nullptr; + namespace detail { int init_helper(hpx::program_options::variables_map& /*vm*/, @@ -151,6 +154,12 @@ namespace hpx { rt->finalize(0); + // invoke user supplied finalizer + if (hpx::on_finalize != nullptr) + { + (*hpx::on_finalize)(); + } + return 0; } diff --git a/libs/core/init_runtime_local/tests/unit/CMakeLists.txt b/libs/core/init_runtime_local/tests/unit/CMakeLists.txt index f141f5c62db9..1f0d848c8ba5 100644 --- a/libs/core/init_runtime_local/tests/unit/CMakeLists.txt +++ b/libs/core/init_runtime_local/tests/unit/CMakeLists.txt @@ -1,10 +1,10 @@ -# Copyright (c) 2020 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 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -set(tests shutdown_suspended_thread_local) +set(tests on_finalize shutdown_suspended_thread_local) foreach(test ${tests}) set(sources ${test}.cpp) diff --git a/libs/core/init_runtime_local/tests/unit/on_finalize.cpp b/libs/core/init_runtime_local/tests/unit/on_finalize.cpp new file mode 100644 index 000000000000..362aa2e824a1 --- /dev/null +++ b/libs/core/init_runtime_local/tests/unit/on_finalize.cpp @@ -0,0 +1,40 @@ +// Copyright (c) 2023 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) + +#include +#include + +int hpx_main() +{ + return hpx::local::finalize(); +} + +bool called_on_finalize = false; + +void finalize_callback() +{ + called_on_finalize = true; +} + +struct set_finalizer +{ + set_finalizer() + { + hpx::on_finalize = &finalize_callback; + } +}; + +set_finalizer init; + +int main(int argc, char** argv) +{ + HPX_TEST_EQ(hpx::local::init(hpx_main, argc, argv), 0); + + // on_finalize should have been called at this point + HPX_TEST(called_on_finalize); + + return hpx::util::report_errors(); +} diff --git a/libs/full/init_runtime/CMakeLists.txt b/libs/full/init_runtime/CMakeLists.txt index 55bb53b69538..7b3edd57771c 100644 --- a/libs/full/init_runtime/CMakeLists.txt +++ b/libs/full/init_runtime/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2020 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 diff --git a/libs/full/init_runtime/src/hpx_init.cpp b/libs/full/init_runtime/src/hpx_init.cpp index 8623d500cc8f..d86502386ac3 100644 --- a/libs/full/init_runtime/src/hpx_init.cpp +++ b/libs/full/init_runtime/src/hpx_init.cpp @@ -73,7 +73,6 @@ #include #include #include -#include #include #include #endif @@ -86,7 +85,6 @@ #include #include #include -#include #include #include #include @@ -100,7 +98,7 @@ namespace hpx_startup { std::vector (*user_main_config_function)( std::vector const&) = nullptr; -} // namespace hpx_startup +} /////////////////////////////////////////////////////////////////////////////// namespace hpx::detail { @@ -135,7 +133,7 @@ namespace hpx::detail { 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); + [[maybe_unused]] int const ret = std::at_quick_exit(detail::on_exit); HPX_ASSERT(ret == 0); #endif return detail::run_or_start(f, argc, argv, params, true); @@ -168,7 +166,7 @@ namespace hpx::detail { 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); + [[maybe_unused]] int const ret = std::at_quick_exit(detail::on_exit); HPX_ASSERT(ret == 0); #endif return 0 == detail::run_or_start(f, argc, argv, params, false); @@ -319,7 +317,7 @@ namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// void list_symbolic_name(std::string const& name, hpx::id_type const& id) { - std::string str = hpx::util::format("{}, {}, {}", name, id, + std::string const str = hpx::util::format("{}, {}, {}", name, id, (id.get_management_type() == id_type::management_type::managed ? "management_type::managed" : "management_type::unmanaged")); @@ -331,7 +329,7 @@ namespace hpx::detail { print(std::string("List of all registered symbolic names:")); print(std::string("--------------------------------------")); - std::map entries = + std::map const entries = agas::find_symbols(hpx::launch::sync); for (auto const& e : entries) @@ -644,7 +642,8 @@ namespace hpx { { if (vm.count("hpx:app-config")) { - std::string config(vm["hpx:app-config"].as()); + std::string const config( + vm["hpx:app-config"].as()); rt.get_config().load_application_configuration(config.c_str()); } @@ -657,7 +656,7 @@ namespace hpx { #if defined(HPX_HAVE_DISTRIBUTED_RUNTIME) // Add startup function related to listing counter names or counter // infos (on console only). - bool print_counters_locally = + bool const print_counters_locally = vm.count("hpx:print-counters-locally") != 0; if (mode == runtime_mode::console || print_counters_locally) handle_list_and_print_options(rt, vm, print_counters_locally); @@ -735,8 +734,8 @@ namespace hpx { HPX_MOVE(startup), HPX_MOVE(shutdown)); // pointer to runtime is stored in TLS - hpx::runtime* p = rt.release(); - (void) p; + [[maybe_unused]] hpx::runtime const* p = rt.release(); + HPX_ASSERT(p != nullptr); return 0; } @@ -851,7 +850,7 @@ namespace hpx { { init_environment(); - int result = 0; + int result; try { // make sure the runtime system is not active yet @@ -898,7 +897,7 @@ namespace hpx { cmdline.rtcfg_.get_entry("hpx.affinity", ""), cmdline.rtcfg_.get_entry("hpx.bind", ""), hpx::util::get_entry_as( - cmdline.rtcfg_, "hpx.use_process_mask", 0)); + cmdline.rtcfg_, "hpx.use_process_mask", false)); hpx::resource::partitioner rp = hpx::resource::detail::make_partitioner( @@ -1041,9 +1040,9 @@ namespace hpx { localwait = detail::get_option("hpx.finalize_wait_time", -1.0); { - hpx::chrono::high_resolution_timer t; - double start_time = t.elapsed(); - double current = 0.0; + hpx::chrono::high_resolution_timer const t; + double const start_time = t.elapsed(); + double current; do { current = t.elapsed(); @@ -1064,6 +1063,11 @@ namespace hpx { rt->finalize(shutdown_timeout); + // invoke user supplied finalizer + if (hpx::on_finalize != nullptr) + { + (*hpx::on_finalize)(); + } return 0; } @@ -1093,9 +1097,9 @@ namespace hpx { localwait = detail::get_option("hpx.finalize_wait_time", -1.0); { - hpx::chrono::high_resolution_timer t; - double start_time = t.elapsed(); - double current = 0.0; + hpx::chrono::high_resolution_timer const t; + double const start_time = t.elapsed(); + double current; do { current = t.elapsed(); From cddb0b15c542ee07876a8328cc30e5aefaa6586b Mon Sep 17 00:00:00 2001 From: Jiakun Yan Date: Mon, 5 Jun 2023 00:33:31 -0500 Subject: [PATCH 44/72] Improve the MPI parcelport and change the default zero-copy serialization threshold from 128 to 8192 - Replace the lock-based tag provider with an atomic variable - Make the header message size dynamic --- CMakeLists.txt | 4 +- cmake/toolchains/Cray.cmake | 6 - cmake/toolchains/CrayKNL.cmake | 6 - cmake/toolchains/CrayKNLStatic.cmake | 6 - cmake/toolchains/CrayStatic.cmake | 6 - .../include/hpx/mpi_base/mpi_environment.hpp | 2 + libs/core/mpi_base/src/mpi_environment.cpp | 7 + .../include/hpx/parcelport_lci/header.hpp | 8 - .../include/hpx/parcelport_mpi/header.hpp | 221 +++++++++++++----- .../include/hpx/parcelport_mpi/receiver.hpp | 32 +-- .../parcelport_mpi/receiver_connection.hpp | 120 +++++----- .../include/hpx/parcelport_mpi/sender.hpp | 78 +------ .../hpx/parcelport_mpi/sender_connection.hpp | 16 +- .../hpx/parcelport_mpi/tag_provider.hpp | 36 +-- 14 files changed, 277 insertions(+), 271 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb4bd1aa04c8..223d14a273ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -655,8 +655,8 @@ endif() hpx_option( HPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD STRING - "The threshold in bytes to when perform zero copy optimizations (default: 128)" - "128" + "The threshold in bytes to when perform zero copy optimizations (default: 8192)" + "8192" ADVANCED ) hpx_add_config_define( diff --git a/cmake/toolchains/Cray.cmake b/cmake/toolchains/Cray.cmake index 0b6e6d3eb1cc..83b9c051f133 100644 --- a/cmake/toolchains/Cray.cmake +++ b/cmake/toolchains/Cray.cmake @@ -90,12 +90,6 @@ set(HPX_PARCELPORT_LIBFABRIC_WITH_LOGGING OFF CACHE BOOL "Libfabric parcelport logging on/off flag" ) -set(HPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD - "4096" - CACHE - STRING - "The threshold in bytes to when perform zero copy optimizations (default: 128)" -) # We do a cross compilation here ... set(CMAKE_CROSSCOMPILING diff --git a/cmake/toolchains/CrayKNL.cmake b/cmake/toolchains/CrayKNL.cmake index cd9da9c23633..126bcc9a0385 100644 --- a/cmake/toolchains/CrayKNL.cmake +++ b/cmake/toolchains/CrayKNL.cmake @@ -88,12 +88,6 @@ set(HPX_PARCELPORT_LIBFABRIC_WITH_LOGGING OFF CACHE BOOL "Libfabric parcelport logging on/off flag" ) -set(HPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD - "4096" - CACHE - STRING - "The threshold in bytes to when perform zero copy optimizations (default: 128)" -) # Set the TBBMALLOC_PLATFORM correctly so that find_package(TBBMalloc) sets the # right hints diff --git a/cmake/toolchains/CrayKNLStatic.cmake b/cmake/toolchains/CrayKNLStatic.cmake index 395b719ce05f..97843059eaa7 100644 --- a/cmake/toolchains/CrayKNLStatic.cmake +++ b/cmake/toolchains/CrayKNLStatic.cmake @@ -72,12 +72,6 @@ set(HPX_PARCELPORT_LIBFABRIC_WITH_LOGGING OFF CACHE BOOL "Libfabric parcelport logging on/off flag" ) -set(HPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD - "4096" - CACHE - STRING - "The threshold in bytes to when perform zero copy optimizations (default: 128)" -) # Set the TBBMALLOC_PLATFORM correctly so that find_package(TBBMalloc) sets the # right hints diff --git a/cmake/toolchains/CrayStatic.cmake b/cmake/toolchains/CrayStatic.cmake index 426afb1fb41b..f89757a2e72c 100644 --- a/cmake/toolchains/CrayStatic.cmake +++ b/cmake/toolchains/CrayStatic.cmake @@ -83,9 +83,3 @@ set(HPX_PARCELPORT_LIBFABRIC_WITH_LOGGING OFF CACHE BOOL "Libfabric parcelport logging on/off flag" ) -set(HPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD - "4096" - CACHE - STRING - "The threshold in bytes to when perform zero copy optimizations (default: 128)" -) 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 c8746f39d59f..97423be36d66 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 @@ -86,6 +86,8 @@ namespace hpx::util { using mutex_type = hpx::spinlock; + static int MPI_MAX_TAG; + private: static mutex_type mtx_; diff --git a/libs/core/mpi_base/src/mpi_environment.cpp b/libs/core/mpi_base/src/mpi_environment.cpp index 29ab87ba3896..5b7e8325c726 100644 --- a/libs/core/mpi_base/src/mpi_environment.cpp +++ b/libs/core/mpi_base/src/mpi_environment.cpp @@ -23,6 +23,8 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx::util { + int mpi_environment::MPI_MAX_TAG = 32767; + namespace detail { bool detect_mpi_environment( @@ -267,6 +269,11 @@ namespace hpx::util { rtcfg.add_entry("hpx.parcel.mpi.rank", std::to_string(this_rank)); rtcfg.add_entry("hpx.parcel.mpi.processorname", get_processor_name()); + void* max_tag_p; + int flag; + MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, &max_tag_p, &flag); + if (flag) + MPI_MAX_TAG = *(int*) max_tag_p; } std::string mpi_environment::get_processor_name() diff --git a/libs/full/parcelport_lci/include/hpx/parcelport_lci/header.hpp b/libs/full/parcelport_lci/include/hpx/parcelport_lci/header.hpp index 4401e0751b2c..2ebb7f18ea76 100644 --- a/libs/full/parcelport_lci/include/hpx/parcelport_lci/header.hpp +++ b/libs/full/parcelport_lci/include/hpx/parcelport_lci/header.hpp @@ -108,14 +108,6 @@ namespace hpx::parcelset::policies::lci { data_ = header_buffer; } - void reset() noexcept - { - if (data_ != nullptr) - { - free(data_); - } - } - bool valid() const noexcept { return data_ != nullptr && signature() == MAGIC_SIGNATURE; 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 953609bbb0ac..de76bb9562f8 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/header.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/header.hpp @@ -1,5 +1,6 @@ // Copyright (c) 2013-2023 Hartmut Kaiser // Copyright (c) 2013-2015 Thomas Heller +// Copyright (c) 2023 Jiakun Yan // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -11,7 +12,7 @@ #if defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI) #include -#include + #include #include @@ -21,120 +22,228 @@ #include namespace hpx::parcelset::policies::mpi { - struct header { using value_type = int; - enum data_pos { - pos_tag = 0 * sizeof(value_type), - pos_size = 1 * sizeof(value_type), - pos_numbytes = 2 * sizeof(value_type), - pos_numchunks_first = 3 * sizeof(value_type), - pos_numchunks_second = 4 * sizeof(value_type), - pos_piggy_back_flag = 5 * sizeof(value_type), - pos_piggy_back_data = 5 * sizeof(value_type) + 1 + // siguature for assert_valid + pos_signature = 0, + // tag + pos_tag = 1 * sizeof(value_type), + // non-zero-copy chunk size + pos_numbytes_nonzero_copy = 2 * sizeof(value_type), + // transmission chunk size + pos_numbytes_tchunk = 3 * sizeof(value_type), + // how many bytes in total (including zero-copy and non-zero-copy chunks) + pos_numbytes = 4 * sizeof(value_type), + // zero-copy chunk number + pos_numchunks_zero_copy = 5 * sizeof(value_type), + // non-zero-copy chunk number + pos_numchunks_nonzero_copy = 6 * sizeof(value_type), + // whether piggyback data + pos_piggy_back_flag_data = 7 * sizeof(value_type), + // whether piggyback transmission chunk + pos_piggy_back_flag_tchunk = 7 * sizeof(value_type) + 1, + pos_piggy_back_address = 7 * sizeof(value_type) + 2 }; - static constexpr std::int32_t data_size_ = 512; - - template - header(Buffer const& buffer, int tag) noexcept + template + static size_t get_header_size( + parcel_buffer const& buffer, + size_t max_header_size) noexcept { - init(buffer, tag); + HPX_ASSERT(max_header_size >= pos_piggy_back_address); + + size_t current_header_size = pos_piggy_back_address; + if (buffer.data_.size() <= (max_header_size - current_header_size)) + { + current_header_size += buffer.data_.size(); + } + int num_zero_copy_chunks = buffer.num_chunks_.first; + [[maybe_unused]] int num_non_zero_copy_chunks = + buffer.num_chunks_.second; + if (num_zero_copy_chunks != 0) + { + HPX_ASSERT(buffer.transmission_chunks_.size() == + size_t(num_zero_copy_chunks + num_non_zero_copy_chunks)); + int tchunk_size = + static_cast(buffer.transmission_chunks_.size() * + sizeof(typename parcel_buffer::transmission_chunk_type)); + if (tchunk_size <= int(max_header_size - current_header_size)) + { + current_header_size += tchunk_size; + } + } + return current_header_size; } - template - void init(Buffer const& buffer, int tag) noexcept + template + header(parcel_buffer const& buffer, + char* header_buffer, size_t max_header_size) noexcept { - auto const size = static_cast(buffer.size_); - auto const numbytes = static_cast(buffer.data_size_); - + HPX_ASSERT(max_header_size >= pos_piggy_back_address); + data_ = header_buffer; + memset(data_, 0, pos_piggy_back_address); + std::int64_t size = static_cast(buffer.data_.size()); + std::int64_t numbytes = + static_cast(buffer.data_size_); HPX_ASSERT(size <= (std::numeric_limits::max)()); HPX_ASSERT(numbytes <= (std::numeric_limits::max)()); + int num_zero_copy_chunks = buffer.num_chunks_.first; + int num_non_zero_copy_chunks = buffer.num_chunks_.second; - set(pos_tag, tag); - set(pos_size, static_cast(size)); + set(pos_signature, MAGIC_SIGNATURE); + set(pos_numbytes_nonzero_copy, static_cast(size)); set(pos_numbytes, static_cast(numbytes)); - set(pos_numchunks_first, - static_cast(buffer.num_chunks_.first)); - set(pos_numchunks_second, - static_cast(buffer.num_chunks_.second)); + set(pos_numchunks_zero_copy, + static_cast(num_zero_copy_chunks)); + set(pos_numchunks_nonzero_copy, + static_cast(num_non_zero_copy_chunks)); + data_[pos_piggy_back_flag_data] = 0; + data_[pos_piggy_back_flag_tchunk] = 0; - if (buffer.data_.size() <= (data_size_ - pos_piggy_back_data)) + size_t current_header_size = pos_piggy_back_address; + if (buffer.data_.size() <= (max_header_size - current_header_size)) { - data_[pos_piggy_back_flag] = 1; - std::memcpy(&data_[pos_piggy_back_data], buffer.data_.data(), - buffer.data_.size()); + data_[pos_piggy_back_flag_data] = 1; + std::memcpy( + &data_[current_header_size], &buffer.data_[0], size); + current_header_size += size; } - else + if (num_zero_copy_chunks != 0) { - data_[pos_piggy_back_flag] = 0; + HPX_ASSERT(buffer.transmission_chunks_.size() == + size_t(num_zero_copy_chunks + num_non_zero_copy_chunks)); + int tchunk_size = + static_cast(buffer.transmission_chunks_.size() * + sizeof(typename parcel_buffer::transmission_chunk_type)); + set(pos_numbytes_tchunk, static_cast(tchunk_size)); + if (tchunk_size <= int(max_header_size - current_header_size)) + { + data_[pos_piggy_back_flag_tchunk] = 1; + std::memcpy(&data_[current_header_size], + buffer.transmission_chunks_.data(), tchunk_size); + } } } header() noexcept { - reset(); + data_ = nullptr; + } + + explicit header(char* header_buffer) noexcept + { + data_ = header_buffer; } void reset() noexcept { - std::memset(data_.data(), static_cast(-1), data_size_); - data_[pos_piggy_back_flag] = 1; + data_ = nullptr; } - [[nodiscard]] constexpr bool valid() const noexcept + [[nodiscard]] bool valid() const noexcept { - return data_[0] != static_cast(-1); + return data_ != nullptr && signature() == MAGIC_SIGNATURE; } void assert_valid() const noexcept { - HPX_ASSERT(tag() != -1); - HPX_ASSERT(size() != -1); - HPX_ASSERT(numbytes() != -1); - HPX_ASSERT(num_chunks().first != -1); - HPX_ASSERT(num_chunks().second != -1); + HPX_ASSERT(valid()); + } + + [[nodiscard]] char* data() noexcept + { + return data_; + } + + [[nodiscard]] size_t size() noexcept + { + return pos_piggy_back_address + piggy_back_size(); } - constexpr char* data() noexcept + [[nodiscard]] value_type signature() const noexcept { - return data_.data(); + return get(pos_signature); } - [[nodiscard]] constexpr value_type tag() const noexcept + void set_tag(int tag) noexcept + { + set(pos_tag, static_cast(tag)); + } + + [[nodiscard]] value_type get_tag() const noexcept { return get(pos_tag); } - [[nodiscard]] constexpr value_type size() const noexcept + [[nodiscard]] value_type numbytes_nonzero_copy() const noexcept + { + return get(pos_numbytes_nonzero_copy); + } + + [[nodiscard]] value_type numbytes_tchunk() const noexcept { - return get(pos_size); + return get(pos_numbytes_tchunk); } - [[nodiscard]] constexpr value_type numbytes() const noexcept + [[nodiscard]] value_type numbytes() const noexcept { return get(pos_numbytes); } - [[nodiscard]] constexpr std::pair num_chunks() - const noexcept + [[nodiscard]] value_type num_zero_copy_chunks() const noexcept { - return std::make_pair( - get(pos_numchunks_first), get(pos_numchunks_second)); + return get(pos_numchunks_zero_copy); } - [[nodiscard]] constexpr char* piggy_back() noexcept + [[nodiscard]] value_type num_non_zero_copy_chunks() const noexcept { - if (data_[pos_piggy_back_flag]) - return &data_[pos_piggy_back_data]; + return get(pos_numchunks_nonzero_copy); + } + + [[nodiscard]] constexpr char* piggy_back_address() noexcept + { + if (data_[pos_piggy_back_flag_data] || + data_[pos_piggy_back_flag_tchunk]) + return &data_[pos_piggy_back_address]; return nullptr; } + [[nodiscard]] int piggy_back_size() noexcept + { + int result = 0; + if (data_[pos_piggy_back_flag_data]) + result += numbytes_nonzero_copy(); + if (data_[pos_piggy_back_flag_tchunk]) + result += numbytes_tchunk(); + return result; + } + + [[nodiscard]] constexpr char* piggy_back_data() noexcept + { + if (data_[pos_piggy_back_flag_data]) + return &data_[pos_piggy_back_address]; + return nullptr; + } + + [[nodiscard]] constexpr char* piggy_back_tchunk() noexcept + { + size_t current_header_size = pos_piggy_back_address; + if (!data_[pos_piggy_back_flag_tchunk]) + return nullptr; + if (data_[pos_piggy_back_flag_data]) + current_header_size += numbytes_nonzero_copy(); + return &data_[current_header_size]; + } + private: - std::array data_; + // random magic number for assert_valid + static constexpr int MAGIC_SIGNATURE = 19527; + char* data_; constexpr void set(std::size_t Pos, value_type const& t) noexcept { 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 eb9805513edb..1fb83e7922d4 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/receiver.hpp @@ -1,5 +1,6 @@ // Copyright (c) 2007-2021 Hartmut Kaiser // Copyright (c) 2014-2015 Thomas Heller +// Copyright (c) 2023 Jiakun Yan // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -23,13 +24,13 @@ #include #include #include +#include namespace hpx::parcelset::policies::mpi { template struct receiver { - using header_list = std::list>; using handles_header_type = std::set>; using connection_type = receiver_connection; using connection_ptr = std::shared_ptr; @@ -38,15 +39,14 @@ namespace hpx::parcelset::policies::mpi { explicit constexpr receiver(Parcelport& pp) noexcept : pp_(pp) , hdr_request_(0) + , header_buffer_(pp.get_zero_copy_serialization_threshold()) { } void run() noexcept { util::mpi_environment::scoped_lock l; - - [[maybe_unused]] header h; - new_header(l, h); + post_new_header(l); } bool background_work() noexcept @@ -112,14 +112,20 @@ namespace hpx::parcelset::policies::mpi { MPI_Status status; if (request_done_locked(l, hdr_request_, &status)) { - header h; - new_header(l, h); + int recv_size = 0; + [[maybe_unused]] int ret = + MPI_Get_count(&status, MPI_CHAR, &recv_size); + HPX_ASSERT(ret == MPI_SUCCESS); + std::vector recv_header(header_buffer_.begin(), + header_buffer_.begin() + recv_size); + + post_new_header(l); l.unlock(); header_lock.unlock(); return std::make_shared( - status.MPI_SOURCE, h, pp_); + status.MPI_SOURCE, HPX_MOVE(recv_header), pp_); } } @@ -131,15 +137,11 @@ namespace hpx::parcelset::policies::mpi { } template - void new_header([[maybe_unused]] Lock& l, header& h) noexcept + void post_new_header([[maybe_unused]] Lock& l) noexcept { HPX_ASSERT_OWNS_LOCK(l); - - h = rcv_header_; - rcv_header_.reset(); - - [[maybe_unused]] int const ret = MPI_Irecv(rcv_header_.data(), - header::data_size_, MPI_BYTE, MPI_ANY_SOURCE, 0, + [[maybe_unused]] int const ret = MPI_Irecv(header_buffer_.data(), + header_buffer_.size(), MPI_BYTE, MPI_ANY_SOURCE, 0, util::mpi_environment::communicator(), &hdr_request_); HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); } @@ -148,7 +150,7 @@ namespace hpx::parcelset::policies::mpi { hpx::spinlock headers_mtx_; MPI_Request hdr_request_; - header rcv_header_; + std::vector header_buffer_; hpx::spinlock handles_header_mtx_; handles_header_type handles_header_; 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 18a9b172dec0..3abba418bf00 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,6 @@ // Copyright (c) 2014-2015 Thomas Heller // Copyright (c) 2007-2023 Hartmut Kaiser +// Copyright (c) 2023 Jiakun Yan // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -37,7 +38,6 @@ namespace hpx::parcelset::policies::mpi { rcvd_transmission_chunks, rcvd_data, rcvd_chunks, - sent_release_tag }; using data_type = std::vector; @@ -45,25 +45,67 @@ namespace hpx::parcelset::policies::mpi { parcel_buffer; public: - receiver_connection(int src, header const& h, Parcelport& pp) noexcept + receiver_connection( + int src, std::vector header_buffer, Parcelport& pp) noexcept : state_(initialized) , src_(src) - , tag_(h.tag()) - , header_(h) , request_(MPI_REQUEST_NULL) , request_ptr_(nullptr) , chunks_idx_(0) , zero_copy_chunks_idx_(0) , pp_(pp) { + header header_ = header(header_buffer.data()); header_.assert_valid(); #if defined(HPX_HAVE_PARCELPORT_COUNTERS) parcelset::data_point& data = buffer_.data_point_; data.time_ = timer_.elapsed_nanoseconds(); data.bytes_ = static_cast(header_.numbytes()); #endif - buffer_.data_.resize(static_cast(header_.size())); - buffer_.num_chunks_ = header_.num_chunks(); + tag_ = header_.get_tag(); + // decode data + buffer_.data_.resize(header_.numbytes_nonzero_copy()); + char* piggy_back_data = header_.piggy_back_data(); + if (piggy_back_data) + { + need_recv_data = false; + memcpy(buffer_.data_.data(), piggy_back_data, + buffer_.data_.size()); + } + else + { + need_recv_data = true; + } + need_recv_tchunks = false; + if (header_.num_zero_copy_chunks() != 0) + { + // decode transmission chunk + int num_zero_copy_chunks = header_.num_zero_copy_chunks(); + int num_non_zero_copy_chunks = + header_.num_non_zero_copy_chunks(); + buffer_.num_chunks_.first = num_zero_copy_chunks; + buffer_.num_chunks_.second = num_non_zero_copy_chunks; + auto& tchunks = buffer_.transmission_chunks_; + tchunks.resize(num_zero_copy_chunks + num_non_zero_copy_chunks); + int tchunks_length = static_cast(tchunks.size() * + sizeof(buffer_type::transmission_chunk_type)); + char* piggy_back_tchunk = header_.piggy_back_tchunk(); + if (piggy_back_tchunk) + { + memcpy(static_cast(tchunks.data()), + piggy_back_tchunk, tchunks_length); + } + else + { + need_recv_tchunks = true; + } + // zero-copy chunks + buffer_.chunks_.resize(num_zero_copy_chunks); + if (!pp_.allow_zero_copy_receive_optimizations()) + { + chunk_buffers_.resize(num_zero_copy_chunks); + } + } } bool receive(std::size_t num_thread = -1) @@ -80,10 +122,7 @@ namespace hpx::parcelset::policies::mpi { return receive_chunks(num_thread); case rcvd_chunks: - return send_release_tag(num_thread); - - case sent_release_tag: - return done(); + return done(num_thread); default: HPX_ASSERT(false); @@ -93,34 +132,19 @@ namespace hpx::parcelset::policies::mpi { bool receive_transmission_chunks(std::size_t num_thread = -1) { - // determine the size of the chunk buffer - auto const num_zero_copy_chunks = static_cast( - static_cast(buffer_.num_chunks_.first)); - 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); - if (num_zero_copy_chunks != 0) + if (need_recv_tchunks) { - 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; + util::mpi_environment::scoped_lock l; - [[maybe_unused]] int const ret = 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); + HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); - request_ptr_ = &request_; - } + request_ptr_ = &request_; } state_ = rcvd_transmission_chunks; @@ -135,12 +159,7 @@ namespace hpx::parcelset::policies::mpi { return false; } - if (char const* piggy_back = header_.piggy_back()) - { - std::memcpy( - buffer_.data_.data(), piggy_back, buffer_.data_.size()); - } - else + if (need_recv_data) { util::mpi_environment::scoped_lock l; @@ -282,10 +301,10 @@ namespace hpx::parcelset::policies::mpi { } state_ = rcvd_chunks; - return send_release_tag(num_thread); + return done(num_thread); } - bool send_release_tag(std::size_t num_thread = -1) + bool done(std::size_t num_thread = -1) noexcept { if (!request_done()) { @@ -296,16 +315,6 @@ namespace hpx::parcelset::policies::mpi { parcelset::data_point& data = buffer_.data_point_; data.time_ = timer_.elapsed_nanoseconds() - data.time_; #endif - { - util::mpi_environment::scoped_lock l; - - [[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_; - } - if (parcels_.empty()) { // decode and handle received data @@ -324,15 +333,7 @@ namespace hpx::parcelset::policies::mpi { handle_received_parcels(HPX_MOVE(parcels_)); buffer_ = buffer_type{}; } - - state_ = sent_release_tag; - - return done(); - } - - bool done() noexcept - { - return request_done(); + return true; } bool request_done() noexcept @@ -368,7 +369,8 @@ namespace hpx::parcelset::policies::mpi { int src_; int tag_; - header header_; + bool need_recv_data; + bool need_recv_tchunks; buffer_type buffer_; MPI_Request request_; 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 c6927ece6ec4..4bfdfaa77fc8 100644 --- a/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender.hpp +++ b/libs/full/parcelport_mpi/include/hpx/parcelport_mpi/sender.hpp @@ -1,5 +1,6 @@ // Copyright (c) 2007-2021 Hartmut Kaiser // Copyright (c) 2014-2015 Thomas Heller +// Copyright (c) 2023 Jiakun Yan // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -33,20 +34,7 @@ namespace hpx::parcelset::policies::mpi { using connection_ptr = std::shared_ptr; using connection_list = std::deque; - // different versions of clang-format disagree - // clang-format off - sender() noexcept - : next_free_tag_request_((MPI_Request) (-1)) - , next_free_tag_(-1) - { - } - // clang-format on - - void run() noexcept - { - util::mpi_environment::scoped_lock l; - get_next_free_tag(l); - } + void run() noexcept {} connection_ptr create_connection(int dest, parcelset::parcelport* pp) { @@ -61,7 +49,7 @@ namespace hpx::parcelset::policies::mpi { int acquire_tag() noexcept { - return tag_provider_.acquire(); + return tag_provider_.get_next_tag(); } void send_messages(connection_ptr connection) @@ -102,73 +90,13 @@ namespace hpx::parcelset::policies::mpi { send_messages(HPX_MOVE(connection)); has_work = true; } - next_free_tag(); return has_work; } private: tag_provider tag_provider_; - - void next_free_tag() noexcept - { - int next_free = -1; - { - std::unique_lock l(next_free_tag_mtx_, std::try_to_lock); - if (l.owns_lock()) - { - next_free = next_free_tag_locked(l); - } - } - - if (next_free != -1) - { - HPX_ASSERT(next_free > 1); - tag_provider_.release(next_free); - } - } - - 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) - { - int completed = 0; - [[maybe_unused]] int const ret = MPI_Test( - &next_free_tag_request_, &completed, MPI_STATUS_IGNORE); - HPX_ASSERT(ret == MPI_SUCCESS); - - if (completed) - { - return get_next_free_tag(l); - } - } - return -1; - } - - template - int get_next_free_tag([[maybe_unused]] Lock& l) noexcept - { - 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; - } - hpx::spinlock connections_mtx_; connection_list connections_; - - hpx::spinlock next_free_tag_mtx_; - MPI_Request next_free_tag_request_; - int next_free_tag_; }; } // namespace hpx::parcelset::policies::mpi 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 5a1b85ea21f4..d7c444053b1e 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 @@ -1,5 +1,6 @@ // Copyright (c) 2007-2021 Hartmut Kaiser // Copyright (c) 2014-2015 Thomas Heller +// Copyright (c) 2023 Jiakun Yan // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -101,7 +102,11 @@ namespace hpx::parcelset::policies::mpi { request_ptr_ = nullptr; chunks_idx_ = 0; tag_ = acquire_tag(sender_); - header_.init(buffer_, tag_); + header_buffer.resize(header::get_header_size( + buffer_, pp_->get_zero_copy_serialization_threshold())); + header_ = header(buffer_, static_cast(header_buffer.data()), + header_buffer.size()); + header_.set_tag(tag_); header_.assert_valid(); state_ = initialized; @@ -154,8 +159,8 @@ namespace hpx::parcelset::policies::mpi { HPX_ASSERT(state_ == initialized); HPX_ASSERT(request_ptr_ == nullptr); - [[maybe_unused]] int const ret = MPI_Isend(header_.data(), - header::data_size_, MPI_BYTE, dst_, 0, + [[maybe_unused]] int const ret = MPI_Isend(header_buffer.data(), + (int) header_buffer.size(), MPI_BYTE, dst_, 0, util::mpi_environment::communicator(), &request_); HPX_ASSERT_LOCKED(l, ret == MPI_SUCCESS); @@ -178,7 +183,7 @@ namespace hpx::parcelset::policies::mpi { HPX_ASSERT(request_ptr_ == nullptr); auto const& chunks = buffer_.transmission_chunks_; - if (!chunks.empty()) + if (!chunks.empty() && !header_.piggy_back_tchunk()) { util::mpi_environment::scoped_lock l; @@ -204,7 +209,7 @@ namespace hpx::parcelset::policies::mpi { return false; } - if (!header_.piggy_back()) + if (!header_.piggy_back_data()) { util::mpi_environment::scoped_lock l; @@ -315,6 +320,7 @@ namespace hpx::parcelset::policies::mpi { std::shared_ptr)>; post_handler_type postprocess_handler_; + std::vector header_buffer; header header_; MPI_Request request_; 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 4d0ecede5ff2..dcb83334194a 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 @@ -1,4 +1,5 @@ // Copyright (c) 2014-2015 Thomas Heller +// Copyright (c) 2023 Jiakun Yan // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -12,6 +13,7 @@ #include #include +#include #include #include #include @@ -21,40 +23,20 @@ namespace hpx::parcelset::policies::mpi { struct tag_provider { tag_provider() - : next_tag_(2) + : next_tag(0) { } - [[nodiscard]] int acquire() noexcept + [[nodiscard]] int get_next_tag() noexcept { - int tag = -1; - std::lock_guard l(mtx_); - if (free_tags_.empty()) - { - HPX_ASSERT(next_tag_ < (std::numeric_limits::max)()); - tag = next_tag_++; - } - else - { - tag = free_tags_.front(); - free_tags_.pop_front(); - } - HPX_ASSERT(tag > 1); + // Tag 0 is reserved for header message + int tag = next_tag.fetch_add(1, std::memory_order_relaxed) % + (util::mpi_environment::MPI_MAX_TAG - 1) + + 1; return tag; } - void release(int tag) - { - HPX_ASSERT(tag > 1); - std::lock_guard l(mtx_); - HPX_ASSERT(tag < next_tag_); - - free_tags_.push_back(tag); - } - - hpx::spinlock mtx_; - int next_tag_; - std::deque free_tags_; + std::atomic next_tag; }; } // namespace hpx::parcelset::policies::mpi From bae0fb25ae61e4d6c5b1e3c992e3101edda28f89 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 3 Jul 2023 08:41:51 -0500 Subject: [PATCH 45/72] Fixing error message about use_guard_pages --- .../include/hpx/coroutines/detail/posix_utility.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/core/coroutines/include/hpx/coroutines/detail/posix_utility.hpp b/libs/core/coroutines/include/hpx/coroutines/detail/posix_utility.hpp index 4af47013f87b..4bc4b248eda3 100644 --- a/libs/core/coroutines/include/hpx/coroutines/detail/posix_utility.hpp +++ b/libs/core/coroutines/include/hpx/coroutines/detail/posix_utility.hpp @@ -100,11 +100,11 @@ namespace hpx::threads::coroutines::detail::posix { "mmap() failed to allocate thread stack"; if (ENOMEM == errno && use_guard_pages) { - error_message = - "mmap() failed to allocate thread stack due to " - "insufficient resources, increase " - "/proc/sys/vm/max_map_count or add " - "-Ihpx.stacks.use_guard_pages=0 to the command line"; + error_message = "mmap() failed to allocate thread stack due to " + " insufficient resources, increase " + "/proc/sys/vm/max_map_count or add " + "--hpx:ini=hpx.stacks.use_guard_pages=0 to the " + "command line"; } throw std::runtime_error(error_message); } @@ -171,7 +171,8 @@ namespace hpx::threads::coroutines::detail::posix { #endif } -#else // non-mmap() +#else + // non-mmap() //this should be a fine default. static constexpr std::size_t const stack_alignment = sizeof(void*) > 16 ? From 4e03b0a1a5f4a1a64029fc27fed7e78a0b0b5645 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Mon, 19 Jun 2023 14:04:16 -0500 Subject: [PATCH 46/72] Initial hardcoded version --- .../include/hpx/async_cuda/cuda_event.hpp | 16 +++++++++++----- .../include/hpx/async_cuda/cuda_future.hpp | 18 +++++++++--------- .../async_cuda/detail/cuda_event_callback.hpp | 2 +- .../async_cuda/src/cuda_event_callback.cpp | 17 +++++++++++------ libs/core/async_cuda/src/cuda_future.cpp | 4 ++-- libs/core/async_cuda/src/cuda_target.cpp | 2 +- 6 files changed, 35 insertions(+), 24 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index f2ae7ef59f5e..859caf245a9f 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -21,25 +21,30 @@ namespace hpx { namespace cuda { namespace experimental { { static constexpr int initial_events_in_pool = 128; - static cuda_event_pool& get_event_pool() + const int device_id; + + static cuda_event_pool& get_event_pool(size_t device_id) { - static cuda_event_pool event_pool_; - return event_pool_; + static std::array event_pool_{0, 1, 2, 3}; + return event_pool_[device_id]; } // create a bunch of events on initialization - cuda_event_pool() - : free_list_(initial_events_in_pool) + cuda_event_pool(int device_id) + : device_id(device_id), free_list_(initial_events_in_pool) { + check_cuda_error(cudaSetDevice(device_id)); for (int i = 0; i < initial_events_in_pool; ++i) { add_event_to_pool(); } + std::cerr << "Created " << device_id << std::endl; } // on destruction, all objects in stack will be freed ~cuda_event_pool() { + check_cuda_error(cudaSetDevice(device_id)); cudaEvent_t event; bool ok = true; while (ok) @@ -68,6 +73,7 @@ namespace hpx { namespace cuda { namespace experimental { private: void add_event_to_pool() { + check_cuda_error(cudaSetDevice(device_id)); cudaEvent_t event; // Create an cuda_event to query a CUDA/CUBLAS kernel for completion. // Timing is disabled for performance. [1] diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp index 042b8199dbeb..9084166ddc54 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp @@ -81,7 +81,7 @@ namespace hpx { namespace cuda { namespace experimental { future_data() {} future_data(init_no_addref no_addref, other_allocator const& alloc, - cudaStream_t stream) + cudaStream_t stream, int device) : lcos::detail::future_data_allocator(no_addref, alloc) { @@ -104,7 +104,7 @@ namespace hpx { namespace cuda { namespace experimental { status))); } }, - stream); + stream, device); } }; @@ -128,7 +128,7 @@ namespace hpx { namespace cuda { namespace experimental { } future_data(init_no_addref no_addref, other_allocator const& alloc, - cudaStream_t stream) + cudaStream_t stream, int device) : lcos::detail::future_data_allocator(no_addref, alloc) , rt_(hpx::get_runtime_ptr()) @@ -183,7 +183,7 @@ namespace hpx { namespace cuda { namespace experimental { // main API call to get a future from a stream using allocator, and the // specified mode template - hpx::future get_future(Allocator const& a, cudaStream_t stream) + hpx::future get_future(Allocator const& a, cudaStream_t stream, int device = 0) { using shared_state = future_data; @@ -200,7 +200,7 @@ namespace hpx { namespace cuda { namespace experimental { unique_ptr p(traits::allocate(alloc, 1), hpx::util::allocator_deleter{alloc}); - traits::construct(alloc, p.get(), init_no_addref{}, alloc, stream); + traits::construct(alloc, p.get(), init_no_addref{}, alloc, stream, device); return hpx::traits::future_access>::create( p.release(), false); @@ -212,16 +212,16 @@ namespace hpx { namespace cuda { namespace experimental { hpx::future get_future_with_callback( Allocator const& a, cudaStream_t stream) { - return get_future(a, stream); + return get_future(a, stream, 0); } // ------------------------------------------------------------- // main API call to get a future from a stream using allocator template hpx::future get_future_with_event( - Allocator const& a, cudaStream_t stream) + Allocator const& a, cudaStream_t stream, int device) { - return get_future(a, stream); + return get_future(a, stream, device); } // ------------------------------------------------------------- @@ -231,7 +231,7 @@ namespace hpx { namespace cuda { namespace experimental { // ------------------------------------------------------------- // non allocator version of : get future with an event set - HPX_CORE_EXPORT hpx::future get_future_with_event(cudaStream_t); + HPX_CORE_EXPORT hpx::future get_future_with_event(cudaStream_t, int); } // namespace detail }}} // namespace hpx::cuda::experimental diff --git a/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp b/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp index fde4361569d5..5c5592dbaded 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp @@ -26,7 +26,7 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { hpx::move_only_function; HPX_CORE_EXPORT void add_event_callback( - event_callback_function_type&& f, cudaStream_t stream); + event_callback_function_type&& f, cudaStream_t stream, int device); HPX_CORE_EXPORT void register_polling(hpx::threads::thread_pool_base& pool); HPX_CORE_EXPORT void unregister_polling( diff --git a/libs/core/async_cuda/src/cuda_event_callback.cpp b/libs/core/async_cuda/src/cuda_event_callback.cpp index 0d53bd4af3f7..56b5cd6884b7 100644 --- a/libs/core/async_cuda/src/cuda_event_callback.cpp +++ b/libs/core/async_cuda/src/cuda_event_callback.cpp @@ -50,6 +50,7 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { { cudaEvent_t event; event_callback_function_type f; + int device; }; using event_callback_queue_type = @@ -104,17 +105,18 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { } void add_event_callback( - event_callback_function_type&& f, cudaStream_t stream) + event_callback_function_type&& f, cudaStream_t stream, int device) { cudaEvent_t event; - if (!cuda_event_pool::get_event_pool().pop(event)) + if (!cuda_event_pool::get_event_pool(device).pop(event)) { HPX_THROW_EXCEPTION(hpx::error::invalid_status, "add_event_callback", "could not get an event"); } + check_cuda_error(cudaSetDevice(device)); check_cuda_error(cudaEventRecord(event, stream)); - detail::add_to_event_callback_queue(event_callback{event, HPX_MOVE(f)}); + detail::add_to_event_callback_queue(event_callback{event, HPX_MOVE(f), device}); } // Background progress function for async CUDA operations. Checks for completed @@ -155,9 +157,6 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { debug::dec<3>(get_number_of_active_events())); } - // Grab the handle to the event pool so we can return completed events - cuda_event_pool& pool = - hpx::cuda::experimental::cuda_event_pool::get_event_pool(); // Iterate over our list of events and see if any have completed event_callback_vector.erase( @@ -177,6 +176,9 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { "active events", debug::dec<3>(get_number_of_active_events())); continuation.f(status); + // Grab the handle to the event pool so we can return completed events + cuda_event_pool& pool = hpx::cuda::experimental:: + cuda_event_pool::get_event_pool(continuation.device); pool.push(HPX_MOVE(continuation.event)); return true; }), @@ -199,6 +201,9 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { "active events", debug::dec<3>(get_number_of_active_events())); continuation.f(status); + // Grab the handle to the event pool so we can return completed events + cuda_event_pool& pool = + hpx::cuda::experimental::cuda_event_pool::get_event_pool(continuation.device); pool.push(HPX_MOVE(continuation.event)); } } diff --git a/libs/core/async_cuda/src/cuda_future.cpp b/libs/core/async_cuda/src/cuda_future.cpp index 6b1dfbbaa436..fdf95bf8e96f 100644 --- a/libs/core/async_cuda/src/cuda_future.cpp +++ b/libs/core/async_cuda/src/cuda_future.cpp @@ -18,8 +18,8 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { hpx::util::internal_allocator<>{}, stream); } - hpx::future get_future_with_event(cudaStream_t stream) + hpx::future get_future_with_event(cudaStream_t stream, int device) { - return get_future_with_event(hpx::util::internal_allocator<>{}, stream); + return get_future_with_event(hpx::util::internal_allocator<>{}, stream, device); } }}}} // namespace hpx::cuda::experimental::detail diff --git a/libs/core/async_cuda/src/cuda_target.cpp b/libs/core/async_cuda/src/cuda_target.cpp index 6906308ebc62..29377b216b55 100644 --- a/libs/core/async_cuda/src/cuda_target.cpp +++ b/libs/core/async_cuda/src/cuda_target.cpp @@ -187,7 +187,7 @@ namespace hpx { namespace cuda { namespace experimental { hpx::future target::get_future_with_event() const { - return detail::get_future_with_event(handle_.get_stream()); + return detail::get_future_with_event(handle_.get_stream(), handle_.get_device()); } hpx::future target::get_future_with_callback() const From 6e5e270f6cdcf4496b19b701ab586f71d56d400b Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Mon, 19 Jun 2023 14:57:15 -0500 Subject: [PATCH 47/72] Detect number of GPUs --- .../include/hpx/async_cuda/cuda_event.hpp | 75 +++++++++++-------- .../async_cuda/src/cuda_event_callback.cpp | 10 +-- 2 files changed, 50 insertions(+), 35 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 859caf245a9f..a2faccd5c873 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -7,6 +7,8 @@ #pragma once +#include + #include #include #include @@ -21,59 +23,71 @@ namespace hpx { namespace cuda { namespace experimental { { static constexpr int initial_events_in_pool = 128; - const int device_id; - - static cuda_event_pool& get_event_pool(size_t device_id) + static cuda_event_pool& get_event_pool() { - static std::array event_pool_{0, 1, 2, 3}; - return event_pool_[device_id]; + static cuda_event_pool event_pool_; + return event_pool_; } // create a bunch of events on initialization - cuda_event_pool(int device_id) - : device_id(device_id), free_list_(initial_events_in_pool) + cuda_event_pool() + : max_number_devices_(0) { - check_cuda_error(cudaSetDevice(device_id)); - for (int i = 0; i < initial_events_in_pool; ++i) - { - add_event_to_pool(); + check_cuda_error(cudaGetDeviceCount(&max_number_devices_)); + HPX_ASSERT_MSG(max_number_devices_ > 0, + "CUDA polling enabled and called, yet no CUDA device found!"); + for (int device = 0; device < max_number_devices_; device++) { + check_cuda_error(cudaSetDevice(device)); + free_lists_.emplace_back(initial_events_in_pool); + for (int i = 0; i < initial_events_in_pool; ++i) + { + add_event_to_pool(device); + } + std::cerr << "Created " << device << std::endl; } - std::cerr << "Created " << device_id << std::endl; } // on destruction, all objects in stack will be freed ~cuda_event_pool() { - check_cuda_error(cudaSetDevice(device_id)); - cudaEvent_t event; - bool ok = true; - while (ok) - { - ok = free_list_.pop(event); - if (ok) - check_cuda_error(cudaEventDestroy(event)); + HPX_ASSERT_MSG(free_lists_.size != max_number_devices_, + "Number of CUDA event pools does not match the number of devices!"); + for (int device = 0; device < max_number_devices_; device++) { + check_cuda_error(cudaSetDevice(device)); + cudaEvent_t event; + bool ok = true; + while (ok) + { + ok = free_lists_[device].pop(event); + if (ok) + check_cuda_error(cudaEventDestroy(event)); + } } } - inline bool pop(cudaEvent_t& event) + inline bool pop(cudaEvent_t& event, int device) { + HPX_ASSERT_MSG(device > 0 && device < max_number_devices_, + "Accessing CUDA event pool with invalid device ID!"); // pop an event off the pool, if that fails, create a new one - while (!free_list_.pop(event)) + while (!free_lists_[device].pop(event)) { - add_event_to_pool(); + add_event_to_pool(device); } return true; } - inline bool push(cudaEvent_t event) + inline bool push(cudaEvent_t event, int device) { - return free_list_.push(event); + HPX_ASSERT_MSG(device > 0 && device < max_number_devices_, + "Accessing CUDA event pool with invalid device ID!"); + return free_lists_[device].push(event); } private: - void add_event_to_pool() + void add_event_to_pool(int device) { - check_cuda_error(cudaSetDevice(device_id)); + check_cuda_error(cudaSetDevice(device)); cudaEvent_t event; // Create an cuda_event to query a CUDA/CUBLAS kernel for completion. // Timing is disabled for performance. [1] @@ -81,10 +95,11 @@ namespace hpx { namespace cuda { namespace experimental { // [1]: CUDA Runtime API, section 5.5 cuda_event Management check_cuda_error( cudaEventCreateWithFlags(&event, cudaEventDisableTiming)); - free_list_.push(event); + free_lists_[device].push(event); } + int max_number_devices_; - // pool is dynamically sized and can grow if needed - hpx::lockfree::stack free_list_; + // One pool per GPU - each pool is dynamically sized and can grow if needed + std::deque> free_lists_; }; }}} // namespace hpx::cuda::experimental diff --git a/libs/core/async_cuda/src/cuda_event_callback.cpp b/libs/core/async_cuda/src/cuda_event_callback.cpp index 56b5cd6884b7..b36b5d4940d2 100644 --- a/libs/core/async_cuda/src/cuda_event_callback.cpp +++ b/libs/core/async_cuda/src/cuda_event_callback.cpp @@ -108,7 +108,7 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { event_callback_function_type&& f, cudaStream_t stream, int device) { cudaEvent_t event; - if (!cuda_event_pool::get_event_pool(device).pop(event)) + if (!cuda_event_pool::get_event_pool().pop(event, device)) { HPX_THROW_EXCEPTION(hpx::error::invalid_status, "add_event_callback", "could not get an event"); @@ -178,8 +178,8 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { continuation.f(status); // Grab the handle to the event pool so we can return completed events cuda_event_pool& pool = hpx::cuda::experimental:: - cuda_event_pool::get_event_pool(continuation.device); - pool.push(HPX_MOVE(continuation.event)); + cuda_event_pool::get_event_pool(); + pool.push(HPX_MOVE(continuation.event), continuation.device); return true; }), event_callback_vector.end()); @@ -203,8 +203,8 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { continuation.f(status); // Grab the handle to the event pool so we can return completed events cuda_event_pool& pool = - hpx::cuda::experimental::cuda_event_pool::get_event_pool(continuation.device); - pool.push(HPX_MOVE(continuation.event)); + hpx::cuda::experimental::cuda_event_pool::get_event_pool(); + pool.push(HPX_MOVE(continuation.event), continuation.device); } } From ef12f35936ac90111f8a0f605790d62b4ff7a837 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Mon, 19 Jun 2023 15:22:04 -0500 Subject: [PATCH 48/72] Cleanup --- .../async_cuda/include/hpx/async_cuda/cuda_event.hpp | 1 - libs/core/async_cuda/src/cuda_event_callback.cpp | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index a2faccd5c873..66659371fb4f 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -43,7 +43,6 @@ namespace hpx { namespace cuda { namespace experimental { { add_event_to_pool(device); } - std::cerr << "Created " << device << std::endl; } } diff --git a/libs/core/async_cuda/src/cuda_event_callback.cpp b/libs/core/async_cuda/src/cuda_event_callback.cpp index b36b5d4940d2..b1439ff338bd 100644 --- a/libs/core/async_cuda/src/cuda_event_callback.cpp +++ b/libs/core/async_cuda/src/cuda_event_callback.cpp @@ -157,6 +157,9 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { debug::dec<3>(get_number_of_active_events())); } + // Grab the handle to the event pool so we can return completed events + cuda_event_pool& pool = + hpx::cuda::experimental::cuda_event_pool::get_event_pool(); // Iterate over our list of events and see if any have completed event_callback_vector.erase( @@ -176,9 +179,6 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { "active events", debug::dec<3>(get_number_of_active_events())); continuation.f(status); - // Grab the handle to the event pool so we can return completed events - cuda_event_pool& pool = hpx::cuda::experimental:: - cuda_event_pool::get_event_pool(); pool.push(HPX_MOVE(continuation.event), continuation.device); return true; }), @@ -201,9 +201,6 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { "active events", debug::dec<3>(get_number_of_active_events())); continuation.f(status); - // Grab the handle to the event pool so we can return completed events - cuda_event_pool& pool = - hpx::cuda::experimental::cuda_event_pool::get_event_pool(); pool.push(HPX_MOVE(continuation.event), continuation.device); } } From 8b8c6c063698437f5625307c91491c10f5ae339a Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Mon, 19 Jun 2023 15:56:03 -0500 Subject: [PATCH 49/72] Add missing default value --- libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp index 9084166ddc54..1c4503d66b81 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp @@ -219,7 +219,7 @@ namespace hpx { namespace cuda { namespace experimental { // main API call to get a future from a stream using allocator template hpx::future get_future_with_event( - Allocator const& a, cudaStream_t stream, int device) + Allocator const& a, cudaStream_t stream, int device = 0) { return get_future(a, stream, device); } @@ -231,7 +231,8 @@ namespace hpx { namespace cuda { namespace experimental { // ------------------------------------------------------------- // non allocator version of : get future with an event set - HPX_CORE_EXPORT hpx::future get_future_with_event(cudaStream_t, int); + HPX_CORE_EXPORT hpx::future get_future_with_event( + cudaStream_t stream, int device = 0); } // namespace detail }}} // namespace hpx::cuda::experimental From 4d698c9254ee90bcf5f9b8277d2ef3699f33aa0c Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Mon, 19 Jun 2023 16:10:37 -0500 Subject: [PATCH 50/72] Fix format --- .../include/hpx/async_cuda/cuda_event.hpp | 36 ++++++++++--------- .../include/hpx/async_cuda/cuda_future.hpp | 6 ++-- .../async_cuda/src/cuda_event_callback.cpp | 6 ++-- libs/core/async_cuda/src/cuda_future.cpp | 3 +- libs/core/async_cuda/src/cuda_target.cpp | 3 +- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 66659371fb4f..cca0859f920b 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -36,13 +36,14 @@ namespace hpx { namespace cuda { namespace experimental { check_cuda_error(cudaGetDeviceCount(&max_number_devices_)); HPX_ASSERT_MSG(max_number_devices_ > 0, "CUDA polling enabled and called, yet no CUDA device found!"); - for (int device = 0; device < max_number_devices_; device++) { - check_cuda_error(cudaSetDevice(device)); - free_lists_.emplace_back(initial_events_in_pool); - for (int i = 0; i < initial_events_in_pool; ++i) - { - add_event_to_pool(device); - } + for (int device = 0; device < max_number_devices_; device++) + { + check_cuda_error(cudaSetDevice(device)); + free_lists_.emplace_back(initial_events_in_pool); + for (int i = 0; i < initial_events_in_pool; ++i) + { + add_event_to_pool(device); + } } } @@ -51,16 +52,17 @@ namespace hpx { namespace cuda { namespace experimental { { HPX_ASSERT_MSG(free_lists_.size != max_number_devices_, "Number of CUDA event pools does not match the number of devices!"); - for (int device = 0; device < max_number_devices_; device++) { - check_cuda_error(cudaSetDevice(device)); - cudaEvent_t event; - bool ok = true; - while (ok) - { - ok = free_lists_[device].pop(event); - if (ok) - check_cuda_error(cudaEventDestroy(event)); - } + for (int device = 0; device < max_number_devices_; device++) + { + check_cuda_error(cudaSetDevice(device)); + cudaEvent_t event; + bool ok = true; + while (ok) + { + ok = free_lists_[device].pop(event); + if (ok) + check_cuda_error(cudaEventDestroy(event)); + } } } diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp index 1c4503d66b81..9633d40bf2bc 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp @@ -183,7 +183,8 @@ namespace hpx { namespace cuda { namespace experimental { // main API call to get a future from a stream using allocator, and the // specified mode template - hpx::future get_future(Allocator const& a, cudaStream_t stream, int device = 0) + hpx::future get_future( + Allocator const& a, cudaStream_t stream, int device = 0) { using shared_state = future_data; @@ -200,7 +201,8 @@ namespace hpx { namespace cuda { namespace experimental { unique_ptr p(traits::allocate(alloc, 1), hpx::util::allocator_deleter{alloc}); - traits::construct(alloc, p.get(), init_no_addref{}, alloc, stream, device); + traits::construct( + alloc, p.get(), init_no_addref{}, alloc, stream, device); return hpx::traits::future_access>::create( p.release(), false); diff --git a/libs/core/async_cuda/src/cuda_event_callback.cpp b/libs/core/async_cuda/src/cuda_event_callback.cpp index b1439ff338bd..b472e5c55e23 100644 --- a/libs/core/async_cuda/src/cuda_event_callback.cpp +++ b/libs/core/async_cuda/src/cuda_event_callback.cpp @@ -116,7 +116,8 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { check_cuda_error(cudaSetDevice(device)); check_cuda_error(cudaEventRecord(event, stream)); - detail::add_to_event_callback_queue(event_callback{event, HPX_MOVE(f), device}); + detail::add_to_event_callback_queue( + event_callback{event, HPX_MOVE(f), device}); } // Background progress function for async CUDA operations. Checks for completed @@ -179,7 +180,8 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { "active events", debug::dec<3>(get_number_of_active_events())); continuation.f(status); - pool.push(HPX_MOVE(continuation.event), continuation.device); + pool.push( + HPX_MOVE(continuation.event), continuation.device); return true; }), event_callback_vector.end()); diff --git a/libs/core/async_cuda/src/cuda_future.cpp b/libs/core/async_cuda/src/cuda_future.cpp index fdf95bf8e96f..c797191e1474 100644 --- a/libs/core/async_cuda/src/cuda_future.cpp +++ b/libs/core/async_cuda/src/cuda_future.cpp @@ -20,6 +20,7 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { hpx::future get_future_with_event(cudaStream_t stream, int device) { - return get_future_with_event(hpx::util::internal_allocator<>{}, stream, device); + return get_future_with_event( + hpx::util::internal_allocator<>{}, stream, device); } }}}} // namespace hpx::cuda::experimental::detail diff --git a/libs/core/async_cuda/src/cuda_target.cpp b/libs/core/async_cuda/src/cuda_target.cpp index 29377b216b55..60ea190980f0 100644 --- a/libs/core/async_cuda/src/cuda_target.cpp +++ b/libs/core/async_cuda/src/cuda_target.cpp @@ -187,7 +187,8 @@ namespace hpx { namespace cuda { namespace experimental { hpx::future target::get_future_with_event() const { - return detail::get_future_with_event(handle_.get_stream(), handle_.get_device()); + return detail::get_future_with_event( + handle_.get_stream(), handle_.get_device()); } hpx::future target::get_future_with_callback() const From db64b6a7a9ea7f1168577494edebc4ccea6ed845 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Mon, 19 Jun 2023 16:19:38 -0500 Subject: [PATCH 51/72] Add missing format fix --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index cca0859f920b..3f239416226a 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -51,7 +51,8 @@ namespace hpx { namespace cuda { namespace experimental { ~cuda_event_pool() { HPX_ASSERT_MSG(free_lists_.size != max_number_devices_, - "Number of CUDA event pools does not match the number of devices!"); + "Number of CUDA event pools does not match the number of " + "devices!"); for (int device = 0; device < max_number_devices_; device++) { check_cuda_error(cudaSetDevice(device)); From 20e849251b2d7d30edde7579f701d29955f3ec8b Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Mon, 19 Jun 2023 18:55:41 -0500 Subject: [PATCH 52/72] Add default device arguments --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 4 ++-- .../include/hpx/async_cuda/detail/cuda_event_callback.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 3f239416226a..1a7b8256f91e 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -67,7 +67,7 @@ namespace hpx { namespace cuda { namespace experimental { } } - inline bool pop(cudaEvent_t& event, int device) + inline bool pop(cudaEvent_t& event, int device = 0) { HPX_ASSERT_MSG(device > 0 && device < max_number_devices_, "Accessing CUDA event pool with invalid device ID!"); @@ -79,7 +79,7 @@ namespace hpx { namespace cuda { namespace experimental { return true; } - inline bool push(cudaEvent_t event, int device) + inline bool push(cudaEvent_t event, int device = 0) { HPX_ASSERT_MSG(device > 0 && device < max_number_devices_, "Accessing CUDA event pool with invalid device ID!"); diff --git a/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp b/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp index 5c5592dbaded..e1e6ef49cb20 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp @@ -26,7 +26,7 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { hpx::move_only_function; HPX_CORE_EXPORT void add_event_callback( - event_callback_function_type&& f, cudaStream_t stream, int device); + event_callback_function_type&& f, cudaStream_t stream, int device = 0); HPX_CORE_EXPORT void register_polling(hpx::threads::thread_pool_base& pool); HPX_CORE_EXPORT void unregister_polling( From 3e469513d63970d033de898afabb4702662b2b3e Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Tue, 20 Jun 2023 09:13:33 -0500 Subject: [PATCH 53/72] Fix asserts --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 1a7b8256f91e..ff33a067f497 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -69,7 +69,7 @@ namespace hpx { namespace cuda { namespace experimental { inline bool pop(cudaEvent_t& event, int device = 0) { - HPX_ASSERT_MSG(device > 0 && device < max_number_devices_, + HPX_ASSERT_MSG(device >= 0 && device < max_number_devices_, "Accessing CUDA event pool with invalid device ID!"); // pop an event off the pool, if that fails, create a new one while (!free_lists_[device].pop(event)) @@ -81,7 +81,7 @@ namespace hpx { namespace cuda { namespace experimental { inline bool push(cudaEvent_t event, int device = 0) { - HPX_ASSERT_MSG(device > 0 && device < max_number_devices_, + HPX_ASSERT_MSG(device >= 0 && device < max_number_devices_, "Accessing CUDA event pool with invalid device ID!"); return free_lists_[device].push(event); } From 323ae69219d6a9106c05eb076a3458e0d858d9a1 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 21 Jun 2023 13:57:21 -0500 Subject: [PATCH 54/72] Delete copy/move event pool constructors --- .../include/hpx/async_cuda/cuda_event.hpp | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index ff33a067f497..1783dd28721a 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -21,7 +21,7 @@ namespace hpx { namespace cuda { namespace experimental { // of them at startup. struct cuda_event_pool { - static constexpr int initial_events_in_pool = 128; + static constexpr std::size_t initial_events_in_pool = 128; static cuda_event_pool& get_event_pool() { @@ -29,24 +29,6 @@ namespace hpx { namespace cuda { namespace experimental { return event_pool_; } - // create a bunch of events on initialization - cuda_event_pool() - : max_number_devices_(0) - { - check_cuda_error(cudaGetDeviceCount(&max_number_devices_)); - HPX_ASSERT_MSG(max_number_devices_ > 0, - "CUDA polling enabled and called, yet no CUDA device found!"); - for (int device = 0; device < max_number_devices_; device++) - { - check_cuda_error(cudaSetDevice(device)); - free_lists_.emplace_back(initial_events_in_pool); - for (int i = 0; i < initial_events_in_pool; ++i) - { - add_event_to_pool(device); - } - } - } - // on destruction, all objects in stack will be freed ~cuda_event_pool() { @@ -86,7 +68,33 @@ namespace hpx { namespace cuda { namespace experimental { return free_lists_[device].push(event); } + // delete copy / move constructors + cuda_event_pool(cuda_event_pool&&) = delete; + cuda_event_pool& operator=(cuda_event_pool&&) = delete; + cuda_event_pool(const cuda_event_pool&) = delete; + cuda_event_pool& operator=(const cuda_event_pool&) = delete; + private: + // Private singleton constructor + // Creates a bunch of events on initialization + cuda_event_pool() + : max_number_devices_(0) + { + check_cuda_error(cudaGetDeviceCount(&max_number_devices_)); + HPX_ASSERT_MSG(max_number_devices_ > 0, + "CUDA polling enabled and called, yet no CUDA device found!"); + /* free_lists_.reserve(max_number_devices_); */ + for (int device = 0; device < max_number_devices_; device++) + { + check_cuda_error(cudaSetDevice(device)); + free_lists_.emplace_back(initial_events_in_pool); + for (std::size_t i = 0; i < initial_events_in_pool; ++i) + { + add_event_to_pool(device); + } + } + } + void add_event_to_pool(int device) { check_cuda_error(cudaSetDevice(device)); From 8d46517ee95e621da5c20be40bf832b1d4a38103 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 21 Jun 2023 14:07:16 -0500 Subject: [PATCH 55/72] Fix unused parameter warning --- .../include/hpx/async_cuda/cuda_future.hpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp index 9633d40bf2bc..85fff23cfdf5 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp @@ -128,7 +128,7 @@ namespace hpx { namespace cuda { namespace experimental { } future_data(init_no_addref no_addref, other_allocator const& alloc, - cudaStream_t stream, int device) + cudaStream_t stream) : lcos::detail::future_data_allocator(no_addref, alloc) , rt_(hpx::get_runtime_ptr()) @@ -201,8 +201,19 @@ namespace hpx { namespace cuda { namespace experimental { unique_ptr p(traits::allocate(alloc, 1), hpx::util::allocator_deleter{alloc}); - traits::construct( - alloc, p.get(), init_no_addref{}, alloc, stream, device); + static_assert(std::is_same_v || + std::is_same_v, + "get_future mode not supported!"); + if constexpr (std::is_same_v) + { + traits::construct( + alloc, p.get(), init_no_addref{}, alloc, stream, device); + } + else if constexpr (std::is_same_v) + { + traits::construct( + alloc, p.get(), init_no_addref{}, alloc, stream); + } return hpx::traits::future_access>::create( p.release(), false); @@ -214,7 +225,7 @@ namespace hpx { namespace cuda { namespace experimental { hpx::future get_future_with_callback( Allocator const& a, cudaStream_t stream) { - return get_future(a, stream, 0); + return get_future(a, stream); } // ------------------------------------------------------------- From 017109ac9c170ac979165623d35985d938979bf8 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 22 Jun 2023 21:31:16 -0500 Subject: [PATCH 56/72] Switch to east const --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 1783dd28721a..07783c97e422 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -71,8 +71,8 @@ namespace hpx { namespace cuda { namespace experimental { // delete copy / move constructors cuda_event_pool(cuda_event_pool&&) = delete; cuda_event_pool& operator=(cuda_event_pool&&) = delete; - cuda_event_pool(const cuda_event_pool&) = delete; - cuda_event_pool& operator=(const cuda_event_pool&) = delete; + cuda_event_pool(cuda_event_pool const&) = delete; + cuda_event_pool& operator=(cuda_event_pool const&) = delete; private: // Private singleton constructor From 3e26df21b1d98f474febc6792919ef3b0cf108de Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 22 Jun 2023 21:31:50 -0500 Subject: [PATCH 57/72] Add -1 default parameter for device auto-detection --- .../include/hpx/async_cuda/cuda_future.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp index 85fff23cfdf5..7b906baa42ed 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp @@ -184,7 +184,7 @@ namespace hpx { namespace cuda { namespace experimental { // specified mode template hpx::future get_future( - Allocator const& a, cudaStream_t stream, int device = 0) + Allocator const& a, cudaStream_t stream, int device) { using shared_state = future_data; @@ -225,15 +225,19 @@ namespace hpx { namespace cuda { namespace experimental { hpx::future get_future_with_callback( Allocator const& a, cudaStream_t stream) { - return get_future(a, stream); + // device id 0 will be dropped in callback mode - can be + // an arbitrary number here + return get_future(a, stream, 0); } // ------------------------------------------------------------- // main API call to get a future from a stream using allocator template hpx::future get_future_with_event( - Allocator const& a, cudaStream_t stream, int device = 0) + Allocator const& a, cudaStream_t stream, int device = -1) { + if (device == -1) + check_cuda_error(cudaGetDevice(&device)); return get_future(a, stream, device); } @@ -245,7 +249,7 @@ namespace hpx { namespace cuda { namespace experimental { // ------------------------------------------------------------- // non allocator version of : get future with an event set HPX_CORE_EXPORT hpx::future get_future_with_event( - cudaStream_t stream, int device = 0); + cudaStream_t stream, int device = -1); } // namespace detail }}} // namespace hpx::cuda::experimental From c5727554abc749485ec062c74755097ddfe01708 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Tue, 27 Jun 2023 11:14:46 -0500 Subject: [PATCH 58/72] Fix assert --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 07783c97e422..8b7b740a167b 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -1,6 +1,5 @@ // Copyright (c) 2020 John Biddiscombe // Copyright (c) 2020 Teodor Nikolov -// // 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) @@ -32,7 +31,7 @@ namespace hpx { namespace cuda { namespace experimental { // on destruction, all objects in stack will be freed ~cuda_event_pool() { - HPX_ASSERT_MSG(free_lists_.size != max_number_devices_, + HPX_ASSERT_MSG(free_lists_.size() != max_number_devices_, "Number of CUDA event pools does not match the number of " "devices!"); for (int device = 0; device < max_number_devices_; device++) From eebcdcad2aa58c915d57c2a275fb4f21e921ff77 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Tue, 27 Jun 2023 13:00:29 -0500 Subject: [PATCH 59/72] Restore original device after init --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 8b7b740a167b..6d249d2031e4 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -82,7 +82,8 @@ namespace hpx { namespace cuda { namespace experimental { check_cuda_error(cudaGetDeviceCount(&max_number_devices_)); HPX_ASSERT_MSG(max_number_devices_ > 0, "CUDA polling enabled and called, yet no CUDA device found!"); - /* free_lists_.reserve(max_number_devices_); */ + int original_device = 0; + check_cuda_error(cudaGetDevice(&original_device)); for (int device = 0; device < max_number_devices_; device++) { check_cuda_error(cudaSetDevice(device)); @@ -92,6 +93,9 @@ namespace hpx { namespace cuda { namespace experimental { add_event_to_pool(device); } } + // Restore original device -- avoids confusion about HPX switching + // devices for the current thread if only one device is used. + check_cuda_error(cudaSetDevice(original_device)); } void add_event_to_pool(int device) From e1a3ef9c53f48b6ddccd48e6331aba344fa3683d Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Tue, 27 Jun 2023 14:54:41 -0500 Subject: [PATCH 60/72] Remove superfluous cudaSetDevice --- libs/core/async_cuda/src/cuda_event_callback.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/core/async_cuda/src/cuda_event_callback.cpp b/libs/core/async_cuda/src/cuda_event_callback.cpp index b472e5c55e23..1b0267cd068b 100644 --- a/libs/core/async_cuda/src/cuda_event_callback.cpp +++ b/libs/core/async_cuda/src/cuda_event_callback.cpp @@ -113,7 +113,6 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { HPX_THROW_EXCEPTION(hpx::error::invalid_status, "add_event_callback", "could not get an event"); } - check_cuda_error(cudaSetDevice(device)); check_cuda_error(cudaEventRecord(event, stream)); detail::add_to_event_callback_queue( From aba2b0ee22c0c587dc5a52bfd6913a704300d997 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 28 Jun 2023 14:18:32 -0500 Subject: [PATCH 61/72] Put event pool singleton access definition in src --- libs/core/async_cuda/CMakeLists.txt | 2 +- .../include/hpx/async_cuda/cuda_event.hpp | 11 +++++------ libs/core/async_cuda/src/cuda_event.cpp | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 libs/core/async_cuda/src/cuda_event.cpp diff --git a/libs/core/async_cuda/CMakeLists.txt b/libs/core/async_cuda/CMakeLists.txt index 77782a23bc47..b2a7954877bb 100644 --- a/libs/core/async_cuda/CMakeLists.txt +++ b/libs/core/async_cuda/CMakeLists.txt @@ -36,7 +36,7 @@ set(async_cuda_compat_headers # cmake-format: on set(async_cuda_sources cuda_event_callback.cpp cuda_future.cpp cuda_target.cpp - get_targets.cpp + get_targets.cpp cuda_event.cpp ) if(HPX_WITH_HIP AND TARGET roc::hipblas) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 6d249d2031e4..c399839a7a13 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -1,5 +1,7 @@ +// Copyright (c) 2023 Gregor Daiß // Copyright (c) 2020 John Biddiscombe // Copyright (c) 2020 Teodor Nikolov +// // 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) @@ -22,16 +24,13 @@ namespace hpx { namespace cuda { namespace experimental { { static constexpr std::size_t initial_events_in_pool = 128; - static cuda_event_pool& get_event_pool() - { - static cuda_event_pool event_pool_; - return event_pool_; - } + HPX_CORE_EXPORT static cuda_event_pool& get_event_pool(); // on destruction, all objects in stack will be freed ~cuda_event_pool() { - HPX_ASSERT_MSG(free_lists_.size() != max_number_devices_, + HPX_ASSERT_MSG(free_lists_.size() != + static_cast(max_number_devices_), "Number of CUDA event pools does not match the number of " "devices!"); for (int device = 0; device < max_number_devices_; device++) diff --git a/libs/core/async_cuda/src/cuda_event.cpp b/libs/core/async_cuda/src/cuda_event.cpp new file mode 100644 index 000000000000..809cf1fa892c --- /dev/null +++ b/libs/core/async_cuda/src/cuda_event.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2023 Gregor Daiß +// +// 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 + +namespace hpx { namespace cuda { namespace experimental { + cuda_event_pool& cuda_event_pool::get_event_pool() + { + static cuda_event_pool event_pool_; + return event_pool_; + } +}}} // namespace hpx::cuda::experimental From c2d81c3bafb28d85c4a3d1a1c0eddc9cb04c4639 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 28 Jun 2023 16:08:11 -0500 Subject: [PATCH 62/72] Add basic multi gpu polling test --- .../core/async_cuda/tests/unit/CMakeLists.txt | 5 +- .../tests/unit/cuda_multi_device_polling.cpp | 83 +++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp diff --git a/libs/core/async_cuda/tests/unit/CMakeLists.txt b/libs/core/async_cuda/tests/unit/CMakeLists.txt index ce6cf5a19ee2..b14933107024 100644 --- a/libs/core/async_cuda/tests/unit/CMakeLists.txt +++ b/libs/core/async_cuda/tests/unit/CMakeLists.txt @@ -4,16 +4,19 @@ # Distributed under the 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 cuda_future transform_stream) +set(tests cuda_future cuda_multi_device_polling transform_stream) if(HPX_WITH_GPUBLAS) set(benchmarks ${benchmarks} cublas_matmul) endif() set(cublas_matmul_PARAMETERS THREADS_PER_LOCALITY 4) set(cuda_future_PARAMETERS THREADS_PER_LOCALITY 4) +set(cuda_multi_device_polling_PARAMETERS THREADS_PER_LOCALITY 4) set(transform_stream_PARAMETERS THREADS_PER_LOCALITY 4) set(cuda_future_CUDA_SOURCE saxpy trivial_demo) +set(cuda_multi_device_polling_CUDA_SOURCE trivial_demo) + set(transform_stream_CUDA ON) foreach(test ${tests}) diff --git a/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp b/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp new file mode 100644 index 000000000000..2200155055e9 --- /dev/null +++ b/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp @@ -0,0 +1,83 @@ +// Copyright (c) 2023 Gregor Daiß +// +// 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 +#include +#include +#include +#include + +// ------------------------------------------------------------------------- +// This example is similar to the unit/cuda_future.cpp example (hence it also uses +// the externally defined cuda_trivial_kernel. See unit/cuda_future.cpp for +// more details regarding this. +// +// This example extends unit/cuda_future.cpp by testing the cuda event polling +// on multiple devices (if available)! If the polling is not working correctly, +// the test will time out as some of the futures are never triggered. + +template +extern void cuda_trivial_kernel(T, cudaStream_t stream); + +extern void launch_saxpy_kernel( + hpx::cuda::experimental::cuda_executor& cudaexec, unsigned int& blocks, + unsigned int& threads, void** args); + + +// ------------------------------------------------------------------------- +int hpx_main(hpx::program_options::variables_map& vm) +{ + // install cuda future polling handler + hpx::cuda::experimental::enable_user_polling poll("default"); + + // Print all targets for debug purposes + hpx::cuda::experimental::print_local_targets(); + + int number_devices = 0; + hpx::cuda::experimental::check_cuda_error(cudaGetDeviceCount(&number_devices)); + HPX_ASSERT(number_devices > 0); + + std::vector> futs(number_devices); + + for (auto device_id = 0; device_id < number_devices; device_id++) { + hpx::cuda::experimental::cuda_executor exec( + device_id, hpx::cuda::experimental::event_mode{}); + auto fut = hpx::async(exec, cuda_trivial_kernel, + static_cast(device_id) + 1); + futs[device_id] = fut.then([device_id](hpx::future&&) { + std::cout + << "Continuation for kernel future triggered on device executor " + << device_id << std::endl; + }); + } + + auto final_fut = hpx::when_all(futs); + std::cout << "All executor test kernels launched! " << std::endl; + final_fut.get(); + std::cout << "All executor test kernels finished! " << std::endl; + + return hpx::local::finalize(); +} + +// ------------------------------------------------------------------------- +int main(int argc, char** argv) +{ + std::cout << "[HPX Cuda multi device polling] - Starting...\n" << std::endl; + + hpx::local::init_params init_args; + + auto result = hpx::local::init(hpx_main, argc, argv, init_args); + return result || hpx::util::report_errors(); +} From b62a3fe564f662c746491df11ccfe6399eda55a2 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 28 Jun 2023 16:51:55 -0500 Subject: [PATCH 63/72] Fix assert (again) --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index c399839a7a13..fa2c8d80b9e4 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -29,7 +29,7 @@ namespace hpx { namespace cuda { namespace experimental { // on destruction, all objects in stack will be freed ~cuda_event_pool() { - HPX_ASSERT_MSG(free_lists_.size() != + HPX_ASSERT_MSG(free_lists_.size() == static_cast(max_number_devices_), "Number of CUDA event pools does not match the number of " "devices!"); From 7e82358bb600bf4106d013e7920223229eb0f107 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 28 Jun 2023 17:12:27 -0500 Subject: [PATCH 64/72] Add test for default device ID --- .../tests/unit/cuda_multi_device_polling.cpp | 47 ++++++++++++++----- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp b/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp index 2200155055e9..636c610ca952 100644 --- a/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp +++ b/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp @@ -46,28 +46,49 @@ int hpx_main(hpx::program_options::variables_map& vm) hpx::cuda::experimental::print_local_targets(); int number_devices = 0; - hpx::cuda::experimental::check_cuda_error(cudaGetDeviceCount(&number_devices)); + hpx::cuda::experimental::check_cuda_error( + cudaGetDeviceCount(&number_devices)); HPX_ASSERT(number_devices > 0); + // Check if the futures complete when using executors on all devices std::vector> futs(number_devices); - - for (auto device_id = 0; device_id < number_devices; device_id++) { - hpx::cuda::experimental::cuda_executor exec( - device_id, hpx::cuda::experimental::event_mode{}); - auto fut = hpx::async(exec, cuda_trivial_kernel, - static_cast(device_id) + 1); - futs[device_id] = fut.then([device_id](hpx::future&&) { - std::cout - << "Continuation for kernel future triggered on device executor " - << device_id << std::endl; - }); + for (auto device_id = 0; device_id < number_devices; device_id++) + { + hpx::cuda::experimental::cuda_executor exec( + device_id, hpx::cuda::experimental::event_mode{}); + auto fut = hpx::async(exec, cuda_trivial_kernel, + static_cast(device_id) + 1); + futs[device_id] = fut.then([device_id](hpx::future&&) { + std::cout << "Continuation for kernel future triggered on device " + "executor " + << device_id << std::endl; + }); } - auto final_fut = hpx::when_all(futs); std::cout << "All executor test kernels launched! " << std::endl; final_fut.get(); std::cout << "All executor test kernels finished! " << std::endl; + // Test to see if HPX correctly picks up the current device in case + // get_future_with_event is not given a device_id + for (auto device_id = 0; device_id < number_devices; device_id++) + { + hpx::cuda::experimental::check_cuda_error(cudaSetDevice(device_id)); + cudaStream_t device_stream; + hpx::cuda::experimental::check_cuda_error( + cudaStreamCreate(&device_stream)); + cuda_trivial_kernel( + number_devices + device_id + 1, device_stream); + auto fut = hpx::cuda::experimental::detail::get_future_with_event( + device_stream); + fut.get(); + std::cout + << "get_future_with_event default ID test finished on device " + << device_id << std::endl; + hpx::cuda::experimental::check_cuda_error( + cudaStreamDestroy(device_stream)); + } + return hpx::local::finalize(); } From 7da1dd0a0e3c998504f182668a456a933897be54 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 28 Jun 2023 17:13:50 -0500 Subject: [PATCH 65/72] Fix some format issues / update file author lists --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 4 ++-- libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp | 5 +++-- libs/core/async_cuda/src/cuda_event.cpp | 2 +- libs/core/async_cuda/src/cuda_event_callback.cpp | 1 + libs/core/async_cuda/src/cuda_future.cpp | 1 + 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index fa2c8d80b9e4..31c6cc768f85 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -73,8 +73,8 @@ namespace hpx { namespace cuda { namespace experimental { cuda_event_pool& operator=(cuda_event_pool const&) = delete; private: - // Private singleton constructor - // Creates a bunch of events on initialization + // Private singleton constructor. Creates a initial_events_in_pool of + // events on initialization cuda_event_pool() : max_number_devices_(0) { diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp index 7b906baa42ed..62fc91c2d1d4 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp @@ -1,3 +1,4 @@ +// Copyright (c) 2023 Gregor Daiß // Copyright (c) 2020 John Biddiscombe // Copyright (c) 2016 Thomas Heller // Copyright (c) 2016 Hartmut Kaiser @@ -236,8 +237,8 @@ namespace hpx { namespace cuda { namespace experimental { hpx::future get_future_with_event( Allocator const& a, cudaStream_t stream, int device = -1) { - if (device == -1) - check_cuda_error(cudaGetDevice(&device)); + if (device == -1) + check_cuda_error(cudaGetDevice(&device)); return get_future(a, stream, device); } diff --git a/libs/core/async_cuda/src/cuda_event.cpp b/libs/core/async_cuda/src/cuda_event.cpp index 809cf1fa892c..470dbf5533d4 100644 --- a/libs/core/async_cuda/src/cuda_event.cpp +++ b/libs/core/async_cuda/src/cuda_event.cpp @@ -8,7 +8,7 @@ #include #include -namespace hpx { namespace cuda { namespace experimental { +namespace hpx { namespace cuda { namespace experimental { cuda_event_pool& cuda_event_pool::get_event_pool() { static cuda_event_pool event_pool_; diff --git a/libs/core/async_cuda/src/cuda_event_callback.cpp b/libs/core/async_cuda/src/cuda_event_callback.cpp index 1b0267cd068b..9597656ecbe6 100644 --- a/libs/core/async_cuda/src/cuda_event_callback.cpp +++ b/libs/core/async_cuda/src/cuda_event_callback.cpp @@ -1,3 +1,4 @@ +// Copyright (c) 2023 Gregor Daiß // Copyright (c) 2021 ETH Zurich // Copyright (c) 2020 John Biddiscombe // Copyright (c) 2016 Hartmut Kaiser diff --git a/libs/core/async_cuda/src/cuda_future.cpp b/libs/core/async_cuda/src/cuda_future.cpp index c797191e1474..545b1dc9b77c 100644 --- a/libs/core/async_cuda/src/cuda_future.cpp +++ b/libs/core/async_cuda/src/cuda_future.cpp @@ -1,3 +1,4 @@ +// Copyright (c) 2023 Gregor Daiß // Copyright (c) 2020 John Biddiscombe // Copyright (c) 2016 Hartmut Kaiser // Copyright (c) 2016 Thomas Heller From beb233e4237df42cccc3fc40e2e7ac9691c143d9 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 28 Jun 2023 17:30:42 -0500 Subject: [PATCH 66/72] Fix test format --- .../async_cuda/tests/unit/cuda_multi_device_polling.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp b/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp index 636c610ca952..24493aa58992 100644 --- a/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp +++ b/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp @@ -35,7 +35,6 @@ extern void launch_saxpy_kernel( hpx::cuda::experimental::cuda_executor& cudaexec, unsigned int& blocks, unsigned int& threads, void** args); - // ------------------------------------------------------------------------- int hpx_main(hpx::program_options::variables_map& vm) { @@ -82,9 +81,8 @@ int hpx_main(hpx::program_options::variables_map& vm) auto fut = hpx::cuda::experimental::detail::get_future_with_event( device_stream); fut.get(); - std::cout - << "get_future_with_event default ID test finished on device " - << device_id << std::endl; + std::cout << "get_future_with_event default ID test finished on device " + << device_id << std::endl; hpx::cuda::experimental::check_cuda_error( cudaStreamDestroy(device_stream)); } From 3b8cd90bf9331824b06a60580a72a1647e8c126b Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 28 Jun 2023 22:57:46 -0500 Subject: [PATCH 67/72] Cal setdevice when creating events on-demand --- .../core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 31c6cc768f85..5a13a911c857 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -54,7 +54,15 @@ namespace hpx { namespace cuda { namespace experimental { // pop an event off the pool, if that fails, create a new one while (!free_lists_[device].pop(event)) { + // Set correct device in case if required + int original_device = -1; + check_cuda_error(cudaGetDevice(&original_device)); + if (original_device != device) + check_cuda_error(cudaSetDevice(device)); add_event_to_pool(device); + // reset to original device if required + if (original_device != device) + check_cuda_error(cudaSetDevice(original_device)); } return true; } From afe52e7cfac144e45b26af672c7c8cf701df7b68 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Wed, 28 Jun 2023 23:17:03 -0500 Subject: [PATCH 68/72] Fix format (again) --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 5a13a911c857..727379a1db09 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -60,9 +60,9 @@ namespace hpx { namespace cuda { namespace experimental { if (original_device != device) check_cuda_error(cudaSetDevice(device)); add_event_to_pool(device); - // reset to original device if required + // reset to original device if required if (original_device != device) - check_cuda_error(cudaSetDevice(original_device)); + check_cuda_error(cudaSetDevice(original_device)); } return true; } From 1d59503f5fb70e1c335b6f77672e39a5db511938 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 29 Jun 2023 11:33:26 -0500 Subject: [PATCH 69/72] Remove superfluous api call --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 727379a1db09..f9c7da830cbb 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -54,11 +54,9 @@ namespace hpx { namespace cuda { namespace experimental { // pop an event off the pool, if that fails, create a new one while (!free_lists_[device].pop(event)) { - // Set correct device in case if required + // Save current device int original_device = -1; check_cuda_error(cudaGetDevice(&original_device)); - if (original_device != device) - check_cuda_error(cudaSetDevice(device)); add_event_to_pool(device); // reset to original device if required if (original_device != device) From a2c6bc346bcf06fb98ad1338de417b619187f649 Mon Sep 17 00:00:00 2001 From: Gregor Daiss Date: Thu, 6 Jul 2023 12:51:50 -0500 Subject: [PATCH 70/72] Fix inspect --- libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp | 4 ++++ libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp | 2 ++ libs/core/async_cuda/src/cuda_event.cpp | 2 ++ libs/core/async_cuda/src/cuda_event_callback.cpp | 2 ++ libs/core/async_cuda/src/cuda_future.cpp | 2 ++ libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp | 3 +++ 6 files changed, 15 insertions(+) diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index f9c7da830cbb..ce4db339969f 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -5,11 +5,15 @@ // 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) +// +// hpxinspect:noascii #pragma once +#include #include +#include #include #include #include diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp index 62fc91c2d1d4..e5e617c47171 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp @@ -6,6 +6,8 @@ // 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) +// +// hpxinspect:noascii #pragma once diff --git a/libs/core/async_cuda/src/cuda_event.cpp b/libs/core/async_cuda/src/cuda_event.cpp index 470dbf5533d4..1425937a8f29 100644 --- a/libs/core/async_cuda/src/cuda_event.cpp +++ b/libs/core/async_cuda/src/cuda_event.cpp @@ -3,6 +3,8 @@ // 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) +// +// hpxinspect:noascii #include #include diff --git a/libs/core/async_cuda/src/cuda_event_callback.cpp b/libs/core/async_cuda/src/cuda_event_callback.cpp index 9597656ecbe6..90698b402a98 100644 --- a/libs/core/async_cuda/src/cuda_event_callback.cpp +++ b/libs/core/async_cuda/src/cuda_event_callback.cpp @@ -7,6 +7,8 @@ // 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) +// +// hpxinspect:noascii #include #include diff --git a/libs/core/async_cuda/src/cuda_future.cpp b/libs/core/async_cuda/src/cuda_future.cpp index 545b1dc9b77c..accb87e1ff89 100644 --- a/libs/core/async_cuda/src/cuda_future.cpp +++ b/libs/core/async_cuda/src/cuda_future.cpp @@ -6,6 +6,8 @@ // 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) +// +// hpxinspect:noascii #include #include diff --git a/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp b/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp index 24493aa58992..ca1ee5579c7f 100644 --- a/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp +++ b/libs/core/async_cuda/tests/unit/cuda_multi_device_polling.cpp @@ -3,8 +3,11 @@ // 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) +// +// hpxinspect:noascii #include +#include #include #include #include From 793e5a6a68025c9bc2def9393974a5e0f9b9a6bf Mon Sep 17 00:00:00 2001 From: Jiakun Yan Date: Wed, 28 Jun 2023 21:31:52 -0500 Subject: [PATCH 71/72] update(lci pp): update the default version of LCI autofetch to v1.7.5 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 223d14a273ad..3a26fafff18d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1138,7 +1138,7 @@ if(HPX_WITH_NETWORKING) ADVANCED ) hpx_option( - HPX_WITH_LCI_TAG STRING "LCI repository tag or branch" "v1.7.4" + HPX_WITH_LCI_TAG STRING "LCI repository tag or branch" "v1.7.5" CATEGORY "Build Targets" ADVANCED ) From bf05f03e09780cde3144ccb1589150bd76188237 Mon Sep 17 00:00:00 2001 From: Jiakun Yan Date: Sun, 2 Jul 2023 15:21:26 -0500 Subject: [PATCH 72/72] Update the documentation for the LCI parcelport. --- .../manual/using_the_lci_parcelport.rst | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/sphinx/manual/using_the_lci_parcelport.rst b/docs/sphinx/manual/using_the_lci_parcelport.rst index 986d24f945db..95e8193282cd 100644 --- a/docs/sphinx/manual/using_the_lci_parcelport.rst +++ b/docs/sphinx/manual/using_the_lci_parcelport.rst @@ -97,13 +97,29 @@ If you are using ``mpirun`` or ``srun``, you can just pass ``--hpx:ini=hpx.parcel.lci.priority=1000``, ``--hpx:ini=hpx.parcel.lci.enable=1``, and ``--hpx:ini=hpx.parcel.bootstrap=lci`` to the |hpx| applications. +If you are running on a Cray machine, you need to pass `--mpi=pmix` or `--mpi=pmi2` to srun +to enable the PMIx or PMI2 support of SLURM since LCI does not support the default Cray PMI. +For example, + +.. code-block:: shell-session + + $ srun --mpi=pmix [hpx application] + .. _tune_lci_pp: Performance tuning of the LCI parcelport ======================================== -We encourage users to increase the zero-copy serialization threshold of LCI to ``8192`` (bytes) by -either the cmake variable ``-DHPX_WITH_ZERO_COPY_SERIALIZATION_THRESHOLD=8192`` -(this will affect all the parcelports) or the command line option -``--hpx:ini=hpx.parcel.lci.zero_copy_serialization_threshold=8192`` -(this will only affect the LCI parcelport). +We encourage users to set the following environmental variables +when using the LCI parcelport to get better performance. + +.. code-block:: shell-session + + $ export LCI_SERVER_MAX_SENDS=1024 + $ export LCI_SERVER_MAX_RECVS=4096 + $ export LCI_SERVER_NUM_PKTS=65536 + $ export LCI_SERVER_MAX_CQES=65536 + $ export LCI_PACKET_SIZE=12288 + +This setting needs roughly 800MB memory per process. The memory consumption mainly +comes from the packets, which can be calculated using `LCI_SERVER_NUM_PKTS x LCI_PACKET_SIZE`. \ No newline at end of file