From 005bde57a7a8e85493c5fcd816053f49a9c8711a Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 18 May 2026 06:52:11 -0500 Subject: [PATCH 1/3] Adapting agas module to C++20 modules Signed-off-by: Hartmut Kaiser --- .../core/algorithms/include/hpx/parallel/util/loop.hpp | 2 +- libs/full/agas/CMakeLists.txt | 1 + libs/full/agas/include/hpx/agas/addressing_service.hpp | 10 ++++------ libs/full/agas/include/hpx/agas/agas_fwd.hpp | 7 ++++--- libs/full/agas/include/hpx/agas/state.hpp | 6 +++--- libs/full/include/include/hpx/include/naming.hpp | 2 +- libs/full/init_runtime/src/pre_main.cpp | 5 +++-- libs/full/parcelport_gasnet/CMakeLists.txt | 2 +- libs/full/parcelport_lci/CMakeLists.txt | 2 +- libs/full/parcelport_lcw/CMakeLists.txt | 2 +- libs/full/parcelport_mpi/CMakeLists.txt | 2 +- libs/full/parcelport_tcp/CMakeLists.txt | 2 +- .../hpx/performance_counters/agas_counter_types.hpp | 2 +- .../performance_counters/src/agas_counter_types.cpp | 3 ++- .../src/component_namespace_counters.cpp | 4 ++-- .../full/performance_counters/src/counter_creators.cpp | 3 ++- .../src/locality_namespace_counters.cpp | 4 ++-- .../src/primary_namespace_counters.cpp | 4 ++-- .../src/symbol_namespace_counters.cpp | 4 ++-- .../full/runtime_components/src/console_error_sink.cpp | 3 ++- libs/full/runtime_components/src/console_logging.cpp | 3 ++- .../include/hpx/runtime_distributed.hpp | 3 ++- .../hpx/runtime_distributed/server/runtime_support.hpp | 3 ++- libs/full/runtime_distributed/src/applier.cpp | 4 ++-- libs/full/runtime_distributed/src/big_boot_barrier.cpp | 3 ++- .../runtime_distributed/src/runtime_distributed.cpp | 6 +++--- .../src/server/runtime_support_server.cpp | 4 ++-- 27 files changed, 52 insertions(+), 44 deletions(-) diff --git a/libs/core/algorithms/include/hpx/parallel/util/loop.hpp b/libs/core/algorithms/include/hpx/parallel/util/loop.hpp index 26929c60dcd8..46f9261781d7 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/loop.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/loop.hpp @@ -525,7 +525,7 @@ namespace hpx::parallel::util { HPX_CXX_CORE_EXPORT template struct const_loop_n_t final - : hpx::functional::detail::tag_fallback> + : hpx::functional::detail::tag_fallback> { private: template diff --git a/libs/full/agas/CMakeLists.txt b/libs/full/agas/CMakeLists.txt index 72d526471986..d2d0eb00675e 100644 --- a/libs/full/agas/CMakeLists.txt +++ b/libs/full/agas/CMakeLists.txt @@ -29,6 +29,7 @@ include(HPX_AddModule) add_hpx_module( full agas GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_MODULE_GEN ON SOURCES ${agas_sources} HEADERS ${agas_headers} COMPAT_HEADERS ${agas_compat_headers} diff --git a/libs/full/agas/include/hpx/agas/addressing_service.hpp b/libs/full/agas/include/hpx/agas/addressing_service.hpp index a61c490082e7..4500089eec4d 100644 --- a/libs/full/agas/include/hpx/agas/addressing_service.hpp +++ b/libs/full/agas/include/hpx/agas/addressing_service.hpp @@ -37,13 +37,13 @@ #include -namespace hpx { namespace agas { +namespace hpx::agas { #if defined(HPX_HAVE_NETWORKING) - HPX_EXPORT void destroy_big_boot_barrier(); + HPX_CXX_EXPORT HPX_EXPORT void destroy_big_boot_barrier(); #endif - struct addressing_service + HPX_CXX_EXPORT struct addressing_service { public: HPX_NON_COPYABLE(addressing_service); @@ -115,7 +115,6 @@ namespace hpx { namespace agas { #if defined(HPX_HAVE_NETWORKING) ~addressing_service() { - // TODO: Free the future pools? destroy_big_boot_barrier(); } #else @@ -1217,7 +1216,6 @@ namespace hpx { namespace agas { // Pre-cache locality endpoints in hosted locality namespace void pre_cache_endpoints(std::vector const&); }; - -}} // namespace hpx::agas +} // namespace hpx::agas #include diff --git a/libs/full/agas/include/hpx/agas/agas_fwd.hpp b/libs/full/agas/include/hpx/agas/agas_fwd.hpp index cba3006ae7a0..a34e56180141 100644 --- a/libs/full/agas/include/hpx/agas/agas_fwd.hpp +++ b/libs/full/agas/include/hpx/agas/agas_fwd.hpp @@ -14,12 +14,13 @@ namespace hpx { namespace agas { - struct HPX_EXPORT addressing_service; + HPX_CXX_EXPORT struct HPX_EXPORT addressing_service; } // namespace agas namespace naming { - HPX_EXPORT agas::addressing_service& get_agas_client(); - HPX_EXPORT agas::addressing_service* get_agas_client_ptr(); + HPX_CXX_EXPORT HPX_EXPORT agas::addressing_service& get_agas_client(); + HPX_CXX_EXPORT HPX_EXPORT agas::addressing_service* + get_agas_client_ptr(); } // namespace naming } // namespace hpx diff --git a/libs/full/agas/include/hpx/agas/state.hpp b/libs/full/agas/include/hpx/agas/state.hpp index 185c058eddff..4b57433ec574 100644 --- a/libs/full/agas/include/hpx/agas/state.hpp +++ b/libs/full/agas/include/hpx/agas/state.hpp @@ -9,8 +9,8 @@ #include #include -namespace hpx { namespace agas { +namespace hpx::agas { // return whether resolver client is in state described by 'mask' - HPX_EXPORT bool router_is(state st); -}} // namespace hpx::agas + HPX_CXX_EXPORT HPX_EXPORT bool router_is(state st); +} // namespace hpx::agas diff --git a/libs/full/include/include/hpx/include/naming.hpp b/libs/full/include/include/hpx/include/naming.hpp index ede2cc32b46d..dcc4dda5ff66 100644 --- a/libs/full/include/include/hpx/include/naming.hpp +++ b/libs/full/include/include/hpx/include/naming.hpp @@ -8,5 +8,5 @@ #pragma once #include -#include +#include #include diff --git a/libs/full/init_runtime/src/pre_main.cpp b/libs/full/init_runtime/src/pre_main.cpp index 57920d31a61f..e6ccdce8563f 100644 --- a/libs/full/init_runtime/src/pre_main.cpp +++ b/libs/full/init_runtime/src/pre_main.cpp @@ -9,12 +9,11 @@ #if defined(HPX_HAVE_DISTRIBUTED_RUNTIME) -#include #include #include #include #include -#include +#include #include #include #include @@ -31,6 +30,8 @@ #include #include +#include + #include #include diff --git a/libs/full/parcelport_gasnet/CMakeLists.txt b/libs/full/parcelport_gasnet/CMakeLists.txt index a0801b96f10d..fb618fa15992 100644 --- a/libs/full/parcelport_gasnet/CMakeLists.txt +++ b/libs/full/parcelport_gasnet/CMakeLists.txt @@ -35,7 +35,7 @@ endif() include(HPX_AddModule) add_hpx_module( full parcelport_gasnet - GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_GEN OFF SOURCES ${parcelport_gasnet_sources} HEADERS ${parcelport_gasnet_headers} DEPENDENCIES hpx_core hpx_gasnet_base PkgConfig::GASNET diff --git a/libs/full/parcelport_lci/CMakeLists.txt b/libs/full/parcelport_lci/CMakeLists.txt index c81978b65f4a..57672d073979 100644 --- a/libs/full/parcelport_lci/CMakeLists.txt +++ b/libs/full/parcelport_lci/CMakeLists.txt @@ -57,7 +57,7 @@ hpx_setup_lci() include(HPX_AddModule) add_hpx_module( full parcelport_lci - GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_GEN OFF SOURCES ${parcelport_lci_sources} HEADERS ${parcelport_lci_headers} COMPAT_HEADERS ${parcelport_lci_compat_headers} diff --git a/libs/full/parcelport_lcw/CMakeLists.txt b/libs/full/parcelport_lcw/CMakeLists.txt index 9f09b9f04b0c..66775da4e1ec 100644 --- a/libs/full/parcelport_lcw/CMakeLists.txt +++ b/libs/full/parcelport_lcw/CMakeLists.txt @@ -52,7 +52,7 @@ hpx_setup_lcw() include(HPX_AddModule) add_hpx_module( full parcelport_lcw - GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_GEN OFF SOURCES ${parcelport_lcw_sources} HEADERS ${parcelport_lcw_headers} COMPAT_HEADERS ${parcelport_lcw_compat_headers} diff --git a/libs/full/parcelport_mpi/CMakeLists.txt b/libs/full/parcelport_mpi/CMakeLists.txt index ec60ec1ba2bf..c89bf16e7a3c 100644 --- a/libs/full/parcelport_mpi/CMakeLists.txt +++ b/libs/full/parcelport_mpi/CMakeLists.txt @@ -32,7 +32,7 @@ hpx_setup_mpi() include(HPX_AddModule) add_hpx_module( full parcelport_mpi - GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_GEN OFF SOURCES ${parcelport_mpi_sources} HEADERS ${parcelport_mpi_headers} COMPAT_HEADERS ${parcelport_mpi_compat_headers} diff --git a/libs/full/parcelport_tcp/CMakeLists.txt b/libs/full/parcelport_tcp/CMakeLists.txt index c7988e0fb669..6b0ababfa5b3 100644 --- a/libs/full/parcelport_tcp/CMakeLists.txt +++ b/libs/full/parcelport_tcp/CMakeLists.txt @@ -26,7 +26,7 @@ set(parcelport_tcp_sources connection_handler_tcp.cpp locality.cpp include(HPX_AddModule) add_hpx_module( full parcelport_tcp - GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_GEN OFF SOURCES ${parcelport_tcp_sources} HEADERS ${parcelport_tcp_headers} COMPAT_HEADERS ${parcelport_tcp_compat_headers} diff --git a/libs/full/performance_counters/include/hpx/performance_counters/agas_counter_types.hpp b/libs/full/performance_counters/include/hpx/performance_counters/agas_counter_types.hpp index d9b59f44a15f..2ecf527abe28 100644 --- a/libs/full/performance_counters/include/hpx/performance_counters/agas_counter_types.hpp +++ b/libs/full/performance_counters/include/hpx/performance_counters/agas_counter_types.hpp @@ -8,7 +8,7 @@ #pragma once #include -#include +#include namespace hpx { namespace performance_counters { diff --git a/libs/full/performance_counters/src/agas_counter_types.cpp b/libs/full/performance_counters/src/agas_counter_types.cpp index a96280f45729..975b32a7df8c 100644 --- a/libs/full/performance_counters/src/agas_counter_types.cpp +++ b/libs/full/performance_counters/src/agas_counter_types.cpp @@ -6,8 +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/libs/full/performance_counters/src/component_namespace_counters.cpp b/libs/full/performance_counters/src/component_namespace_counters.cpp index 079c71abbbb1..e5f68cec7e20 100644 --- a/libs/full/performance_counters/src/component_namespace_counters.cpp +++ b/libs/full/performance_counters/src/component_namespace_counters.cpp @@ -7,14 +7,14 @@ // file 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/full/performance_counters/src/counter_creators.cpp b/libs/full/performance_counters/src/counter_creators.cpp index c44956faf560..f2476d133037 100644 --- a/libs/full/performance_counters/src/counter_creators.cpp +++ b/libs/full/performance_counters/src/counter_creators.cpp @@ -5,16 +5,17 @@ // file 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/full/performance_counters/src/locality_namespace_counters.cpp b/libs/full/performance_counters/src/locality_namespace_counters.cpp index 1a987139d02c..b570ddeef953 100644 --- a/libs/full/performance_counters/src/locality_namespace_counters.cpp +++ b/libs/full/performance_counters/src/locality_namespace_counters.cpp @@ -7,14 +7,14 @@ // file 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/full/performance_counters/src/primary_namespace_counters.cpp b/libs/full/performance_counters/src/primary_namespace_counters.cpp index dfcd901b1f20..84a4daa32d9f 100644 --- a/libs/full/performance_counters/src/primary_namespace_counters.cpp +++ b/libs/full/performance_counters/src/primary_namespace_counters.cpp @@ -7,14 +7,14 @@ // file 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/full/performance_counters/src/symbol_namespace_counters.cpp b/libs/full/performance_counters/src/symbol_namespace_counters.cpp index 8c49bfe5c164..374e98ee9059 100644 --- a/libs/full/performance_counters/src/symbol_namespace_counters.cpp +++ b/libs/full/performance_counters/src/symbol_namespace_counters.cpp @@ -7,13 +7,13 @@ // file 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/full/runtime_components/src/console_error_sink.cpp b/libs/full/runtime_components/src/console_error_sink.cpp index 422a5afbf169..c9f3ac1e55d1 100644 --- a/libs/full/runtime_components/src/console_error_sink.cpp +++ b/libs/full/runtime_components/src/console_error_sink.cpp @@ -6,10 +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 diff --git a/libs/full/runtime_components/src/console_logging.cpp b/libs/full/runtime_components/src/console_logging.cpp index 5002a9bb0b7d..d8ee0d63440f 100644 --- a/libs/full/runtime_components/src/console_logging.cpp +++ b/libs/full/runtime_components/src/console_logging.cpp @@ -6,8 +6,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include #include +#include #include #include #include @@ -21,6 +21,7 @@ #include #include #include + #include #include diff --git a/libs/full/runtime_distributed/include/hpx/runtime_distributed.hpp b/libs/full/runtime_distributed/include/hpx/runtime_distributed.hpp index ad4b29328fa8..8d444681f9e1 100644 --- a/libs/full/runtime_distributed/include/hpx/runtime_distributed.hpp +++ b/libs/full/runtime_distributed/include/hpx/runtime_distributed.hpp @@ -8,7 +8,7 @@ #pragma once #include -#include +#include #include #include #include @@ -18,6 +18,7 @@ #include #include #include + #include #include #include 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 286f6790f5e5..d3da7170ee80 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 @@ -9,10 +9,10 @@ #pragma once #include -#include #include #include #include +#include #include #include #include @@ -25,6 +25,7 @@ #include #include #include + #include #include diff --git a/libs/full/runtime_distributed/src/applier.cpp b/libs/full/runtime_distributed/src/applier.cpp index 32a0672863d6..b905f2f4a041 100644 --- a/libs/full/runtime_distributed/src/applier.cpp +++ b/libs/full/runtime_distributed/src/applier.cpp @@ -8,9 +8,8 @@ #include -#include -#include #include +#include #include #include #include @@ -20,6 +19,7 @@ #include #include #include + #include #include #include diff --git a/libs/full/runtime_distributed/src/big_boot_barrier.cpp b/libs/full/runtime_distributed/src/big_boot_barrier.cpp index 3596077282d6..5ee8b35ad00e 100644 --- a/libs/full/runtime_distributed/src/big_boot_barrier.cpp +++ b/libs/full/runtime_distributed/src/big_boot_barrier.cpp @@ -9,9 +9,9 @@ #include #if defined(HPX_HAVE_NETWORKING) -#include #include #include +#include #include #include #include @@ -27,6 +27,7 @@ #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 40f71edf3e30..d56a3c58e69a 100644 --- a/libs/full/runtime_distributed/src/runtime_distributed.cpp +++ b/libs/full/runtime_distributed/src/runtime_distributed.cpp @@ -6,9 +6,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include - -#include #include +#include #include #include #include @@ -41,6 +40,8 @@ #include #include #include +#include + #include #include #include @@ -49,7 +50,6 @@ #include #include #include -#include #include #include 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 917153946799..57ed66cf88ae 100644 --- a/libs/full/runtime_distributed/src/server/runtime_support_server.cpp +++ b/libs/full/runtime_distributed/src/server/runtime_support_server.cpp @@ -6,10 +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 #include @@ -34,6 +33,7 @@ #include #include #include + #include #include #include From 9de4ea1d2cc2c66608f4a722f0fb92da7ac4f2f9 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Tue, 19 May 2026 08:54:15 -0500 Subject: [PATCH 2/3] Adapting async_colocated module to C++20 modules Signed-off-by: Hartmut Kaiser --- libs/full/async_colocated/CMakeLists.txt | 7 +- .../hpx/async_colocated/async_colocated.hpp | 90 +++++++------------ .../async_colocated_callback.hpp | 76 +++++++--------- .../async_colocated_callback_fwd.hpp | 36 ++++---- .../async_colocated/async_colocated_fwd.hpp | 19 ++-- .../functional/colocated_helpers.hpp | 2 +- .../hpx/async_colocated/get_colocation_id.hpp | 6 +- .../include/hpx/async_colocated/macros.hpp | 33 +++++++ .../hpx/async_colocated/post_colocated.hpp | 46 +++++----- .../post_colocated_callback.hpp | 34 +++---- .../post_colocated_callback_fwd.hpp | 17 ++-- .../async_colocated/post_colocated_fwd.hpp | 17 ++-- .../register_post_colocated.hpp | 10 +-- .../server/destroy_component.hpp | 8 +- .../async_colocated/src/get_colocation_id.cpp | 3 +- .../src/server/destroy_component.cpp | 5 +- .../hpx/collectives/broadcast_direct.hpp | 3 +- .../include/hpx/collectives/fold.hpp | 2 +- .../include/hpx/collectives/reduce_direct.hpp | 2 +- .../colocating_distribution_policy.hpp | 5 +- .../include/include/hpx/include/applier.hpp | 3 +- .../include/include/hpx/include/async.hpp | 3 +- .../include/hpx/include/components.hpp | 3 +- .../full/include/include/hpx/include/post.hpp | 3 +- .../runtime_components/component_registry.hpp | 6 +- .../create_component_helpers.hpp | 2 +- .../runtime_distributed/copy_component.hpp | 3 +- .../runtime_distributed/migrate_component.hpp | 3 +- .../stubs/runtime_support.hpp | 3 +- .../src/stubs/runtime_support_stubs.cpp | 2 +- 30 files changed, 225 insertions(+), 227 deletions(-) create mode 100644 libs/full/async_colocated/include/hpx/async_colocated/macros.hpp diff --git a/libs/full/async_colocated/CMakeLists.txt b/libs/full/async_colocated/CMakeLists.txt index b1845878ea39..1cb331e08704 100644 --- a/libs/full/async_colocated/CMakeLists.txt +++ b/libs/full/async_colocated/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022 The STE||AR-Group +# Copyright (c) 2019-2026 The STE||AR-Group # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -15,6 +15,7 @@ set(async_colocated_headers hpx/async_colocated/async_colocated_callback.hpp hpx/async_colocated/async_colocated_fwd.hpp hpx/async_colocated/async_colocated.hpp + hpx/async_colocated/macros.hpp hpx/async_colocated/post_colocated_callback_fwd.hpp hpx/async_colocated/post_colocated_callback.hpp hpx/async_colocated/post_colocated_fwd.hpp @@ -25,6 +26,8 @@ set(async_colocated_headers hpx/async_colocated/server/destroy_component.hpp ) +set(async_colocated_macros_headers hpx/async_colocated/macros.hpp) + # cmake-format: off set(async_colocated_compat_headers hpx/async_distributed/detail/async_colocated_callback_fwd.hpp => hpx/async_colocated/async_colocated_callback_fwd.hpp @@ -48,8 +51,10 @@ include(HPX_AddModule) add_hpx_module( full async_colocated GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_MODULE_GEN ON SOURCES ${async_colocated_sources} HEADERS ${async_colocated_headers} + MACRO_HEADERS ${async_colocated_macros_headers} COMPAT_HEADERS ${async_colocated_compat_headers} DEPENDENCIES hpx_core MODULE_DEPENDENCIES hpx_actions_base hpx_agas_base hpx_async_distributed diff --git a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated.hpp b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated.hpp index bbd66a950126..1f7c3d835ee7 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2015 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -25,8 +25,9 @@ #include #include -namespace hpx { namespace detail { - template +namespace hpx::detail { + + template struct async_colocated_bound_action; template @@ -39,54 +40,31 @@ namespace hpx { namespace detail { hpx::id_type>, Ts...>; }; -}} // namespace hpx::detail - -#define HPX_REGISTER_ASYNC_COLOCATED_DECLARATION(Action, Name) \ - HPX_UTIL_REGISTER_UNIQUE_FUNCTION_DECLARATION( \ - void(hpx::id_type, hpx::id_type), \ - (hpx::util::functional::detail::async_continuation_impl< \ - typename hpx::detail::async_colocated_bound_action::type, \ - hpx::util::unused_type>), \ - Name) \ - /**/ -#define HPX_REGISTER_ASYNC_COLOCATED(Action, Name) \ - HPX_UTIL_REGISTER_UNIQUE_FUNCTION(void(hpx::id_type, hpx::id_type), \ - (hpx::util::functional::detail::async_continuation_impl< \ - typename hpx::detail::async_colocated_bound_action::type, \ - hpx::util::unused_type>), \ - Name) \ - /**/ - -namespace hpx { namespace detail { /////////////////////////////////////////////////////////////////////////// template - hpx::future::remote_result_type>::type> - async_colocated(hpx::id_type const& gid, - Ts&&... -#if !defined(HPX_COMPUTE_DEVICE_CODE) - vs -#endif - ) + hpx::future::remote_result_type>> + async_colocated( + [[maybe_unused]] hpx::id_type const& id, [[maybe_unused]] Ts&&... vs) { // Attach the requested action as a continuation to a resolve_async // call on the locality responsible for the target gid. hpx::id_type service_target( - agas::primary_namespace::get_service_instance(gid.get_gid()), + agas::primary_namespace::get_service_instance(id.get_gid()), hpx::id_type::management_type::unmanaged); #if !defined(HPX_COMPUTE_DEVICE_CODE) using remote_result_type = - typename hpx::traits::extract_action::remote_result_type; + hpx::traits::extract_action::remote_result_type; using action_type = agas::server::primary_namespace::colocate_action; using placeholders::_2; return detail::async_continue_r( util::functional::async_continuation(hpx::bind( - hpx::bind(util::functional::extract_locality(), _2, gid), + hpx::bind(util::functional::extract_locality(), _2, id), HPX_FORWARD(Ts, vs)...)), - service_target, gid.get_gid()); + service_target, id.get_gid()); #else HPX_ASSERT(false); return hpx::future - hpx::future::remote_result_type>::type> + hpx::future::remote_result_type>> async_colocated( hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Ts&&... vs) + hpx::id_type const& id, Ts&&... vs) { - return async_colocated(gid, HPX_FORWARD(Ts, vs)...); + return async_colocated(id, HPX_FORWARD(Ts, vs)...); } /////////////////////////////////////////////////////////////////////////// template - std::enable_if_t, - hpx::future::remote_result_type>>> - async_colocated(Continuation&& cont, hpx::id_type const& gid, - Ts&&... -#if !defined(HPX_COMPUTE_DEVICE_CODE) - vs -#endif - ) + requires(traits::is_continuation_v) + hpx::future::remote_result_type>> + async_colocated([[maybe_unused]] Continuation&& cont, + [[maybe_unused]] hpx::id_type const& id, [[maybe_unused]] Ts&&... vs) { #if defined(HPX_COMPUTE_DEVICE_CODE) - HPX_UNUSED(cont); - HPX_UNUSED(gid); HPX_ASSERT(false); #else // Attach the requested action as a continuation to a resolve_async // call on the locality responsible for the target gid. hpx::id_type service_target( - agas::primary_namespace::get_service_instance(gid.get_gid()), + agas::primary_namespace::get_service_instance(id.get_gid()), hpx::id_type::management_type::unmanaged); using remote_result_type = - typename hpx::traits::extract_action::remote_result_type; + hpx::traits::extract_action::remote_result_type; using action_type = agas::server::primary_namespace::colocate_action; using placeholders::_2; return detail::async_continue_r( util::functional::async_continuation( hpx::bind( - hpx::bind(util::functional::extract_locality(), _2, gid), + hpx::bind(util::functional::extract_locality(), _2, id), HPX_FORWARD(Ts, vs)...), HPX_FORWARD(Continuation, cont)), - service_target, gid.get_gid()); + service_target, id.get_gid()); #endif } template - std::enable_if_t, - hpx::future::remote_result_type>>> + requires(traits::is_continuation_v) + hpx::future::remote_result_type>> async_colocated(Continuation&& cont, hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Ts&&... vs) + hpx::id_type const& id, Ts&&... vs) { return async_colocated( - HPX_FORWARD(Continuation, cont), gid, HPX_FORWARD(Ts, vs)...); + HPX_FORWARD(Continuation, cont), id, HPX_FORWARD(Ts, vs)...); } -}} // namespace hpx::detail +} // namespace hpx::detail diff --git a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback.hpp b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback.hpp index 6632087dc56d..607dc6dd892a 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback.hpp @@ -18,103 +18,91 @@ #include -namespace hpx { namespace detail { +namespace hpx::detail { + /////////////////////////////////////////////////////////////////////////// template - hpx::future::remote_result_type>::type> - async_colocated_cb(hpx::id_type const& gid, Callback&& cb, - Ts&&... -#if !defined(HPX_COMPUTE_DEVICE_CODE) - vs -#endif - ) + hpx::future::remote_result_type>> + async_colocated_cb([[maybe_unused]] hpx::id_type const& id, + [[maybe_unused]] Callback&& cb, [[maybe_unused]] Ts&&... vs) { #if defined(HPX_COMPUTE_DEVICE_CODE) - HPX_UNUSED(gid); - HPX_UNUSED(cb); HPX_ASSERT(false); #else // Attach the requested action as a continuation to a resolve_async // call on the locality responsible for the target gid. hpx::id_type service_target( - agas::primary_namespace::get_service_instance(gid.get_gid()), + agas::primary_namespace::get_service_instance(id.get_gid()), hpx::id_type::management_type::unmanaged); - typedef typename hpx::traits::extract_action::remote_result_type - remote_result_type; - typedef agas::server::primary_namespace::colocate_action action_type; + using remote_result_type = + hpx::traits::extract_action::remote_result_type; + using action_type = agas::server::primary_namespace::colocate_action; using placeholders::_2; return detail::async_continue_r_cb( util::functional::async_continuation(hpx::bind( - hpx::bind(util::functional::extract_locality(), _2, gid), + hpx::bind(util::functional::extract_locality(), _2, id), HPX_FORWARD(Ts, vs)...)), - service_target, HPX_FORWARD(Callback, cb), gid.get_gid()); + service_target, HPX_FORWARD(Callback, cb), id.get_gid()); #endif } template - hpx::future::remote_result_type>::type> + hpx::future::remote_result_type>> async_colocated_cb( hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Callback&& cb, Ts&&... vs) + hpx::id_type const& id, Callback&& cb, Ts&&... vs) { return async_colocated_cb( - gid, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); + id, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); } /////////////////////////////////////////////////////////////////////////// template - hpx::future::remote_result_type>::type> - async_colocated_cb( - Continuation&& cont, hpx::id_type const& gid, Callback&& cb, - Ts&&... -#if !defined(HPX_COMPUTE_DEVICE_CODE) - vs -#endif - ) + hpx::future::remote_result_type>> + async_colocated_cb([[maybe_unused]] Continuation&& cont, + [[maybe_unused]] hpx::id_type const& id, [[maybe_unused]] Callback&& cb, + [[maybe_unused]] Ts&&... vs) { #if defined(HPX_COMPUTE_DEVICE_CODE) - HPX_UNUSED(cont); - HPX_UNUSED(gid); - HPX_UNUSED(cb); HPX_ASSERT(false); #else // Attach the requested action as a continuation to a resolve_async // call on the locality responsible for the target gid. hpx::id_type service_target( - agas::primary_namespace::get_service_instance(gid.get_gid()), + agas::primary_namespace::get_service_instance(id.get_gid()), hpx::id_type::management_type::unmanaged); - typedef typename hpx::traits::extract_action::remote_result_type - remote_result_type; - typedef agas::server::primary_namespace::colocate_action action_type; + using remote_result_type = + hpx::traits::extract_action::remote_result_type; + using action_type = agas::server::primary_namespace::colocate_action; using placeholders::_2; return detail::async_continue_r_cb( util::functional::async_continuation( hpx::bind( - hpx::bind(util::functional::extract_locality(), _2, gid), + hpx::bind(util::functional::extract_locality(), _2, id), HPX_FORWARD(Ts, vs)...), HPX_FORWARD(Continuation, cont)), - service_target, HPX_FORWARD(Callback, cb), gid.get_gid()); + service_target, HPX_FORWARD(Callback, cb), id.get_gid()); #endif } template - hpx::future::remote_result_type>::type> + hpx::future::remote_result_type>> async_colocated_cb(Continuation&& cont, hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Callback&& cb, Ts&&... vs) + hpx::id_type const& id, Callback&& cb, Ts&&... vs) { - return async_colocated_cb(HPX_FORWARD(Continuation, cont), gid, + return async_colocated_cb(HPX_FORWARD(Continuation, cont), id, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); } -}} // namespace hpx::detail +} // namespace hpx::detail diff --git a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback_fwd.hpp b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback_fwd.hpp index f810e7753bb2..dfc2ae087044 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback_fwd.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback_fwd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2015 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,38 +6,40 @@ #pragma once -#include #include #include -namespace hpx { namespace detail { +#include + +namespace hpx::detail { + /////////////////////////////////////////////////////////////////////////// template - hpx::future::remote_result_type>::type> - async_colocated_cb(hpx::id_type const& gid, Callback&& cb, Ts&&... vs); + hpx::future::remote_result_type>> + async_colocated_cb(hpx::id_type const& id, Callback&& cb, Ts&&... vs); template - hpx::future::remote_result_type>::type> + hpx::future::remote_result_type>> async_colocated_cb( hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Callback&& cb, Ts&&... vs); + hpx::id_type const& id, Callback&& cb, Ts&&... vs); /////////////////////////////////////////////////////////////////////////// template - hpx::future::remote_result_type>::type> - async_colocated_cb(Continuation&& cont, hpx::id_type const& gid, - Callback&& cb, Ts&&... vs); + hpx::future::remote_result_type>> + async_colocated_cb( + Continuation&& cont, hpx::id_type const& id, Callback&& cb, Ts&&... vs); template - hpx::future::remote_result_type>::type> + hpx::future::remote_result_type>> async_colocated_cb(Continuation&& cont, hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Callback&& cb, Ts&&... vs); -}} // namespace hpx::detail + hpx::id_type const& id, Callback&& cb, Ts&&... vs); +} // namespace hpx::detail diff --git a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_fwd.hpp b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_fwd.hpp index 6926865a49b5..21adebb02d8c 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_fwd.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_fwd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -14,7 +14,8 @@ #include -namespace hpx { namespace detail { +namespace hpx::detail { + /////////////////////////////////////////////////////////////////////////// template hpx::future - std::enable_if_t, - hpx::future::remote_result_type>>> + requires(traits::is_continuation_v < Continuation) + hpx::future::remote_result_type>> async_colocated(Continuation&& cont, hpx::id_type const& id, Ts&&... vs); template - std::enable_if_t, - hpx::future::remote_result_type>>> + requires(traits::is_continuation_v) + hpx::future::remote_result_type>> async_colocated(Continuation&& cont, hpx::actions::basic_action, hpx::id_type const& id, Ts&&... vs); #endif -}} // namespace hpx::detail +} // namespace hpx::detail diff --git a/libs/full/async_colocated/include/hpx/async_colocated/functional/colocated_helpers.hpp b/libs/full/async_colocated/include/hpx/async_colocated/functional/colocated_helpers.hpp index 8418e7fe3ba5..fb96ad93dd58 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/functional/colocated_helpers.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/functional/colocated_helpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/libs/full/async_colocated/include/hpx/async_colocated/get_colocation_id.hpp b/libs/full/async_colocated/include/hpx/async_colocated/get_colocation_id.hpp index d5dac83c7079..77b2af1f6c35 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/get_colocation_id.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/get_colocation_id.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -36,7 +36,7 @@ namespace hpx { /// hpx::exception. /// /// \see \a hpx::get_colocation_id() - HPX_EXPORT hpx::id_type get_colocation_id( + HPX_CXX_EXPORT HPX_EXPORT hpx::id_type get_colocation_id( launch::sync_policy, hpx::id_type const& id, error_code& ec = throws); /// \brief Asynchronously return the id of the locality where the object @@ -45,6 +45,6 @@ namespace hpx { /// \param id [in] The id of the object to locate. /// /// \see \a hpx::get_colocation_id(launch::sync_policy) - HPX_EXPORT hpx::future get_colocation_id( + HPX_CXX_EXPORT HPX_EXPORT hpx::future get_colocation_id( hpx::id_type const& id); } // namespace hpx diff --git a/libs/full/async_colocated/include/hpx/async_colocated/macros.hpp b/libs/full/async_colocated/include/hpx/async_colocated/macros.hpp new file mode 100644 index 000000000000..23af14093d52 --- /dev/null +++ b/libs/full/async_colocated/include/hpx/async_colocated/macros.hpp @@ -0,0 +1,33 @@ +// Copyright (c) 2007-2026 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 + +//////////////////////////////////////////////////////////////////////////////// +// from async_colocated.hpp +#define HPX_REGISTER_ASYNC_COLOCATED_DECLARATION(Action, Name) \ + HPX_UTIL_REGISTER_UNIQUE_FUNCTION_DECLARATION( \ + void(hpx::id_type, hpx::id_type), \ + (hpx::util::functional::detail::async_continuation_impl< \ + typename hpx::detail::async_colocated_bound_action::type, \ + hpx::util::unused_type>), \ + Name) \ + /**/ + +#define HPX_REGISTER_ASYNC_COLOCATED(Action, Name) \ + HPX_UTIL_REGISTER_UNIQUE_FUNCTION(void(hpx::id_type, hpx::id_type), \ + (hpx::util::functional::detail::async_continuation_impl< \ + typename hpx::detail::async_colocated_bound_action::type, \ + hpx::util::unused_type>), \ + Name) \ + /**/ + +//////////////////////////////////////////////////////////////////////////////// +// from register_post_colocated.hpp +#define HPX_REGISTER_APPLY_COLOCATED_DECLARATION(Action, Name) +#define HPX_REGISTER_APPLY_COLOCATED(action, name) diff --git a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated.hpp b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated.hpp index fdae66f3853f..83c74758dc0b 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -22,81 +22,81 @@ #include #include -namespace hpx { namespace detail { +namespace hpx::detail { + /////////////////////////////////////////////////////////////////////////// template - bool post_colocated(hpx::id_type const& gid, Ts&&... vs) + bool post_colocated(hpx::id_type const& id, Ts&&... vs) { // shortcut co-location code if target already is a locality - if (naming::is_locality(gid)) + if (naming::is_locality(id)) { - return post(gid, HPX_FORWARD(Ts, vs)...); + return post(id, HPX_FORWARD(Ts, vs)...); } // Attach the requested action as a continuation to a resolve_async // call on the locality responsible for the target gid. hpx::id_type service_target( - agas::primary_namespace::get_service_instance(gid.get_gid()), + agas::primary_namespace::get_service_instance(id.get_gid()), hpx::id_type::management_type::unmanaged); - typedef agas::server::primary_namespace::colocate_action action_type; + using action_type = agas::server::primary_namespace::colocate_action; using placeholders::_2; return post_continue( util::functional::post_continuation(hpx::bind( - hpx::bind(util::functional::extract_locality(), _2, gid), + hpx::bind(util::functional::extract_locality(), _2, id), HPX_FORWARD(Ts, vs)...)), - service_target, gid.get_gid()); + service_target, id.get_gid()); } template bool post_colocated( hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Ts&&... vs) + hpx::id_type const& id, Ts&&... vs) { - return post_colocated(gid, HPX_FORWARD(Ts, vs)...); + return post_colocated(id, HPX_FORWARD(Ts, vs)...); } template - typename std::enable_if::value, - bool>::type - post_colocated(Continuation&& cont, hpx::id_type const& gid, Ts&&... vs) + requires(traits::is_continuation_v) + bool post_colocated(Continuation&& cont, hpx::id_type const& id, Ts&&... vs) { // shortcut co-location code if target already is a locality - if (naming::is_locality(gid)) + if (naming::is_locality(id)) { return post_continue( - HPX_FORWARD(Continuation, cont), gid, HPX_FORWARD(Ts, vs)...); + HPX_FORWARD(Continuation, cont), id, HPX_FORWARD(Ts, vs)...); } // Attach the requested action as a continuation to a resolve_async // call on the locality responsible for the target gid. hpx::id_type service_target( - agas::primary_namespace::get_service_instance(gid.get_gid()), + agas::primary_namespace::get_service_instance(id.get_gid()), hpx::id_type::management_type::unmanaged); - typedef agas::server::primary_namespace::colocate_action action_type; + using action_type = agas::server::primary_namespace::colocate_action; using placeholders::_2; return post_continue( util::functional::post_continuation( hpx::bind( - hpx::bind(util::functional::extract_locality(), _2, gid), + hpx::bind(util::functional::extract_locality(), _2, id), HPX_FORWARD(Ts, vs)...), HPX_FORWARD(Continuation, cont)), - service_target, gid.get_gid()); + service_target, id.get_gid()); } template bool post_colocated(Continuation&& cont, hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Ts&&... vs) + hpx::id_type const& id, Ts&&... vs) { return post_colocated( - HPX_FORWARD(Continuation, cont), gid, HPX_FORWARD(Ts, vs)...); + HPX_FORWARD(Continuation, cont), id, HPX_FORWARD(Ts, vs)...); } -}} // namespace hpx::detail +} // namespace hpx::detail #endif diff --git a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback.hpp b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback.hpp index 1cb3d967e906..3822a562083e 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -25,19 +25,19 @@ namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// template - bool post_colocated_cb(hpx::id_type const& gid, Callback&& cb, Ts&&... vs) + bool post_colocated_cb(hpx::id_type const& id, Callback&& cb, Ts&&... vs) { // shortcut co-location code if target already is a locality - if (naming::is_locality(gid)) + if (naming::is_locality(id)) { return hpx::post_cb( - gid, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); + id, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); } // Attach the requested action as a continuation to a resolve_async // call on the locality responsible for the target gid. hpx::id_type service_target( - agas::primary_namespace::get_service_instance(gid.get_gid()), + agas::primary_namespace::get_service_instance(id.get_gid()), hpx::id_type::management_type::unmanaged); using action_type = agas::server::primary_namespace::colocate_action; @@ -45,41 +45,41 @@ namespace hpx::detail { using placeholders::_2; return post_continue_cb( util::functional::post_continuation(hpx::bind( - hpx::bind(util::functional::extract_locality(), _2, gid), + hpx::bind(util::functional::extract_locality(), _2, id), HPX_FORWARD(Ts, vs)...)), - service_target, HPX_FORWARD(Callback, cb), gid.get_gid()); + service_target, HPX_FORWARD(Callback, cb), id.get_gid()); } template bool post_colocated_cb( hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Callback&& cb, Ts&&... vs) + hpx::id_type const& id, Callback&& cb, Ts&&... vs) { return post_colocated_cb( - gid, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); + id, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); } /////////////////////////////////////////////////////////////////////////// template bool post_colocated_cb( - Continuation&& cont, hpx::id_type const& gid, Callback&& cb, Ts&&... vs) + Continuation&& cont, hpx::id_type const& id, Callback&& cb, Ts&&... vs) { // shortcut co-location code if target already is a locality - if (naming::is_locality(gid)) + if (naming::is_locality(id)) { constexpr hpx::launch::async_policy policy( actions::action_priority(), actions::action_stacksize()); - return hpx::post_p_cb(HPX_FORWARD(Continuation, cont), gid, + return hpx::post_p_cb(HPX_FORWARD(Continuation, cont), id, policy, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); } // Attach the requested action as a continuation to a resolve_async // call on the locality responsible for the target gid. hpx::id_type service_target( - agas::primary_namespace::get_service_instance(gid.get_gid()), + agas::primary_namespace::get_service_instance(id.get_gid()), hpx::id_type::management_type::unmanaged); using action_type = agas::server::primary_namespace::colocate_action; @@ -88,19 +88,19 @@ namespace hpx::detail { return post_continue_cb( util::functional::post_continuation( hpx::bind( - hpx::bind(util::functional::extract_locality(), _2, gid), + hpx::bind(util::functional::extract_locality(), _2, id), HPX_FORWARD(Ts, vs)...), HPX_FORWARD(Continuation, cont)), - service_target, HPX_FORWARD(Callback, cb), gid.get_gid()); + service_target, HPX_FORWARD(Callback, cb), id.get_gid()); } template bool post_colocated_cb(Continuation&& cont, hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Callback&& cb, Ts&&... vs) + hpx::id_type const& id, Callback&& cb, Ts&&... vs) { - return post_colocated_cb(HPX_FORWARD(Continuation, cont), gid, + return post_colocated_cb(HPX_FORWARD(Continuation, cont), id, HPX_FORWARD(Callback, cb), HPX_FORWARD(Ts, vs)...); } } // namespace hpx::detail diff --git a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback_fwd.hpp b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback_fwd.hpp index 3c0705cd8a04..65f6a586c1f2 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback_fwd.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback_fwd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -10,26 +10,27 @@ #include #include -namespace hpx { namespace detail { +namespace hpx::detail { + /////////////////////////////////////////////////////////////////////////// template - bool post_colocated_cb(hpx::id_type const& gid, Callback&& cb, Ts&&... vs); + bool post_colocated_cb(hpx::id_type const& id, Callback&& cb, Ts&&... vs); template bool post_colocated_cb( hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Callback&& cb, Ts&&... vs); + hpx::id_type const& id, Callback&& cb, Ts&&... vs); /////////////////////////////////////////////////////////////////////////// template - bool post_colocated_cb(Continuation&& cont, hpx::id_type const& gid, - Callback&& cb, Ts&&... vs); + bool post_colocated_cb( + Continuation&& cont, hpx::id_type const& id, Callback&& cb, Ts&&... vs); template bool post_colocated_cb(Continuation&& cont, hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Callback&& cb, Ts&&... vs); -}} // namespace hpx::detail + hpx::id_type const& id, Callback&& cb, Ts&&... vs); +} // namespace hpx::detail diff --git a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_fwd.hpp b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_fwd.hpp index e697a23a702b..dd594dd556bc 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_fwd.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_fwd.hpp @@ -12,26 +12,27 @@ #include -namespace hpx { namespace detail { +namespace hpx::detail { + /////////////////////////////////////////////////////////////////////////// template - bool post_colocated(hpx::id_type const& gid, Ts&&... vs); + bool post_colocated(hpx::id_type const& id, Ts&&... vs); template bool post_colocated( hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Ts&&... vs); + hpx::id_type const& id, Ts&&... vs); /////////////////////////////////////////////////////////////////////////// template - typename std::enable_if::value, - bool>::type - post_colocated(Continuation&& cont, hpx::id_type const& gid, Ts&&... vs); + requires(traits::is_continuation_v) + bool post_colocated( + Continuation&& cont, hpx::id_type const& id, Ts&&... vs); template bool post_colocated(Continuation&& cont, hpx::actions::basic_action /*act*/, - hpx::id_type const& gid, Ts&&... vs); -}} // namespace hpx::detail + hpx::id_type const& id, Ts&&... vs); +} // namespace hpx::detail diff --git a/libs/full/async_colocated/include/hpx/async_colocated/register_post_colocated.hpp b/libs/full/async_colocated/include/hpx/async_colocated/register_post_colocated.hpp index abf2cbc67abd..e563b775fdd4 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/register_post_colocated.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/register_post_colocated.hpp @@ -7,14 +7,15 @@ #pragma once #include -#include #include #include #include #include #include -namespace hpx { namespace detail { +#include + +namespace hpx::detail { template struct post_colocated_bound_action; @@ -29,7 +30,4 @@ namespace hpx { namespace detail { hpx::id_type>, Ts...>; }; -}} // namespace hpx::detail - -#define HPX_REGISTER_APPLY_COLOCATED_DECLARATION(Action, Name) -#define HPX_REGISTER_APPLY_COLOCATED(action, name) +} // namespace hpx::detail 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 eb5314320948..04191f0c52aa 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-2025 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011-2017 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 @@ -17,11 +17,11 @@ namespace hpx::components::server { /////////////////////////////////////////////////////////////////////////// - HPX_EXPORT void destroy_component( + HPX_CXX_EXPORT HPX_EXPORT void destroy_component( naming::gid_type const& gid, naming::address const& addr); /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template void destroy(naming::gid_type const& gid, naming::address const& addr) { // make sure this component is located here @@ -59,7 +59,7 @@ namespace hpx::components::server { component_heap().free(c, 1); } - template + HPX_CXX_EXPORT template void destroy(naming::gid_type const& gid) { naming::address addr; diff --git a/libs/full/async_colocated/src/get_colocation_id.cpp b/libs/full/async_colocated/src/get_colocation_id.cpp index 9f865385421e..f372e428c43e 100644 --- a/libs/full/async_colocated/src/get_colocation_id.cpp +++ b/libs/full/async_colocated/src/get_colocation_id.cpp @@ -6,13 +6,14 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include #include #include #include #include #include +#include + namespace hpx { hpx::id_type get_colocation_id( diff --git a/libs/full/async_colocated/src/server/destroy_component.cpp b/libs/full/async_colocated/src/server/destroy_component.cpp index 6a94bfb82e80..e4dfcc7cb487 100644 --- a/libs/full/async_colocated/src/server/destroy_component.cpp +++ b/libs/full/async_colocated/src/server/destroy_component.cpp @@ -5,8 +5,6 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include #include #include #include @@ -14,6 +12,9 @@ #include #include +#include +#include + #include #include diff --git a/libs/full/collectives/include/hpx/collectives/broadcast_direct.hpp b/libs/full/collectives/include/hpx/collectives/broadcast_direct.hpp index a63fa74484d4..82b0cc23a69a 100644 --- a/libs/full/collectives/include/hpx/collectives/broadcast_direct.hpp +++ b/libs/full/collectives/include/hpx/collectives/broadcast_direct.hpp @@ -129,10 +129,9 @@ namespace hpx { namespace lcos { #include #if !defined(HPX_COMPUTE_DEVICE_CODE) #include -#include -#include #include #include +#include #include #include #include diff --git a/libs/full/collectives/include/hpx/collectives/fold.hpp b/libs/full/collectives/include/hpx/collectives/fold.hpp index cc797ebcb584..225bdada2f0e 100644 --- a/libs/full/collectives/include/hpx/collectives/fold.hpp +++ b/libs/full/collectives/include/hpx/collectives/fold.hpp @@ -159,9 +159,9 @@ namespace hpx { namespace lcos { #include #include -#include #include #include +#include #include #include #include diff --git a/libs/full/collectives/include/hpx/collectives/reduce_direct.hpp b/libs/full/collectives/include/hpx/collectives/reduce_direct.hpp index d497f37593a8..02fc66fa188f 100644 --- a/libs/full/collectives/include/hpx/collectives/reduce_direct.hpp +++ b/libs/full/collectives/include/hpx/collectives/reduce_direct.hpp @@ -75,9 +75,9 @@ namespace hpx { namespace lcos { #include #include -#include #include #include +#include #include #include #include diff --git a/libs/full/distribution_policies/include/hpx/distribution_policies/colocating_distribution_policy.hpp b/libs/full/distribution_policies/include/hpx/distribution_policies/colocating_distribution_policy.hpp index 23f328c4bccb..e3fbb7acc39d 100644 --- a/libs/full/distribution_policies/include/hpx/distribution_policies/colocating_distribution_policy.hpp +++ b/libs/full/distribution_policies/include/hpx/distribution_policies/colocating_distribution_policy.hpp @@ -9,12 +9,9 @@ #pragma once #include -#include -#include -#include -#include #include #include +#include #include #include #include diff --git a/libs/full/include/include/hpx/include/applier.hpp b/libs/full/include/include/hpx/include/applier.hpp index c3aac468af4c..51fcde4f1d22 100644 --- a/libs/full/include/include/hpx/include/applier.hpp +++ b/libs/full/include/include/hpx/include/applier.hpp @@ -8,7 +8,6 @@ #pragma once #include -#include -#include +#include #include #include diff --git a/libs/full/include/include/hpx/include/async.hpp b/libs/full/include/include/hpx/include/async.hpp index 87f4269da47a..4aae56467606 100644 --- a/libs/full/include/include/hpx/include/async.hpp +++ b/libs/full/include/include/hpx/include/async.hpp @@ -9,6 +9,5 @@ #include #include -#include -#include +#include #include diff --git a/libs/full/include/include/hpx/include/components.hpp b/libs/full/include/include/hpx/include/components.hpp index de488a100b5d..b4a43e079767 100644 --- a/libs/full/include/include/hpx/include/components.hpp +++ b/libs/full/include/include/hpx/include/components.hpp @@ -16,9 +16,8 @@ #include #include -#include - #include +#include #include #include diff --git a/libs/full/include/include/hpx/include/post.hpp b/libs/full/include/include/hpx/include/post.hpp index 0e4bf18ff60d..5601e18e1b8c 100644 --- a/libs/full/include/include/hpx/include/post.hpp +++ b/libs/full/include/include/hpx/include/post.hpp @@ -7,7 +7,6 @@ #pragma once #include -#include -#include +#include #include #include diff --git a/libs/full/runtime_components/include/hpx/runtime_components/component_registry.hpp b/libs/full/runtime_components/include/hpx/runtime_components/component_registry.hpp index 160a062da11e..311f35f3151a 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/component_registry.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/component_registry.hpp @@ -9,7 +9,7 @@ #pragma once #include -#include +#include #include #include #include @@ -56,7 +56,7 @@ namespace hpx::components { bool get_component_info(std::vector& fillini, std::string const& filepath, bool is_static = false) override { - using type_holder = typename Component::type_holder; + using type_holder = Component::type_holder; char const* name = get_component_name(); char const* more = traits::component_config_data::call(); @@ -86,7 +86,7 @@ namespace hpx::components { components::set_component_type(type); } components::enabled(type) = enabled; - components::deleter(type) = &server::destroy; + components::deleter(type) = &server::template destroy; } }; } // namespace hpx::components diff --git a/libs/full/runtime_components/include/hpx/runtime_components/create_component_helpers.hpp b/libs/full/runtime_components/include/hpx/runtime_components/create_component_helpers.hpp index 78aa714e02c6..6f66d7371392 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/create_component_helpers.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/create_component_helpers.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/libs/full/runtime_distributed/include/hpx/runtime_distributed/copy_component.hpp b/libs/full/runtime_distributed/include/hpx/runtime_distributed/copy_component.hpp index c5d1e50a4301..6e77954dec83 100644 --- a/libs/full/runtime_distributed/include/hpx/runtime_distributed/copy_component.hpp +++ b/libs/full/runtime_distributed/include/hpx/runtime_distributed/copy_component.hpp @@ -9,12 +9,13 @@ #pragma once #include -#include #include +#include #include #include #include #include + #include #include 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 60eb9e1c1167..17b87a502685 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 @@ -10,14 +10,15 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) -#include #include #include +#include #include #include #include #include #include + #include #include diff --git a/libs/full/runtime_distributed/include/hpx/runtime_distributed/stubs/runtime_support.hpp b/libs/full/runtime_distributed/include/hpx/runtime_distributed/stubs/runtime_support.hpp index 5ae5f4f267bb..0245feb77fce 100644 --- a/libs/full/runtime_distributed/include/hpx/runtime_distributed/stubs/runtime_support.hpp +++ b/libs/full/runtime_distributed/include/hpx/runtime_distributed/stubs/runtime_support.hpp @@ -8,7 +8,7 @@ #pragma once #include -#include +#include #include #include #include @@ -16,6 +16,7 @@ #include #include #include + #include #include 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 2a9ff713aa31..e8b8c1e87509 100644 --- a/libs/full/runtime_distributed/src/stubs/runtime_support_stubs.cpp +++ b/libs/full/runtime_distributed/src/stubs/runtime_support_stubs.cpp @@ -7,9 +7,9 @@ #include #include -#include #include #include +#include #include #include #include From 2d0c47f2e1d13ef9f16716603003eed5f41b8e7c Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Tue, 19 May 2026 12:10:50 -0500 Subject: [PATCH 3/3] Adapting runtime_components module to C++20 modules Signed-off-by: Hartmut Kaiser --- .cmake-format.py | 1 - .codacy.yml | 1 + .../src/component_module.cpp | 2 +- .../src/component_storage.cpp | 2 +- .../partitioned_vector_component_impl.hpp | 2 +- .../partitioned_vector_decl.hpp | 3 +- .../partitioned_vector_impl.hpp | 3 +- .../src/partitioned_vector_component.cpp | 2 +- .../partition_unordered_map_component.hpp | 2 +- .../containers/unordered/unordered_map.hpp | 3 +- .../src/partition_unordered_map_component.cpp | 2 +- components/iostreams/src/component_module.cpp | 5 +- .../papi/src/server/papi.cpp | 2 +- .../hpx/components/process/process.hpp | 2 +- components/process/src/process.cpp | 3 +- .../algorithms/adjacent_difference.hpp | 2 +- .../parallel/datapar/adjacent_difference.hpp | 2 +- .../tests/unit/algorithms/sort_by_key.cpp | 13 +- libs/core/executors/tests/unit/CMakeLists.txt | 2 +- .../tests/unit/named_pool_executor.cpp | 3 +- .../hpx/type_support/lazy_enable_if.hpp | 2 +- .../include/hpx/actions_base/macros.hpp | 32 +- .../hpx/async_colocated/async_colocated.hpp | 17 +- .../async_colocated_callback.hpp | 14 +- .../async_colocated_callback_fwd.hpp | 14 +- .../async_colocated/async_colocated_fwd.hpp | 15 +- .../functional/colocated_helpers.hpp | 6 +- .../include/hpx/async_colocated/macros.hpp | 2 + .../hpx/async_colocated/post_colocated.hpp | 13 +- .../post_colocated_callback.hpp | 14 +- .../post_colocated_callback_fwd.hpp | 14 +- .../async_colocated/post_colocated_fwd.hpp | 13 +- .../register_post_colocated.hpp | 4 +- .../include/hpx/checkpoint/checkpoint.hpp | 2 +- libs/full/collectives/CMakeLists.txt | 2 + .../hpx/collectives/exclusive_scan.hpp | 1 + .../hpx/collectives/inclusive_scan.hpp | 1 + .../collectives/src/channel_communicator.cpp | 2 +- .../collectives/src/create_communicator.cpp | 3 +- .../detail/channel_communicator_server.cpp | 2 +- libs/full/collectives/src/latch.cpp | 3 +- .../host/target_distribution_policy.hpp | 2 +- .../binpacking_distribution_policy.hpp | 2 +- .../colocating_distribution_policy.hpp | 2 +- .../default_distribution_policy.hpp | 2 +- .../target_distribution_policy.hpp | 2 +- .../include/hpx/include/components.hpp | 7 +- libs/full/init_runtime/CMakeLists.txt | 2 + libs/full/init_runtime/src/init_logging.cpp | 2 +- libs/full/init_runtime/src/pre_main.cpp | 2 +- libs/full/lcos_distributed/CMakeLists.txt | 2 +- .../include/hpx/lcos_distributed/channel.hpp | 2 +- .../src/server/arithmetics_counter.cpp | 2 +- .../server/arithmetics_counter_extended.cpp | 2 +- .../src/server/elapsed_time_counter.cpp | 2 +- .../src/server/raw_counter.cpp | 2 +- .../src/server/raw_values_counter.cpp | 2 +- .../src/server/statistics_counter.cpp | 2 +- libs/full/runtime_components/CMakeLists.txt | 5 + .../runtime_components/component_factory.hpp | 120 +------ .../runtime_components/component_registry.hpp | 58 +--- .../hpx/runtime_components/components_fwd.hpp | 18 +- .../runtime_components/console_error_sink.hpp | 11 +- .../runtime_components/console_logging.hpp | 12 +- .../create_component_helpers.hpp | 52 +-- .../derived_component_factory.hpp | 81 +---- .../distributed_metadata_base.hpp | 54 +-- .../include/hpx/runtime_components/macros.hpp | 310 ++++++++++++++++++ .../include/hpx/runtime_components/new.hpp | 95 +++--- .../server/console_error_sink.hpp | 11 +- .../server/console_error_sink_singleton.hpp | 27 +- .../server/console_logging.hpp | 30 +- .../src/component_registry.cpp | 3 +- .../src/console_error_sink.cpp | 6 +- .../src/console_logging.cpp | 4 +- .../src/server/console_error_sink_server.cpp | 7 +- .../server/console_error_sink_singleton.cpp | 3 +- .../src/server/console_logging_server.cpp | 7 +- .../include/hpx/runtime_distributed.hpp | 2 +- .../server/copy_component.hpp | 2 +- .../server/runtime_support.hpp | 2 +- .../src/runtime_distributed.cpp | 5 +- .../src/runtime_support.cpp | 2 +- .../src/server/runtime_support_server.cpp | 2 +- .../adjacent_difference.hpp | 2 + .../segmented_algorithms/adjacent_find.hpp | 2 + .../detail/is_partitioned.hpp | 1 + .../segmented_algorithms/detail/scan.hpp | 2 + .../segmented_algorithms/is_partitioned.hpp | 1 + .../segmented_algorithms/is_sorted.hpp | 2 + .../parallel/segmented_algorithms/reduce.hpp | 2 + .../parallel/segmented_algorithms/replace.hpp | 2 + 92 files changed, 633 insertions(+), 582 deletions(-) create mode 100644 libs/full/runtime_components/include/hpx/runtime_components/macros.hpp diff --git a/.cmake-format.py b/.cmake-format.py index 832560aa2dc9..3f36f0b89d7b 100644 --- a/.cmake-format.py +++ b/.cmake-format.py @@ -392,7 +392,6 @@ 'SOURCES': '+', 'SOURCE_ROOT': 1, 'ARGS': '+', - 'EXECUTABLE': 1, 'PSEUDO_DEPS_NAME': 1, 'LOCALITIES': 1, 'PARCELPORTS': '+', diff --git a/.codacy.yml b/.codacy.yml index 97d0428c8a95..7d1397a1286f 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -13,4 +13,5 @@ exclude_paths: tools: duplication: exclude: + - "tests/**" - "**/tests/**" diff --git a/components/component_storage/src/component_module.cpp b/components/component_storage/src/component_module.cpp index 0b80706621bf..1641488530a4 100644 --- a/components/component_storage/src/component_module.cpp +++ b/components/component_storage/src/component_module.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include diff --git a/components/component_storage/src/component_storage.cpp b/components/component_storage/src/component_storage.cpp index 15d131eb68e0..54327da957f2 100644 --- a/components/component_storage/src/component_storage.cpp +++ b/components/component_storage/src/component_storage.cpp @@ -7,8 +7,8 @@ #include #include #include +#include #include -#include #include diff --git a/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_component_impl.hpp b/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_component_impl.hpp index 2352742b0153..02bfd34f2888 100644 --- a/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_component_impl.hpp +++ b/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_component_impl.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include diff --git a/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_decl.hpp b/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_decl.hpp index 3b0b7333a80f..379a593260fd 100644 --- a/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_decl.hpp +++ b/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_decl.hpp @@ -18,9 +18,8 @@ #include #include #include +#include #include -#include -#include #include #include diff --git a/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_impl.hpp b/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_impl.hpp index e4318cd13725..438dc265d31b 100644 --- a/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_impl.hpp +++ b/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_impl.hpp @@ -18,8 +18,7 @@ #include #include #include -#include -#include +#include #include #include diff --git a/components/containers/partitioned_vector/src/partitioned_vector_component.cpp b/components/containers/partitioned_vector/src/partitioned_vector_component.cpp index 26775410107b..0f109d0c7482 100644 --- a/components/containers/partitioned_vector/src/partitioned_vector_component.cpp +++ b/components/containers/partitioned_vector/src/partitioned_vector_component.cpp @@ -11,7 +11,7 @@ /// required for proper functioning of components in the context of HPX. #include -#include +#include #include #include diff --git a/components/containers/unordered/include/hpx/components/containers/unordered/partition_unordered_map_component.hpp b/components/containers/unordered/include/hpx/components/containers/unordered/partition_unordered_map_component.hpp index 7f5e01ad25ac..ad00145dd9c1 100644 --- a/components/containers/unordered/include/hpx/components/containers/unordered/partition_unordered_map_component.hpp +++ b/components/containers/unordered/include/hpx/components/containers/unordered/partition_unordered_map_component.hpp @@ -28,8 +28,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/components/containers/unordered/include/hpx/components/containers/unordered/unordered_map.hpp b/components/containers/unordered/include/hpx/components/containers/unordered/unordered_map.hpp index ad17ab7eea17..e40197da08b9 100644 --- a/components/containers/unordered/include/hpx/components/containers/unordered/unordered_map.hpp +++ b/components/containers/unordered/include/hpx/components/containers/unordered/unordered_map.hpp @@ -16,10 +16,9 @@ #include #include #include +#include #include #include -#include -#include #include #include diff --git a/components/containers/unordered/src/partition_unordered_map_component.cpp b/components/containers/unordered/src/partition_unordered_map_component.cpp index ecccef191651..6c44bdc6eefd 100644 --- a/components/containers/unordered/src/partition_unordered_map_component.cpp +++ b/components/containers/unordered/src/partition_unordered_map_component.cpp @@ -10,7 +10,7 @@ /// required for proper functioning of components in the context of HPX. #include -#include +#include #include #include diff --git a/components/iostreams/src/component_module.cpp b/components/iostreams/src/component_module.cpp index ccba84993e01..1359f7a13167 100644 --- a/components/iostreams/src/component_module.cpp +++ b/components/iostreams/src/component_module.cpp @@ -8,12 +8,13 @@ #include #include -#include #include +#include #include #include +#include +#include #include -#include #include #include diff --git a/components/performance_counters/papi/src/server/papi.cpp b/components/performance_counters/papi/src/server/papi.cpp index 020ff0e5db79..016b6ac962ff 100644 --- a/components/performance_counters/papi/src/server/papi.cpp +++ b/components/performance_counters/papi/src/server/papi.cpp @@ -14,10 +14,10 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/components/process/include/hpx/components/process/process.hpp b/components/process/include/hpx/components/process/process.hpp index 23c63e80fedf..634f10839eae 100644 --- a/components/process/include/hpx/components/process/process.hpp +++ b/components/process/include/hpx/components/process/process.hpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include diff --git a/components/process/src/process.cpp b/components/process/src/process.cpp index 28f86adc6507..11d7d66b34af 100644 --- a/components/process/src/process.cpp +++ b/components/process/src/process.cpp @@ -5,7 +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/core/algorithms/include/hpx/parallel/algorithms/adjacent_difference.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_difference.hpp index 4d9743423412..5446035d1813 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_difference.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_difference.hpp @@ -316,7 +316,7 @@ namespace hpx::parallel { std::size_t part_size) mutable { // VS2015RC bails out when op is captured by ref using hpx::get; - util::const_loop_n>( + util::loop_n>( part_begin, part_size, [op](auto&& it) mutable { get<2>(*it) = HPX_INVOKE(op, get<0>(*it), get<1>(*it)); diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_difference.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_difference.hpp index 611e901737db..d852959b94e9 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_difference.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_difference.hpp @@ -50,7 +50,7 @@ namespace hpx::parallel::detail { using hpx::get; - util::const_loop_n>( + util::loop_n>( hpx::util::zip_iterator(first, prev, dest), count, [op](auto&& it) mutable { get<2>(*it) = HPX_INVOKE(op, get<0>(*it), get<1>(*it)); 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 ad4c6ed839d9..07bd9ba7e42c 100644 --- a/libs/core/algorithms/tests/unit/algorithms/sort_by_key.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/sort_by_key.cpp @@ -29,21 +29,20 @@ // namespace debug { template - void output(std::string const& name, std::vector const& v) + void output([[maybe_unused]] std::string const& name, + [[maybe_unused]] std::vector const& v) { #ifdef EXTRA_DEBUG7 std::cout << name.c_str() << "\t : {" << v.size() << "} : "; std::copy(std::begin(v), std::end(v), std::ostream_iterator(std::cout, ", ")); std::cout << "\n"; -#else - HPX_UNUSED(name); - HPX_UNUSED(v); #endif } template - void output(std::string const& name, Iter begin, Iter end) + void output([[maybe_unused]] std::string const& name, + [[maybe_unused]] Iter begin, [[maybe_unused]] Iter end) { #ifdef EXTRA_DEBUG std::cout << name.c_str() << "\t : {" << std::distance(begin, end) @@ -53,10 +52,6 @@ namespace debug { typename std::iterator_traits::value_type>( std::cout, ", ")); std::cout << "\n"; -#else - HPX_UNUSED(name); - HPX_UNUSED(begin); - HPX_UNUSED(end); #endif } diff --git a/libs/core/executors/tests/unit/CMakeLists.txt b/libs/core/executors/tests/unit/CMakeLists.txt index 326468de85a3..086109bf493e 100644 --- a/libs/core/executors/tests/unit/CMakeLists.txt +++ b/libs/core/executors/tests/unit/CMakeLists.txt @@ -61,7 +61,7 @@ if(HPX_WITH_CXX_MODULES AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) # Clang (last tested version is v22) fails compiling the following tests when # C++ module support is enabled. set(failing_clang_tests explicit_scheduler_executor parallel_scheduler - thread_pool_scheduler + scheduler_executor thread_pool_scheduler ) foreach(test ${failing_clang_tests}) target_compile_definitions( 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 24086e96173a..c99f6fe1d9ef 100644 --- a/libs/core/resource_partitioner/tests/unit/named_pool_executor.cpp +++ b/libs/core/resource_partitioner/tests/unit/named_pool_executor.cpp @@ -57,8 +57,7 @@ int hpx_main() } // Make sure default construction works - hpx::execution::parallel_executor exec_default; - HPX_UNUSED(exec_default); + [[maybe_unused]] hpx::execution::parallel_executor exec_default; // setup executors for different task priorities on the pools // segfaults or exceptions in any of the following will cause diff --git a/libs/core/type_support/include/hpx/type_support/lazy_enable_if.hpp b/libs/core/type_support/include/hpx/type_support/lazy_enable_if.hpp index 04abe25a3814..65d8243001a5 100644 --- a/libs/core/type_support/include/hpx/type_support/lazy_enable_if.hpp +++ b/libs/core/type_support/include/hpx/type_support/lazy_enable_if.hpp @@ -18,6 +18,6 @@ namespace hpx::util { template struct lazy_enable_if { - using type = typename T::type; + using type = T::type; }; } // namespace hpx::util diff --git a/libs/full/actions_base/include/hpx/actions_base/macros.hpp b/libs/full/actions_base/include/hpx/actions_base/macros.hpp index c83fe80a2ff9..028e23b15b71 100644 --- a/libs/full/actions_base/include/hpx/actions_base/macros.hpp +++ b/libs/full/actions_base/include/hpx/actions_base/macros.hpp @@ -292,7 +292,7 @@ /// The parameter \a action is the type of the action to define the /// boilerplate for. /// -/// The parameter \a actionname specifies an unique name of the action to be +/// The parameter \a actionname specifies a unique name of the action to be /// used for serialization purposes. /// The second parameter has to be usable as a plain (nonqualified) C++ /// identifier, it should not contain special characters which cannot be part @@ -483,7 +483,11 @@ /**/ #define HPX_DEFINE_PLAIN_ACTION_1(func) \ - HPX_DEFINE_PLAIN_ACTION_2(func, HPX_PP_CAT(func, _action)) \ + HPX_DEFINE_PLAIN_ACTION_3(HPX_PP_EMPTY(), func, HPX_PP_CAT(func, _action)) \ + /**/ + +#define HPX_DEFINE_PLAIN_ACTION_2(func, name) \ + HPX_DEFINE_PLAIN_ACTION_3(HPX_PP_EMPTY(), func, name) \ /**/ #if defined(HPX_HAVE_CXX26_REFLECTION) @@ -491,13 +495,13 @@ /// When C++26 reflection is available, HPX_DEFINE_PLAIN_ACTION_2 uses /// reflect_action<^^func> instead of make_action_t. This eliminates the /// need for HPX_REGISTER_ACTION while keeping the same user-facing syntax. -#define HPX_DEFINE_PLAIN_ACTION_2(func, name) \ - using name = hpx::actions::reflect_action<^^func> \ +#define HPX_DEFINE_PLAIN_ACTION_3(Prefix, func, name) \ + Prefix using name = hpx::actions::reflect_action<^^func> \ /**/ // clang-format on #elif defined(__NVCC__) || defined(__CUDACC__) -#define HPX_DEFINE_PLAIN_ACTION_2(func, name) \ - struct name \ +#define HPX_DEFINE_PLAIN_ACTION_3(Prefix, func, name) \ + Prefix struct name \ : hpx::actions::make_action< \ typename std::add_pointer< \ typename std::remove_pointer::type>::type, \ @@ -505,18 +509,24 @@ { \ } /**/ #else -#define HPX_DEFINE_PLAIN_ACTION_2(func, name) \ - struct name : hpx::actions::make_action_t \ +#define HPX_DEFINE_PLAIN_ACTION_3(Prefix, func, name) \ + Prefix struct name \ + : hpx::actions::make_action_t \ { \ } /**/ #endif #define HPX_DEFINE_PLAIN_DIRECT_ACTION_1(func) \ - HPX_DEFINE_PLAIN_DIRECT_ACTION_2(func, HPX_PP_CAT(func, _action)) \ + HPX_DEFINE_PLAIN_DIRECT_ACTION_3( \ + HPX_PP_EMPTY(), func, HPX_PP_CAT(func, _action)) \ /**/ #define HPX_DEFINE_PLAIN_DIRECT_ACTION_2(func, name) \ - struct name \ + HPX_DEFINE_PLAIN_DIRECT_ACTION_3(HPX_PP_EMPTY(), func, name) \ + /**/ + +#define HPX_DEFINE_PLAIN_DIRECT_ACTION_3(Prefix, func, name) \ + Prefix struct name \ : hpx::actions::make_direct_action_t \ { \ } /**/ @@ -597,7 +607,7 @@ /// be encapsulated into a plain action. The parameter \p name is the name of /// the action type defined by this macro. /// -/// The second parameter has to be usable as a plain (non-qualified) C++ +/// The second parameter has to be usable as a plain (nonqualified) C++ /// identifier, it should not contain special characters which cannot be part of /// a C++ identifier, such as '<', '>', or ':'. /// diff --git a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated.hpp b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated.hpp index 1f7c3d835ee7..41e7e58cf6d5 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated.hpp @@ -21,13 +21,15 @@ #include #include +#include #include #include namespace hpx::detail { - template + HPX_CXX_EXPORT template struct async_colocated_bound_action; template @@ -42,7 +44,7 @@ namespace hpx::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated( @@ -72,8 +74,8 @@ namespace hpx::detail { #endif } - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated( @@ -84,7 +86,8 @@ namespace hpx::detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template requires(traits::is_continuation_v) hpx::future::remote_result_type>> @@ -115,8 +118,8 @@ namespace hpx::detail { #endif } - template + HPX_CXX_EXPORT template requires(traits::is_continuation_v) hpx::future::remote_result_type>> diff --git a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback.hpp b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback.hpp index 607dc6dd892a..02ea056ddaa6 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback.hpp @@ -21,7 +21,7 @@ namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated_cb([[maybe_unused]] hpx::id_type const& id, @@ -49,8 +49,8 @@ namespace hpx::detail { #endif } - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated_cb( @@ -62,8 +62,8 @@ namespace hpx::detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated_cb([[maybe_unused]] Continuation&& cont, @@ -94,8 +94,8 @@ namespace hpx::detail { #endif } - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated_cb(Continuation&& cont, diff --git a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback_fwd.hpp b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback_fwd.hpp index dfc2ae087044..01cde38d94f7 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback_fwd.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_callback_fwd.hpp @@ -14,13 +14,13 @@ namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated_cb(hpx::id_type const& id, Callback&& cb, Ts&&... vs); - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated_cb( @@ -28,15 +28,15 @@ namespace hpx::detail { hpx::id_type const& id, Callback&& cb, Ts&&... vs); /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated_cb( Continuation&& cont, hpx::id_type const& id, Callback&& cb, Ts&&... vs); - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated_cb(Continuation&& cont, diff --git a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_fwd.hpp b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_fwd.hpp index 21adebb02d8c..b2ec8ef38603 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_fwd.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/async_colocated_fwd.hpp @@ -17,13 +17,13 @@ namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated(hpx::id_type const& id, Ts&&... vs); - template + HPX_CXX_EXPORT template hpx::future::remote_result_type>> async_colocated(hpx::actions::basic_action, @@ -32,14 +32,15 @@ namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// // MSVC complains about ambiguities if it sees this forward declaration #if !defined(HPX_MSVC) - template - requires(traits::is_continuation_v < Continuation) + HPX_CXX_EXPORT template + requires(traits::is_continuation_v) hpx::future::remote_result_type>> async_colocated(Continuation&& cont, hpx::id_type const& id, Ts&&... vs); - template + HPX_CXX_EXPORT template requires(traits::is_continuation_v) hpx::future::remote_result_type>> diff --git a/libs/full/async_colocated/include/hpx/async_colocated/functional/colocated_helpers.hpp b/libs/full/async_colocated/include/hpx/async_colocated/functional/colocated_helpers.hpp index fb96ad93dd58..c6ff4d97d3c5 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/functional/colocated_helpers.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/functional/colocated_helpers.hpp @@ -21,7 +21,7 @@ namespace hpx::util::functional { /////////////////////////////////////////////////////////////////////////// - struct extract_locality + HPX_CXX_EXPORT struct extract_locality { hpx::id_type operator()( hpx::id_type const& locality_id, hpx::id_type const& id) const @@ -39,7 +39,7 @@ namespace hpx::util::functional { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct post_continuation_impl { using bound_type = std::decay_t; @@ -160,7 +160,7 @@ namespace hpx::util::functional { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct async_continuation_impl { using bound_type = std::decay_t; diff --git a/libs/full/async_colocated/include/hpx/async_colocated/macros.hpp b/libs/full/async_colocated/include/hpx/async_colocated/macros.hpp index 23af14093d52..af66be8745be 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/macros.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/macros.hpp @@ -8,6 +8,8 @@ #include +#include + //////////////////////////////////////////////////////////////////////////////// // from async_colocated.hpp #define HPX_REGISTER_ASYNC_COLOCATED_DECLARATION(Action, Name) \ diff --git a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated.hpp b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated.hpp index 83c74758dc0b..19110fcc4774 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated.hpp @@ -25,7 +25,7 @@ namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template bool post_colocated(hpx::id_type const& id, Ts&&... vs) { // shortcut co-location code if target already is a locality @@ -50,8 +50,8 @@ namespace hpx::detail { service_target, id.get_gid()); } - template + HPX_CXX_EXPORT template bool post_colocated( hpx::actions::basic_action /*act*/, hpx::id_type const& id, Ts&&... vs) @@ -59,7 +59,8 @@ namespace hpx::detail { return post_colocated(id, HPX_FORWARD(Ts, vs)...); } - template + HPX_CXX_EXPORT template requires(traits::is_continuation_v) bool post_colocated(Continuation&& cont, hpx::id_type const& id, Ts&&... vs) { @@ -88,8 +89,8 @@ namespace hpx::detail { service_target, id.get_gid()); } - template + HPX_CXX_EXPORT template bool post_colocated(Continuation&& cont, hpx::actions::basic_action /*act*/, hpx::id_type const& id, Ts&&... vs) diff --git a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback.hpp b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback.hpp index 3822a562083e..57ed97b8f685 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback.hpp @@ -24,7 +24,7 @@ namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template bool post_colocated_cb(hpx::id_type const& id, Callback&& cb, Ts&&... vs) { // shortcut co-location code if target already is a locality @@ -50,8 +50,8 @@ namespace hpx::detail { service_target, HPX_FORWARD(Callback, cb), id.get_gid()); } - template + HPX_CXX_EXPORT template bool post_colocated_cb( hpx::actions::basic_action /*act*/, hpx::id_type const& id, Callback&& cb, Ts&&... vs) @@ -61,8 +61,8 @@ namespace hpx::detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template bool post_colocated_cb( Continuation&& cont, hpx::id_type const& id, Callback&& cb, Ts&&... vs) { @@ -94,8 +94,8 @@ namespace hpx::detail { service_target, HPX_FORWARD(Callback, cb), id.get_gid()); } - template + HPX_CXX_EXPORT template bool post_colocated_cb(Continuation&& cont, hpx::actions::basic_action /*act*/, hpx::id_type const& id, Callback&& cb, Ts&&... vs) diff --git a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback_fwd.hpp b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback_fwd.hpp index 65f6a586c1f2..c61f081bea0f 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback_fwd.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_callback_fwd.hpp @@ -13,23 +13,23 @@ namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template bool post_colocated_cb(hpx::id_type const& id, Callback&& cb, Ts&&... vs); - template + HPX_CXX_EXPORT template bool post_colocated_cb( hpx::actions::basic_action /*act*/, hpx::id_type const& id, Callback&& cb, Ts&&... vs); /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template bool post_colocated_cb( Continuation&& cont, hpx::id_type const& id, Callback&& cb, Ts&&... vs); - template + HPX_CXX_EXPORT template bool post_colocated_cb(Continuation&& cont, hpx::actions::basic_action /*act*/, hpx::id_type const& id, Callback&& cb, Ts&&... vs); diff --git a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_fwd.hpp b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_fwd.hpp index dd594dd556bc..48f735e7b895 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_fwd.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/post_colocated_fwd.hpp @@ -15,23 +15,24 @@ namespace hpx::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template bool post_colocated(hpx::id_type const& id, Ts&&... vs); - template + HPX_CXX_EXPORT template bool post_colocated( hpx::actions::basic_action /*act*/, hpx::id_type const& id, Ts&&... vs); /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template requires(traits::is_continuation_v) bool post_colocated( Continuation&& cont, hpx::id_type const& id, Ts&&... vs); - template + HPX_CXX_EXPORT template bool post_colocated(Continuation&& cont, hpx::actions::basic_action /*act*/, hpx::id_type const& id, Ts&&... vs); diff --git a/libs/full/async_colocated/include/hpx/async_colocated/register_post_colocated.hpp b/libs/full/async_colocated/include/hpx/async_colocated/register_post_colocated.hpp index e563b775fdd4..132b4215c379 100644 --- a/libs/full/async_colocated/include/hpx/async_colocated/register_post_colocated.hpp +++ b/libs/full/async_colocated/include/hpx/async_colocated/register_post_colocated.hpp @@ -14,10 +14,12 @@ #include #include +#include namespace hpx::detail { - template + HPX_CXX_EXPORT template struct post_colocated_bound_action; template diff --git a/libs/full/checkpoint/include/hpx/checkpoint/checkpoint.hpp b/libs/full/checkpoint/include/hpx/checkpoint/checkpoint.hpp index 18928e512a9e..b752a322e598 100644 --- a/libs/full/checkpoint/include/hpx/checkpoint/checkpoint.hpp +++ b/libs/full/checkpoint/include/hpx/checkpoint/checkpoint.hpp @@ -22,8 +22,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/libs/full/collectives/CMakeLists.txt b/libs/full/collectives/CMakeLists.txt index 51c7647beb2e..d0b090d2ea8a 100644 --- a/libs/full/collectives/CMakeLists.txt +++ b/libs/full/collectives/CMakeLists.txt @@ -78,10 +78,12 @@ add_hpx_module( MODULE_DEPENDENCIES hpx_actions hpx_actions_base + hpx_async_colocated hpx_async_distributed hpx_components hpx_components_base hpx_naming_base + hpx_runtime_components hpx_runtime_distributed CMAKE_SUBDIRS examples tests ) diff --git a/libs/full/collectives/include/hpx/collectives/exclusive_scan.hpp b/libs/full/collectives/include/hpx/collectives/exclusive_scan.hpp index f8671ca01db5..1c4225e010ce 100644 --- a/libs/full/collectives/include/hpx/collectives/exclusive_scan.hpp +++ b/libs/full/collectives/include/hpx/collectives/exclusive_scan.hpp @@ -281,6 +281,7 @@ namespace hpx { namespace collectives { #include #include #include +#include #include #include diff --git a/libs/full/collectives/include/hpx/collectives/inclusive_scan.hpp b/libs/full/collectives/include/hpx/collectives/inclusive_scan.hpp index 8a20b2e405bf..0048f487541e 100644 --- a/libs/full/collectives/include/hpx/collectives/inclusive_scan.hpp +++ b/libs/full/collectives/include/hpx/collectives/inclusive_scan.hpp @@ -227,6 +227,7 @@ namespace hpx { namespace collectives { #include #include #include +#include #include #include diff --git a/libs/full/collectives/src/channel_communicator.cpp b/libs/full/collectives/src/channel_communicator.cpp index a486320bb356..6f914f223ada 100644 --- a/libs/full/collectives/src/channel_communicator.cpp +++ b/libs/full/collectives/src/channel_communicator.cpp @@ -16,8 +16,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/libs/full/collectives/src/create_communicator.cpp b/libs/full/collectives/src/create_communicator.cpp index 0f510f32752e..ea67309e9d1b 100644 --- a/libs/full/collectives/src/create_communicator.cpp +++ b/libs/full/collectives/src/create_communicator.cpp @@ -19,10 +19,9 @@ #include #include #include +#include #include #include -#include -#include #include #include diff --git a/libs/full/collectives/src/detail/channel_communicator_server.cpp b/libs/full/collectives/src/detail/channel_communicator_server.cpp index 9ea3f78f6a15..4cdd772e1133 100644 --- a/libs/full/collectives/src/detail/channel_communicator_server.cpp +++ b/libs/full/collectives/src/detail/channel_communicator_server.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/libs/full/collectives/src/latch.cpp b/libs/full/collectives/src/latch.cpp index 697f696abc24..b5874daaa520 100644 --- a/libs/full/collectives/src/latch.cpp +++ b/libs/full/collectives/src/latch.cpp @@ -11,11 +11,10 @@ #include #include #include +#include #include #include #include -#include -#include #include #include diff --git a/libs/full/compute/include/hpx/compute/host/target_distribution_policy.hpp b/libs/full/compute/include/hpx/compute/host/target_distribution_policy.hpp index e567d9583d62..f111609b325d 100644 --- a/libs/full/compute/include/hpx/compute/host/target_distribution_policy.hpp +++ b/libs/full/compute/include/hpx/compute/host/target_distribution_policy.hpp @@ -19,8 +19,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/libs/full/distribution_policies/include/hpx/distribution_policies/binpacking_distribution_policy.hpp b/libs/full/distribution_policies/include/hpx/distribution_policies/binpacking_distribution_policy.hpp index 7dfc91ec259d..da4e606eb8ad 100644 --- a/libs/full/distribution_policies/include/hpx/distribution_policies/binpacking_distribution_policy.hpp +++ b/libs/full/distribution_policies/include/hpx/distribution_policies/binpacking_distribution_policy.hpp @@ -17,9 +17,9 @@ #include #include #include +#include #include #include -#include #include #include diff --git a/libs/full/distribution_policies/include/hpx/distribution_policies/colocating_distribution_policy.hpp b/libs/full/distribution_policies/include/hpx/distribution_policies/colocating_distribution_policy.hpp index e3fbb7acc39d..a4f84c0d8758 100644 --- a/libs/full/distribution_policies/include/hpx/distribution_policies/colocating_distribution_policy.hpp +++ b/libs/full/distribution_policies/include/hpx/distribution_policies/colocating_distribution_policy.hpp @@ -17,8 +17,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/libs/full/distribution_policies/include/hpx/distribution_policies/default_distribution_policy.hpp b/libs/full/distribution_policies/include/hpx/distribution_policies/default_distribution_policy.hpp index be78b8c645a8..2226ffd3f343 100644 --- a/libs/full/distribution_policies/include/hpx/distribution_policies/default_distribution_policy.hpp +++ b/libs/full/distribution_policies/include/hpx/distribution_policies/default_distribution_policy.hpp @@ -18,8 +18,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/libs/full/distribution_policies/include/hpx/distribution_policies/target_distribution_policy.hpp b/libs/full/distribution_policies/include/hpx/distribution_policies/target_distribution_policy.hpp index f2d943011d54..c9e98719b2aa 100644 --- a/libs/full/distribution_policies/include/hpx/distribution_policies/target_distribution_policy.hpp +++ b/libs/full/distribution_policies/include/hpx/distribution_policies/target_distribution_policy.hpp @@ -15,8 +15,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/libs/full/include/include/hpx/include/components.hpp b/libs/full/include/include/hpx/include/components.hpp index b4a43e079767..adcab72cf705 100644 --- a/libs/full/include/include/hpx/include/components.hpp +++ b/libs/full/include/include/hpx/include/components.hpp @@ -10,16 +10,11 @@ #include #include -#include -#include -#include -#include -#include - #include #include #include #include +#include #include #include diff --git a/libs/full/init_runtime/CMakeLists.txt b/libs/full/init_runtime/CMakeLists.txt index e8cffee9776d..845adc322465 100644 --- a/libs/full/init_runtime/CMakeLists.txt +++ b/libs/full/init_runtime/CMakeLists.txt @@ -31,6 +31,7 @@ if(HPX_WITH_DISTRIBUTED_RUNTIME) set(init_runtime_sources ${init_runtime_sources} pre_main.cpp) set(init_runtime_optional_module_dependencies + hpx_agas hpx_actions_base hpx_async_distributed hpx_collectives @@ -38,6 +39,7 @@ if(HPX_WITH_DISTRIBUTED_RUNTIME) hpx_naming hpx_parcelports hpx_performance_counters + hpx_runtime_components hpx_runtime_distributed ) endif() diff --git a/libs/full/init_runtime/src/init_logging.cpp b/libs/full/init_runtime/src/init_logging.cpp index 9bd1402825a5..91d13bf2c586 100644 --- a/libs/full/init_runtime/src/init_logging.cpp +++ b/libs/full/init_runtime/src/init_logging.cpp @@ -12,8 +12,8 @@ #include #if defined(HPX_HAVE_DISTRIBUTED_RUNTIME) +#include #include -#include #endif #include diff --git a/libs/full/init_runtime/src/pre_main.cpp b/libs/full/init_runtime/src/pre_main.cpp index e6ccdce8563f..9765cdb88758 100644 --- a/libs/full/init_runtime/src/pre_main.cpp +++ b/libs/full/init_runtime/src/pre_main.cpp @@ -19,12 +19,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include diff --git a/libs/full/lcos_distributed/CMakeLists.txt b/libs/full/lcos_distributed/CMakeLists.txt index afacfffbd6ca..85625afaaa78 100644 --- a/libs/full/lcos_distributed/CMakeLists.txt +++ b/libs/full/lcos_distributed/CMakeLists.txt @@ -32,6 +32,6 @@ add_hpx_module( COMPAT_HEADERS ${lcos_distributed_compat_headers} DEPENDENCIES hpx_core MODULE_DEPENDENCIES hpx_actions_base hpx_actions hpx_async_distributed - hpx_components_base hpx_naming + hpx_components_base hpx_naming hpx_runtime_components CMAKE_SUBDIRS examples tests ) 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 6ddbb476237b..9c583d858ffa 100644 --- a/libs/full/lcos_distributed/include/hpx/lcos_distributed/channel.hpp +++ b/libs/full/lcos_distributed/include/hpx/lcos_distributed/channel.hpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include diff --git a/libs/full/performance_counters/src/server/arithmetics_counter.cpp b/libs/full/performance_counters/src/server/arithmetics_counter.cpp index 1ffd1b371208..12f77d52b2e7 100644 --- a/libs/full/performance_counters/src/server/arithmetics_counter.cpp +++ b/libs/full/performance_counters/src/server/arithmetics_counter.cpp @@ -9,13 +9,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/libs/full/performance_counters/src/server/arithmetics_counter_extended.cpp b/libs/full/performance_counters/src/server/arithmetics_counter_extended.cpp index 077c6b467970..7683615ec7aa 100644 --- a/libs/full/performance_counters/src/server/arithmetics_counter_extended.cpp +++ b/libs/full/performance_counters/src/server/arithmetics_counter_extended.cpp @@ -7,13 +7,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/libs/full/performance_counters/src/server/elapsed_time_counter.cpp b/libs/full/performance_counters/src/server/elapsed_time_counter.cpp index 51deeda08da5..0515c7e04e1b 100644 --- a/libs/full/performance_counters/src/server/elapsed_time_counter.cpp +++ b/libs/full/performance_counters/src/server/elapsed_time_counter.cpp @@ -7,11 +7,11 @@ #include #include #include +#include #include #include #include #include -#include #include diff --git a/libs/full/performance_counters/src/server/raw_counter.cpp b/libs/full/performance_counters/src/server/raw_counter.cpp index a1374fc866c5..4f43f9773a10 100644 --- a/libs/full/performance_counters/src/server/raw_counter.cpp +++ b/libs/full/performance_counters/src/server/raw_counter.cpp @@ -8,10 +8,10 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/libs/full/performance_counters/src/server/raw_values_counter.cpp b/libs/full/performance_counters/src/server/raw_values_counter.cpp index b869f60d328d..c3d1c623a4fa 100644 --- a/libs/full/performance_counters/src/server/raw_values_counter.cpp +++ b/libs/full/performance_counters/src/server/raw_values_counter.cpp @@ -8,10 +8,10 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/libs/full/performance_counters/src/server/statistics_counter.cpp b/libs/full/performance_counters/src/server/statistics_counter.cpp index 8b18c613cd7f..ccf81deaaff1 100644 --- a/libs/full/performance_counters/src/server/statistics_counter.cpp +++ b/libs/full/performance_counters/src/server/statistics_counter.cpp @@ -10,13 +10,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/libs/full/runtime_components/CMakeLists.txt b/libs/full/runtime_components/CMakeLists.txt index 36d6093bb34e..db8cdca3b1b0 100644 --- a/libs/full/runtime_components/CMakeLists.txt +++ b/libs/full/runtime_components/CMakeLists.txt @@ -19,12 +19,15 @@ set(runtime_components_headers hpx/runtime_components/create_component_helpers.hpp hpx/runtime_components/derived_component_factory.hpp hpx/runtime_components/distributed_metadata_base.hpp + hpx/runtime_components/macros.hpp hpx/runtime_components/new.hpp hpx/runtime_components/server/console_error_sink.hpp hpx/runtime_components/server/console_error_sink_singleton.hpp hpx/runtime_components/server/console_logging.hpp ) +set(runtime_components_macro_headers hpx/runtime_components/macros.hpp) + # cmake-format: off set(runtime_components_compat_headers hpx/runtime/components_fwd.hpp => hpx/modules/runtime_components.hpp @@ -56,7 +59,9 @@ include(HPX_AddModule) add_hpx_module( full runtime_components GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_MODULE_GEN ON HEADERS ${runtime_components_headers} + MACRO_HEADERS ${runtime_components_macro_headers} SOURCES ${runtime_components_sources} COMPAT_HEADERS ${runtime_components_compat_headers} DEPENDENCIES hpx_core diff --git a/libs/full/runtime_components/include/hpx/runtime_components/component_factory.hpp b/libs/full/runtime_components/include/hpx/runtime_components/component_factory.hpp index 6ce3fc43048b..18014cdfd1dc 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/component_factory.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/component_factory.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2024 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -41,123 +41,9 @@ #else #include -#include #include -#include - -#if !defined(HPX_COMPUTE_DEVICE_CODE) - -/////////////////////////////////////////////////////////////////////////////// -// This macro is used create and to register a minimal component factory with -// Hpx.Plugin. -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY(...) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_(__VA_ARGS__) \ - /**/ - -#define HPX_REGISTER_COMPONENT(...) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_(__VA_ARGS__) \ - /**/ - -#define HPX_REGISTER_ENABLED_COMPONENT_FACTORY(ComponentType, componentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_3(ComponentType, componentname, \ - ::hpx::components::factory_state::enabled) \ - HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ - /**/ -#define HPX_REGISTER_DISABLED_COMPONENT_FACTORY(ComponentType, componentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_3(ComponentType, componentname, \ - ::hpx::components::factory_state::disabled) \ - HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ -/**/ - -/////////////////////////////////////////////////////////////////////////////// -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_(...) \ - HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_, \ - HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ -/**/ -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_1(ComponentType) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_3( \ - ComponentType, ComponentType, ::hpx::components::factory_state::check) \ - HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ -/**/ -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_2(ComponentType, componentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_3( \ - ComponentType, componentname, ::hpx::components::factory_state::check) \ - HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ -/**/ -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_3( \ - ComponentType, componentname, state) \ - HPX_REGISTER_COMPONENT_HEAP(ComponentType) \ - HPX_REGISTER_COMPONENT_FACTORY(componentname) \ - HPX_DEFINE_COMPONENT_NAME(ComponentType::type_holder, componentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_3( \ - ComponentType, componentname, state) \ -/**/ - -/////////////////////////////////////////////////////////////////////////////// -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC(...) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_(__VA_ARGS__) \ -/**/ - -// same as above, just a better name - -/// This macro is used create and to register a minimal component factory for -/// a component type which allows it to be remotely created using the -/// hpx::new_<> function. -/// This macro can be invoked with one, two or three arguments -#define HPX_REGISTER_COMPONENT_DYNAMIC(...) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_(__VA_ARGS__) \ - /**/ - -#define HPX_REGISTER_ENABLED_COMPONENT_FACTORY_DYNAMIC( \ - ComponentType, componentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_3(ComponentType, \ - componentname, ::hpx::components::factory_state::enabled) \ - HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ - /**/ - -#define HPX_REGISTER_DISABLED_COMPONENT_FACTORY_DYNAMIC( \ - ComponentType, componentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_3(ComponentType, \ - componentname, ::hpx::components::factory_state::disabled) \ - HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ - /**/ - -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_(...) \ - HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_, \ - HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ -/**/ -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_1(ComponentType) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_3( \ - ComponentType, ComponentType, ::hpx::components::factory_state::check) \ - HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ -/**/ -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_2( \ - ComponentType, componentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_3( \ - ComponentType, componentname, ::hpx::components::factory_state::check) \ - HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ -/**/ -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_3( \ - ComponentType, componentname, state) \ - HPX_REGISTER_COMPONENT_HEAP(ComponentType) \ - HPX_DEFINE_COMPONENT_NAME(ComponentType::type_holder, componentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_3( \ - ComponentType, componentname, state) \ - /**/ - -#else // COMPUTE DEVICE CODE - -#define HPX_REGISTER_COMPONENT(...) -#define HPX_REGISTER_ENABLED_COMPONENT_FACTORY(ComponentType, componentname) -#define HPX_REGISTER_DISABLED_COMPONENT_FACTORY(ComponentType, componentname) -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY(...) -#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC(...) -#define HPX_REGISTER_COMPONENT_DYNAMIC(...) -#define HPX_REGISTER_ENABLED_COMPONENT_FACTORY_DYNAMIC( \ - ComponentType, componentname) -#define HPX_REGISTER_DISABLED_COMPONENT_FACTORY_DYNAMIC( \ - ComponentType, componentname) +#include +#include #endif -#endif diff --git a/libs/full/runtime_components/include/hpx/runtime_components/component_registry.hpp b/libs/full/runtime_components/include/hpx/runtime_components/component_registry.hpp index 311f35f3151a..6900010c8116 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/component_registry.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/component_registry.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2024 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2017 Thomas Heller // Copyright (c) 2011 Bryce Lelbach // @@ -11,9 +11,10 @@ #include #include #include -#include #include +#include + #include #include @@ -38,7 +39,7 @@ namespace hpx::components { /// /// \tparam Component The component type this registry should be /// responsible for. - template + HPX_CXX_EXPORT template struct component_registry : component_registry_base { /// \brief Return the ini-information for all contained components @@ -90,54 +91,3 @@ namespace hpx::components { } }; } // namespace hpx::components - -/////////////////////////////////////////////////////////////////////////////// -/// This macro is used create and to register a minimal component registry with -/// Hpx.Plugin. - -#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY(...) \ - HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_(__VA_ARGS__) \ - /**/ - -#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_(...) \ - HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_, \ - HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ - /**/ - -#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_2( \ - ComponentType, componentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_3( \ - ComponentType, componentname, ::hpx::components::factory_state::check) \ -/**/ -#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_3( \ - ComponentType, componentname, state) \ - using componentname##_component_registry_type = \ - hpx::components::component_registry; \ - HPX_REGISTER_COMPONENT_REGISTRY( \ - componentname##_component_registry_type, componentname) \ - template struct hpx::components::component_registry; \ -/**/ - -/////////////////////////////////////////////////////////////////////////////// -#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC(...) \ - HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_(__VA_ARGS__) \ - /**/ - -#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_(...) \ - HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_, \ - HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ - /**/ - -#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_2( \ - ComponentType, componentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_3( \ - ComponentType, componentname, ::hpx::components::factory_state::check) \ -/**/ -#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_3( \ - ComponentType, componentname, state) \ - using componentname##_component_registry_type = \ - hpx::components::component_registry; \ - HPX_REGISTER_COMPONENT_REGISTRY_DYNAMIC( \ - componentname##_component_registry_type, componentname) \ - template struct hpx::components::component_registry; \ -/**/ diff --git a/libs/full/runtime_components/include/hpx/runtime_components/components_fwd.hpp b/libs/full/runtime_components/include/hpx/runtime_components/components_fwd.hpp index cd21d8460fd1..55674f203de0 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/components_fwd.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/components_fwd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2014 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -8,11 +8,6 @@ #pragma once #include -#include -#include - -#include -#include namespace hpx { @@ -20,22 +15,23 @@ namespace hpx { namespace components { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct component_factory; - class runtime_support; + HPX_CXX_EXPORT class runtime_support; namespace stubs { - struct runtime_support; + HPX_CXX_EXPORT struct runtime_support; } // namespace stubs namespace server { - class HPX_EXPORT runtime_support; + HPX_CXX_EXPORT class HPX_EXPORT runtime_support; } // namespace server } // namespace components - HPX_EXPORT components::server::runtime_support* get_runtime_support_ptr(); + HPX_CXX_EXPORT HPX_EXPORT components::server::runtime_support* + get_runtime_support_ptr(); } // namespace hpx diff --git a/libs/full/runtime_components/include/hpx/runtime_components/console_error_sink.hpp b/libs/full/runtime_components/include/hpx/runtime_components/console_error_sink.hpp index eac8fee36613..1cf8aabd5629 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/console_error_sink.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/console_error_sink.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -14,12 +14,13 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { +namespace hpx::components { // Stub function which applies the console_error_sink action. - HPX_EXPORT void console_error_sink( + HPX_CXX_EXPORT HPX_EXPORT void console_error_sink( hpx::id_type const& dst, std::exception_ptr const& e); // Stub function which applies the console_error_sink action. - HPX_EXPORT void console_error_sink(std::exception_ptr const& e); -}} // namespace hpx::components + HPX_CXX_EXPORT HPX_EXPORT void console_error_sink( + std::exception_ptr const& e); +} // namespace hpx::components diff --git a/libs/full/runtime_components/include/hpx/runtime_components/console_logging.hpp b/libs/full/runtime_components/include/hpx/runtime_components/console_logging.hpp index 0ddc05be17f1..821f8da8bbc6 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/console_logging.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/console_logging.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -14,10 +14,10 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { +namespace hpx::components { - HPX_EXPORT void console_logging( + HPX_CXX_EXPORT HPX_EXPORT void console_logging( logging_destination dest, std::size_t level, std::string const& msg); - HPX_EXPORT void cleanup_logging(); - HPX_EXPORT void activate_logging(); -}} // namespace hpx::components + HPX_CXX_EXPORT HPX_EXPORT void cleanup_logging(); + HPX_CXX_EXPORT HPX_EXPORT void activate_logging(); +} // namespace hpx::components diff --git a/libs/full/runtime_components/include/hpx/runtime_components/create_component_helpers.hpp b/libs/full/runtime_components/include/hpx/runtime_components/create_component_helpers.hpp index 6f66d7371392..958dfbe6d067 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/create_component_helpers.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/create_component_helpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Hartmut Kaiser +// Copyright (c) 2020-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -33,10 +33,10 @@ namespace hpx::components { /////////////////////////////////////////////////////////////////////////// /// Asynchronously create a new instance of a component - template - future create_async(hpx::id_type const& gid, Ts&&... vs) + HPX_CXX_EXPORT template + future create_async(hpx::id_type const& id, Ts&&... vs) { - if (!naming::is_locality(gid)) + if (!naming::is_locality(id)) { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "stubs::runtime_support::create_component_async", @@ -47,14 +47,14 @@ namespace hpx::components { using action_type = server::create_component_action...>; - return hpx::async(gid, HPX_FORWARD(Ts, vs)...); + return hpx::async(id, HPX_FORWARD(Ts, vs)...); } - template + HPX_CXX_EXPORT template future> bulk_create_async( - hpx::id_type const& gid, std::size_t count, Ts&&... vs) + hpx::id_type const& id, std::size_t count, Ts&&... vs) { - if (!naming::is_locality(gid)) + if (!naming::is_locality(id)) { HPX_THROW_EXCEPTION(hpx::error::bad_parameter, "stubs::runtime_support::bulk_create_component_async", @@ -65,53 +65,53 @@ namespace hpx::components { using action_type = server::bulk_create_component_action...>; - return hpx::async(gid, count, HPX_FORWARD(Ts, vs)...); + return hpx::async(id, count, HPX_FORWARD(Ts, vs)...); } - template - hpx::id_type create(hpx::id_type const& gid, Ts&&... vs) + HPX_CXX_EXPORT template + hpx::id_type create(hpx::id_type const& id, Ts&&... vs) { - return create_async(gid, HPX_FORWARD(Ts, vs)...).get(); + return create_async(id, HPX_FORWARD(Ts, vs)...).get(); } - template + HPX_CXX_EXPORT template std::vector bulk_create( - hpx::id_type const& gid, std::size_t count, Ts&&... vs) + hpx::id_type const& id, std::size_t count, Ts&&... vs) { return bulk_create_async( - gid, count, HPX_FORWARD(Ts, vs)...) + id, count, HPX_FORWARD(Ts, vs)...) .get(); } - template + HPX_CXX_EXPORT template future create_colocated_async( - hpx::id_type const& gid, Ts&&... vs) + hpx::id_type const& id, Ts&&... vs) { using action_type = server::create_component_action...>; return hpx::detail::async_colocated( - gid, HPX_FORWARD(Ts, vs)...); + id, HPX_FORWARD(Ts, vs)...); } - template - static hpx::id_type create_colocated(hpx::id_type const& gid, Ts&&... vs) + HPX_CXX_EXPORT template + hpx::id_type create_colocated(hpx::id_type const& id, Ts&&... vs) { - return create_colocated_async(gid, HPX_FORWARD(Ts, vs)...).get(); + return create_colocated_async(id, HPX_FORWARD(Ts, vs)...).get(); } - template - static future> bulk_create_colocated_async( - hpx::id_type const& gid, std::size_t count, Ts&&... vs) + HPX_CXX_EXPORT template + future> bulk_create_colocated_async( + hpx::id_type const& id, std::size_t count, Ts&&... vs) { using action_type = server::bulk_create_component_action...>; return hpx::detail::async_colocated( - gid, count, HPX_FORWARD(Ts, vs)...); + id, count, HPX_FORWARD(Ts, vs)...); } - template + HPX_CXX_EXPORT template std::vector bulk_create_colocated( hpx::id_type const& id, std::size_t count, Ts&&... vs) { diff --git a/libs/full/runtime_components/include/hpx/runtime_components/derived_component_factory.hpp b/libs/full/runtime_components/include/hpx/runtime_components/derived_component_factory.hpp index 541629df5774..b90dab11fd15 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/derived_component_factory.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/derived_component_factory.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2024 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2017 Thomas Heller // Copyright (c) 2011 Bryce Lelbach // @@ -10,82 +10,5 @@ #include -#if !defined(HPX_COMPUTE_DEVICE_CODE) -#include #include - -/////////////////////////////////////////////////////////////////////////////// -/// This macro is used create and to register a minimal component factory with -/// Hpx.Plugin. This macro may be used if the registered component factory is -/// the only factory to be exposed from a particular module. If more than one -/// factory needs to be exposed the \a HPX_REGISTER_COMPONENT_FACTORY and -/// \a HPX_REGISTER_COMPONENT_MODULE macros should be used instead. -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY(...) \ - HPX_REGISTER_DERIVED_COMPONENT_FACTORY_(__VA_ARGS__) \ - /**/ - -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_(...) \ - HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_DERIVED_COMPONENT_FACTORY_, \ - HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ - /**/ - -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_3( \ - ComponentType, componentname, basecomponentname) \ - HPX_REGISTER_DERIVED_COMPONENT_FACTORY_4(ComponentType, componentname, \ - basecomponentname, ::hpx::components::factory_state::check) \ - HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ - /**/ - -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_4( \ - ComponentType, componentname, basecomponentname, state) \ - HPX_REGISTER_COMPONENT_HEAP(ComponentType) \ - HPX_REGISTER_COMPONENT_FACTORY(componentname) \ - HPX_DEFINE_COMPONENT_NAME( \ - ComponentType::type_holder, componentname, basecomponentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_3( \ - ComponentType, componentname, state) \ - /**/ - -/////////////////////////////////////////////////////////////////////////////// -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC(...) \ - HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_(__VA_ARGS__) \ - /**/ - -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_(...) \ - HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_, \ - HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ - /**/ - -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_3( \ - ComponentType, componentname, basecomponentname) \ - HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_4(ComponentType, \ - componentname, basecomponentname, \ - ::hpx::components::factory_state::check) \ - HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ - /**/ - -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_4( \ - ComponentType, componentname, basecomponentname, state) \ - HPX_REGISTER_COMPONENT_HEAP(ComponentType) \ - HPX_DEFINE_COMPONENT_NAME( \ - ComponentType::type_holder, componentname, basecomponentname) \ - HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_3( \ - ComponentType, componentname, state) \ - /**/ - -#else // COMPUTE DEVICE CODE - -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY(...) -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_(...) -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_3( \ - ComponentType, componentname, basecomponentname) -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_4( \ - ComponentType, componentname, basecomponentname, state) -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC(...) -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_(...) -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_3( \ - ComponentType, componentname, basecomponentname) -#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_4( \ - ComponentType, componentname, basecomponentname, state) - -#endif +#include diff --git a/libs/full/runtime_components/include/hpx/runtime_components/distributed_metadata_base.hpp b/libs/full/runtime_components/include/hpx/runtime_components/distributed_metadata_base.hpp index e8ebc313da8c..ae41c5af3ced 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/distributed_metadata_base.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/distributed_metadata_base.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2024 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -12,14 +12,15 @@ #include #include #include -#include + +#include #include namespace hpx::components::server { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template class distributed_metadata_base : public hpx::components::component_base< std::conditional_t, @@ -36,7 +37,7 @@ namespace hpx::components::server { { } - /// Retrieve the configuration data. + // Retrieve the configuration data. ConfigData get() const { return data_; @@ -48,48 +49,3 @@ namespace hpx::components::server { ConfigData data_; }; } // namespace hpx::components::server - -#define HPX_DISTRIBUTED_METADATA_DECLARATION(...) \ - HPX_DISTRIBUTED_METADATA_DECLARATION_(__VA_ARGS__) \ - /**/ -#define HPX_DISTRIBUTED_METADATA_DECLARATION_(...) \ - HPX_PP_EXPAND(HPX_PP_CAT(HPX_DISTRIBUTED_METADATA_DECLARATION_, \ - HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ - /**/ - -#define HPX_DISTRIBUTED_METADATA_DECLARATION_1(config) \ - HPX_DISTRIBUTED_METADATA_DECLARATION_2(config, config) \ - /**/ -#define HPX_DISTRIBUTED_METADATA_DECLARATION_2(config, name) \ - HPX_REGISTER_ACTION_DECLARATION( \ - ::hpx::components::server::distributed_metadata_base< \ - config>::get_action, \ - HPX_PP_CAT(__distributed_metadata_get_action_, name)) \ - HPX_REGISTER_ACTION_DECLARATION( \ - ::hpx::lcos::base_lco_with_value::set_value_action, \ - HPX_PP_CAT(__set_value_distributed_metadata_config_data_, name)) \ - /**/ - -#define HPX_DISTRIBUTED_METADATA(...) \ - HPX_DISTRIBUTED_METADATA_(__VA_ARGS__) \ - /**/ -#define HPX_DISTRIBUTED_METADATA_(...) \ - HPX_PP_EXPAND(HPX_PP_CAT( \ - HPX_DISTRIBUTED_METADATA_, HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ - /**/ - -#define HPX_DISTRIBUTED_METADATA_1(config) \ - HPX_DISTRIBUTED_METADATA_2(config, config) \ - /**/ -#define HPX_DISTRIBUTED_METADATA_2(config, name) \ - HPX_REGISTER_ACTION(::hpx::components::server::distributed_metadata_base< \ - config>::get_action, \ - HPX_PP_CAT(__distributed_metadata_get_action_, name)) \ - HPX_REGISTER_ACTION( \ - ::hpx::lcos::base_lco_with_value::set_value_action, \ - HPX_PP_CAT(__set_value_distributed_metadata_config_data_, name)) \ - typedef ::hpx::components::component< \ - ::hpx::components::server::distributed_metadata_base> \ - HPX_PP_CAT(__distributed_metadata_, name); \ - HPX_REGISTER_COMPONENT(HPX_PP_CAT(__distributed_metadata_, name)) \ - /**/ diff --git a/libs/full/runtime_components/include/hpx/runtime_components/macros.hpp b/libs/full/runtime_components/include/hpx/runtime_components/macros.hpp new file mode 100644 index 000000000000..fb677cb36ad5 --- /dev/null +++ b/libs/full/runtime_components/include/hpx/runtime_components/macros.hpp @@ -0,0 +1,310 @@ +// Copyright (c) 2007-2026 Hartmut Kaiser +// Copyright (c) 2011 Bryce 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) + +#pragma once + +#include +#include + +#include + +#if !defined(HPX_COMPUTE_DEVICE_CODE) + +/////////////////////////////////////////////////////////////////////////////// +// from component_factory.hpp + +// This macro is used create and to register a minimal component factory with +// Hpx.Plugin. +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY(...) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_(__VA_ARGS__) \ + /**/ + +#define HPX_REGISTER_COMPONENT(...) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_(__VA_ARGS__) \ + /**/ + +#define HPX_REGISTER_ENABLED_COMPONENT_FACTORY(ComponentType, componentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_3(ComponentType, componentname, \ + ::hpx::components::factory_state::enabled) \ + HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ + /**/ + +#define HPX_REGISTER_DISABLED_COMPONENT_FACTORY(ComponentType, componentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_3(ComponentType, componentname, \ + ::hpx::components::factory_state::disabled) \ + HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ +/**/ + +/////////////////////////////////////////////////////////////////////////////// +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_(...) \ + HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_, \ + HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ +/**/ +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_1(ComponentType) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_3( \ + ComponentType, ComponentType, ::hpx::components::factory_state::check) \ + HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ +/**/ +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_2(ComponentType, componentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_3( \ + ComponentType, componentname, ::hpx::components::factory_state::check) \ + HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ +/**/ +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_3( \ + ComponentType, componentname, state) \ + HPX_REGISTER_COMPONENT_HEAP(ComponentType) \ + HPX_REGISTER_COMPONENT_FACTORY(componentname) \ + HPX_DEFINE_COMPONENT_NAME(ComponentType::type_holder, componentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_3( \ + ComponentType, componentname, state) \ +/**/ + +/////////////////////////////////////////////////////////////////////////////// +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC(...) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_(__VA_ARGS__) \ +/**/ + +// same as above, just a better name + +/// This macro is used create and to register a minimal component factory for +/// a component type which allows it to be remotely created using the +/// hpx::new_<> function. +/// This macro can be invoked with one, two or three arguments +#define HPX_REGISTER_COMPONENT_DYNAMIC(...) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_(__VA_ARGS__) \ + /**/ + +#define HPX_REGISTER_ENABLED_COMPONENT_FACTORY_DYNAMIC( \ + ComponentType, componentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_3(ComponentType, \ + componentname, ::hpx::components::factory_state::enabled) \ + HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ + /**/ + +#define HPX_REGISTER_DISABLED_COMPONENT_FACTORY_DYNAMIC( \ + ComponentType, componentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_3(ComponentType, \ + componentname, ::hpx::components::factory_state::disabled) \ + HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ + /**/ + +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_(...) \ + HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_, \ + HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ +/**/ +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_1(ComponentType) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_3( \ + ComponentType, ComponentType, ::hpx::components::factory_state::check) \ + HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ +/**/ +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_2( \ + ComponentType, componentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_3( \ + ComponentType, componentname, ::hpx::components::factory_state::check) \ + HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ +/**/ +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC_3( \ + ComponentType, componentname, state) \ + HPX_REGISTER_COMPONENT_HEAP(ComponentType) \ + HPX_DEFINE_COMPONENT_NAME(ComponentType::type_holder, componentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_3( \ + ComponentType, componentname, state) \ + /**/ + +#else // COMPUTE DEVICE CODE + +#define HPX_REGISTER_COMPONENT(...) +#define HPX_REGISTER_ENABLED_COMPONENT_FACTORY(ComponentType, componentname) +#define HPX_REGISTER_DISABLED_COMPONENT_FACTORY(ComponentType, componentname) +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY(...) +#define HPX_REGISTER_MINIMAL_COMPONENT_FACTORY_DYNAMIC(...) +#define HPX_REGISTER_COMPONENT_DYNAMIC(...) +#define HPX_REGISTER_ENABLED_COMPONENT_FACTORY_DYNAMIC( \ + ComponentType, componentname) +#define HPX_REGISTER_DISABLED_COMPONENT_FACTORY_DYNAMIC( \ + ComponentType, componentname) + +#endif + +/////////////////////////////////////////////////////////////////////////////// +// from component_registry.hpp + +/// This macro is used create and to register a minimal component registry with +/// Hpx.Plugin. + +#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY(...) \ + HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_(__VA_ARGS__) \ + /**/ + +#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_(...) \ + HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_, \ + HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ + /**/ + +#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_2( \ + ComponentType, componentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_3( \ + ComponentType, componentname, ::hpx::components::factory_state::check) \ +/**/ +#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_3( \ + ComponentType, componentname, state) \ + using componentname##_component_registry_type = \ + hpx::components::component_registry; \ + HPX_REGISTER_COMPONENT_REGISTRY( \ + componentname##_component_registry_type, componentname) \ + template struct hpx::components::component_registry; \ +/**/ + +/////////////////////////////////////////////////////////////////////////////// +#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC(...) \ + HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_(__VA_ARGS__) \ + /**/ + +#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_(...) \ + HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_, \ + HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ + /**/ + +#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_2( \ + ComponentType, componentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_3( \ + ComponentType, componentname, ::hpx::components::factory_state::check) \ +/**/ +#define HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_3( \ + ComponentType, componentname, state) \ + using componentname##_component_registry_type = \ + hpx::components::component_registry; \ + HPX_REGISTER_COMPONENT_REGISTRY_DYNAMIC( \ + componentname##_component_registry_type, componentname) \ + template struct hpx::components::component_registry; \ + /**/ + +#if !defined(HPX_COMPUTE_DEVICE_CODE) +/////////////////////////////////////////////////////////////////////////////// +// from derived_component_factory.hpp + +/// This macro is used create and to register a minimal component factory with +/// Hpx.Plugin. This macro may be used if the registered component factory is +/// the only factory to be exposed from a particular module. If more than one +/// factory needs to be exposed the \a HPX_REGISTER_COMPONENT_FACTORY and +/// \a HPX_REGISTER_COMPONENT_MODULE macros should be used instead. +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY(...) \ + HPX_REGISTER_DERIVED_COMPONENT_FACTORY_(__VA_ARGS__) \ + /**/ + +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_(...) \ + HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_DERIVED_COMPONENT_FACTORY_, \ + HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ + /**/ + +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_3( \ + ComponentType, componentname, basecomponentname) \ + HPX_REGISTER_DERIVED_COMPONENT_FACTORY_4(ComponentType, componentname, \ + basecomponentname, ::hpx::components::factory_state::check) \ + HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ + /**/ + +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_4( \ + ComponentType, componentname, basecomponentname, state) \ + HPX_REGISTER_COMPONENT_HEAP(ComponentType) \ + HPX_REGISTER_COMPONENT_FACTORY(componentname) \ + HPX_DEFINE_COMPONENT_NAME( \ + ComponentType::type_holder, componentname, basecomponentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_3( \ + ComponentType, componentname, state) \ + /**/ + +/////////////////////////////////////////////////////////////////////////////// +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC(...) \ + HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_(__VA_ARGS__) \ + /**/ + +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_(...) \ + HPX_PP_EXPAND(HPX_PP_CAT(HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_, \ + HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ + /**/ + +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_3( \ + ComponentType, componentname, basecomponentname) \ + HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_4(ComponentType, \ + componentname, basecomponentname, \ + ::hpx::components::factory_state::check) \ + HPX_DEFINE_GET_COMPONENT_TYPE(ComponentType::wrapped_type) \ + /**/ + +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_4( \ + ComponentType, componentname, basecomponentname, state) \ + HPX_REGISTER_COMPONENT_HEAP(ComponentType) \ + HPX_DEFINE_COMPONENT_NAME( \ + ComponentType::type_holder, componentname, basecomponentname) \ + HPX_REGISTER_MINIMAL_COMPONENT_REGISTRY_DYNAMIC_3( \ + ComponentType, componentname, state) \ + /**/ + +#else // COMPUTE DEVICE CODE + +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY(...) +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_(...) +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_3( \ + ComponentType, componentname, basecomponentname) +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_4( \ + ComponentType, componentname, basecomponentname, state) +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC(...) +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_(...) +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_3( \ + ComponentType, componentname, basecomponentname) +#define HPX_REGISTER_DERIVED_COMPONENT_FACTORY_DYNAMIC_4( \ + ComponentType, componentname, basecomponentname, state) + +#endif + +//////////////////////////////////////////////////////////////////////////////// +// from distributed_metadata_base.hpp +#define HPX_DISTRIBUTED_METADATA_DECLARATION(...) \ + HPX_DISTRIBUTED_METADATA_DECLARATION_(__VA_ARGS__) \ + /**/ +#define HPX_DISTRIBUTED_METADATA_DECLARATION_(...) \ + HPX_PP_EXPAND(HPX_PP_CAT(HPX_DISTRIBUTED_METADATA_DECLARATION_, \ + HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ + /**/ + +#define HPX_DISTRIBUTED_METADATA_DECLARATION_1(config) \ + HPX_DISTRIBUTED_METADATA_DECLARATION_2(config, config) \ + /**/ +#define HPX_DISTRIBUTED_METADATA_DECLARATION_2(config, name) \ + HPX_REGISTER_ACTION_DECLARATION( \ + ::hpx::components::server::distributed_metadata_base< \ + config>::get_action, \ + HPX_PP_CAT(__distributed_metadata_get_action_, name)) \ + HPX_REGISTER_ACTION_DECLARATION( \ + ::hpx::lcos::base_lco_with_value::set_value_action, \ + HPX_PP_CAT(__set_value_distributed_metadata_config_data_, name)) \ + /**/ + +#define HPX_DISTRIBUTED_METADATA(...) \ + HPX_DISTRIBUTED_METADATA_(__VA_ARGS__) \ + /**/ +#define HPX_DISTRIBUTED_METADATA_(...) \ + HPX_PP_EXPAND(HPX_PP_CAT( \ + HPX_DISTRIBUTED_METADATA_, HPX_PP_NARGS(__VA_ARGS__))(__VA_ARGS__)) \ + /**/ + +#define HPX_DISTRIBUTED_METADATA_1(config) \ + HPX_DISTRIBUTED_METADATA_2(config, config) \ + /**/ +#define HPX_DISTRIBUTED_METADATA_2(config, name) \ + HPX_REGISTER_ACTION(::hpx::components::server::distributed_metadata_base< \ + config>::get_action, \ + HPX_PP_CAT(__distributed_metadata_get_action_, name)) \ + HPX_REGISTER_ACTION( \ + ::hpx::lcos::base_lco_with_value::set_value_action, \ + HPX_PP_CAT(__set_value_distributed_metadata_config_data_, name)) \ + typedef ::hpx::components::component< \ + ::hpx::components::server::distributed_metadata_base> \ + HPX_PP_CAT(__distributed_metadata_, name); \ + HPX_REGISTER_COMPONENT(HPX_PP_CAT(__distributed_metadata_, name)) \ + /**/ diff --git a/libs/full/runtime_components/include/hpx/runtime_components/new.hpp b/libs/full/runtime_components/include/hpx/runtime_components/new.hpp index 8d6838295da6..8df1c9e2bc42 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/new.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/new.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -18,6 +18,7 @@ #include #include #include + #include #include @@ -319,7 +320,7 @@ namespace hpx::components { template static type call(Ts&&... ts) { - using component_type = typename Component::wrapping_type; + using component_type = Component::wrapping_type; hpx::id_type id(components::server::create( HPX_FORWARD(Ts, ts)...), @@ -336,7 +337,7 @@ namespace hpx::components { template static type call(std::size_t count, Ts&&... ts) { - using component_type = typename Component::wrapping_type; + using component_type = Component::wrapping_type; std::vector result; result.reserve(count); @@ -352,6 +353,7 @@ namespace hpx::components { } }; + /////////////////////////////////////////////////////////////////////// // same as above, just fully synchronous template struct local_new_component_sync @@ -361,7 +363,7 @@ namespace hpx::components { template static type call(Ts&&... ts) { - using component_type = typename Component::wrapping_type; + using component_type = Component::wrapping_type; hpx::id_type id(components::server::create( HPX_FORWARD(Ts, ts)...), @@ -379,7 +381,7 @@ namespace hpx::components { template static type call(std::size_t count, Ts&&... ts) { - using component_type = typename Component::wrapping_type; + using component_type = Component::wrapping_type; std::vector result; result.reserve(count); @@ -397,11 +399,9 @@ namespace hpx::components { } // namespace detail /////////////////////////////////////////////////////////////////////////// - template - inline typename util::lazy_enable_if< - traits::is_component_or_component_array::value, - detail::new_component>::type - new_(id_type const& locality, Ts&&... vs) + HPX_CXX_EXPORT template + requires(traits::is_component_or_component_array_v) + decltype(auto) new_(id_type const& locality, Ts&&... vs) { if (naming::get_locality_id_from_id(locality) == agas::get_locality_id()) @@ -414,12 +414,11 @@ namespace hpx::components { locality, HPX_FORWARD(Ts, vs)...); } - template - inline typename util::lazy_enable_if< - traits::is_component_or_component_array::value && - traits::is_distribution_policy::value, - detail::new_component>::type - new_(DistPolicy const& policy, Ts&&... vs) + HPX_CXX_EXPORT template + requires(traits::is_component_or_component_array_v && + traits::is_distribution_policy_v) + decltype(auto) new_(DistPolicy const& policy, Ts&&... vs) { return detail::new_component::call( policy, HPX_FORWARD(Ts, vs)...); @@ -433,7 +432,7 @@ namespace hpx::components { struct new_client { using type = Client; - using component_type = typename Client::server_component_type; + using component_type = Client::server_component_type; template static type call(hpx::id_type const& locality, Ts&&... vs) @@ -457,7 +456,7 @@ namespace hpx::components { struct new_client { using type = hpx::future>; - using component_type = typename Client::server_component_type; + using component_type = Client::server_component_type; template static type call(Ts&&... vs) @@ -477,8 +476,7 @@ namespace hpx::components { struct local_new_client { using type = Client; - using component_type = - typename Client::server_component_type::wrapping_type; + using component_type = Client::server_component_type::wrapping_type; template static type call(Ts&&... ts) @@ -494,8 +492,7 @@ namespace hpx::components { struct local_new_client { using type = hpx::future>; - using component_type = - typename Client::server_component_type::wrapping_type; + using component_type = Client::server_component_type::wrapping_type; template static type call(Ts&&... ts) @@ -512,10 +509,9 @@ namespace hpx::components { } // namespace detail /////////////////////////////////////////////////////////////////////////// - template - typename util::lazy_enable_if, - detail::new_client>::type - new_(id_type const& locality, Ts&&... vs) + HPX_CXX_EXPORT template + requires(traits::is_client_or_client_array_v) + decltype(auto) new_(id_type const& locality, Ts&&... vs) { if (naming::get_locality_id_from_id(locality) == agas::get_locality_id()) @@ -528,11 +524,11 @@ namespace hpx::components { locality, HPX_FORWARD(Ts, vs)...); } - template - typename util::lazy_enable_if && - traits::is_distribution_policy_v, - detail::new_client>::type - new_(DistPolicy const& policy, Ts&&... vs) + HPX_CXX_EXPORT template + requires(traits::is_client_or_client_array_v && + traits::is_distribution_policy_v) + decltype(auto) new_(DistPolicy const& policy, Ts&&... vs) { return detail::new_client::call(policy, HPX_FORWARD(Ts, vs)...); } @@ -541,41 +537,34 @@ namespace hpx::components { // Same as above, but just on this locality. This does not go through an // action, that means that the constructor arguments can be non-copyable and // non-movable. - template - typename util::lazy_enable_if< - traits::is_component_or_component_array_v, - detail::local_new_component>::type - local_new() + HPX_CXX_EXPORT template + requires(traits::is_component_or_component_array_v) + decltype(auto) local_new() { return detail::local_new_component::call(); } - template - typename util::lazy_enable_if< - traits::is_component_or_component_array_v && - !std::is_same_v, launch::sync_policy>, - detail::local_new_component>::type - local_new(T1&& t1, Ts&&... ts) + HPX_CXX_EXPORT template + requires(traits::is_component_or_component_array_v && + !std::is_same_v, launch::sync_policy>) + decltype(auto) local_new(T1&& t1, Ts&&... ts) { return detail::local_new_component::call( HPX_FORWARD(T1, t1), HPX_FORWARD(Ts, ts)...); } - template - typename util::lazy_enable_if< - traits::is_component_or_component_array_v, - detail::local_new_component_sync>::type - local_new(launch::sync_policy, Ts&&... ts) + HPX_CXX_EXPORT template + requires(traits::is_component_or_component_array_v) + decltype(auto) local_new(launch::sync_policy, Ts&&... ts) { return detail::local_new_component_sync::call( HPX_FORWARD(Ts, ts)...); } /////////////////////////////////////////////////////////////////////////// - template - typename util::lazy_enable_if, - detail::local_new_client>::type - local_new(Ts&&... ts) + HPX_CXX_EXPORT template + requires(traits::is_client_or_client_array_v) + decltype(auto) local_new(Ts&&... ts) { return detail::local_new_client::call(HPX_FORWARD(Ts, ts)...); } @@ -583,8 +572,8 @@ namespace hpx::components { namespace hpx { - using hpx::components::local_new; - using hpx::components::new_; + HPX_CXX_EXPORT using hpx::components::local_new; + HPX_CXX_EXPORT using hpx::components::new_; } // namespace hpx #endif diff --git a/libs/full/runtime_components/include/hpx/runtime_components/server/console_error_sink.hpp b/libs/full/runtime_components/include/hpx/runtime_components/server/console_error_sink.hpp index 112eb229c1d5..5cc4337a7a08 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/server/console_error_sink.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/server/console_error_sink.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -16,14 +16,15 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { namespace server { +namespace hpx::components::server { /////////////////////////////////////////////////////////////////////////// // console logging happens here - void console_error_sink(std::exception_ptr const&); + HPX_CXX_EXPORT void console_error_sink(std::exception_ptr const&); - HPX_DEFINE_PLAIN_ACTION(console_error_sink, console_error_sink_action); -}}} // namespace hpx::components::server + HPX_DEFINE_PLAIN_ACTION( + HPX_CXX_EXPORT, console_error_sink, console_error_sink_action); +} // namespace hpx::components::server HPX_ACTION_HAS_CRITICAL_PRIORITY( hpx::components::server::console_error_sink_action) diff --git a/libs/full/runtime_components/include/hpx/runtime_components/server/console_error_sink_singleton.hpp b/libs/full/runtime_components/include/hpx/runtime_components/server/console_error_sink_singleton.hpp index 46f45598572f..99497d1660ae 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/server/console_error_sink_singleton.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/server/console_error_sink_singleton.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -16,22 +16,25 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { namespace server { +namespace hpx::components::server { /////////////////////////////////////////////////////////////////////////// - class console_error_dispatcher + HPX_CXX_EXPORT class console_error_dispatcher { public: - HPX_NON_COPYABLE(console_error_dispatcher); + console_error_dispatcher(console_error_dispatcher const&) = delete; + console_error_dispatcher(console_error_dispatcher&&) = delete; + console_error_dispatcher& operator=( + console_error_dispatcher const&) = delete; + console_error_dispatcher& operator=( + console_error_dispatcher&&) = delete; public: - typedef util::spinlock mutex_type; - typedef hpx::function sink_type; + using mutex_type = util::spinlock; + using sink_type = hpx::function; - console_error_dispatcher() - : mtx_() - { - } + console_error_dispatcher() = default; + ~console_error_dispatcher() = default; template sink_type set_error_sink(F&& sink) @@ -55,5 +58,5 @@ namespace hpx { namespace components { namespace server { }; /////////////////////////////////////////////////////////////////////////// - HPX_EXPORT console_error_dispatcher& get_error_dispatcher(); -}}} // namespace hpx::components::server + HPX_CXX_EXPORT HPX_EXPORT console_error_dispatcher& get_error_dispatcher(); +} // namespace hpx::components::server diff --git a/libs/full/runtime_components/include/hpx/runtime_components/server/console_logging.hpp b/libs/full/runtime_components/include/hpx/runtime_components/server/console_logging.hpp index 35862a8e43a7..0a9694c1d907 100644 --- a/libs/full/runtime_components/include/hpx/runtime_components/server/console_logging.hpp +++ b/libs/full/runtime_components/include/hpx/runtime_components/server/console_logging.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2025 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -15,6 +15,7 @@ #include #include #include + #include #include @@ -25,10 +26,10 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx::components { - using message_type = + HPX_CXX_EXPORT using message_type = hpx::tuple; - using messages_type = std::vector; + HPX_CXX_EXPORT using messages_type = std::vector; } // namespace hpx::components ////////////////////////////////////////////////////////////////////////////// @@ -36,12 +37,12 @@ namespace hpx::components::server { /////////////////////////////////////////////////////////////////////////// // console logging happens here - void console_logging(messages_type const&); + HPX_CXX_EXPORT void console_logging(messages_type const&); /////////////////////////////////////////////////////////////////////////// // this type is a dummy template to avoid premature instantiation of the // serialization support instances - template + HPX_CXX_EXPORT template class console_logging_action : public actions::direct_action> @@ -91,13 +92,16 @@ HPX_REGISTER_ACTION_DECLARATION( #if !defined(HPX_COMPUTE_DEVICE_CODE) && defined(HPX_HAVE_NETWORKING) /////////////////////////////////////////////////////////////////////////// // Logging does not make this locality black -template <> -struct hpx::traits::action_does_termination_detection< - hpx::components::server::console_logging_action<>> -{ - static constexpr bool call() noexcept +namespace hpx::traits { + + template <> + struct action_does_termination_detection< + hpx::components::server::console_logging_action<>> { - return true; - } -}; // namespace hpx::traits + static constexpr bool call() noexcept + { + return true; + } + }; // namespace hpx::traits +} // namespace hpx::traits #endif diff --git a/libs/full/runtime_components/src/component_registry.cpp b/libs/full/runtime_components/src/component_registry.cpp index 21dedcc51291..1cfc8b52648a 100644 --- a/libs/full/runtime_components/src/component_registry.cpp +++ b/libs/full/runtime_components/src/component_registry.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2024 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2017 Thomas Heller // Copyright (c) 2011 Bryce Lelbach // @@ -12,6 +12,7 @@ #include #include #include + #include #include diff --git a/libs/full/runtime_components/src/console_error_sink.cpp b/libs/full/runtime_components/src/console_error_sink.cpp index c9f3ac1e55d1..899b3b0a48ea 100644 --- a/libs/full/runtime_components/src/console_error_sink.cpp +++ b/libs/full/runtime_components/src/console_error_sink.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -17,7 +17,7 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { +namespace hpx::components { // Stub function which applies the console_error_sink action. void console_error_sink( @@ -62,4 +62,4 @@ namespace hpx { namespace components { hpx::async(dst, e).get(); } } -}} // namespace hpx::components +} // namespace hpx::components diff --git a/libs/full/runtime_components/src/console_logging.cpp b/libs/full/runtime_components/src/console_logging.cpp index d8ee0d63440f..abf8f7961c52 100644 --- a/libs/full/runtime_components/src/console_logging.cpp +++ b/libs/full/runtime_components/src/console_logging.cpp @@ -33,7 +33,7 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { +namespace hpx::components { void fallback_console_logging_locked( messages_type const& msgs, std::string fail_msg = "") @@ -346,4 +346,4 @@ namespace hpx { namespace components { { detail::logger().activate(); } -}} // namespace hpx::components +} // namespace hpx::components diff --git a/libs/full/runtime_components/src/server/console_error_sink_server.cpp b/libs/full/runtime_components/src/server/console_error_sink_server.cpp index 830352461d99..904965ba9275 100644 --- a/libs/full/runtime_components/src/server/console_error_sink_server.cpp +++ b/libs/full/runtime_components/src/server/console_error_sink_server.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -12,13 +12,14 @@ #include #include #include + #include #include #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace components { namespace server { +namespace hpx::components::server { /////////////////////////////////////////////////////////////////////////// // implementation of this console error sink @@ -27,7 +28,7 @@ namespace hpx { namespace components { namespace server { // dispatch this error to registered functions get_error_dispatcher()(hpx::diagnostic_information(e)); } -}}} // namespace hpx::components::server +} // namespace hpx::components::server /////////////////////////////////////////////////////////////////////////////// // This must be in global namespace diff --git a/libs/full/runtime_components/src/server/console_error_sink_singleton.cpp b/libs/full/runtime_components/src/server/console_error_sink_singleton.cpp index ddb83b66da28..479b46234819 100644 --- a/libs/full/runtime_components/src/server/console_error_sink_singleton.cpp +++ b/libs/full/runtime_components/src/server/console_error_sink_singleton.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2025 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,6 +6,7 @@ #include #include + #include /////////////////////////////////////////////////////////////////////////////// diff --git a/libs/full/runtime_components/src/server/console_logging_server.cpp b/libs/full/runtime_components/src/server/console_logging_server.cpp index c1bf15ff507b..3ac70e9cd28c 100644 --- a/libs/full/runtime_components/src/server/console_logging_server.cpp +++ b/libs/full/runtime_components/src/server/console_logging_server.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 Hartmut Kaiser +// Copyright (c) 2007-2026 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 @@ -13,6 +13,7 @@ #include #include #include + #include #include @@ -23,7 +24,7 @@ /////////////////////////////////////////////////////////////////////////////// // definitions related to console logging -namespace hpx { namespace util { namespace detail { +namespace hpx::util::detail { struct log_lock_tag { @@ -34,7 +35,7 @@ namespace hpx { namespace util { namespace detail { hpx::util::static_ lock; return lock.get(); } -}}} // namespace hpx::util::detail +} // namespace hpx::util::detail /////////////////////////////////////////////////////////////////////////////// // This must be in global namespace diff --git a/libs/full/runtime_distributed/include/hpx/runtime_distributed.hpp b/libs/full/runtime_distributed/include/hpx/runtime_distributed.hpp index 8d444681f9e1..22df84888888 100644 --- a/libs/full/runtime_distributed/include/hpx/runtime_distributed.hpp +++ b/libs/full/runtime_distributed/include/hpx/runtime_distributed.hpp @@ -13,11 +13,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/copy_component.hpp b/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/copy_component.hpp index 92a83601af6c..ebacd11ff6bc 100644 --- a/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/copy_component.hpp +++ b/libs/full/runtime_distributed/include/hpx/runtime_distributed/server/copy_component.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include 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 d3da7170ee80..9c6446f9bfc2 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 @@ -21,10 +21,10 @@ #include #include #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 d56a3c58e69a..d430562ff612 100644 --- a/libs/full/runtime_distributed/src/runtime_distributed.cpp +++ b/libs/full/runtime_distributed/src/runtime_distributed.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -36,10 +37,6 @@ #include #include #include -#include -#include -#include -#include #include #include diff --git a/libs/full/runtime_distributed/src/runtime_support.cpp b/libs/full/runtime_distributed/src/runtime_support.cpp index 5498a029bc20..6efbc1a45f29 100644 --- a/libs/full/runtime_distributed/src/runtime_support.cpp +++ b/libs/full/runtime_distributed/src/runtime_support.cpp @@ -6,8 +6,8 @@ #include #include +#include #include -#include #include #include 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 57ed66cf88ae..fc4b4a672f86 100644 --- a/libs/full/runtime_distributed/src/server/runtime_support_server.cpp +++ b/libs/full/runtime_distributed/src/server/runtime_support_server.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_difference.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_difference.hpp index d845b418e9cb..f482431e33df 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_difference.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_difference.hpp @@ -12,6 +12,8 @@ #include #include #include +#include + #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_find.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_find.hpp index 2c7c043e2093..5c72fbc1bd28 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_find.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_find.hpp @@ -11,7 +11,9 @@ #include #include #include +#include #include + #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/is_partitioned.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/is_partitioned.hpp index 43f7ec825298..bf475867aae9 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/is_partitioned.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/is_partitioned.hpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/scan.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/scan.hpp index a8e7017be69e..4e5469af87b4 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/scan.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/scan.hpp @@ -19,7 +19,9 @@ #include #include #include +#include #include + #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/is_partitioned.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/is_partitioned.hpp index 23c59b6dca35..96da034b5b0b 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/is_partitioned.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/is_partitioned.hpp @@ -11,6 +11,7 @@ #include #include #include + #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/is_sorted.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/is_sorted.hpp index 5b1c4bbe506c..6355e09cbb23 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/is_sorted.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/is_sorted.hpp @@ -10,7 +10,9 @@ #include #include #include +#include #include + #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/reduce.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/reduce.hpp index 07c7c2299cab..e0c9de2c638e 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/reduce.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/reduce.hpp @@ -11,6 +11,8 @@ #include #include #include +#include + #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/replace.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/replace.hpp index 8c627ed9bfd8..ca3e6ebc5f4c 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/replace.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/replace.hpp @@ -10,6 +10,8 @@ #include #include #include +#include + #include #include