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

Add error checking for objects on external heap #1116

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions src/collectives_c.c4
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ shmem_team_sync(shmem_team_t team)
SHMEM_ERR_CHECK_SYMMETRIC(pSync, sizeof(long) * \
SHMEM_REDUCE_SYNC_SIZE); \
SHMEM_ERR_CHECK_OVERLAP(target, source, sizeof(TYPE)*nreduce, \
sizeof(TYPE)*nreduce, 1); \
sizeof(TYPE)*nreduce, 1, 1); \
\
shmem_internal_op_to_all(target, source, nreduce, sizeof(TYPE), \
PE_start, 1 << logPE_stride, PE_size, \
Expand All @@ -244,7 +244,7 @@ shmem_team_sync(shmem_team_t team)
SHMEM_ERR_CHECK_SYMMETRIC(dest, sizeof(TYPE)*nreduce); \
SHMEM_ERR_CHECK_SYMMETRIC(source, sizeof(TYPE)*nreduce); \
SHMEM_ERR_CHECK_OVERLAP(dest, source, sizeof(TYPE)*nreduce, \
sizeof(TYPE)*nreduce, 1); \
sizeof(TYPE)*nreduce, 1, 1); \
TYPE *pWrk = NULL; \
\
shmem_internal_team_t *myteam = (shmem_internal_team_t *)team; \
Expand Down Expand Up @@ -290,7 +290,7 @@ shmem_broadcast32(void *target, const void *source, size_t nlong,
SHMEM_ERR_CHECK_SYMMETRIC(target, nlong * 4);
SHMEM_ERR_CHECK_SYMMETRIC(source, nlong * 4);
SHMEM_ERR_CHECK_SYMMETRIC(pSync, sizeof(long)*SHMEM_BCAST_SYNC_SIZE);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 4, nlong * 4, 1);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 4, nlong * 4, 1, 1);

shmem_internal_bcast(target, source, nlong * 4,
PE_root, PE_start, 1 << logPE_stride, PE_size,
Expand All @@ -309,7 +309,7 @@ shmem_broadcast64(void *target, const void *source, size_t nlong,
SHMEM_ERR_CHECK_SYMMETRIC(target, nlong * 8);
SHMEM_ERR_CHECK_SYMMETRIC(source, nlong * 8);
SHMEM_ERR_CHECK_SYMMETRIC(pSync, sizeof(long)*SHMEM_BCAST_SYNC_SIZE);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 8, nlong * 8, 1);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 8, nlong * 8, 1, 1);

shmem_internal_bcast(target, source, nlong * 8,
PE_root, PE_start, 1 << logPE_stride, PE_size,
Expand All @@ -325,7 +325,7 @@ shmem_broadcastmem(shmem_team_t team, void *dest, const void *source,
SHMEM_ERR_CHECK_TEAM_VALID(team);
SHMEM_ERR_CHECK_SYMMETRIC(dest, nelems);
SHMEM_ERR_CHECK_SYMMETRIC(source, nelems);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems, nelems, 1);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems, nelems, 1, 1);

shmem_internal_team_t *myteam = (shmem_internal_team_t *)team;
long *psync = shmem_internal_team_choose_psync(myteam, BCAST);
Expand All @@ -351,7 +351,7 @@ shmem_broadcastmem(shmem_team_t team, void *dest, const void *source,
SHMEM_ERR_CHECK_SYMMETRIC(dest, nelems * sizeof(TYPE)); \
SHMEM_ERR_CHECK_SYMMETRIC(source, nelems * sizeof(TYPE)); \
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems * sizeof(TYPE), \
nelems * sizeof(TYPE), 1); \
nelems * sizeof(TYPE), 1, 1); \
\
shmem_internal_team_t *myteam = (shmem_internal_team_t *)team; \
long *psync = shmem_internal_team_choose_psync(myteam, BCAST); \
Expand All @@ -378,7 +378,7 @@ shmem_collect32(void *target, const void *source, size_t nlong,
SHMEM_ERR_CHECK_SYMMETRIC(target, nlong * 4);
SHMEM_ERR_CHECK_SYMMETRIC(source, nlong * 4);
SHMEM_ERR_CHECK_SYMMETRIC(pSync, sizeof(long) * SHMEM_COLLECT_SYNC_SIZE);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 4, nlong * 4, 1);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 4, nlong * 4, 1, 1);

shmem_internal_collect(target, source, nlong * 4,
PE_start, 1 << logPE_stride, PE_size, pSync);
Expand All @@ -394,7 +394,7 @@ shmem_collect64(void *target, const void *source, size_t nlong,
SHMEM_ERR_CHECK_SYMMETRIC(target, nlong * 8);
SHMEM_ERR_CHECK_SYMMETRIC(source, nlong * 8);
SHMEM_ERR_CHECK_SYMMETRIC(pSync, sizeof(long) * SHMEM_COLLECT_SYNC_SIZE);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 8, nlong * 8, 1);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 8, nlong * 8, 1, 1);

shmem_internal_collect(target, source, nlong * 8,
PE_start, 1 << logPE_stride, PE_size, pSync);
Expand All @@ -410,7 +410,7 @@ shmem_collect64(void *target, const void *source, size_t nlong,
SHMEM_ERR_CHECK_SYMMETRIC(dest, nelems * sizeof(TYPE)); \
SHMEM_ERR_CHECK_SYMMETRIC(source, nelems * sizeof(TYPE)); \
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems * sizeof(TYPE), \
nelems * sizeof(TYPE), 1); \
nelems * sizeof(TYPE), 1, 1); \
\
shmem_internal_team_t *myteam = (shmem_internal_team_t *)team; \
long *psync = shmem_internal_team_choose_psync(myteam, \
Expand All @@ -432,7 +432,7 @@ shmem_collectmem(shmem_team_t team, void *dest, const void *source,
SHMEM_ERR_CHECK_TEAM_VALID(team);
SHMEM_ERR_CHECK_SYMMETRIC(dest, nelems);
SHMEM_ERR_CHECK_SYMMETRIC(source, nelems);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems, nelems, 1);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems, nelems, 1, 1);

shmem_internal_team_t *myteam = (shmem_internal_team_t *)team;
long *psync = shmem_internal_team_choose_psync(myteam, COLLECT);
Expand All @@ -451,7 +451,7 @@ shmem_fcollect32(void *target, const void *source, size_t nlong,
SHMEM_ERR_CHECK_SYMMETRIC(target, nlong * 4);
SHMEM_ERR_CHECK_SYMMETRIC(source, nlong * 4);
SHMEM_ERR_CHECK_SYMMETRIC(pSync, sizeof(long) * SHMEM_COLLECT_SYNC_SIZE);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 4, nlong * 4, 1);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 4, nlong * 4, 1, 1);

shmem_internal_fcollect(target, source, nlong * 4,
PE_start, 1 << logPE_stride, PE_size, pSync);
Expand All @@ -467,7 +467,7 @@ shmem_fcollect64(void *target, const void *source, size_t nlong,
SHMEM_ERR_CHECK_SYMMETRIC(target, nlong * 8);
SHMEM_ERR_CHECK_SYMMETRIC(source, nlong * 8);
SHMEM_ERR_CHECK_SYMMETRIC(pSync, sizeof(long) * SHMEM_COLLECT_SYNC_SIZE);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 8, nlong * 8, 1);
SHMEM_ERR_CHECK_OVERLAP(target, source, nlong * 8, nlong * 8, 1, 1);

shmem_internal_fcollect(target, source, nlong * 8,
PE_start, 1 << logPE_stride, PE_size, pSync);
Expand All @@ -483,7 +483,7 @@ shmem_fcollect64(void *target, const void *source, size_t nlong,
SHMEM_ERR_CHECK_SYMMETRIC(dest, nelems * sizeof(TYPE)); \
SHMEM_ERR_CHECK_SYMMETRIC(source, nelems * sizeof(TYPE)); \
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems * sizeof(TYPE), \
nelems * sizeof(TYPE), 1); \
nelems * sizeof(TYPE), 1, 1); \
\
shmem_internal_team_t *myteam = (shmem_internal_team_t *)team; \
long *psync = shmem_internal_team_choose_psync(myteam, \
Expand All @@ -505,7 +505,7 @@ shmem_fcollectmem(shmem_team_t team, void *dest, const void *source,
SHMEM_ERR_CHECK_TEAM_VALID(team);
SHMEM_ERR_CHECK_SYMMETRIC(dest, nelems);
SHMEM_ERR_CHECK_SYMMETRIC(source, nelems);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems, nelems, 1);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems, nelems, 1, 1);

shmem_internal_team_t *myteam = (shmem_internal_team_t *)team;
long *psync = shmem_internal_team_choose_psync(myteam, COLLECT);
Expand All @@ -524,7 +524,7 @@ shmem_alltoall32(void *dest, const void *source, size_t nelems, int PE_start,
SHMEM_ERR_CHECK_SYMMETRIC(dest, nelems * 4);
SHMEM_ERR_CHECK_SYMMETRIC(source, nelems * 4);
SHMEM_ERR_CHECK_SYMMETRIC(pSync, sizeof(long) * SHMEM_ALLTOALL_SYNC_SIZE);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems * 4, nelems * 4, 1);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems * 4, nelems * 4, 1, 1);

shmem_internal_alltoall(dest, source, nelems * 4,
PE_start, 1 << logPE_stride, PE_size, pSync);
Expand All @@ -540,7 +540,7 @@ shmem_alltoall64(void *dest, const void *source, size_t nelems, int PE_start,
SHMEM_ERR_CHECK_SYMMETRIC(dest, nelems * 8);
SHMEM_ERR_CHECK_SYMMETRIC(source, nelems * 8);
SHMEM_ERR_CHECK_SYMMETRIC(pSync, sizeof(long) * SHMEM_ALLTOALL_SYNC_SIZE);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems * 8, nelems * 8, 1);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems * 8, nelems * 8, 1, 1);

shmem_internal_alltoall(dest, source, nelems * 8,
PE_start, 1 << logPE_stride, PE_size, pSync);
Expand All @@ -556,7 +556,7 @@ shmem_alltoall64(void *dest, const void *source, size_t nelems, int PE_start,
SHMEM_ERR_CHECK_SYMMETRIC(dest, nelems * sizeof(TYPE)); \
SHMEM_ERR_CHECK_SYMMETRIC(source, nelems * sizeof(TYPE)); \
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems * sizeof(TYPE), \
nelems * sizeof(TYPE), 1); \
nelems * sizeof(TYPE), 1, 1); \
\
shmem_internal_team_t *myteam = (shmem_internal_team_t *)team; \
long *psync = shmem_internal_team_choose_psync(myteam, \
Expand All @@ -578,7 +578,7 @@ shmem_alltoallmem(shmem_team_t team, void *dest, const void *source,
SHMEM_ERR_CHECK_TEAM_VALID(team);
SHMEM_ERR_CHECK_SYMMETRIC(dest, nelems);
SHMEM_ERR_CHECK_SYMMETRIC(source, nelems);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems, nelems, 1);
SHMEM_ERR_CHECK_OVERLAP(dest, source, nelems, nelems, 1, 1);

shmem_internal_team_t *myteam = (shmem_internal_team_t *)team;
long *psync = shmem_internal_team_choose_psync(myteam, ALLTOALL);
Expand Down
Loading
Loading