Skip to content

Commit

Permalink
Fix MPI rank naming to be consistent in slides
Browse files Browse the repository at this point in the history
  • Loading branch information
leopekkas committed Jul 28, 2023
1 parent 7ee4bc2 commit c8b7af0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions mpi/docs/06-user-defined-communicators.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```
Expand Down Expand Up @@ -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);
```
Expand Down
6 changes: 2 additions & 4 deletions mpi/docs/09-user-defined-datatypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ call mpi_type_free(rowtype, ierr)
</div>
<div class=column>
```c
if (myid == 0)
if (rank == 0)
MPI_Type_vector(n, 1, 2, MPI_FLOAT,
&newtype)
...
Expand All @@ -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,
Expand Down Expand Up @@ -550,5 +550,3 @@ MPI_Type_free(&sub_type);
<div class=column>
![](img/type_array.png){.center width=100%}
</div>


0 comments on commit c8b7af0

Please sign in to comment.