Skip to content

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

Merged
merged 1 commit into from
Sep 27, 2016

Conversation

alex-mikheev
Copy link
Contributor

The commit adds atomic set and fetch functions as described in
oshmem 1.3 spec.

@igor-ivanov @jladd-mlnx please review

@jsquyres
Copy link
Member

@alex-mikheev Please rebase this to the top of master to fix the Travis failure. Please also set a milestone and appropriate labels. Thanks!

Copy link
Member

@igor-ivanov igor-ivanov left a 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);

Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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
Copy link
Member

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, \
Copy link
Member

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?

Copy link
Contributor Author

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
Copy link
Member

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 \
\
Copy link
Member

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 \
Copy link
Member

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 alex-mikheev added this to the v2.1.0 milestone Sep 22, 2016
@alex-mikheev alex-mikheev self-assigned this Sep 22, 2016
@igor-ivanov
Copy link
Member

@alex-mikheev please ignore I think that we should add shmemx_ functions review general comment. Should be I think that we should not add shmemx_ functions

@alex-mikheev
Copy link
Contributor Author

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.

@jladd-mlnx
Copy link
Member

👍 This looks good.

@alex-mikheev
Copy link
Contributor Author

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.
@igor-ivanov
Copy link
Member

igor-ivanov commented Sep 26, 2016

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

@alex-mikheev
Copy link
Contributor Author

i do not remember why it was added

@jladd-mlnx
Copy link
Member

@igor-ivanov I'm going to merge this. If you guys decide to remove the shmemx_ functions, do it as a separate PR.

@jladd-mlnx jladd-mlnx merged commit 13e53b4 into open-mpi:master Sep 27, 2016
jladd-mlnx added a commit that referenced this pull request Sep 27, 2016
clementFoyer pushed a commit to bosilca/ompi that referenced this pull request Nov 4, 2016
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.

4 participants