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

First pass at scan, implemented linear and ring algorithms #1154

Merged
merged 13 commits into from
Jan 21, 2025

Conversation

avincigu
Copy link
Collaborator

No description provided.

@avincigu avincigu requested review from davidozog and wrrobin October 14, 2024 21:05
Copy link
Member

@davidozog davidozog left a comment

Choose a reason for hiding this comment

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

This looks great, thanks @avincigu!

I noticed an issue with "in-place" scan (the specification example uses the same source and dest buffer). Do you have any other testing in place?

The C11 variants can probably added as well - something like this:

diff --git a/mpp/shmemx.h4 b/mpp/shmemx.h4
index 92b38519..f82729e0 100644
--- a/mpp/shmemx.h4
+++ b/mpp/shmemx.h4
@@ -119,6 +119,19 @@ SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_IBGET', `, \') \
         uint64_t*: shmemx_signal_add \
     )(__VA_ARGS__)

+define(`SHMEM_C11_GEN_EXSCAN', `        $2*: shmemx_$1_sum_exscan')dnl
+#define shmemx_sum_exscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_EXSCAN', `, \') \
+    )(__VA_ARGS__)
+
+define(`SHMEM_C11_GEN_INSCAN', `        $2*: shmemx_$1_sum_inscan')dnl
+#define shmemx_sum_inscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_INSCAN', `, \') \
+    )(__VA_ARGS__)

The code style is a bit different from typical SOS, at least in collectives.c. We gravitate towards the Google style guide:
https://google.github.io/styleguide/cppguide.html

Let's chat offline tomorrow, thanks!

src/collectives.c Outdated Show resolved Hide resolved
src/collectives.c Outdated Show resolved Hide resolved
@davidozog
Copy link
Member

davidozog commented Oct 15, 2024

The Portals4 testing row looks like a real issue to me, seemingly with the pshmem symbols.
The UCX rows look like a known issue #1148

@wrrobin
Copy link
Collaborator

wrrobin commented Oct 16, 2024

This looks great, thanks @avincigu!

I noticed an issue with "in-place" scan (the specification example uses the same source and dest buffer). Do you have any other testing in place?

The C11 variants can probably added as well - something like this:

diff --git a/mpp/shmemx.h4 b/mpp/shmemx.h4
index 92b38519..f82729e0 100644
--- a/mpp/shmemx.h4
+++ b/mpp/shmemx.h4
@@ -119,6 +119,19 @@ SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_IBGET', `, \') \
         uint64_t*: shmemx_signal_add \
     )(__VA_ARGS__)

+define(`SHMEM_C11_GEN_EXSCAN', `        $2*: shmemx_$1_sum_exscan')dnl
+#define shmemx_sum_exscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_EXSCAN', `, \') \
+    )(__VA_ARGS__)
+
+define(`SHMEM_C11_GEN_INSCAN', `        $2*: shmemx_$1_sum_inscan')dnl
+#define shmemx_sum_inscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_INSCAN', `, \') \
+    )(__VA_ARGS__)

The code style is a bit different from typical SOS, at least in collectives.c. We gravitate towards the Google style guide: https://google.github.io/styleguide/cppguide.html

Let's chat offline tomorrow, thanks!

Looking at the PR, I realize why @davidozog commented on code style. I did not see any issue when we were looking at the code @avincigu. Perhaps, it is the editor you were using.

@avincigu
Copy link
Collaborator Author

This looks great, thanks @avincigu!

I noticed an issue with "in-place" scan (the specification example uses the same source and dest buffer). Do you have any other testing in place?

The C11 variants can probably added as well - something like this:

diff --git a/mpp/shmemx.h4 b/mpp/shmemx.h4
index 92b38519..f82729e0 100644
--- a/mpp/shmemx.h4
+++ b/mpp/shmemx.h4
@@ -119,6 +119,19 @@ SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_IBGET', `, \') \
         uint64_t*: shmemx_signal_add \
     )(__VA_ARGS__)

+define(`SHMEM_C11_GEN_EXSCAN', `        $2*: shmemx_$1_sum_exscan')dnl
+#define shmemx_sum_exscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_EXSCAN', `, \') \
+    )(__VA_ARGS__)
+
+define(`SHMEM_C11_GEN_INSCAN', `        $2*: shmemx_$1_sum_inscan')dnl
+#define shmemx_sum_inscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_INSCAN', `, \') \
+    )(__VA_ARGS__)

The code style is a bit different from typical SOS, at least in collectives.c. We gravitate towards the Google style guide: https://google.github.io/styleguide/cppguide.html

Let's chat offline tomorrow, thanks!

Thanks for the comments Dave! I made the changes you suggested. It seems like my editor was adding extra spaces whenever I hit tab. I have fixed it now, please let me know if you see any style issues still.

@wrrobin
Copy link
Collaborator

wrrobin commented Dec 13, 2024

@avincigu - XPMEM tests are failing. You might have to try those configs to debug and see what is the issue. Neptune/Perlmutter has XPMEM as a module.

mpp/shmemx.h4 Outdated Show resolved Hide resolved
src/collectives.c Outdated Show resolved Hide resolved
src/collectives.c Outdated Show resolved Hide resolved
src/collectives.c Outdated Show resolved Hide resolved
src/collectives.c Outdated Show resolved Hide resolved
src/collectives.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@wrrobin wrrobin left a comment

Choose a reason for hiding this comment

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

LGTM @avincigu. BTW, please add another reviewer to review unless we get @davidozog's approval.

Copy link
Member

@davidozog davidozog left a comment

Choose a reason for hiding this comment

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

Looks great - I just pointed out a few minor things.

mpp/shmemx.h4 Outdated Show resolved Hide resolved
mpp/shmemx.h4 Outdated Show resolved Hide resolved
src/collectives.c Outdated Show resolved Hide resolved
src/collectives.c Outdated Show resolved Hide resolved
src/collectives.c Outdated Show resolved Hide resolved
src/shmem_collectives.h Outdated Show resolved Hide resolved
src/collectives_c.c4 Outdated Show resolved Hide resolved
@avincigu avincigu requested a review from davidozog January 21, 2025 18:40
@avincigu avincigu merged commit 0c1676b into Sandia-OpenSHMEM:main Jan 21, 2025
36 checks passed
@avincigu avincigu deleted the scan branch January 21, 2025 20:44
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.

3 participants