From c8b7af0598be7c4582a895d35c23e5d62f93d64c Mon Sep 17 00:00:00 2001 From: leopekkas Date: Fri, 28 Jul 2023 10:44:39 +0300 Subject: [PATCH] Fix MPI rank naming to be consistent in slides --- mpi/docs/06-user-defined-communicators.md | 6 +++--- mpi/docs/09-user-defined-datatypes.md | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/mpi/docs/06-user-defined-communicators.md b/mpi/docs/06-user-defined-communicators.md index a5ccdbc12..17c5f4788 100644 --- a/mpi/docs/06-user-defined-communicators.md +++ b/mpi/docs/06-user-defined-communicators.md @@ -61,10 +61,10 @@ if (rank%2 == 0) { MPI_Comm_split(MPI_COMM_WORLD, color, rank, &subcomm); -MPI_Comm_rank(subcomm, &mysubid); +MPI_Comm_rank(subcomm, &subrank); printf ("I am rank %d in MPI_COMM_WORLD, but" - "%d in Comm %d.\n", rank, mysubid, + "%d in Comm %d.\n", rank, subrank, color); ``` @@ -100,7 +100,7 @@ if (rank%2 == 0) { } MPI_Comm_split(MPI_COMM_WORLD, color, rank, &subcomm); -MPI_Comm_rank(subcomm, &mysubid); +MPI_Comm_rank(subcomm, &subrank); MPI_Bcast(sendbuf, 8, MPI_INT, 0, subcomm); ``` diff --git a/mpi/docs/09-user-defined-datatypes.md b/mpi/docs/09-user-defined-datatypes.md index 2fe3d56ac..faab6de9e 100644 --- a/mpi/docs/09-user-defined-datatypes.md +++ b/mpi/docs/09-user-defined-datatypes.md @@ -179,7 +179,7 @@ call mpi_type_free(rowtype, ierr)
```c -if (myid == 0) +if (rank == 0) MPI_Type_vector(n, 1, 2, MPI_FLOAT, &newtype) ... @@ -190,7 +190,7 @@ else ``` ```c -if (myid == 0) +if (rank == 0) MPI_Send(A, n, MPI_FLOAT, 1, ...) else MPI_Type_vector(n, 1, 2, MPI_FLOAT, @@ -550,5 +550,3 @@ MPI_Type_free(&sub_type);
![](img/type_array.png){.center width=100%}
- -