Skip to content

Commit c8cce70

Browse files
committed
OSHMEM/MCA/SPML/UCX: removed config leak, fixed start calculation, removed (start < size) requirement
Signed-off-by: Roie Danino <[email protected]>
1 parent a6babaf commit c8cce70

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,14 +1789,14 @@ int mca_spml_ucx_team_get_config(shmem_team_t team, long config_mask,
17891789
}
17901790

17911791
static inline int mca_spml_ucx_is_pe_in_strided_team(int src_pe, int start,
1792-
int stride, int size)
1792+
int stride, int size)
17931793
{
17941794
return (src_pe >= start) && (src_pe < start + size * stride)
17951795
&& ((src_pe - start) % stride == 0);
17961796
}
17971797

17981798
int mca_spml_ucx_team_translate_pe(shmem_team_t src_team, int src_pe,
1799-
shmem_team_t dest_team)
1799+
shmem_team_t dest_team)
18001800
{
18011801
mca_spml_ucx_team_t *ucx_src_team = (mca_spml_ucx_team_t*) src_team;
18021802
mca_spml_ucx_team_t *ucx_dest_team = (mca_spml_ucx_team_t*) dest_team;
@@ -1831,7 +1831,8 @@ int mca_spml_ucx_team_split_strided(shmem_team_t parent_team, int start, int
18311831
int parent_stride;
18321832
int my_pe;
18331833

1834-
SPML_UCX_ASSERT(((start + size * stride) <= oshmem_num_procs()) && (start < size) && (stride > 0) && (size > 0));
1834+
SPML_UCX_ASSERT(((start + size * stride) <= oshmem_num_procs()) &&
1835+
(stride > 0) && (size > 0));
18351836

18361837
if (parent_team == SHMEM_TEAM_WORLD) {
18371838
parent_pe = shmem_my_pe();
@@ -1855,7 +1856,7 @@ int mca_spml_ucx_team_split_strided(shmem_team_t parent_team, int start, int
18551856
/* In order to simplify pe translations start and stride are calculated with respect to
18561857
* world_team */
18571858
ucx_new_team = (mca_spml_ucx_team_t *)malloc(sizeof(mca_spml_ucx_team_t));
1858-
ucx_new_team->start = parent_start + start;
1859+
ucx_new_team->start = parent_start + (start * parent_stride);
18591860
ucx_new_team->stride = parent_stride * stride;
18601861

18611862
ucx_new_team->n_pes = size;
@@ -1867,7 +1868,6 @@ int mca_spml_ucx_team_split_strided(shmem_team_t parent_team, int start, int
18671868
memcpy(&ucx_new_team->config->super, config, sizeof(shmem_team_config_t));
18681869
}
18691870

1870-
ucx_new_team->config = (mca_spml_ucx_team_config_t*)config;
18711871
ucx_new_team->parent_team = (mca_spml_ucx_team_t*)parent_team;
18721872

18731873
*new_team = (shmem_team_t)ucx_new_team;

0 commit comments

Comments
 (0)