https://github.com/JuliaParallel/MPI.jl
Raw File
Tip revision: 69ce0bf5c15e4a29cb4a4c3df3e8d02f3e9ba0ad authored by Simon Byrne on 23 January 2023, 18:49:26 UTC
Tag v0.20.8 (#712)
Tip revision: 69ce0bf
test_cart_get.jl
using Test
using MPI

MPI.Init()

comm = MPI.COMM_WORLD
nnodes = MPI.Comm_size(comm)

# setting
maxdims = 3
periods = Cint[0, 1,      0]
dims    = Cint[1, 1, nnodes]

# create
comm_cart = MPI.Cart_create(comm, dims; periodic=periods, reorder=false)

# check number of dimensions
@test MPI.Cartdim_get(comm_cart) == maxdims

# get info
_dims, _periods, _coords = MPI.Cart_get(comm_cart) 

# test
@test _dims    == dims
@test _periods == periods
@test _coords  == MPI.Cart_coords(comm_cart)

MPI.Finalize()

back to top