Skip to content

Adapting HPX actions module to C++20 modules#7237

Open
arpittkhandelwal wants to merge 7 commits intoTheHPXProject:masterfrom
arpittkhandelwal:feature/cxx20-modules
Open

Adapting HPX actions module to C++20 modules#7237
arpittkhandelwal wants to merge 7 commits intoTheHPXProject:masterfrom
arpittkhandelwal:feature/cxx20-modules

Conversation

@arpittkhandelwal
Copy link
Copy Markdown
Contributor

This PR modularizes the actions module to properly support C++20 standard modules, following the exact same architectural pattern previously established for components_base and actions_base.

Key Changes:

  • Macro Segregation: Extracted all registration macros (e.g. HPX_REGISTER_ACTION_* and HPX_DEFINE_GET_ACTION_NAME_*) from base_action.hpp into a newly created macros.hpp file.
  • CMake Configuration: Exposed the newly created macros.hpp to CMake via the MACRO_HEADERS argument, protecting the macros from breaking the BMI generation.
  • Module Generation: Enabled GLOBAL_HEADER_MODULE_GEN ON for the actions module in CMakeLists.txt.
  • Global Header Adoption: Refactored 42 instances of granular internal header inclusions (#include <hpx/actions/...>) across the broader codebase to strictly use the unified module interface (#include <hpx/modules/actions.hpp>).

This brings the actions module fully up to speed with the repository's ongoing C++20 transition requirements.

Copilot AI review requested due to automatic review settings May 1, 2026 06:38
@arpittkhandelwal arpittkhandelwal requested a review from hkaiser as a code owner May 1, 2026 06:38
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 1, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.hpp into a dedicated hpx/actions/macros.hpp, and exposed it to CMake through MACRO_HEADERS.
  • Enabled GLOBAL_HEADER_MODULE_GEN ON for actions and 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.

Comment thread libs/full/actions/include/hpx/actions/macros.hpp
Comment thread libs/full/init_runtime/CMakeLists.txt
Comment thread libs/full/parcelports/CMakeLists.txt
Comment thread replace_actions.py Outdated
Comment thread replace_actions.py Outdated
Comment thread modularize.py Outdated
Copilot AI review requested due to automatic review settings May 1, 2026 07:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.hpp and wire it into module/global-header generation via MACRO_HEADERS.
  • Switch many call sites from granular hpx/actions/... includes to #include <hpx/modules/actions.hpp>.
  • Enable GLOBAL_HEADER_MODULE_GEN (and in some cases GLOBAL_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.

Comment on lines +15 to +17
#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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants