IBM Books

MPI Subroutine Reference

MPI_GET_ADDRESS, MPI_Get_address

Purpose

Returns the address of a location in memory.

C synopsis

#include <mpi.h>
int MPI_Get_address(void *location, MPI_Aint *address);

C++ synopsis

#include mpi.h
MPI::Aint MPI::Get_address(void* location);

FORTRAN synopsis

include 'mpif.h' or use mpi
MPI_GET_ADDRESS(CHOICE LOCATION(*), 
		INTEGER(KIND=MPI_ADDRESS_KIND) ADDRESS, 
		INTEGER IERROR)

Parameters

location
is the location in caller memory (choice) (IN)

address
is the address of the location (integer) (OUT)

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

Description

This subroutine returns the byte address of location.

Notes

On the IBM RS/6000 SP, MPI_GET_ADDRESS is equivalent to address= (MPI_Aint) location in C, but this subroutine is portable to processors with less straightforward addressing.

MPI_GET_ADDRESS is synonymous with MPI_ADDRESS. MPI_ADDRESS is not available in C++. In FORTRAN, MPI_GET_ADDRESS returns an argument of type INTEGER(KIND=MPI_ADDRESS_KIND) to support 32- and 64-bit addresses. Such variables may be declared as INTEGER*4 in purely 32-bit codes and as INTEGER*8 in 64-bit codes; KIND=MPI_ADDRESS_KIND works correctly in either mode. MPI_ADDRESS is provided for backward compatibility. However, users are encouraged to switch to MPI_GET_ADDRESS, in both FORTRAN and C.

Current FORTRAN MPI codes will run unmodified, and will port to any system. However, these codes may fail if addresses larger than (2 (to the power of 32) -1) are used in the program. New codes should be written so that they use MPI_GET_ADDRESS. This provides compatibility with C/C++ and avoids errors on 64-bit architectures. However, such newly-written codes may need to be rewritten slightly to port to old FORTRAN 77 environments that do not support KIND declarations.

Errors

Fatal errors:

MPI not initialized

MPI already finalized

Related information

MPI_TYPE_CREATE_HINDEXED
MPI_TYPE_CREATE_HVECTOR
MPI_TYPE_CREATE_STRUCT


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