-
Notifications
You must be signed in to change notification settings - Fork 903
OSHMEM: v1.3: adds shmem_fetch and shmem_set AMOs #2103
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
OSHMEM: v1.3: adds shmem_fetch and shmem_set AMOs #2103
Conversation
@alex-mikheev Please rebase this to the top of master to fix the Travis failure. Please also set a milestone and appropriate labels. Thanks! |
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 that we should add shmemx_ functions
OSHMEM_DECLSPEC void pshmem_longlong_set(long long*target, long long value, int pe); | ||
OSHMEM_DECLSPEC void pshmemx_int32_set(int32_t *target, int32_t value, int pe); | ||
OSHMEM_DECLSPEC void pshmemx_int64_set(int64_t *target, int64_t value, int pe); | ||
|
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.
@alex-mikheev could you consider following ordering as:
char,short,int,long,long long, float, double, long double to improve readability.
OSHMEM_DECLSPEC void pshmem_int_set(int *target, int value, int pe); | ||
OSHMEM_DECLSPEC void pshmem_long_set(long *target, long value, int pe); | ||
OSHMEM_DECLSPEC void pshmem_longlong_set(long long*target, long long value, int pe); | ||
OSHMEM_DECLSPEC void pshmemx_int32_set(int32_t *target, int32_t value, int pe); |
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.
v1.3 does not have shmex calls for this set of function.
I think shmex_ should be removed.
OSHMEM_DECLSPEC long long pshmem_longlong_fetch(const long long *target, int pe); | ||
OSHMEM_DECLSPEC double pshmem_double_fetch(const double *target, int pe); | ||
OSHMEM_DECLSPEC float pshmem_float_fetch(const float *target, int pe); | ||
OSHMEM_DECLSPEC int32_t pshmemx_int32_fetch(const int32_t *target, int pe); |
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.
v1.3 does not have shmex calls for this set of function.
I think shmex_ should be removed.
OSHMEM_DECLSPEC long pshmem_long_fetch(const long *target, int pe); | ||
OSHMEM_DECLSPEC long long pshmem_longlong_fetch(const long long *target, int pe); | ||
OSHMEM_DECLSPEC double pshmem_double_fetch(const double *target, int pe); | ||
OSHMEM_DECLSPEC float pshmem_float_fetch(const float *target, int pe); |
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.
please change float and double order
OSHMEM_DECLSPEC void shmem_float_set(float *target, float value, int pe); | ||
OSHMEM_DECLSPEC void shmem_int_set(int *target, int value, int pe); | ||
OSHMEM_DECLSPEC void shmem_long_set(long *target, long value, int pe); | ||
OSHMEM_DECLSPEC void shmem_longlong_set(long long*target, long long value, int pe); |
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.
@alex-mikheev could you consider following ordering as:
char,short,int,long,long long, float, double, long double to improve readability.
/* | ||
* These routines perform an atomic fetch operation. | ||
* The fetch and add routines retrieve the value at address target on PE pe. | ||
* The operation must be completed without the possibility of another process |
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.
incorrect description
(void*)target, \ | ||
(void*)&out_value, \ | ||
(const void*)&value, \ | ||
size, \ |
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.
is target
updated with 0
in this call?
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.
zero is added to the target
#pragma weak shmem_longlong_fetch = pshmem_longlong_fetch | ||
#pragma weak shmem_double_fetch = pshmem_double_fetch | ||
#pragma weak shmem_float_fetch = pshmem_float_fetch | ||
#pragma weak shmemx_int32_fetch = pshmemx_int32_fetch |
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.
do we need shmemx_?
shmem/man/man3/shmem_int_set.3 \ | ||
shmem/man/man3/shmem_longlong_set.3 \ | ||
shmem/man/man3/shmem_long_set.3 \ | ||
\ |
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.
@alex-mikheev fix alignment
shmem/man/man3/shmem_int_fetch.3 \ | ||
shmem/man/man3/shmem_long_fetch.3 \ | ||
shmem/man/man3/shmem_longlong_fetch.3 \ | ||
\ | ||
shmem/man/man3/shmem_int_finc.3 \ |
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.
@alex-mikheev fix alignment
@alex-mikheev please ignore |
I added shmemx_ functions because we already have them for atomic swap. So it it reasonable to have such functions for the set and fetch. Or remove them all. |
👍 This looks good. |
Actually we have shmemx_int(32|64) extensions for pretty much everything. If we want to remove them all it should be done in separate PR. Meanwhile it is reasonable that shmem_set/shmem_fetch also have such extenstion. |
The commit adds atomic set and fetch functions as described in oshmem 1.3 spec.
7f1fb96
to
3a03435
Compare
@alex-mikheev I do not know a reason we added shmemx_ functions in previous code. Do you know if there are requests from someone? Personally I prefer to avoid having one w/o any needs. |
i do not remember why it was added |
@igor-ivanov I'm going to merge this. If you guys decide to remove the |
OSHMEM v1.3: c11 generics (DNM before #2103)
The commit adds atomic set and fetch functions as described in
oshmem 1.3 spec.
@igor-ivanov @jladd-mlnx please review