From 313ea7af199eb4a9bcbde947599e676b31b457c4 Mon Sep 17 00:00:00 2001 From: "David M. Ozog" Date: Fri, 10 Apr 2020 16:38:05 -0400 Subject: [PATCH] Make example helper functions static Also fixing examples that use C/C++ interfaces, but say they use C11. Signed-off-by: David M. Ozog --- content/shmem_team_create_ctx.tex | 2 +- content/shmem_team_split_2d.tex | 2 +- example_code/shmem_team_split_2D.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/shmem_team_create_ctx.tex b/content/shmem_team_create_ctx.tex index 7ebc49c69..8fea8d795 100644 --- a/content/shmem_team_create_ctx.tex +++ b/content/shmem_team_create_ctx.tex @@ -61,7 +61,7 @@ \begin{apiexamples} \apicexample {The following example demonstrates the use of contexts for multiple teams in a - \Cstd[11] program. This example shows contexts being used to communicate within + \CorCpp program. This example shows contexts being used to communicate within a team using team \ac{PE} numbers, and across teams using translated \ac{PE} numbers.} {./example_code/shmem_team_context.c} {} diff --git a/content/shmem_team_split_2d.tex b/content/shmem_team_split_2d.tex index da7bf59f6..3bc7ecb37 100644 --- a/content/shmem_team_split_2d.tex +++ b/content/shmem_team_split_2d.tex @@ -147,7 +147,7 @@ \apicexample {The following example demonstrates the use of 2D Cartesian split in a - \Cstd[11] program. This example shows how multiple 2D splits can be used + \CorCpp program. This example shows how multiple 2D splits can be used to generate a 3D Cartesian split.} {./example_code/shmem_team_split_2D.c} { diff --git a/example_code/shmem_team_split_2D.c b/example_code/shmem_team_split_2D.c index f1bedf420..840a23862 100644 --- a/example_code/shmem_team_split_2D.c +++ b/example_code/shmem_team_split_2D.c @@ -3,7 +3,7 @@ #include /* Find x and y such that x * y == npes and abs(x - y) is minimized. */ -void find_xy_dims(int npes, int *x, int *y) { +static void find_xy_dims(int npes, int *x, int *y) { for(int divider = ceil(sqrt(npes)); divider >= 1; divider--) if (npes % divider == 0) { *x = divider; @@ -14,7 +14,7 @@ void find_xy_dims(int npes, int *x, int *y) { /* Find x, y, and z such that x * y * z == npes and * abs(x - y) + abs(x - z) + abs(y - z) is minimized. */ -void find_xyz_dims(int npes, int *x, int *y, int *z) { +static void find_xyz_dims(int npes, int *x, int *y, int *z) { for(int divider = ceil(cbrt(npes)); divider >= 1; divider--) if (npes % divider == 0) { *x = divider;