Feat/local convenience header#7070
Feat/local convenience header#7070shivansh023023 wants to merge 3 commits intoTheHPXProject:masterfrom
Conversation
|
Can one of the admins verify this patch? |
2540073 to
be0b7cd
Compare
|
Also, your new test causes compilation errors: https://github.com/STEllAR-GROUP/hpx/actions/runs/23336959505/job/67885450859?pr=7070 |
|
Thank you for the detailed review, @hkaiser I see the issue, including hpx_main.hpp in the core_local module was a mistake that caused the circular dependency and the CI failures. I am currently refactoring the PR to move the convenience header to a higher-level module (likely libs/full) and will update the copyright years and test logic accordingly. I'll push an update shortly. |
Moving the header to |
I completely understand, @hkaiser . Moving it to libs/full would indeed defeat the purpose for local-only users. I am refactoring the header within include_local to conditionally include hpx_main.hpp only when HPX_HAVE_NETWORKING (or the equivalent 'full' runtime flag) is defined. This should keep the core dependencies clean while still providing the convenience bundle for both local and full installations. I am also updating the copyrights to the 2020-2026 range as suggested. Updated PR coming in a few minutes. |
Add a single-include convenience header that bundles the Standard Parallel Toolkit: algorithm, execution, future, and numeric. In local-only builds (HPX_WITH_NETWORKING=OFF), hpx_main.hpp is also included for zero-boilerplate implicit main() wrapping. In full builds, the include is guarded to avoid a circular module dependency. Refs: TheHPXProject#7070
be0b7cd to
265bb1c
Compare
Add a single-include convenience header that bundles the Standard Parallel Toolkit: algorithm, execution, future, and numeric. In local-only builds (HPX_WITH_NETWORKING=OFF), hpx_main.hpp is also included for zero-boilerplate implicit main() wrapping. In full builds, the include is guarded to avoid a circular module dependency. Refs: TheHPXProject#7070 Signed-off-by: shivansh023023 <singhshivansh023@gmail.com>
265bb1c to
70dea5f
Compare
FWIW, the correct CMake flag is |
70dea5f to
478f834
Compare
Thank you for the tip, @hkaiser ! I've updated the code to use the canonical HPX_HAVE_DISTRIBUTED_RUNTIME macro in both the header and the unit test. This should resolve the circular dependency issues in the CI. |
478f834 to
023d94f
Compare
|
@shivansh023023 Please have a look at the CI results.There seem to be some problems with your changes. |
Move the -Wl,-wrap=main compile-time diagnostic into an isolated header (hpx/config/static_linker_check.hpp) in the config module to avoid circular module dependencies. The header emits a #warning when all of these hold: - __linux__ is defined - HPX_HAVE_DYNAMIC_HPX_MAIN is defined (generated config) - HPX_HAVE_STATIC_LINKING is defined (generated config) - HPX_HAVE_WRAP_MAIN_CONFIGURED is NOT defined CMake consumers are unaffected: hpx_wrap and hpx_auto_wrap inject HPX_HAVE_WRAP_MAIN_CONFIGURED via INTERFACE compile definitions. Refs: TheHPXProject#7068, TheHPXProject#7072 Signed-off-by: shivansh023023 <singhshivansh023@gmail.com>
- local.hpp: use only source-tree headers (hpx/execution.hpp, hpx/numeric.hpp) instead of generated .hpp.in headers (algorithm.hpp, future.hpp) - local.hpp: remove all hpx_main.hpp references from comments - local_header.cpp: use hpx::local::init instead of hpx_main.hpp wrapping - tests/unit/CMakeLists.txt: remove HPX::wrap_main dependency Refs: TheHPXProject#7070 Signed-off-by: shivansh023023 <singhshivansh023@gmail.com>
023d94f to
15b0e7d
Compare
- local.hpp: use only source-tree headers (hpx/execution.hpp, hpx/numeric.hpp) instead of generated .hpp.in headers (algorithm.hpp, future.hpp) - local.hpp: remove all hpx_main.hpp references from comments - local_header.cpp: use hpx::local::init instead of hpx_main.hpp wrapping - tests/unit/CMakeLists.txt: remove HPX::wrap_main dependency Refs: TheHPXProject#7070 Signed-off-by: shivansh023023 <singhshivansh023@gmail.com>
15b0e7d to
9f4d518
Compare
- local.hpp: use only source-tree headers (hpx/execution.hpp, hpx/numeric.hpp) instead of generated .hpp.in headers (algorithm.hpp, future.hpp) - local.hpp: remove all hpx_main.hpp references from comments - local_header.cpp: use hpx::local::init instead of hpx_main.hpp wrapping - tests/unit/CMakeLists.txt: remove HPX::wrap_main dependency Refs: TheHPXProject#7070 Signed-off-by: shivansh023023 <singhshivansh023@gmail.com>
9f4d518 to
80af546
Compare
|
The issues reported by the header consistency check are caused by your changes (https://github.com/STEllAR-GROUP/hpx/actions/runs/23444582618/job/68240317644?pr=7070). Please have a look. Also, please rebase onto master to fix the other compilation issues reported. |
sure , i will look into that |
|
@shivansh023023 ping? |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 medium |
🟢 Metrics 0 complexity · 0 duplication
Metric Results Complexity 0 Duplication 0
TIP This summary will be updated as you push new changes. Give us feedback
Fixes # — N/A (new feature)
Proposed Changes
hpx/local.hppconvenience header that bundleshpx_main.hpp,algorithm.hpp,execution.hpp,future.hpp, andnumeric.hppinto a single include for single-node HPX usage.
include_local/CMakeLists.txtso it iscorrectly installed and exported.
local_header.cpp) verifying thathpx::async,hpx::for_each, andhpx::reduceare all reachable through thesingle include.
Any background context you want to provide?
This follows the existing "convenience bundle" pattern already established
in the
include_localmodule (e.g.,hpx/execution.hppbundles fourexecution modules,
hpx/numeric.hppbundleshpx/modules/algorithms.hpp).The header directly supports the 2026 GSoC "Compiler Explorer Integration"
by providing a canonical single-header entry point for browser-based
development. On Godbolt, users currently need 4-5 separate
#includelines to write a basic parallel HPX program. With
hpx/local.hpp, thedefault code snippet becomes:
The header includes
hpx_main.hppfor automatic main wrapping, sousers do not need to write any HPX boilerplate.
Checklist
I have fixed a bug and have added a regression test.— N/AI have added a test using random numbers— N/A