Skip to content

Integrate NVIDIA's S/R Bulk implementation into HPX#6746

Merged
hkaiser merged 70 commits intoTheHPXProject:masterfrom
charan-003:feature/forward-bulk
Mar 12, 2026
Merged

Integrate NVIDIA's S/R Bulk implementation into HPX#6746
hkaiser merged 70 commits intoTheHPXProject:masterfrom
charan-003:feature/forward-bulk

Conversation

@charan-003
Copy link
Copy Markdown
Contributor

This PR forwards stdexec::bulk and stdexec::bulk_t inside stdexec_forward.hpp.

These were previously commented out. This change makes bulk available through hpx::execution::experimental::bulk, aligning HPX's Sender/Receiver interface with NVIDIA's stdexec implementation.

This exception_list class in the hpx namespace is a thread-safe container for handling multiple exceptions encountered during parallel algorithm execution. It allows storing std::exception_ptr objects, provides thread-safe access via a spinlock, and includes methods to add exceptions, get the count (size()), and iterate over the stored exceptions (begin()/end()). The class also includes placeholders for retrieving error codes and messages. This is useful for collecting and managing exceptions across parallel threads.
@charan-003 charan-003 requested a review from hkaiser as a code owner July 18, 2025 17:58
@StellarBot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@charan-003 charan-003 changed the title updated algorithm_bulk test file Integrate NVIDIA's S/R Bulk implementation into HPX Jul 23, 2025
@hkaiser hkaiser added type: enhancement category: senders/receivers Implementations of the p0443r14 / p2300 + p1897 proposals project: GSoC labels Jul 25, 2025
@charan-003 charan-003 marked this pull request as draft August 2, 2025 06:10
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Aug 2, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 14d6bb91 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (14d6bb9) Report Missing Report Missing Report Missing
Head commit (fc9837c) 143562 51 0.04%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6746) 133 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Comment thread libs/core/executors/include/hpx/executors/thread_pool_scheduler.hpp Fixed
@charan-003 charan-003 force-pushed the feature/forward-bulk branch from 49b7122 to ff8a35c Compare August 13, 2025 19:00
Copy link
Copy Markdown
Contributor

@isidorostsa isidorostsa left a comment

Choose a reason for hiding this comment

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

Excellent work! The tests are checking all the correct things, so if we get them passing we are good to merge :)

Comment thread libs/core/execution/include/hpx/execution/algorithms/bulk.hpp
Comment thread libs/core/execution_base/include/hpx/execution_base/stdexec_forward.hpp Outdated
Comment thread libs/core/executors/include/hpx/executors/explicit_scheduler_executor.hpp Outdated
Comment thread libs/core/executors/include/hpx/executors/explicit_scheduler_executor.hpp Outdated
Comment thread libs/core/executors/include/hpx/executors/thread_pool_scheduler.hpp Outdated
Comment thread libs/core/executors/include/hpx/executors/thread_pool_scheduler.hpp Outdated
Comment thread libs/core/executors/include/hpx/executors/thread_pool_scheduler.hpp
@charan-003 charan-003 force-pushed the feature/forward-bulk branch 6 times, most recently from bf43519 to 15f19e6 Compare August 20, 2025 05:26
@charan-003 charan-003 marked this pull request as ready for review August 20, 2025 05:26
@charan-003 charan-003 marked this pull request as draft August 20, 2025 05:30
@charan-003 charan-003 force-pushed the feature/forward-bulk branch 2 times, most recently from 1a7c336 to d8a6edc Compare August 20, 2025 22:50
@charan-003 charan-003 marked this pull request as ready for review August 22, 2025 04:44
@charan-003 charan-003 requested a review from isidorostsa August 22, 2025 16:48
)>
// clang-format on
template <typename Parameters>
requires(hpx::traits::is_executor_parameters_v<Parameters>)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As said before, in our experience, requires clauses don't always play well with return type SFIANE. I'd suggest leaving the HPX_CONCEPT_REQUIRES_ macro in place in these cases.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried using HPX_CONCEPT_REQUIRES_ but it causes compilation errors with friend functions that have trailing return types. The compiler gives errors like "cannot combine with previous declaration specifier" no matter where I place the macro.

The C++20 requires clause is what scheduler_executor.hpp uses for the same pattern (line 260), so I followed that approach. Is there a way to make HPX_CONCEPT_REQUIRES_ work in this case ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If everything works with requires clauses - great. No need to use SFINAE in that case. We have seen issues with this pattern before, that's all.

Comment thread libs/core/executors/include/hpx/executors/thread_pool_scheduler.hpp Outdated
@charan-003
Copy link
Copy Markdown
Contributor Author

@hkaiser, in this commit, switched to HPX_CONCEPT_REQUIRES_ , and removed integral constraints from bulk operations to support both integral and range shapes everywhere

@charan-003
Copy link
Copy Markdown
Contributor Author

@hkaiser

removing #if !defined(HPX_HAVE_STDEXEC) causing compilation errors on macOS CI because the current implementation assumes S is always a range (uses range_traits<S>::value_type

to support both integral and range shapes, should I keep two separate overloads or use if constexpr within a single overload to handle both cases? or any different approach to solve this?

@charan-003 charan-003 requested a review from hkaiser March 3, 2026 13:46
@hkaiser
Copy link
Copy Markdown
Contributor

hkaiser commented Mar 7, 2026

@hkaiser

removing #if !defined(HPX_HAVE_STDEXEC) causing compilation errors on macOS CI because the current implementation assumes S is always a range (uses range_traits<S>::value_type

to support both integral and range shapes, should I keep two separate overloads or use if constexpr within a single overload to handle both cases? or any different approach to solve this?

We usually use two overloads instead of constexpr if. But it's up to you to do whatever you feel fits best.

@charan-003 charan-003 force-pushed the feature/forward-bulk branch from 8f5ec08 to bfb9680 Compare March 8, 2026 16:07
Copy link
Copy Markdown
Contributor

@hkaiser hkaiser left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM, thanks!

Comment thread libs/core/algorithms/include/hpx/parallel/util/detail/partitioner_iteration.hpp Outdated
Comment thread libs/core/execution_base/include/hpx/execution_base/stdexec_forward.hpp Outdated
Comment thread libs/core/executors/include/hpx/executors/thread_pool_scheduler_bulk.hpp Outdated
@hkaiser hkaiser added this to the 2.0.0 milestone Mar 11, 2026
@hkaiser hkaiser merged commit 6af7a7c into TheHPXProject:master Mar 12, 2026
109 of 113 checks passed
@hkaiser
Copy link
Copy Markdown
Contributor

hkaiser commented Mar 12, 2026

@charan-003, @isidorostsa Thanks for working on this! It was a long journey, but you made it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: senders/receivers Implementations of the p0443r14 / p2300 + p1897 proposals project: GSoC type: enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants