Adapting HPX actions module to C++20 modules#7237
Adapting HPX actions module to C++20 modules#7237arpittkhandelwal wants to merge 7 commits intoTheHPXProject:masterfrom
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull request overview
This PR continues HPX’s C++20 modules transition by making the actions module safe to consume through generated module-aware global headers, primarily by separating macro-only headers from BMI-affecting headers and updating downstream includes to use the unified hpx/modules/actions.hpp entrypoint.
Changes:
- Extracted action registration/name macros from
base_action.hppinto a dedicatedhpx/actions/macros.hpp, and exposed it to CMake throughMACRO_HEADERS. - Enabled
GLOBAL_HEADER_MODULE_GEN ONforactionsand a number of related modules to support C++20 module interface generation. - Replaced many granular
<hpx/actions/...>includes across the codebase with<hpx/modules/actions.hpp>.
Reviewed changes
Copilot reviewed 75 out of 75 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| replace_actions.py | Adds a helper script to rewrite action includes to the unified module include. |
| modularize.py | Adds a helper script to enable GLOBAL_HEADER_MODULE_GEN and collect detail headers. |
| libs/full/segmented_algorithms/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/runtime_distributed/include/hpx/runtime_distributed/server/runtime_support.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/runtime_distributed/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/runtime_components/src/server/console_logging_server.cpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/runtime_components/src/server/console_error_sink_server.cpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/runtime_components/include/hpx/runtime_components/server/console_logging.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/runtime_components/include/hpx/runtime_components/server/console_error_sink.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/runtime_components/include/hpx/runtime_components/distributed_metadata_base.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/runtime_components/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/resiliency_distributed/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/performance_counters/src/server/base_performance_counter.cpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/performance_counters/src/counter_creators.cpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/performance_counters/include/hpx/performance_counters/server/symbol_namespace_counters.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/performance_counters/include/hpx/performance_counters/server/primary_namespace_counters.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/performance_counters/include/hpx/performance_counters/server/locality_namespace_counters.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/performance_counters/include/hpx/performance_counters/server/component_namespace_counters.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/performance_counters/include/hpx/performance_counters/server/base_performance_counter.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/performance_counters/CMakeLists.txt | Enables module header generation and adds a detail header to the global header. |
| libs/full/parcelset/src/parcel.cpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/parcelset/src/detail/parcel_await.cpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/parcelset/include/hpx/parcelset/parcel.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/parcelset/CMakeLists.txt | Enables module header generation and adds detail headers to the global header. |
| libs/full/parcelports/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/parcelport_tcp/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/parcelport_mpi/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/parcelport_lcw/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/parcelport_lci/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/parcelport_gasnet/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/lcos_distributed/include/hpx/lcos_distributed/server/channel.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/lcos_distributed/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/init_runtime/CMakeLists.txt | Enables module header generation and adds detail headers to the global header set. |
| libs/full/include/include/hpx/include/components.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/include/include/hpx/include/actions.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/executors_distributed/include/hpx/executors_distributed/distribution_policy_executor.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/executors_distributed/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/distribution_policies/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/compute/CMakeLists.txt | Enables module header generation and adds a detail header to the global header. |
| libs/full/components/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/collectives/src/latch.cpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/collectives/include/hpx/collectives/reduce_direct.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/collectives/include/hpx/collectives/fold.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/collectives/include/hpx/collectives/detail/latch.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/collectives/include/hpx/collectives/broadcast_direct.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/collectives/CMakeLists.txt | Enables module header generation and adds detail headers to the global header. |
| libs/full/checkpoint/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/async_distributed/src/continuation.cpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/async_distributed/src/base_lco.cpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/async_distributed/include/hpx/async_distributed/trigger_lco.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/async_distributed/include/hpx/async_distributed/transfer_continuation_action.hpp | Consolidates multiple action includes into hpx/modules/actions.hpp. |
| libs/full/async_distributed/include/hpx/async_distributed/put_parcel.hpp | Consolidates action includes into hpx/modules/actions.hpp. |
| libs/full/async_distributed/include/hpx/async_distributed/detail/post.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/async_distributed/include/hpx/async_distributed/base_lco_with_value.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/async_distributed/include/hpx/async_distributed/base_lco.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/async_distributed/CMakeLists.txt | Enables module header generation and adds detail headers to the global header list. |
| libs/full/async_colocated/CMakeLists.txt | Enables module header generation and adds detail headers to the global header list. |
| libs/full/agas_base/include/hpx/agas_base/server/symbol_namespace.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/agas_base/include/hpx/agas_base/server/primary_namespace.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/agas_base/include/hpx/agas_base/server/locality_namespace.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/agas_base/include/hpx/agas_base/server/component_namespace.hpp | Switches to unified hpx/modules/actions.hpp include. |
| libs/full/agas_base/CMakeLists.txt | Enables module header generation and adds detail headers to the global header. |
| libs/full/agas/CMakeLists.txt | Enables module header generation for the module. |
| libs/full/actions/include/hpx/actions/macros.hpp | New macro-only header for action registration and naming support. |
| libs/full/actions/include/hpx/actions/base_action.hpp | Removes inline macro definitions and includes the new macros.hpp. |
| libs/full/actions/CMakeLists.txt | Adds macros.hpp, marks it as MACRO_HEADERS, and enables module header generation. |
| libs/core/preprocessor/CMakeLists.txt | Disables module header generation and marks headers as macro headers. |
| libs/core/lcw_base/CMakeLists.txt | Enables module header generation for the module. |
| libs/core/gasnet_base/CMakeLists.txt | Enables module header generation for the module. |
| libs/core/async_sycl/CMakeLists.txt | Enables module header generation and adds a detail header to the global header. |
| components/process/include/hpx/components/process/server/child.hpp | Switches to unified hpx/modules/actions.hpp include. |
| components/iostreams/include/hpx/components/iostreams/server/output_stream.hpp | Switches to unified hpx/modules/actions.hpp include. |
| components/containers/unordered/include/hpx/components/containers/unordered/partition_unordered_map_component.hpp | Switches to unified hpx/modules/actions.hpp include. |
| components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_component_decl.hpp | Switches to unified hpx/modules/actions.hpp include. |
| components/component_storage/include/hpx/components/component_storage/server/component_storage.hpp | Switches to unified hpx/modules/actions.hpp include. |
There was a problem hiding this comment.
Pull request overview
This PR advances HPX’s C++20 modules transition by modularizing the actions module (notably separating macro-only registration facilities) and updating downstream code to include the unified hpx/modules/actions.hpp interface, while also enabling global header module generation across a broad set of dependent modules.
Changes:
- Extract action registration/name macros into
hpx/actions/macros.hppand wire it into module/global-header generation viaMACRO_HEADERS. - Switch many call sites from granular
hpx/actions/...includes to#include <hpx/modules/actions.hpp>. - Enable
GLOBAL_HEADER_MODULE_GEN(and in some casesGLOBAL_HEADER_GEN/ADD_TO_GLOBAL_HEADER) across multiple modules to support module-header/BMI generation.
Reviewed changes
Copilot reviewed 82 out of 82 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| wrap/src/hpx_wrap.cpp | Minor type spelling change for exported app_name_libhpx_wrap declaration. |
| libs/full/segmented_algorithms/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/runtime_distributed/include/hpx/runtime_distributed/server/runtime_support.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/runtime_distributed/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/runtime_components/src/server/console_logging_server.cpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/runtime_components/src/server/console_error_sink_server.cpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/runtime_components/include/hpx/runtime_components/server/console_logging.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/runtime_components/include/hpx/runtime_components/server/console_error_sink.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/runtime_components/include/hpx/runtime_components/distributed_metadata_base.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/runtime_components/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/resiliency_distributed/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/performance_counters/src/server/base_performance_counter.cpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/performance_counters/src/counter_creators.cpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/performance_counters/include/hpx/performance_counters/server/symbol_namespace_counters.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/performance_counters/include/hpx/performance_counters/server/primary_namespace_counters.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/performance_counters/include/hpx/performance_counters/server/locality_namespace_counters.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/performance_counters/include/hpx/performance_counters/server/component_namespace_counters.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/performance_counters/include/hpx/performance_counters/server/base_performance_counter.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/performance_counters/CMakeLists.txt | Enable module global header generation and add specific detail header to global header. |
| libs/full/parcelset/src/parcel.cpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/parcelset/src/detail/parcel_await.cpp | Replace actions forward include with hpx/modules/actions.hpp. |
| libs/full/parcelset/include/hpx/parcelset/parcel.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/parcelset/CMakeLists.txt | Enable module global header generation and add selected detail headers. |
| libs/full/parcelports/CMakeLists.txt | Turn on global header generation and enable module global header generation. |
| libs/full/parcelport_tcp/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/parcelport_mpi/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/parcelport_lcw/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/parcelport_lci/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/parcelport_gasnet/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/lcos_distributed/include/hpx/lcos_distributed/server/channel.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/lcos_distributed/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/init_runtime/CMakeLists.txt | Turn on global header generation and enable module global header generation; add selected detail headers. |
| libs/full/include/include/hpx/include/components.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/include/include/hpx/include/actions.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/executors_distributed/include/hpx/executors_distributed/distribution_policy_executor.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/executors_distributed/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/distribution_policies/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/compute/CMakeLists.txt | Enable global header module generation and add selected detail header. |
| libs/full/components/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/collectives/src/latch.cpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/collectives/include/hpx/collectives/reduce_direct.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/collectives/include/hpx/collectives/fold.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/collectives/include/hpx/collectives/detail/latch.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/collectives/include/hpx/collectives/broadcast_direct.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/collectives/CMakeLists.txt | Enable global header module generation and add selected detail headers. |
| libs/full/checkpoint/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/async_distributed/src/continuation.cpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/async_distributed/src/base_lco.cpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/async_distributed/include/hpx/async_distributed/trigger_lco.hpp | Replace actions forward include with hpx/modules/actions.hpp. |
| libs/full/async_distributed/include/hpx/async_distributed/transfer_continuation_action.hpp | Replace multiple granular actions includes with hpx/modules/actions.hpp. |
| libs/full/async_distributed/include/hpx/async_distributed/put_parcel.hpp | Replace granular actions includes with hpx/modules/actions.hpp. |
| libs/full/async_distributed/include/hpx/async_distributed/detail/post.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/async_distributed/include/hpx/async_distributed/base_lco_with_value.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/async_distributed/include/hpx/async_distributed/base_lco.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/async_distributed/CMakeLists.txt | Enable global header module generation and add many detail headers to global header. |
| libs/full/async_colocated/CMakeLists.txt | Enable global header module generation and add selected detail headers. |
| libs/full/agas_base/include/hpx/agas_base/server/symbol_namespace.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/agas_base/include/hpx/agas_base/server/primary_namespace.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/agas_base/include/hpx/agas_base/server/locality_namespace.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/agas_base/include/hpx/agas_base/server/component_namespace.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| libs/full/agas_base/CMakeLists.txt | Enable global header module generation and add selected detail headers. |
| libs/full/agas/CMakeLists.txt | Enable global header module generation for the module. |
| libs/full/actions/include/hpx/actions/macros.hpp | New macro-only header for action registration/name macros. |
| libs/full/actions/include/hpx/actions/base_action.hpp | Remove macro definitions from this header and include the new hpx/actions/macros.hpp. |
| libs/full/actions/CMakeLists.txt | Add macros.hpp, expose it via MACRO_HEADERS, and enable global header module generation. |
| libs/core/threading_base/include/hpx/threading_base/thread_data.hpp | Formatting change for exported function declaration. |
| libs/core/preprocessor/CMakeLists.txt | Explicitly set GLOBAL_HEADER_MODULE_GEN OFF and add MACRO_HEADERS. |
| libs/core/lcw_base/CMakeLists.txt | Enable global header module generation for the module. |
| libs/core/gasnet_base/CMakeLists.txt | Enable global header module generation for the module. |
| libs/core/execution_base/include/hpx/execution_base/completion_signatures.hpp | Formatting change for exported tag type declaration. |
| libs/core/execution/include/hpx/execution/executors/execution_parameters_fwd.hpp | Formatting changes for exported tag type declarations. |
| libs/core/execution/include/hpx/execution/algorithms/when_all.hpp | Formatting change for exported tag type declaration. |
| libs/core/algorithms/include/hpx/parallel/container_algorithms/iota.hpp | Formatting change for tag_fallback_invoke declaration. |
| libs/core/algorithms/include/hpx/parallel/container_algorithms/find.hpp | Formatting changes for tag_fallback_invoke declarations. |
| libs/core/algorithms/include/hpx/parallel/algorithms/shift_right.hpp | Formatting change for tag_fallback_invoke declaration. |
| libs/core/algorithms/include/hpx/parallel/algorithms/shift_left.hpp | Formatting change for tag_fallback_invoke declaration. |
| libs/core/async_sycl/CMakeLists.txt | Enable global header module generation and add selected detail header. |
| components/process/include/hpx/components/process/server/child.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| components/iostreams/include/hpx/components/iostreams/server/output_stream.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| components/containers/unordered/include/hpx/components/containers/unordered/partition_unordered_map_component.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_component_decl.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| components/component_storage/include/hpx/components/component_storage/server/component_storage.hpp | Replace granular actions include with hpx/modules/actions.hpp. |
| #include <hpx/actions/transfer_action.hpp> | ||
| #include <hpx/actions/transfer_continuation_action.hpp> | ||
|
|
| GLOBAL_HEADER_GEN ON | ||
| GLOBAL_HEADER_MODULE_GEN OFF | ||
| HEADERS ${preprocessor_headers} | ||
| MACRO_HEADERS ${preprocessor_headers} |
This PR modularizes the
actionsmodule to properly support C++20 standard modules, following the exact same architectural pattern previously established forcomponents_baseandactions_base.Key Changes:
HPX_REGISTER_ACTION_*andHPX_DEFINE_GET_ACTION_NAME_*) frombase_action.hppinto a newly createdmacros.hppfile.macros.hppto CMake via theMACRO_HEADERSargument, protecting the macros from breaking the BMI generation.GLOBAL_HEADER_MODULE_GEN ONfor theactionsmodule inCMakeLists.txt.#include <hpx/actions/...>) across the broader codebase to strictly use the unified module interface (#include <hpx/modules/actions.hpp>).This brings the
actionsmodule fully up to speed with the repository's ongoing C++20 transition requirements.