Skip to content

Commit b334664

Browse files
authored
[mlir] Reland "Initial patch to add an MPI dialect" (#81975)
This patch introduces the new MPI dialect into MLIR. The Message Passing Interface (MPI) is a widely-used standard for distributed programs to exchange data. This PR goes together with a talk later at today's LLVM Dev Meeting. This is just a first, small patch to get going and add the necessary base files, so that we can add more operations in further patches. Here's the documentation as generated by `ninja mlir-doc`: # 'mpi' Dialect This dialect models the Message Passing Interface (MPI), version 4.0. It is meant to serve as an interfacing dialect that is targeted by higher-level dialects. The MPI dialect itself can be lowered to multiple MPI implementations and hide differences in ABI. The dialect models the functions of the MPI specification as close to 1:1 as possible while preserving SSA value semantics where it makes sense, and uses `memref` types instead of bare pointers. This dialect is under active development, and while stability is an eventual goal, it is not guaranteed at this juncture. Given the early state, it is recommended to inquire further prior to using this dialect. For an in-depth documentation of the MPI library interface, please refer to official documentation such as the [OpenMPI online documentation](https://www.open-mpi.org/doc/current/). [TOC] ## Operation definition ### `mpi.comm_rank` (mpi::CommRankOp) _Get the current rank, equivalent to `MPI_Comm_rank(MPI_COMM_WORLD, &rank)`_ Syntax: ``` operation ::= `mpi.comm_rank` attr-dict `:` type(results) ``` Communicators other than `MPI_COMM_WORLD` are not supported for now. This operation can optionally return an `!mpi.retval` value that can be used to check for errors. #### Results: | Result | Description | | :----: | ----------- | | `retval` | MPI function call return value | `rank` | 32-bit signless integer ### `mpi.error_class` (mpi::ErrorClassOp) _Get the error class from an error code, equivalent to the `MPI_Error_class` function_ Syntax: ``` operation ::= `mpi.error_class` $val attr-dict `:` type($val) ``` `MPI_Error_class` maps return values from MPI calls to a set of well-known MPI error classes. #### Operands: | Operand | Description | | :-----: | ----------- | | `val` | MPI function call return value #### Results: | Result | Description | | :----: | ----------- | | `errclass` | MPI function call return value ### `mpi.finalize` (mpi::FinalizeOp) _Finalize the MPI library, equivalent to `MPI_Finalize()`_ Syntax: ``` operation ::= `mpi.finalize` attr-dict (`:` type($retval)^)? ``` This function cleans up the MPI state. Afterwards, no MPI methods may be invoked (excpet for MPI_Get_version, MPI_Initialized, and MPI_Finalized). Notably, MPI_Init cannot be called again in the same program. This operation can optionally return an `!mpi.retval` value that can be used to check for errors. #### Results: | Result | Description | | :----: | ----------- | | `retval` | MPI function call return value ### `mpi.init` (mpi::InitOp) _Initialize the MPI library, equivalent to `MPI_Init(NULL, NULL)`_ Syntax: ``` operation ::= `mpi.init` attr-dict (`:` type($retval)^)? ``` This operation must preceed most MPI calls (except for very few exceptions, please consult with the MPI specification on these). Passing &argc, &argv is not supported currently. This operation can optionally return an `!mpi.retval` value that can be used to check for errors. #### Results: | Result | Description | | :----: | ----------- | | `retval` | MPI function call return value ### `mpi.recv` (mpi::RecvOp) _Equivalent to `MPI_Recv(ptr, size, dtype, dest, tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE)`_ Syntax: ``` operation ::= `mpi.recv` `(` $ref `,` $tag `,` $rank `)` attr-dict `:` type($ref) `,` type($tag) `,` type($rank)(`->` type($retval)^)? ``` MPI_Recv performs a blocking receive of `size` elements of type `dtype` from rank `dest`. The `tag` value and communicator enables the library to determine the matching of multiple sends and receives between the same ranks. Communicators other than `MPI_COMM_WORLD` are not supprted for now. The MPI_Status is set to `MPI_STATUS_IGNORE`, as the status object is not yet ported to MLIR. This operation can optionally return an `!mpi.retval` value that can be used to check for errors. #### Operands: | Operand | Description | | :-----: | ----------- | | `ref` | memref of any type values | `tag` | 32-bit signless integer | `rank` | 32-bit signless integer #### Results: | Result | Description | | :----: | ----------- | | `retval` | MPI function call return value ### `mpi.retval_check` (mpi::RetvalCheckOp) _Check an MPI return value against an error class_ Syntax: ``` operation ::= `mpi.retval_check` $val `=` $errclass attr-dict `:` type($res) ``` This operation compares MPI status codes to known error class constants such as `MPI_SUCCESS`, or `MPI_ERR_COMM`. #### Attributes: <table> <tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr> <tr><td><code>errclass</code></td><td>::mlir::mpi::MPI_ErrorClassEnumAttr</td><td><details><summary>MPI error class name</summary>{{% markdown %}}Enum cases: * MPI_SUCCESS (`MPI_SUCCESS`) * MPI_ERR_ACCESS (`MPI_ERR_ACCESS`) * MPI_ERR_AMODE (`MPI_ERR_AMODE`) * MPI_ERR_ARG (`MPI_ERR_ARG`) * MPI_ERR_ASSERT (`MPI_ERR_ASSERT`) * MPI_ERR_BAD_FILE (`MPI_ERR_BAD_FILE`) * MPI_ERR_BASE (`MPI_ERR_BASE`) * MPI_ERR_BUFFER (`MPI_ERR_BUFFER`) * MPI_ERR_COMM (`MPI_ERR_COMM`) * MPI_ERR_CONVERSION (`MPI_ERR_CONVERSION`) * MPI_ERR_COUNT (`MPI_ERR_COUNT`) * MPI_ERR_DIMS (`MPI_ERR_DIMS`) * MPI_ERR_DISP (`MPI_ERR_DISP`) * MPI_ERR_DUP_DATAREP (`MPI_ERR_DUP_DATAREP`) * MPI_ERR_ERRHANDLER (`MPI_ERR_ERRHANDLER`) * MPI_ERR_FILE (`MPI_ERR_FILE`) * MPI_ERR_FILE_EXISTS (`MPI_ERR_FILE_EXISTS`) * MPI_ERR_FILE_IN_USE (`MPI_ERR_FILE_IN_USE`) * MPI_ERR_GROUP (`MPI_ERR_GROUP`) * MPI_ERR_INFO (`MPI_ERR_INFO`) * MPI_ERR_INFO_KEY (`MPI_ERR_INFO_KEY`) * MPI_ERR_INFO_NOKEY (`MPI_ERR_INFO_NOKEY`) * MPI_ERR_INFO_VALUE (`MPI_ERR_INFO_VALUE`) * MPI_ERR_IN_STATUS (`MPI_ERR_IN_STATUS`) * MPI_ERR_INTERN (`MPI_ERR_INTERN`) * MPI_ERR_IO (`MPI_ERR_IO`) * MPI_ERR_KEYVAL (`MPI_ERR_KEYVAL`) * MPI_ERR_LOCKTYPE (`MPI_ERR_LOCKTYPE`) * MPI_ERR_NAME (`MPI_ERR_NAME`) * MPI_ERR_NO_MEM (`MPI_ERR_NO_MEM`) * MPI_ERR_NO_SPACE (`MPI_ERR_NO_SPACE`) * MPI_ERR_NO_SUCH_FILE (`MPI_ERR_NO_SUCH_FILE`) * MPI_ERR_NOT_SAME (`MPI_ERR_NOT_SAME`) * MPI_ERR_OP (`MPI_ERR_OP`) * MPI_ERR_OTHER (`MPI_ERR_OTHER`) * MPI_ERR_PENDING (`MPI_ERR_PENDING`) * MPI_ERR_PORT (`MPI_ERR_PORT`) * MPI_ERR_PROC_ABORTED (`MPI_ERR_PROC_ABORTED`) * MPI_ERR_QUOTA (`MPI_ERR_QUOTA`) * MPI_ERR_RANK (`MPI_ERR_RANK`) * MPI_ERR_READ_ONLY (`MPI_ERR_READ_ONLY`) * MPI_ERR_REQUEST (`MPI_ERR_REQUEST`) * MPI_ERR_RMA_ATTACH (`MPI_ERR_RMA_ATTACH`) * MPI_ERR_RMA_CONFLICT (`MPI_ERR_RMA_CONFLICT`) * MPI_ERR_RMA_FLAVOR (`MPI_ERR_RMA_FLAVOR`) * MPI_ERR_RMA_RANGE (`MPI_ERR_RMA_RANGE`) * MPI_ERR_RMA_SHARED (`MPI_ERR_RMA_SHARED`) * MPI_ERR_RMA_SYNC (`MPI_ERR_RMA_SYNC`) * MPI_ERR_ROOT (`MPI_ERR_ROOT`) * MPI_ERR_SERVICE (`MPI_ERR_SERVICE`) * MPI_ERR_SESSION (`MPI_ERR_SESSION`) * MPI_ERR_SIZE (`MPI_ERR_SIZE`) * MPI_ERR_SPAWN (`MPI_ERR_SPAWN`) * MPI_ERR_TAG (`MPI_ERR_TAG`) * MPI_ERR_TOPOLOGY (`MPI_ERR_TOPOLOGY`) * MPI_ERR_TRUNCATE (`MPI_ERR_TRUNCATE`) * MPI_ERR_TYPE (`MPI_ERR_TYPE`) * MPI_ERR_UNKNOWN (`MPI_ERR_UNKNOWN`) * MPI_ERR_UNSUPPORTED_DATAREP (`MPI_ERR_UNSUPPORTED_DATAREP`) * MPI_ERR_UNSUPPORTED_OPERATION (`MPI_ERR_UNSUPPORTED_OPERATION`) * MPI_ERR_VALUE_TOO_LARGE (`MPI_ERR_VALUE_TOO_LARGE`) * MPI_ERR_WIN (`MPI_ERR_WIN`) * MPI_ERR_LASTCODE (`MPI_ERR_LASTCODE`){{% /markdown %}}</details></td></tr> </table> #### Operands: | Operand | Description | | :-----: | ----------- | | `val` | MPI function call return value #### Results: | Result | Description | | :----: | ----------- | | `res` | 1-bit signless integer ### `mpi.send` (mpi::SendOp) _Equivalent to `MPI_Send(ptr, size, dtype, dest, tag, MPI_COMM_WORLD)`_ Syntax: ``` operation ::= `mpi.send` `(` $ref `,` $tag `,` $rank `)` attr-dict `:` type($ref) `,` type($tag) `,` type($rank)(`->` type($retval)^)? ``` MPI_Send performs a blocking send of `size` elements of type `dtype` to rank `dest`. The `tag` value and communicator enables the library to determine the matching of multiple sends and receives between the same ranks. Communicators other than `MPI_COMM_WORLD` are not supprted for now. This operation can optionally return an `!mpi.retval` value that can be used to check for errors. #### Operands: | Operand | Description | | :-----: | ----------- | | `ref` | memref of any type values | `tag` | 32-bit signless integer | `rank` | 32-bit signless integer #### Results: | Result | Description | | :----: | ----------- | | `retval` | MPI function call return value ## Attribute definition ### MPI_ErrorClassEnumAttr MPI error class name Syntax: ``` #mpi.errclass< ::mlir::mpi::MPI_ErrorClassEnum # value > ``` Enum cases: * MPI_SUCCESS (`MPI_SUCCESS`) * MPI_ERR_ACCESS (`MPI_ERR_ACCESS`) * MPI_ERR_AMODE (`MPI_ERR_AMODE`) * ... *all other MPI error codes* #### Parameters: | Parameter | C++ type | Description | | :-------: | :-------: | ----------- | | value | `::mlir::mpi::MPI_ErrorClassEnum` | an enum of type MPI_ErrorClassEnum | ## Type definition ### RetvalType MPI function call return value Syntax: `!mpi.retval` This type represents a return value from an MPI function vall. This value can be MPI_SUCCESS, MPI_ERR_IN_STATUS, or any error code. This return value can be compared agains the known MPI error classes represented by `#mpi.errclass` using the `mpi.retval_check` operation.
1 parent 10007ee commit b334664

File tree

14 files changed

+639
-0
lines changed

14 files changed

+639
-0
lines changed

mlir/include/mlir/Dialect/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ add_subdirectory(Math)
2121
add_subdirectory(MemRef)
2222
add_subdirectory(Mesh)
2323
add_subdirectory(MLProgram)
24+
add_subdirectory(MPI)
2425
add_subdirectory(NVGPU)
2526
add_subdirectory(OpenACC)
2627
add_subdirectory(OpenACCMPCommon)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_subdirectory(IR)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
add_mlir_dialect(MPI mpi)
2+
add_mlir_doc(MPIOps MPI Dialects/ -gen-dialect-doc)
3+
4+
# Add MPI operations
5+
set(LLVM_TARGET_DEFINITIONS MPIOps.td)
6+
mlir_tablegen(MPIOps.h.inc -gen-op-decls)
7+
mlir_tablegen(MPIOps.cpp.inc -gen-op-defs)
8+
add_public_tablegen_target(MLIRMPIOpsIncGen)
9+
10+
# Add MPI types
11+
set(LLVM_TARGET_DEFINITIONS MPITypes.td)
12+
mlir_tablegen(MPITypesGen.h.inc -gen-typedef-decls)
13+
mlir_tablegen(MPITypesGen.cpp.inc -gen-typedef-defs)
14+
add_public_tablegen_target(MLIRMPITypesIncGen)
15+
16+
# Add MPI attributes
17+
set(LLVM_TARGET_DEFINITIONS MPI.td)
18+
mlir_tablegen(MPIEnums.h.inc -gen-enum-decls)
19+
mlir_tablegen(MPIEnums.cpp.inc -gen-enum-defs)
20+
mlir_tablegen(MPIAttrDefs.h.inc -gen-attrdef-decls)
21+
mlir_tablegen(MPIAttrDefs.cpp.inc -gen-attrdef-defs)
22+
add_public_tablegen_target(MLIRMPIAttrsIncGen)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//===- MPI.h - MPI dialect ----------------------------------------*- C++-*-==//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
#ifndef MLIR_DIALECT_MPI_IR_MPI_H_
9+
#define MLIR_DIALECT_MPI_IR_MPI_H_
10+
11+
#include "mlir/Bytecode/BytecodeOpInterface.h"
12+
#include "mlir/IR/Dialect.h"
13+
#include "mlir/IR/OpDefinition.h"
14+
#include "mlir/IR/OpImplementation.h"
15+
16+
//===----------------------------------------------------------------------===//
17+
// MPIDialect
18+
//===----------------------------------------------------------------------===//
19+
20+
#include "mlir/Dialect/MPI/IR/MPIDialect.h.inc"
21+
22+
#define GET_TYPEDEF_CLASSES
23+
#include "mlir/Dialect/MPI/IR/MPITypesGen.h.inc"
24+
25+
#include "mlir/Dialect/MPI/IR/MPIEnums.h.inc"
26+
27+
#define GET_ATTRDEF_CLASSES
28+
#include "mlir/Dialect/MPI/IR/MPIAttrDefs.h.inc"
29+
30+
#define GET_OP_CLASSES
31+
#include "mlir/Dialect/MPI/IR/MPIOps.h.inc"
32+
33+
#endif // MLIR_DIALECT_MPI_IR_MPI_H_
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
//===- MPI.td - Base defs for mpi dialect ------------------*- tablegen -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef MLIR_DIALECT_MPI_IR_MPI_TD
10+
#define MLIR_DIALECT_MPI_IR_MPI_TD
11+
12+
include "mlir/IR/AttrTypeBase.td"
13+
include "mlir/IR/OpBase.td"
14+
include "mlir/IR/EnumAttr.td"
15+
16+
def MPI_Dialect : Dialect {
17+
let name = "mpi";
18+
let cppNamespace = "::mlir::mpi";
19+
let description = [{
20+
This dialect models the Message Passing Interface (MPI), version
21+
4.0. It is meant to serve as an interfacing dialect that is targeted
22+
by higher-level dialects. The MPI dialect itself can be lowered to
23+
multiple MPI implementations and hide differences in ABI. The dialect
24+
models the functions of the MPI specification as close to 1:1 as possible
25+
while preserving SSA value semantics where it makes sense, and uses
26+
`memref` types instead of bare pointers.
27+
28+
This dialect is under active development, and while stability is an
29+
eventual goal, it is not guaranteed at this juncture. Given the early
30+
state, it is recommended to inquire further prior to using this dialect.
31+
32+
For an in-depth documentation of the MPI library interface, please refer
33+
to official documentation such as the
34+
[OpenMPI online documentation](https://www.open-mpi.org/doc/current/).
35+
}];
36+
37+
let useDefaultAttributePrinterParser = 1;
38+
let useDefaultTypePrinterParser = 1;
39+
}
40+
41+
//===----------------------------------------------------------------------===//
42+
// Error classes enum:
43+
//===----------------------------------------------------------------------===//
44+
45+
def MPI_CodeSuccess : I32EnumAttrCase<"MPI_SUCCESS", 0, "MPI_SUCCESS">;
46+
def MPI_CodeErrAccess : I32EnumAttrCase<"MPI_ERR_ACCESS", 1, "MPI_ERR_ACCESS">;
47+
def MPI_CodeErrAmode : I32EnumAttrCase<"MPI_ERR_AMODE", 2, "MPI_ERR_AMODE">;
48+
def MPI_CodeErrArg : I32EnumAttrCase<"MPI_ERR_ARG", 3, "MPI_ERR_ARG">;
49+
def MPI_CodeErrAssert : I32EnumAttrCase<"MPI_ERR_ASSERT", 4, "MPI_ERR_ASSERT">;
50+
def MPI_CodeErrBadFile
51+
: I32EnumAttrCase<"MPI_ERR_BAD_FILE", 5, "MPI_ERR_BAD_FILE">;
52+
def MPI_CodeErrBase : I32EnumAttrCase<"MPI_ERR_BASE", 6, "MPI_ERR_BASE">;
53+
def MPI_CodeErrBuffer : I32EnumAttrCase<"MPI_ERR_BUFFER", 7, "MPI_ERR_BUFFER">;
54+
def MPI_CodeErrComm : I32EnumAttrCase<"MPI_ERR_COMM", 8, "MPI_ERR_COMM">;
55+
def MPI_CodeErrConversion
56+
: I32EnumAttrCase<"MPI_ERR_CONVERSION", 9, "MPI_ERR_CONVERSION">;
57+
def MPI_CodeErrCount : I32EnumAttrCase<"MPI_ERR_COUNT", 10, "MPI_ERR_COUNT">;
58+
def MPI_CodeErrDims : I32EnumAttrCase<"MPI_ERR_DIMS", 11, "MPI_ERR_DIMS">;
59+
def MPI_CodeErrDisp : I32EnumAttrCase<"MPI_ERR_DISP", 12, "MPI_ERR_DISP">;
60+
def MPI_CodeErrDupDatarep
61+
: I32EnumAttrCase<"MPI_ERR_DUP_DATAREP", 13, "MPI_ERR_DUP_DATAREP">;
62+
def MPI_CodeErrErrhandler
63+
: I32EnumAttrCase<"MPI_ERR_ERRHANDLER", 14, "MPI_ERR_ERRHANDLER">;
64+
def MPI_CodeErrFile : I32EnumAttrCase<"MPI_ERR_FILE", 15, "MPI_ERR_FILE">;
65+
def MPI_CodeErrFileExists
66+
: I32EnumAttrCase<"MPI_ERR_FILE_EXISTS", 16, "MPI_ERR_FILE_EXISTS">;
67+
def MPI_CodeErrFileInUse
68+
: I32EnumAttrCase<"MPI_ERR_FILE_IN_USE", 17, "MPI_ERR_FILE_IN_USE">;
69+
def MPI_CodeErrGroup : I32EnumAttrCase<"MPI_ERR_GROUP", 18, "MPI_ERR_GROUP">;
70+
def MPI_CodeErrInfo : I32EnumAttrCase<"MPI_ERR_INFO", 19, "MPI_ERR_INFO">;
71+
def MPI_CodeErrInfoKey
72+
: I32EnumAttrCase<"MPI_ERR_INFO_KEY", 20, "MPI_ERR_INFO_KEY">;
73+
def MPI_CodeErrInfoNokey
74+
: I32EnumAttrCase<"MPI_ERR_INFO_NOKEY", 21, "MPI_ERR_INFO_NOKEY">;
75+
def MPI_CodeErrInfoValue
76+
: I32EnumAttrCase<"MPI_ERR_INFO_VALUE", 22, "MPI_ERR_INFO_VALUE">;
77+
def MPI_CodeErrInStatus
78+
: I32EnumAttrCase<"MPI_ERR_IN_STATUS", 23, "MPI_ERR_IN_STATUS">;
79+
def MPI_CodeErrIntern : I32EnumAttrCase<"MPI_ERR_INTERN", 24, "MPI_ERR_INTERN">;
80+
def MPI_CodeErrIo : I32EnumAttrCase<"MPI_ERR_IO", 25, "MPI_ERR_IO">;
81+
def MPI_CodeErrKeyval : I32EnumAttrCase<"MPI_ERR_KEYVAL", 26, "MPI_ERR_KEYVAL">;
82+
def MPI_CodeErrLocktype
83+
: I32EnumAttrCase<"MPI_ERR_LOCKTYPE", 27, "MPI_ERR_LOCKTYPE">;
84+
def MPI_CodeErrName : I32EnumAttrCase<"MPI_ERR_NAME", 28, "MPI_ERR_NAME">;
85+
def MPI_CodeErrNoMem : I32EnumAttrCase<"MPI_ERR_NO_MEM", 29, "MPI_ERR_NO_MEM">;
86+
def MPI_CodeErrNoSpace
87+
: I32EnumAttrCase<"MPI_ERR_NO_SPACE", 30, "MPI_ERR_NO_SPACE">;
88+
def MPI_CodeErrNoSuchFile
89+
: I32EnumAttrCase<"MPI_ERR_NO_SUCH_FILE", 31, "MPI_ERR_NO_SUCH_FILE">;
90+
def MPI_CodeErrNotSame
91+
: I32EnumAttrCase<"MPI_ERR_NOT_SAME", 32, "MPI_ERR_NOT_SAME">;
92+
def MPI_CodeErrOp : I32EnumAttrCase<"MPI_ERR_OP", 33, "MPI_ERR_OP">;
93+
def MPI_CodeErrOther : I32EnumAttrCase<"MPI_ERR_OTHER", 34, "MPI_ERR_OTHER">;
94+
def MPI_CodeErrPending
95+
: I32EnumAttrCase<"MPI_ERR_PENDING", 35, "MPI_ERR_PENDING">;
96+
def MPI_CodeErrPort : I32EnumAttrCase<"MPI_ERR_PORT", 36, "MPI_ERR_PORT">;
97+
def MPI_CodeErrProcAborted
98+
: I32EnumAttrCase<"MPI_ERR_PROC_ABORTED", 37, "MPI_ERR_PROC_ABORTED">;
99+
def MPI_CodeErrQuota : I32EnumAttrCase<"MPI_ERR_QUOTA", 38, "MPI_ERR_QUOTA">;
100+
def MPI_CodeErrRank : I32EnumAttrCase<"MPI_ERR_RANK", 39, "MPI_ERR_RANK">;
101+
def MPI_CodeErrReadOnly
102+
: I32EnumAttrCase<"MPI_ERR_READ_ONLY", 40, "MPI_ERR_READ_ONLY">;
103+
def MPI_CodeErrRequest
104+
: I32EnumAttrCase<"MPI_ERR_REQUEST", 41, "MPI_ERR_REQUEST">;
105+
def MPI_CodeErrRmaAttach
106+
: I32EnumAttrCase<"MPI_ERR_RMA_ATTACH", 42, "MPI_ERR_RMA_ATTACH">;
107+
def MPI_CodeErrRmaConflict
108+
: I32EnumAttrCase<"MPI_ERR_RMA_CONFLICT", 43, "MPI_ERR_RMA_CONFLICT">;
109+
def MPI_CodeErrRmaFlavor
110+
: I32EnumAttrCase<"MPI_ERR_RMA_FLAVOR", 44, "MPI_ERR_RMA_FLAVOR">;
111+
def MPI_CodeErrRmaRange
112+
: I32EnumAttrCase<"MPI_ERR_RMA_RANGE", 45, "MPI_ERR_RMA_RANGE">;
113+
def MPI_CodeErrRmaShared
114+
: I32EnumAttrCase<"MPI_ERR_RMA_SHARED", 46, "MPI_ERR_RMA_SHARED">;
115+
def MPI_CodeErrRmaSync
116+
: I32EnumAttrCase<"MPI_ERR_RMA_SYNC", 47, "MPI_ERR_RMA_SYNC">;
117+
def MPI_CodeErrRoot : I32EnumAttrCase<"MPI_ERR_ROOT", 48, "MPI_ERR_ROOT">;
118+
def MPI_CodeErrService
119+
: I32EnumAttrCase<"MPI_ERR_SERVICE", 49, "MPI_ERR_SERVICE">;
120+
def MPI_CodeErrSession
121+
: I32EnumAttrCase<"MPI_ERR_SESSION", 50, "MPI_ERR_SESSION">;
122+
def MPI_CodeErrSize : I32EnumAttrCase<"MPI_ERR_SIZE", 51, "MPI_ERR_SIZE">;
123+
def MPI_CodeErrSpawn : I32EnumAttrCase<"MPI_ERR_SPAWN", 52, "MPI_ERR_SPAWN">;
124+
def MPI_CodeErrTag : I32EnumAttrCase<"MPI_ERR_TAG", 53, "MPI_ERR_TAG">;
125+
def MPI_CodeErrTopology
126+
: I32EnumAttrCase<"MPI_ERR_TOPOLOGY", 54, "MPI_ERR_TOPOLOGY">;
127+
def MPI_CodeErrTruncate
128+
: I32EnumAttrCase<"MPI_ERR_TRUNCATE", 55, "MPI_ERR_TRUNCATE">;
129+
def MPI_CodeErrType : I32EnumAttrCase<"MPI_ERR_TYPE", 56, "MPI_ERR_TYPE">;
130+
def MPI_CodeErrUnknown
131+
: I32EnumAttrCase<"MPI_ERR_UNKNOWN", 57, "MPI_ERR_UNKNOWN">;
132+
def MPI_CodeErrUnsupportedDatarep
133+
: I32EnumAttrCase<"MPI_ERR_UNSUPPORTED_DATAREP", 58,
134+
"MPI_ERR_UNSUPPORTED_DATAREP">;
135+
def MPI_CodeErrUnsupportedOperation
136+
: I32EnumAttrCase<"MPI_ERR_UNSUPPORTED_OPERATION", 59,
137+
"MPI_ERR_UNSUPPORTED_OPERATION">;
138+
def MPI_CodeErrValueTooLarge
139+
: I32EnumAttrCase<"MPI_ERR_VALUE_TOO_LARGE", 60, "MPI_ERR_VALUE_TOO_LARGE">;
140+
def MPI_CodeErrWin : I32EnumAttrCase<"MPI_ERR_WIN", 61, "MPI_ERR_WIN">;
141+
def MPI_CodeErrLastcode
142+
: I32EnumAttrCase<"MPI_ERR_LASTCODE", 62, "MPI_ERR_LASTCODE">;
143+
144+
def MPI_ErrorClassEnum
145+
: I32EnumAttr<"MPI_ErrorClassEnum", "MPI error class name", [
146+
MPI_CodeSuccess,
147+
MPI_CodeErrAccess,
148+
MPI_CodeErrAmode,
149+
MPI_CodeErrArg,
150+
MPI_CodeErrAssert,
151+
MPI_CodeErrBadFile,
152+
MPI_CodeErrBase,
153+
MPI_CodeErrBuffer,
154+
MPI_CodeErrComm,
155+
MPI_CodeErrConversion,
156+
MPI_CodeErrCount,
157+
MPI_CodeErrDims,
158+
MPI_CodeErrDisp,
159+
MPI_CodeErrDupDatarep,
160+
MPI_CodeErrErrhandler,
161+
MPI_CodeErrFile,
162+
MPI_CodeErrFileExists,
163+
MPI_CodeErrFileInUse,
164+
MPI_CodeErrGroup,
165+
MPI_CodeErrInfo,
166+
MPI_CodeErrInfoKey,
167+
MPI_CodeErrInfoNokey,
168+
MPI_CodeErrInfoValue,
169+
MPI_CodeErrInStatus,
170+
MPI_CodeErrIntern,
171+
MPI_CodeErrIo,
172+
MPI_CodeErrKeyval,
173+
MPI_CodeErrLocktype,
174+
MPI_CodeErrName,
175+
MPI_CodeErrNoMem,
176+
MPI_CodeErrNoSpace,
177+
MPI_CodeErrNoSuchFile,
178+
MPI_CodeErrNotSame,
179+
MPI_CodeErrOp,
180+
MPI_CodeErrOther,
181+
MPI_CodeErrPending,
182+
MPI_CodeErrPort,
183+
MPI_CodeErrProcAborted,
184+
MPI_CodeErrQuota,
185+
MPI_CodeErrRank,
186+
MPI_CodeErrReadOnly,
187+
MPI_CodeErrRequest,
188+
MPI_CodeErrRmaAttach,
189+
MPI_CodeErrRmaConflict,
190+
MPI_CodeErrRmaFlavor,
191+
MPI_CodeErrRmaRange,
192+
MPI_CodeErrRmaShared,
193+
MPI_CodeErrRmaSync,
194+
MPI_CodeErrRoot,
195+
MPI_CodeErrService,
196+
MPI_CodeErrSession,
197+
MPI_CodeErrSize,
198+
MPI_CodeErrSpawn,
199+
MPI_CodeErrTag,
200+
MPI_CodeErrTopology,
201+
MPI_CodeErrTruncate,
202+
MPI_CodeErrType,
203+
MPI_CodeErrUnknown,
204+
MPI_CodeErrUnsupportedDatarep,
205+
MPI_CodeErrUnsupportedOperation,
206+
MPI_CodeErrValueTooLarge,
207+
MPI_CodeErrWin,
208+
MPI_CodeErrLastcode
209+
]> {
210+
let genSpecializedAttr = 0;
211+
let cppNamespace = "::mlir::mpi";
212+
}
213+
214+
def MPI_ErrorClassAttr : EnumAttr<MPI_Dialect, MPI_ErrorClassEnum, "errclass"> {
215+
let assemblyFormat = "`<` $value `>`";
216+
}
217+
218+
#endif // MLIR_DIALECT_MPI_IR_MPI_TD

0 commit comments

Comments
 (0)