I am trying to let rank 0 get other rank indexes, but I got different results from `MPI.Irecv!()`

and `MPI.Recv()`

, and result from `MPI.Irecv!()`

seems odd:

```
import MPI
function main()
MPI.Init()
comm = MPI.COMM_WORLD
size = MPI.Comm_size(comm)
rank = MPI.Comm_rank(comm)
if rank==0
buf = 10
mid = [10]
for i in 1:size-1
MPI.Recv!(mid, i, 0, comm)
println("mid: $mid")
buf = mid[1]
println("buf: $buf")
end
else
MPI.Isend([rank], 0, 0, comm)
end
MPI.Finalize()
end
main()
```

Which outputďź

```
mid: [1]
buf: 1
mid: [2]
buf: 2
mid: [3]
buf: 3
```

If I replace ` MPI.Recv!(mid, i, 0, comm)`

by `MPI.Irecv!(mid, i, 0, comm)`

, the output seemed not right:

```
mid: [10]
buf: 10
mid: [10]
buf: 10
mid: [10]
buf: 10
```

So my question is, why `mid`

didnât change when I use ` MPI.Irecv!()`

, and how to get the right rank number with ` MPI.Irecv!()`

?

Thanks for any suggestions and answers!