IBM Books

MPI Subroutine Reference

MPI_DIMS_CREATE, MPI_Dims_create

Purpose

Defines a cartesian grid to balance tasks.

C synopsis

#include <mpi.h>
MPI_Dims_create(int nnodes,int ndims,int *dims);

C++ synopsis

#include mpi.h
void MPI::Compute_dims(int nnodes, int ndims, int dims[]);

FORTRAN synopsis

include 'mpif.h' or use mpi
MPI_DIMS_CREATE(INTEGER NNODES,INTEGER NDIMS,INTEGER DIMS(*),
      INTEGER IERROR)

Parameters

nnodes
is an integer specifying the number of nodes in a grid (IN)

ndims
is an integer specifying the number of cartesian dimensions (IN)

dims
is an integer array of size ndims that specifies the number of nodes in each dimension. (INOUT)

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

Description

This subroutine creates a cartesian grid with a given number of dimensions and a given number of nodes. The dimensions are constrained to be as close to each other as possible.

If dims[i] is a positive number when MPI_DIMS_CREATE is called, the routine will not modify the number of nodes in dimension i. Only those entries where dims[i]=0 are modified by the call.

Notes

MPI_DIMS_CREATE chooses dimensions so that the resulting grid is as close as possible to being an ndims-dimensional cube.

Errors

MPI not initialized

MPI already finalized

Invalid ndims
ndims < 0

Invalid nnodes
nnodes < 0

Invalid dimension
dims[i] < 0 or nnodes is not a multiple of the non-zero entries of dims

Related information

MPI_CART_CREATE


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