Skip to content

Commit 623a442

Browse files
committed
another pass on documentation
1 parent 2622d40 commit 623a442

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

mlir/include/mlir/Dialect/MPI/IR/MPIBase.td

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ def MPI_Dialect : Dialect {
1717
let description = [{
1818
This dialect models the Message Passing Interface (MPI), version 4.0. It is meant
1919
to serve as a targetable dialect, that can be lowered to multiple MPI implementations
20-
and hide differences in ABI between these. The dialect models the functions of the MPI
20+
and hide differences in ABI. The dialect models the functions of the MPI
2121
specification as close to 1:1 as possible while preserving SSA value semantics where it
2222
makes sense, and uses `memref` types instead of bare pointers.
2323

2424
This dialect is under active development, and while stability is an
2525
eventual goal, it is not guaranteed at this juncture. Given the early state,
2626
it is recommended to inquire further prior to using this dialect.
27+
28+
The current version of the dialect models a very limited part of the MPI Library,
29+
often simplifying operations. This was a conscious decision that enables us to
30+
incrementally add features as they are needed.
31+
32+
For an in-depth documentation of the MPI library interface, please refer to official documentation
33+
such as the [OpenMPI online documentation](https://www.open-mpi.org/doc/current/).
2734
}];
2835

2936
let usePropertiesForAttributes = 1;

mlir/include/mlir/Dialect/MPI/IR/MPIOps.td

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ def MPI_InitOp : MPI_Op<"init", [
2323
]> {
2424
let summary = "Initialize the MPI library, equivalent to `MPI_Init(NULL, NULL)`";
2525
let description = [{
26+
This operation must preceed most MPI calls (except for very few exceptions,
27+
please consult with the MPI specification on these).
28+
2629
Passing &argc, &argv is not supported currently.
27-
Inspecting the return value (error code) is also not supported.
30+
Inspecting the functions return value (error code) is also not supported.
2831
}];
2932

3033
let assemblyFormat = "attr-dict";
@@ -40,7 +43,7 @@ def MPI_CommRankOp : MPI_Op<"comm_rank", [
4043
let summary = "Get the current rank, equivalent to `MPI_Comm_rank(MPI_COMM_WORLD, &rank)`";
4144
let description = [{
4245
Communicators other than `MPI_COMM_WORLD` are not supprted for now.
43-
Inspecting the return value (error code) is also not supported.
46+
Inspecting the functions return value (error code) is also not supported.
4447
}];
4548

4649
let results = (outs
@@ -60,8 +63,12 @@ def MPI_SendOp : MPI_Op<"send", [
6063
]> {
6164
let summary = "Equivalent to `MPI_Send(ptr, size, dtype, dest, tag, MPI_COMM_WORLD)`";
6265
let description = [{
66+
MPI_Send performs a blocking send of `size` elements of type `dtype` to rank `dest`.
67+
The `tag` value and communicator enables the library to determine the matching of
68+
multiple sends and receives between the same ranks.
69+
6370
Communicators other than `MPI_COMM_WORLD` are not supprted for now.
64-
Inspecting the return value (error code) is also not supported.
71+
Inspecting the functions return value (error code) is also not supported.
6572
}];
6673

6774
let arguments = (ins
@@ -82,9 +89,13 @@ def MPI_RecvOp : MPI_Op<"recv", [
8289
]> {
8390
let summary = "Equivalent to `MPI_Recv(ptr, size, dtype, dest, tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE)`";
8491
let description = [{
92+
MPI_Recv performs a blocking receive of `size` elements of type `dtype` from rank `dest`.
93+
The `tag` value and communicator enables the library to determine the matching of
94+
multiple sends and receives between the same ranks.
95+
8596
Communicators other than `MPI_COMM_WORLD` are not supprted for now.
8697
The MPI_Status is set to `MPI_STATUS_IGNORE`, as the status object is not yet ported to MLIR.
87-
Inspecting the return value (error code) is also not supported.
98+
Inspecting the functions return value (error code) is also not supported.
8899
}];
89100

90101
let arguments = (ins
@@ -105,7 +116,11 @@ def MPI_FinalizeOp : MPI_Op<"finalize", [
105116
]> {
106117
let summary = "Finalize the MPI library, equivalent to `MPI_Finalize()`";
107118
let description = [{
108-
Inspecting the return value (error code) is not supported.
119+
This function cleans up the MPI state. Afterwards, no MPI methods may be invoked
120+
(excpet for MPI_Get_version, MPI_Initialized, and MPI_Finalized).
121+
Notably, MPI_Init cannot be called again in the same program.
122+
123+
Inspecting the functions return value (error code) is not supported.
109124
}];
110125

111126
let assemblyFormat = "attr-dict";

0 commit comments

Comments
 (0)