Skip to content

Commit 8cb9c9b

Browse files
committed
addressed review comments (docs, formatting)
1 parent cd85636 commit 8cb9c9b

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

mlir/include/mlir/Conversion/MeshToMPI/MeshToMPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- MeshToMPI.h - Convert Mesh to MPI dialect --*- C++ -*-===//
1+
//===- MeshToMPI.h - Convert Mesh to MPI dialect ----------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

mlir/include/mlir/Conversion/Passes.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ def ConvertMeshToMPIPass : Pass<"convert-mesh-to-mpi"> {
886886
let summary = "Convert Mesh dialect to MPI dialect.";
887887
let description = [{
888888
This pass converts communication operations
889-
from the Mesh dialect to operations from the MPI dialect.
889+
from the Mesh dialect to the MPI dialect.
890890
}];
891891
let dependentDialects = [
892892
"memref::MemRefDialect",

mlir/include/mlir/Dialect/Mesh/IR/MeshOps.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def Mesh_NeighborsLinearIndicesOp : Mesh_Op<"neighbors_linear_indices", [
162162
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>
163163
]> {
164164
let summary =
165-
"For given split axes get the linear index the direct neighbor processes.";
165+
"For given split axes get the linear indices of the direct neighbor processes.";
166166
let description = [{
167167
Example:
168168
```
@@ -172,8 +172,8 @@ def Mesh_NeighborsLinearIndicesOp : Mesh_Op<"neighbors_linear_indices", [
172172
Given `@mesh` with shape `(10, 20, 30)`,
173173
`device` = `(1, 2, 3)`
174174
`$split_axes` = `[1]`
175-
it returns the linear indices of the processes at positions `(1, 1, 3)`: `633`
176-
and `(1, 3, 3)`: `693`.
175+
returns two indices, `633` and `693`, which correspond to the index of the previous
176+
process `(1, 1, 3)`, and the next process `(1, 3, 3) along the split axis `1`.
177177

178178
A negative value is returned if `$device` has no neighbor in the given
179179
direction along the given `split_axes`.

mlir/lib/Conversion/MeshToMPI/MeshToMPI.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ struct ConvertUpdateHaloOp
4545
mlir::LogicalResult
4646
matchAndRewrite(mlir::mesh::UpdateHaloOp op,
4747
mlir::PatternRewriter &rewriter) const override {
48+
// The input/output memref is assumed to be in C memory order.
4849
// Halos are exchanged as 2 blocks per dimension (one for each side: down
49-
// and up). It is assumed that the last dim in a default memref is
50-
// contiguous, hence iteration starts with the complete halo on the first
51-
// dim which should be contiguous (unless the source is not). The size of
52-
// the exchanged data will decrease when iterating over dimensions. That's
53-
// good because the halos of last dim will be most fragmented.
50+
// and up). For each haloed dimension `d`, the exchanged blocks are
51+
// expressed as multi-dimensional subviews. The subviews include potential
52+
// halos of higher dimensions `dh > d`, no halos for the lower dimensions
53+
// `dl < d` and for dimension `d` the currently exchanged halo only.
54+
// By iterating form higher to lower dimensions this also updates the halos
55+
// in the 'corners'.
5456
// memref.subview is used to read and write the halo data from and to the
55-
// local data. subviews and halos have dynamic and static values, so
56-
// OpFoldResults are used whenever possible.
57+
// local data. Because subviews and halos can have mixed dynamic and static
58+
// shapes, OpFoldResults are used whenever possible.
5759

5860
SymbolTableCollection symbolTableCollection;
5961
auto loc = op.getLoc();

0 commit comments

Comments
 (0)