Skip to content

Commit 23deccf

Browse files
zerothijsquyres
authored andcommitted
doc: lots of code block clarifications
These changes also revealed some typos and we fixed lots of links and codes that were present. Signed-off-by: Nick Papior <nickpapior@gmail.com>
1 parent 87a5e09 commit 23deccf

File tree

87 files changed

+337
-365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+337
-365
lines changed

docs/man-openmpi/man3/MPI_Accumulate.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ The MPI standard prescribes portable Fortran syntax for the
145145
*TARGET_DISP* argument only for Fortran 90. FORTRAN 77 users may use the
146146
non-portable syntax
147147

148-
::
148+
.. code-block:: fortran
149149
150150
INTEGER*MPI_ADDRESS_KIND TARGET_DISP
151151

docs/man-openmpi/man3/MPI_Add_error_class.3.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ MPI_Add_error_class
66

77
.. include_body
88
9-
::
10-
11-
MPI_Add_error_class - Creates a new error class and returns its value
9+
:ref:`MPI_Add_error_class` - Creates a new error class and returns its value
1210

1311

1412
SYNTAX

docs/man-openmpi/man3/MPI_Add_error_string.3.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ MPI_Add_error_string
66

77
.. include_body
88
9-
::
10-
11-
MPI_Add_error_string - Associates a string with an error code or class
9+
:ref:`MPI_Add_error_string` - Associates a string with an error code or class
1210

1311

1412
SYNTAX

docs/man-openmpi/man3/MPI_Address.3.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,24 @@ function. Returns the (byte) address of location.
5555

5656
Example: Using :ref:`MPI_Address` for an array.
5757

58-
::
58+
.. code-block:: fortran
5959
6060
REAL A(100,100)
6161
62-
|
63-
| INTEGER I1, I2, DIFF
64-
| CALL MPI_ADDRESS(A(1,1), I1, IERROR)
65-
| CALL MPI_ADDRESS(A(10,10), I2, IERROR)
66-
| DIFF = I2 - I1
67-
| ! The value of DIFF is 909*sizeofreal; the values of I1 and I2 are
68-
| ! implementation dependent.
62+
INTEGER I1, I2, DIFF
63+
CALL MPI_ADDRESS(A(1,1), I1, IERROR)
64+
CALL MPI_ADDRESS(A(10,10), I2, IERROR)
65+
DIFF = I2 - I1
66+
! The value of DIFF is 909*sizeof(real)
67+
!the values of I1 and I2 are implementation dependent.
6968
7069
7170
NOTES
7271
-----
7372

7473
This routine is provided for both Fortran and C programmers and may be
7574
useful when writing portable code. In the current release, the address
76-
returned by this routine will be the same as that produced by the C &
75+
returned by this routine will be the same as that produced by the C ``&``
7776
operator.
7877

7978
C users may be tempted to avoid using :ref:`MPI_Address` and rely on the

docs/man-openmpi/man3/MPI_Aint_add.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ in the same object referenced by *base*, as described in MPI-3.1 section
7373
correct MPI_Aint representation of the output address, as if the process
7474
that originally produced *base* had called:
7575

76-
::
76+
.. code-block:: c
7777
7878
MPI_Get_address ((char *) base + disp, &result);
7979

docs/man-openmpi/man3/MPI_Allgather.3.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,21 +129,23 @@ any other process.
129129
The outcome of a call to :ref:`MPI_Allgather` is as if all processes
130130
executed n calls to
131131

132-
::
132+
.. code-block:: c
133+
134+
MPI_Gather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
135+
recvtype, root, comm);
133136
134-
MPI_Gather(sendbuf,sendcount,sendtype,recvbuf,recvcount,
135-
recvtype,root,comm),
137+
// for root = 0 , ..., n-1.
136138
137-
for root = 0 , ..., n-1. The rules for correct usage of :ref:`MPI_Allgather`
139+
The rules for correct usage of :ref:`MPI_Allgather`
138140
are easily found from the corresponding rules for :ref:`MPI_Gather`.
139141

140142
**Example:** The all-gather version of Example 1 in :ref:`MPI_Gather`. Using
141143
:ref:`MPI_Allgather`, we will gather 100 ints from every process in the group
142144
to every process.
143145

144-
::
146+
.. code-block:: c
145147
146-
MPI_Comm comm;
148+
MPI_Comm comm;
147149
int gsize,sendarray[100];
148150
int *rbuf;
149151
...
@@ -167,12 +169,12 @@ receive its own contribution to the receive buffer. Specifically, the
167169
outcome of a call to :ref:`MPI_Allgather` that used the in-place option is
168170
identical to the case in which all processes executed *n* calls to
169171

170-
::
172+
.. code-block:: c
171173
172174
MPI_Allgather( MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, recvbuf,
173-
recvcount, recvtype, root, comm )
175+
recvcount, recvtype, root, comm )
174176
175-
for root =0, ... , n-1.
177+
// for root =0, ... , n-1.
176178
177179
Note that MPI_IN_PLACE is a special kind of value; it has the same
178180
restrictions on its use as MPI_BOTTOM.

docs/man-openmpi/man3/MPI_Allgatherv.3.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,14 @@ recvtype at any other process.
134134

135135
The outcome is as if all processes executed calls to
136136

137-
::
137+
.. code-block:: c
138+
139+
MPI_Allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcount,
140+
displs,recvtype,root,comm);
138141
139-
MPI_Allgatherv(sendbuf,sendcount,sendtype,recvbuf,recvcount,
140-
displs,recvtype,root,comm)
142+
// for root = 0 , ..., n-1.
141143
142-
for root = 0 , ..., n-1. The rules for correct usage of :ref:`MPI_Allgatherv`
144+
The rules for correct usage of :ref:`MPI_Allgatherv`
143145
are easily found from the corresponding rules for :ref:`MPI_Gatherv`.
144146

145147

@@ -155,12 +157,12 @@ receive its own contribution to the receive buffer. Specifically, the
155157
outcome of a call to :ref:`MPI_Allgatherv` that used the in-place option is
156158
identical to the case in which all processes executed *n* calls to
157159

158-
::
160+
.. code-block:: c
159161
160162
MPI_Allgatherv ( MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, recvbuf,
161-
recvcounts, displs, recvtype, root, comm )
163+
recvcounts, displs, recvtype, root, comm );
162164
163-
for root =0, ... , n-1.
165+
// for root =0, ... , n-1.
164166
165167
Note that MPI_IN_PLACE is a special kind of value; it has the same
166168
restrictions on its use as MPI_BOTTOM.

docs/man-openmpi/man3/MPI_Allreduce.3.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ of all the group members.
117117
array that are distributed across a group of processes and returns the
118118
answer at all nodes (compare with Example 2, with :ref:`MPI_Reduce`, below).
119119

120-
::
120+
.. code-block:: fortran
121121
122122
SUBROUTINE PAR_BLAS2(m, n, a, b, c, comm)
123123
REAL a(m), b(m,n) ! local slice of array
@@ -143,7 +143,7 @@ answer at all nodes (compare with Example 2, with :ref:`MPI_Reduce`, below).
143143
array that are distributed across a group of processes and returns the
144144
answer at node zero.
145145

146-
::
146+
.. code-block:: fortran
147147
148148
SUBROUTINE PAR_BLAS2(m, n, a, b, c, comm)
149149
REAL a(m), b(m,n) ! local slice of array

docs/man-openmpi/man3/MPI_Alltoallv.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ process performs 2n (n being the number of processes in communicator
145145
*comm*) independent point-to-point communications (including
146146
communication with itself).
147147

148-
::
148+
.. code-block:: c
149149
150150
MPI_Comm_size(comm, &n);
151151
for (i = 0, i < n; i++)

docs/man-openmpi/man3/MPI_Alltoallw.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ where each process performs 2n (n being the number of processes in
148148
communicator *comm) independent point-to-point communications*
149149
(including communication with itself).
150150

151-
::
151+
.. code-block:: c
152152
153153
MPI_Comm_size(comm, &n);
154154
for (i = 0, i < n; i++)

0 commit comments

Comments
 (0)