-
Notifications
You must be signed in to change notification settings - Fork 53
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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!
The Portals4 testing row looks like a real issue to me, seemingly with the pshmem symbols. |
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. |
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. |
@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. |
Co-authored-by: Md Rahman <wrrobin@gmail.com>
Co-authored-by: Md Rahman <wrrobin@gmail.com>
There was a problem hiding this 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.
There was a problem hiding this 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.
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', `, \') \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these need to be SHMEM_BIND_C11_COLL_SUM_PROD
.
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', `, \') \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too - SHMEM_BIND_C11_COLL_SUM_PROD
?
@@ -18,13 +18,15 @@ | |||
|
|||
#define SHMEM_INTERNAL_INCLUDE | |||
#include "shmem.h" | |||
#include "shmemx.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor - I don't believe this is needed, it's in shmem_internal.h
.
|
||
/* initialize target buffer. The put | ||
will flush any atomic cache value that may currently | ||
exist. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor - this is slightly out-of-place (narrow) comment style here.
|
||
/* initialize target buffer. The put | ||
will flush any atomic cache value that may currently | ||
exist. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor - slightly narrow comment style.
case AUTO: | ||
shmem_internal_scan_linear(target, source, count, type_size, | ||
PE_start, PE_stride, PE_size, | ||
pWrk, pSync, op, datatype, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor style thing - SOS tends to align with the first argument's column, not to suggest that it's perfect everywhere ;) (see op_to_all
above and collect_linear
).
@@ -28,6 +28,7 @@ include(shmem_bind_c.m4)dnl | |||
|
|||
#define SHMEM_INTERNAL_INCLUDE | |||
#include "shmem.h" | |||
#include "shmemx.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor - I don't believe this is needed, it's in shmem_internal.h
.
No description provided.