9 logical periods(NUM_DIMS)
10 integer new_coords(NUM_DIMS)
11 integer new_new_coords(NUM_DIMS)
21 call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
22 call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierr)
24 c Clear dims array and get dims for topology
29 call MPI_DIMS_CREATE(size, NUM_DIMS, dims, ierr)
31 c Make a new communicator with a topology
32 call MPI_CART_CREATE(MPI_COMM_WORLD, 2, dims, periods,
33 $ reorder, comm_cart, ierr)
35 c Does the mapping from rank to coords work
36 call MPI_CART_COORDS(comm_cart, rank, NUM_DIMS, new_coords,
39 c 2nd call to Cart coords gives us an error - why? *34*
40 call MPI_CART_COORDS(comm_cart, rank, NUM_DIMS, new_new_coords,
43 call MPI_COMM_FREE(comm_cart, ierr)
44 c call Test_Waitforall()
46 c call MPI_ALLREDUCE( errors, toterrors, 1, MPI_INTEGER,
47 c 1 MPI_SUM, MPI_COMM_WORLD )
49 c print *, ' Done with ', toterrors, ' ERRORS!'
51 call MPI_FINALIZE(ierr)
52 c print *, 'cart2f completed, errors=', ierr