Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6224, fold algorithms #6255

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open

#6224, fold algorithms #6255

wants to merge 32 commits into from

Conversation

Johan511
Copy link
Contributor

Fixes #6224

Proposed Changes

  • fold algorithms, as proposed in C++23

Checklist

Not all points below apply to all pull requests.

  • I have added a new feature and have added tests to go along with it.
  • I have added a test using random numbers; I have made sure it uses a seed, and that random numbers generated are valid inputs for the tests.

Signed-off-by: Hari Hara Naveen S <[email protected]>
Hari Hara Naveen S added 4 commits May 23, 2023 09:58
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
@StellarBot
Copy link

Performance test report

HPX Performance

Comparison

BENCHMARKFORK_JOIN_EXECUTORPARALLEL_EXECUTORSCHEDULER_EXECUTOR
For Each(=)??-

Info

PropertyBeforeAfter
HPX Datetime2023-05-10T12:07:53+00:002023-05-23T23:10:49+00:00
HPX Commitdcb5415f9d60b4
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Envfile
Clusternamerostamrostam
Datetime2023-05-10T14:50:18.616050-05:002023-05-23T18:15:12.569979-05:00
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu

Comparison

BENCHMARKNO-EXECUTOR
Future Overhead - Create Thread Hierarchical - Latch=

Info

PropertyBeforeAfter
HPX Datetime2023-05-10T12:07:53+00:002023-05-23T23:10:49+00:00
HPX Commitdcb5415f9d60b4
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Envfile
Clusternamerostamrostam
Datetime2023-05-10T14:52:35.047119-05:002023-05-23T18:17:29.090305-05:00
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu

Comparison

BENCHMARKFORK_JOIN_EXECUTOR_DEFAULT_FORK_JOIN_POLICY_ALLOCATORPARALLEL_EXECUTOR_DEFAULT_PARALLEL_POLICY_ALLOCATORSCHEDULER_EXECUTOR_DEFAULT_SCHEDULER_EXECUTOR_ALLOCATOR
Stream Benchmark - Add(=)(=)(=)
Stream Benchmark - Scale(=)(=)(=)
Stream Benchmark - Triad(=)(=)(=)
Stream Benchmark - Copy(=)(=)(=)

Info

PropertyBeforeAfter
HPX Datetime2023-05-10T12:07:53+00:002023-05-23T23:10:49+00:00
HPX Commitdcb5415f9d60b4
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Envfile
Clusternamerostamrostam
Datetime2023-05-10T14:52:52.237641-05:002023-05-23T18:17:46.319263-05:00
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu

Explanation of Symbols

SymbolMEANING
=No performance change (confidence interval within ±1%)
(=)Probably no performance change (confidence interval within ±2%)
(+)/(-)Very small performance improvement/degradation (≤1%)
+/-Small performance improvement/degradation (≤5%)
++/--Large performance improvement/degradation (≤10%)
+++/---Very large performance improvement/degradation (>10%)
?Probably no change, but quite large uncertainty (confidence interval with ±5%)
??Unclear result, very large uncertainty (±10%)
???Something unexpected…

Hari Hara Naveen S added 3 commits May 24, 2023 00:14
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Hari Hara Naveen S added 4 commits May 27, 2023 11:23
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
return {std::move(in), std::move(value)};
}
};
}} // namespace hpx::experimental::ranges
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@Johan511 Johan511 Jun 22, 2023

Choose a reason for hiding this comment

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

https://en.cppreference.com/w/cpp/algorithm/ranges/fold_left_with_iter

The examples here seem to suggest that the member variables are to be named as in and value

https://en.cppreference.com/w/cpp/algorithm/ranges/return_types/in_value_result#Notes
also mentions that

Unlike std::pair and std::tuple, this class template has data members of meaningful names.

Hari Hara Naveen S added 5 commits May 31, 2023 03:27
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Hari Hara Naveen S added 5 commits June 10, 2023 15:50
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
@StellarBot
Copy link

Performance test report

HPX Performance

Comparison

BENCHMARKFORK_JOIN_EXECUTORPARALLEL_EXECUTORSCHEDULER_EXECUTOR
For Each(=)??-

Info

PropertyBeforeAfter
HPX Commitdcb541536cb4cd
HPX Datetime2023-05-10T12:07:53+00:002023-06-17T15:09:48+00:00
Envfile
Datetime2023-05-10T14:50:18.616050-05:002023-06-17T10:15:43.150300-05:00
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Clusternamerostamrostam
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu

Comparison

BENCHMARKNO-EXECUTOR
Future Overhead - Create Thread Hierarchical - Latch(=)

Info

PropertyBeforeAfter
HPX Commitdcb541536cb4cd
HPX Datetime2023-05-10T12:07:53+00:002023-06-17T15:09:48+00:00
Envfile
Datetime2023-05-10T14:52:35.047119-05:002023-06-17T10:18:00.129179-05:00
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Clusternamerostamrostam
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu

Comparison

BENCHMARKFORK_JOIN_EXECUTOR_DEFAULT_FORK_JOIN_POLICY_ALLOCATORPARALLEL_EXECUTOR_DEFAULT_PARALLEL_POLICY_ALLOCATORSCHEDULER_EXECUTOR_DEFAULT_SCHEDULER_EXECUTOR_ALLOCATOR
Stream Benchmark - Add(=)=(=)
Stream Benchmark - Scale(=)(=)(=)
Stream Benchmark - Triad(=)(=)(=)
Stream Benchmark - Copy(=)=(=)

Info

PropertyBeforeAfter
HPX Commitdcb541536cb4cd
HPX Datetime2023-05-10T12:07:53+00:002023-06-17T15:09:48+00:00
Envfile
Datetime2023-05-10T14:52:52.237641-05:002023-06-17T10:18:17.413210-05:00
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Clusternamerostamrostam
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu

Explanation of Symbols

SymbolMEANING
=No performance change (confidence interval within ±1%)
(=)Probably no performance change (confidence interval within ±2%)
(+)/(-)Very small performance improvement/degradation (≤1%)
+/-Small performance improvement/degradation (≤5%)
++/--Large performance improvement/degradation (≤10%)
+++/---Very large performance improvement/degradation (>10%)
?Probably no change, but quite large uncertainty (confidence interval with ±5%)
??Unclear result, very large uncertainty (±10%)
???Something unexpected…

Hari Hara Naveen S and others added 3 commits June 17, 2023 18:53
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
@StellarBot
Copy link

Performance test report

HPX Performance

Comparison

BENCHMARKFORK_JOIN_EXECUTORPARALLEL_EXECUTORSCHEDULER_EXECUTOR
For Each(=)??-

Info

PropertyBeforeAfter
HPX Datetime2023-05-10T12:07:53+00:002023-06-17T23:55:30+00:00
HPX Commitdcb5415109a0ee
Envfile
Datetime2023-05-10T14:50:18.616050-05:002023-06-17T19:05:26.094899-05:00
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Clusternamerostamrostam
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu

Comparison

BENCHMARKNO-EXECUTOR
Future Overhead - Create Thread Hierarchical - Latch=

Info

PropertyBeforeAfter
HPX Datetime2023-05-10T12:07:53+00:002023-06-17T23:55:30+00:00
HPX Commitdcb5415109a0ee
Envfile
Datetime2023-05-10T14:52:35.047119-05:002023-06-17T19:07:42.685417-05:00
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Clusternamerostamrostam
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu

Comparison

BENCHMARKFORK_JOIN_EXECUTOR_DEFAULT_FORK_JOIN_POLICY_ALLOCATORPARALLEL_EXECUTOR_DEFAULT_PARALLEL_POLICY_ALLOCATORSCHEDULER_EXECUTOR_DEFAULT_SCHEDULER_EXECUTOR_ALLOCATOR
Stream Benchmark - Add(=)(=)(=)
Stream Benchmark - Scale(=)=(=)
Stream Benchmark - Triad==(=)
Stream Benchmark - Copy(=)(=)(=)

Info

PropertyBeforeAfter
HPX Datetime2023-05-10T12:07:53+00:002023-06-17T23:55:30+00:00
HPX Commitdcb5415109a0ee
Envfile
Datetime2023-05-10T14:52:52.237641-05:002023-06-17T19:08:00.033553-05:00
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Clusternamerostamrostam
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu

Explanation of Symbols

SymbolMEANING
=No performance change (confidence interval within ±1%)
(=)Probably no performance change (confidence interval within ±2%)
(+)/(-)Very small performance improvement/degradation (≤1%)
+/-Small performance improvement/degradation (≤5%)
++/--Large performance improvement/degradation (≤10%)
+++/---Very large performance improvement/degradation (>10%)
?Probably no change, but quite large uncertainty (confidence interval with ±5%)
??Unclear result, very large uncertainty (±10%)
???Something unexpected…

@StellarBot
Copy link

Performance test report

HPX Performance

Comparison

BENCHMARKFORK_JOIN_EXECUTORPARALLEL_EXECUTORSCHEDULER_EXECUTOR
For Each(=)??-

Info

PropertyBeforeAfter
HPX Commitdcb541521fad47
HPX Datetime2023-05-10T12:07:53+00:002023-06-18T00:07:48+00:00
Datetime2023-05-10T14:50:18.616050-05:002023-06-17T19:15:58.713761-05:00
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Envfile
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu
Clusternamerostamrostam

Comparison

BENCHMARKNO-EXECUTOR
Future Overhead - Create Thread Hierarchical - Latch=

Info

PropertyBeforeAfter
HPX Commitdcb541521fad47
HPX Datetime2023-05-10T12:07:53+00:002023-06-18T00:07:48+00:00
Datetime2023-05-10T14:52:35.047119-05:002023-06-17T19:18:14.613723-05:00
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Envfile
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu
Clusternamerostamrostam

Comparison

BENCHMARKFORK_JOIN_EXECUTOR_DEFAULT_FORK_JOIN_POLICY_ALLOCATORPARALLEL_EXECUTOR_DEFAULT_PARALLEL_POLICY_ALLOCATORSCHEDULER_EXECUTOR_DEFAULT_SCHEDULER_EXECUTOR_ALLOCATOR
Stream Benchmark - Add(=)(=)=
Stream Benchmark - Scale(=)=(=)
Stream Benchmark - Triad(=)(=)(=)
Stream Benchmark - Copy(=)(=)(=)

Info

PropertyBeforeAfter
HPX Commitdcb541521fad47
HPX Datetime2023-05-10T12:07:53+00:002023-06-18T00:07:48+00:00
Datetime2023-05-10T14:52:52.237641-05:002023-06-17T19:18:31.936841-05:00
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1
Envfile
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu
Clusternamerostamrostam

Explanation of Symbols

SymbolMEANING
=No performance change (confidence interval within ±1%)
(=)Probably no performance change (confidence interval within ±2%)
(+)/(-)Very small performance improvement/degradation (≤1%)
+/-Small performance improvement/degradation (≤5%)
++/--Large performance improvement/degradation (≤10%)
+++/---Very large performance improvement/degradation (>10%)
?Probably no change, but quite large uncertainty (confidence interval with ±5%)
??Unclear result, very large uncertainty (±10%)
???Something unexpected…

Hari Hara Naveen S added 4 commits June 18, 2023 05:32
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
@vivekd01
Copy link

vivekd01 commented Jul 4, 2023

i want to work on this issues please assign me this issue.

@Johan511
Copy link
Contributor Author

Johan511 commented Jul 5, 2023

Hi @vivekd01, thank you for the initiative but all the fold algorithms have been implemented in this PR. You could look at our issues page for other issues/feature-requests.

Copy link
Member

@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.

Could you please add tests for all the algorithms?

Hari Hara Naveen S and others added 3 commits July 16, 2023 11:41
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
Signed-off-by: Hari Hara Naveen S <[email protected]>
@Johan511
Copy link
Contributor Author

@hkaiser basic tests for all the algorithms have been added

@hkaiser
Copy link
Member

hkaiser commented Jul 23, 2023

@Johan511 thanks for adding the tests. The last thing missing here is to add the documentation for the algorithms. All other algorithms have extensive documentation. Please coordinate with @dimitraka on what's necessary for this.

@hkaiser hkaiser modified the milestones: 1.10.0, 1.11.0 May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add C++23 fold algorithms
4 participants