Skip to content

Commit

Permalink
teams: allow split stride of zero iff size is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
davidozog committed Jun 17, 2024
1 parent cca11d0 commit d2e38a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/shmem_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ void shmem_internal_bit_to_string(char *str, size_t str_size,
static inline
int shmem_internal_pe_in_active_set(int global_pe, int PE_start, int PE_stride, int PE_size)
{
shmem_internal_assert(PE_stride != 0);
if (PE_size == 1) return PE_start == global_pe ? 0 : -1;
if (PE_stride == 0) return -1;
int n = (global_pe - PE_start) / PE_stride;
if ((global_pe < PE_start && PE_stride > 0) || (global_pe > PE_start && PE_stride < 0) ||
(global_pe - PE_start) % PE_stride || n >= PE_size)
Expand Down
2 changes: 1 addition & 1 deletion src/shmem_team.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ int shmem_internal_team_split_strided(shmem_internal_team_t *parent_team, int PE

if (PE_start < 0 || PE_start >= parent_team->size ||
PE_size <= 0 || PE_size > parent_team->size ||
PE_stride == 0) {
(PE_stride == 0 && PE_size !=1)) {
RAISE_WARN_MSG("Invalid <start, stride, size>: child <%d, %d, %d>, parent <%d, %d, %d>\n",
PE_start, PE_stride, PE_size,
parent_team->start, parent_team->stride, parent_team->size);
Expand Down

0 comments on commit d2e38a9

Please sign in to comment.