IBM Books

MPI Subroutine Reference

MPI_SIZEOF

Purpose

Returns the size in bytes of the machine representation of the given variable.

FORTRAN synopsis

use mpi
MPI_SIZEOF(CHOICE X, INTEGER SIZE, INTEGER IERROR)

Parameters

X
is a FORTRAN variable of numeric intrinsic type (choice) (IN)

SIZE
is the size of the machine representation of that type (integer) (OUT)

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

Description

This subroutine returns the size in bytes of the machine representation of the given variable. It is a generic FORTRAN routine and has a FORTRAN binding only. It requires information provided by the MPI module and will produce a runtime error if the program was coded with include 'mpif.h'. MPI_SIZEOF is most useful when variables are declared with KIND=SELECTED_xxx_KIND because the number of bytes for a variable may vary from one architecture to another.

Notes

MPI_SIZEOF is similar to the C and C++ sizeof operator but behaves slightly differently. If MPI_SIZEOF is given an array argument, it returns the size of the base element, not the size of the whole array.

Errors

Fatal errors:

MPI already finalized

MPI not initialized

No "USE MPI" statement in compilation unit


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