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

Make teams example helper functions static #19

Merged
merged 1 commit into from
Apr 13, 2020
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
2 changes: 1 addition & 1 deletion content/shmem_team_create_ctx.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
jdinan marked this conversation as resolved.
Show resolved Hide resolved
a team using team \ac{PE} numbers, and across teams using translated \ac{PE} numbers.}
{./example_code/shmem_team_context.c}
{}
Expand Down
2 changes: 1 addition & 1 deletion content/shmem_team_split_2d.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
{
Expand Down
4 changes: 2 additions & 2 deletions example_code/shmem_team_split_2D.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <math.h>

/* 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;
Expand All @@ -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;
Expand Down