From 3b1cbb37054421babe9cc1589753b4ac680bf290 Mon Sep 17 00:00:00 2001 From: maawad Date: Thu, 29 Aug 2024 12:02:29 -0700 Subject: [PATCH 1/8] Fix `shmem_team_split_strided`'s `start` argument wording for non-positive value. --- content/shmem_team_split_strided.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/shmem_team_split_strided.tex b/content/shmem_team_split_strided.tex index 08969792..9232962e 100644 --- a/content/shmem_team_split_strided.tex +++ b/content/shmem_team_split_strided.tex @@ -13,8 +13,7 @@ \begin{apiarguments} \apiargument{IN}{parent\_team}{An \openshmem team.} -\apiargument{IN}{start}{The lowest \ac{PE} number of the subset of \acp{PE} from -the parent team that will form the new team.} +\apiargument{IN}{start}{The first \acs{PE} number of the subset of \acp{PE} from the parent team that will form the new team. If the stride is less than zero, the first \acs{PE} number is the highest; if greater than zero, it is the lowest; if the stride is zero, it is the starting \acs{PE}.} \apiargument{IN}{stride}{The stride between team \ac{PE} numbers in the parent team that comprise the subset of \acp{PE} that will form From 1aa5958d1ff6127224a5ebffeb531ac0463b2434 Mon Sep 17 00:00:00 2001 From: David Ozog Date: Thu, 29 Aug 2024 15:19:15 -0400 Subject: [PATCH 2/8] teams: split does not permit parent PE wrap-around --- content/shmem_team_split_strided.tex | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/content/shmem_team_split_strided.tex b/content/shmem_team_split_strided.tex index 08969792..18671d56 100644 --- a/content/shmem_team_split_strided.tex +++ b/content/shmem_team_split_strided.tex @@ -13,7 +13,7 @@ \begin{apiarguments} \apiargument{IN}{parent\_team}{An \openshmem team.} -\apiargument{IN}{start}{The lowest \ac{PE} number of the subset of \acp{PE} from +\apiargument{IN}{start}{The first \ac{PE} number of the subset of \acp{PE} from the parent team that will form the new team.} \apiargument{IN}{stride}{The stride between team \ac{PE} @@ -59,6 +59,17 @@ relative order with respect to the parent team. If a $stride$ value equal to 0 is passed to \FUNC{shmem\_team\_split\_strided}, then the $size$ argument passed must be 1, or the behavior is undefined. +A newly created team must only include \acp{PE} whose subsequent parent \ac{PE} +values are either all increasing (for positive $stride$) or all decreasing +(for negative $stride$). +That is, \textit{wrap-around} with respect to the parent team's \ac{PE} values +is not permitted. +For example, the list of \acp{PE} in the parent team should not start at a high +number and then continue to include \acp{PE} in the lower end of the parent +team's \ac{PE} range. +If the triplet provided to \FUNC{shmem\_team\_split\_strided} implies such a +wrap-around sequence, the input is considered invalid and the behavior is +undefined. This routine must be called by all \acp{PE} in the parent team. All \acp{PE} must provide the same values for the \ac{PE} triplet. From a0911b0167e9b32dc2ad9fb53f4d9c309adc37da Mon Sep 17 00:00:00 2001 From: David Ozog Date: Thu, 29 Aug 2024 15:19:15 -0400 Subject: [PATCH 3/8] teams: split does not permit parent PE wrap-around --- content/shmem_team_split_strided.tex | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/shmem_team_split_strided.tex b/content/shmem_team_split_strided.tex index 08969792..c147c447 100644 --- a/content/shmem_team_split_strided.tex +++ b/content/shmem_team_split_strided.tex @@ -59,6 +59,17 @@ relative order with respect to the parent team. If a $stride$ value equal to 0 is passed to \FUNC{shmem\_team\_split\_strided}, then the $size$ argument passed must be 1, or the behavior is undefined. +A newly created team must only include \acp{PE} whose subsequent parent \ac{PE} +values are either all increasing (for positive $stride$) or all decreasing +(for negative $stride$). +That is, \textit{wrap-around} with respect to the parent team's \ac{PE} values +is not permitted. +For example, the list of \acp{PE} in the parent team should not start at a high +number and then continue to include \acp{PE} in the lower end of the parent +team's \ac{PE} range. +If the triplet provided to \FUNC{shmem\_team\_split\_strided} implies such a +wrap-around sequence, the input is considered invalid and the behavior is +undefined. This routine must be called by all \acp{PE} in the parent team. All \acp{PE} must provide the same values for the \ac{PE} triplet. From 5ba6559e10bd160c3648e0ec501b7a4ed59d9bba Mon Sep 17 00:00:00 2001 From: David Ozog Date: Thu, 29 Aug 2024 16:48:45 -0400 Subject: [PATCH 4/8] Update content/shmem_team_split_strided.tex Co-authored-by: Muhammad Awad --- content/shmem_team_split_strided.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_team_split_strided.tex b/content/shmem_team_split_strided.tex index c147c447..e475290c 100644 --- a/content/shmem_team_split_strided.tex +++ b/content/shmem_team_split_strided.tex @@ -59,7 +59,7 @@ relative order with respect to the parent team. If a $stride$ value equal to 0 is passed to \FUNC{shmem\_team\_split\_strided}, then the $size$ argument passed must be 1, or the behavior is undefined. -A newly created team must only include \acp{PE} whose subsequent parent \ac{PE} +When $stride$ is nonzero, a newly created team must only include \acp{PE} whose subsequent parent \ac{PE} values are either all increasing (for positive $stride$) or all decreasing (for negative $stride$). That is, \textit{wrap-around} with respect to the parent team's \ac{PE} values From 7e0191cb8f8d7684810d4027709d5508f4e479c7 Mon Sep 17 00:00:00 2001 From: David Ozog Date: Fri, 30 Aug 2024 12:49:31 -0400 Subject: [PATCH 5/8] teams: improve the explanation of no wrap-arounds --- content/shmem_team_split_strided.tex | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/content/shmem_team_split_strided.tex b/content/shmem_team_split_strided.tex index c2f3523f..d282b955 100644 --- a/content/shmem_team_split_strided.tex +++ b/content/shmem_team_split_strided.tex @@ -59,17 +59,18 @@ relative order with respect to the parent team. If a $stride$ value equal to 0 is passed to \FUNC{shmem\_team\_split\_strided}, then the $size$ argument passed must be 1, or the behavior is undefined. -When $stride$ is nonzero, a newly created team must only include \acp{PE} whose subsequent parent \ac{PE} -values are either all increasing (for positive $stride$) or all decreasing -(for negative $stride$). +If the triplet provided to \FUNC{shmem\_team\_split\_strided} implies a +wrap-around sequence, the input is considered invalid and the behavior is +undefined. +In other words, when $stride$ is nonzero, a newly created team must only +include \acp{PE} whose subsequent parent \ac{PE} values are either all +increasing (for positive $stride$) or all decreasing (for negative +$stride$). That is, \textit{wrap-around} with respect to the parent team's \ac{PE} values is not permitted. For example, the list of \acp{PE} in the parent team should not start at a high number and then continue to include \acp{PE} in the lower end of the parent team's \ac{PE} range. -If the triplet provided to \FUNC{shmem\_team\_split\_strided} implies such a -wrap-around sequence, the input is considered invalid and the behavior is -undefined. This routine must be called by all \acp{PE} in the parent team. All \acp{PE} must provide the same values for the \ac{PE} triplet. From 266a8dae29751c117a6db4a849c481065d5f273b Mon Sep 17 00:00:00 2001 From: David Ozog Date: Fri, 30 Aug 2024 12:56:10 -0400 Subject: [PATCH 6/8] teams: revert change to "start" arg description The fix to "start" is covered in a different PR: https://github.com/wokuno/specification/pull/1 --- content/shmem_team_split_strided.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_team_split_strided.tex b/content/shmem_team_split_strided.tex index d282b955..0f247a75 100644 --- a/content/shmem_team_split_strided.tex +++ b/content/shmem_team_split_strided.tex @@ -13,7 +13,7 @@ \begin{apiarguments} \apiargument{IN}{parent\_team}{An \openshmem team.} -\apiargument{IN}{start}{The first \ac{PE} number of the subset of \acp{PE} from +\apiargument{IN}{start}{The lowest \ac{PE} number of the subset of \acp{PE} from the parent team that will form the new team.} \apiargument{IN}{stride}{The stride between team \ac{PE} From 8d87f9d24e549665d141f976d5350eb8a0413cbb Mon Sep 17 00:00:00 2001 From: William Okuno <38401861+wokuno@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:55:26 -0500 Subject: [PATCH 7/8] Updated example 14 for OpenSHMEM 1.5 --- example_code/shmem_ctx.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/example_code/shmem_ctx.c b/example_code/shmem_ctx.c index b122e874..15b3f76b 100644 --- a/example_code/shmem_ctx.c +++ b/example_code/shmem_ctx.c @@ -1,9 +1,6 @@ #include #include -long pwrk[SHMEM_REDUCE_MIN_WRKDATA_SIZE]; -long psync[SHMEM_REDUCE_SYNC_SIZE]; - long task_cntr = 0; /* Next task counter */ long tasks_done = 0; /* Tasks done by this PE */ long total_done = 0; /* Total tasks done by all PEs */ @@ -12,9 +9,6 @@ int main(void) { int tl, i; long ntasks = 1024; /* Total tasks per PE */ - for (i = 0; i < SHMEM_REDUCE_SYNC_SIZE; i++) - psync[i] = SHMEM_SYNC_VALUE; - shmem_init_thread(SHMEM_THREAD_MULTIPLE, &tl); if (tl != SHMEM_THREAD_MULTIPLE) shmem_global_exit(1); @@ -49,7 +43,7 @@ int main(void) { shmem_ctx_destroy(ctx); } - shmem_long_sum_to_all(&total_done, &tasks_done, 1, 0, 0, npes, pwrk, psync); + shmem_long_sum_reduce(SHMEM_TEAM_WORLD, &total_done, &tasks_done, 1); int result = (total_done != ntasks * npes); shmem_finalize(); From 1795f124c8e4ca3bbd34a3cf464840e6624be36f Mon Sep 17 00:00:00 2001 From: Muhammad Awad Date: Fri, 30 Aug 2024 14:25:33 -0700 Subject: [PATCH 8/8] Address review comment --- content/shmem_team_split_strided.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shmem_team_split_strided.tex b/content/shmem_team_split_strided.tex index 9232962e..76fcdca6 100644 --- a/content/shmem_team_split_strided.tex +++ b/content/shmem_team_split_strided.tex @@ -13,7 +13,7 @@ \begin{apiarguments} \apiargument{IN}{parent\_team}{An \openshmem team.} -\apiargument{IN}{start}{The first \acs{PE} number of the subset of \acp{PE} from the parent team that will form the new team. If the stride is less than zero, the first \acs{PE} number is the highest; if greater than zero, it is the lowest; if the stride is zero, it is the starting \acs{PE}.} +\apiargument{IN}{start}{The first \acs{PE} number of the subset of \acp{PE} from the parent team that will form the new team. If the stride is less than zero, the first \acs{PE} number is the highest \acs{PE} of the parent team; if it is greater than zero, it is the lowest; if the stride is zero, it is the starting \acs{PE}.} \apiargument{IN}{stride}{The stride between team \ac{PE} numbers in the parent team that comprise the subset of \acp{PE} that will form