IBM Books

MPI Subroutine Reference

MPI_CART_COORDS, MPI_Cart_coords

Purpose

Translates task rank in a communicator into cartesian task coordinates.

C synopsis

#include <mpi.h>
MPI_Cart_coords(MPI_Comm comm,int rank,int maxdims,int *coords);

C++ synopsis

#include mpi.h
void MPI::Cartcomm::Get_coords(int rank, int maxdims, 
			       int coords[]) const;

FORTRAN synopsis

include 'mpif.h' or use mpi
MPI_CART_COORDS(INTEGER COMM,INTEGER RANK,INTEGER MAXDIMS,
	        INTEGER COORDS(*),INTEGER IERROR)

Parameters

comm
is a communicator with cartesian topology (handle) (IN)

rank
is the rank of a task within group comm (integer) (IN)

maxdims
is the length of array coords in the calling program (integer) (IN)

coords
is an integer array specifying the cartesian coordinates of a task. (OUT)

IERROR
is the FORTRAN return code. It is always the last argument.

Description

This subroutine translates task rank in a communicator into task coordinates.

Notes

Task coordinates in a cartesian structure begin their numbering at 0. Row-major numbering is always used for the tasks in a cartesian structure.

Errors

MPI not initialized

MPI already finalized

Invalid communicator

No topology

Invalid topology
type must be cartesian

Invalid rank
rank < 0 or rank > = groupsize

Invalid array size
maxdims < 0

Related information

MPI_CART_CREATE
MPI_CART_RANK


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]