IBM Books

MPI Subroutine Reference

MPI_ALLOC_MEM, MPI_Alloc_mem

Purpose

Allocates storage and returns a pointer to it.

C synopsis

#include <mpi.h>
int MPI_Alloc_mem (MPI_Aint size, MPI_Info info, void *baseptr);

C++ synopsis

#include mpi.h
void* MPI::Alloc_mem(MPI::Aint size, const MPI::Info& info);

FORTRAN synopsis

include 'mpif.h' or use mpi
MPI_ALLOC_MEM(INTEGER SIZE, INTEGER INFO, INTEGER BASEPTR, INTEGER IERROR)

Parameters

size
is the size of the memory segment in bytes (nonnegative integer) (IN)

info
is the info argument (handle) (IN)

baseptr
is the pointer to the beginning of the memory segment allocated (OUT)

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

Description

This subroutine allocates at least size bytes of storage and returns a pointer to it in the baseptr argument. The block of allocated storage is aligned so that it may be used for any type of data.

The info argument may be used in some implementations to provide directives that control the desired location of the allocated memory. Such a directive does not affect the semantics of the call. Valid info values are implementation-dependent. PE MPI does not recognize any hints for for MPI_ALLOC_MEM. A null directive value of info = MPI_INFO_NULL is always valid.

Notes

If the requested amount of memory is not available, the error handler associated with MPI_COMM_WORLD is invoked. By default, this is MPI_ERRORS_ARE_FATAL.

Errors

Fatal errors:

Out of memory (MPI_ERR_NO_MEM)

Invalid info (MPI_ERR_INFO)

MPI not initialized (MPI_ERR_OTHER)

MPI already finalized (MPI_ERR_OTHER)

Related information

MPI_FREE_MEM
MPI_WIN_CREATE


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