2014-10-24 01:21:54 +04:00
.\" -*- nroff -*-
2014-10-24 00:43:41 +04:00
.\" Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
2010-10-08 01:13:11 +04:00
.\" Copyright 2006-2008 Sun Microsystems, Inc.
2006-09-28 22:39:36 +04:00
.\" Copyright (c) 1996 Thinking Machines Corporation
2014-10-24 00:43:41 +04:00
.\" $COPYRIGHT$
2008-08-02 01:14:37 +04:00
.TH MPI_Alloc_mem 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
2006-09-28 22:39:36 +04:00
.SH NAME
2015-06-24 06:59:57 +03:00
\fBMPI_Alloc_mem \fP \- Allocates a specified memory segment.
2006-09-28 22:39:36 +04:00
.SH SYNTAX
.ft R
.SH C Syntax
.nf
#include <mpi.h>
int MPI_Alloc_mem(MPI_Aint \fIsize\fP, MPI_Info \fIinfo\fP, void *\fIbaseptr\fP)
2010-10-08 01:13:11 +04:00
.fi
2006-09-28 22:39:36 +04:00
.SH Fortran Syntax (see FORTRAN NOTES)
.nf
INCLUDE 'mpif.h'
2015-06-24 06:59:57 +03:00
MPI_ALLOC_MEM(\fISIZE, INFO, BASEPTR, IERROR\fP)
INTEGER \fIINFO, IERROR\fP
INTEGER(KIND=MPI_ADDRESS_KIND) \fISIZE, BASEPTR\fP
2006-09-28 22:39:36 +04:00
2010-10-08 01:13:11 +04:00
.fi
2006-09-28 22:39:36 +04:00
.SH C++ Syntax
.nf
#include <mpi.h>
void* MPI::Alloc_mem(MPI::Aint \fIsize\fP, const MPI::Info& \fIinfo\fP)
2010-10-08 01:13:11 +04:00
.fi
2006-09-28 22:39:36 +04:00
.SH INPUT PARAMETERS
.ft R
.TP 1i
size
2015-06-24 06:59:57 +03:00
Size of memory segment in bytes (nonnegative integer).
2006-09-28 22:39:36 +04:00
.ft R
.TP 1i
info
2015-06-24 06:59:57 +03:00
Info argument (handle).
2006-09-28 22:39:36 +04:00
.SH OUTPUT PARAMETERS
.ft R
.TP 1i
baseptr
2015-06-24 06:59:57 +03:00
Pointer to beginning of memory segment allocated.
2006-09-28 22:39:36 +04:00
.TP 1i
IERROR
2015-06-24 06:59:57 +03:00
Fortran only: Error status (integer).
2006-09-28 22:39:36 +04:00
.SH DESCRIPTION
.ft R
MPI_Alloc_mem allocates \fIsize\fP bytes of memory. The starting address
2015-06-24 06:59:57 +03:00
of this memory is returned in the variable \fIbase\fP.
2006-09-28 22:39:36 +04:00
.sp
.SH FORTRAN NOTES
.ft R
There is no portable FORTRAN 77 syntax for using MPI_Alloc_mem.
There is no portable Fortran syntax for using pointers returned
2015-06-24 06:59:57 +03:00
from MPI_Alloc_mem. However, MPI_Alloc_mem can be used with Sun
2006-09-28 22:39:36 +04:00
Fortran compilers.
.sp
2015-06-24 06:59:57 +03:00
From FORTRAN 77, you can use the following non-standard
2006-09-28 22:39:36 +04:00
declarations for the SIZE and BASEPTR arguments:
.nf
INCLUDE "mpif.h"
INTEGER*MPI_ADDRESS_KIND SIZE, BASEPTR
.fi
.sp
2015-06-24 06:59:57 +03:00
From either FORTRAN 77 or Fortran 90, you can use "Cray pointers"
for the BASEPTR argument. Cray pointers are described further in
the Fortran User's Guide and are supported by many Fortran compilers.
For example,
2006-09-28 22:39:36 +04:00
.sp
.nf
INCLUDE "mpif.h"
REAL*4 A(100,100)
POINTER (BASEPTR, A)
INTEGER*MPI_ADDRESS_KIND SIZE
SIZE = 4 * 100 * 100
CALL MPI_ALLOC_MEM(SIZE,MPI_INFO_NULL,BASEPTR,IERR)
! use A
CALL MPI_FREE_MEM(A, IERR)
.fi
2012-02-21 02:12:43 +04:00
.ft R
2006-09-28 22:39:36 +04:00
.SH ERRORS
2010-07-22 05:24:12 +04:00
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ functions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI::Exception object.
2006-09-28 22:39:36 +04:00
.sp
Before the error value is returned, the current MPI error handler is
called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler
2015-06-24 06:59:57 +03:00
may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error.
2006-09-28 22:39:36 +04:00
.SH SEE ALSO
.ft R
.sp
MPI_Free_mem