1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
2 | .\" Copyright (c) 1996 Thinking Machines Corporation |
---|
3 | .TH MPI_Address 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
4 | .SH NAME |
---|
5 | \fBMPI_Address\fP \- Gets the address of a location in memory -- use of this routine is deprecated. |
---|
6 | |
---|
7 | .SH SYNTAX |
---|
8 | .ft R |
---|
9 | .SH C Syntax |
---|
10 | .nf |
---|
11 | #include <mpi.h> |
---|
12 | int MPI_Address(void *\fIlocation\fP, MPI_Aint\fP *address\fP) |
---|
13 | |
---|
14 | .SH Fortran Syntax |
---|
15 | .nf |
---|
16 | INCLUDE 'mpif.h' |
---|
17 | MPI_ADDRESS(\fILOCATION\fP,\fI ADDRESS\fP,\fI IERROR\fP) |
---|
18 | <type> \fILOCATION\fP (*) |
---|
19 | INTEGER \fIADDRESS\fP,\fI IERROR\fP |
---|
20 | |
---|
21 | |
---|
22 | .SH INPUT PARAMETER |
---|
23 | .ft R |
---|
24 | .TP 1i |
---|
25 | location |
---|
26 | Location in caller memory (choice). |
---|
27 | |
---|
28 | .SH OUTPUT PARAMETERS |
---|
29 | .ft R |
---|
30 | .TP 1i |
---|
31 | address |
---|
32 | Address of location (integer). |
---|
33 | .ft R |
---|
34 | .TP 1i |
---|
35 | IERROR |
---|
36 | Fortran only: Error status (integer). |
---|
37 | |
---|
38 | .SH DESCRIPTION |
---|
39 | .ft R |
---|
40 | Note that use of this routine is \fIdeprecated\fP as of MPI-2. Please use MPI_get_address instead. |
---|
41 | .sp |
---|
42 | This deprecated routine is not available in C++. |
---|
43 | .sp |
---|
44 | The address of a location in memory can be found by invoking this function. Returns the (byte) address of location. |
---|
45 | .sp |
---|
46 | Example: Using MPI_Address for an array. |
---|
47 | .sp |
---|
48 | .nf |
---|
49 | REAL A(100,100) |
---|
50 | .br |
---|
51 | INTEGER I1, I2, DIFF |
---|
52 | .br |
---|
53 | CALL MPI_ADDRESS(A(1,1), I1, IERROR) |
---|
54 | .br |
---|
55 | CALL MPI_ADDRESS(A(10,10), I2, IERROR) |
---|
56 | .br |
---|
57 | DIFF = I2 - I1 |
---|
58 | .br |
---|
59 | ! The value of DIFF is 909*sizeofreal; the values of I1 and I2 are |
---|
60 | .br |
---|
61 | ! implementation dependent. |
---|
62 | .fi |
---|
63 | |
---|
64 | .SH NOTES |
---|
65 | .ft R |
---|
66 | This routine is provided for both Fortran and C programmers and may be useful when writing portable code. In the current release, the address returned by this routine will be the same as that produced by the C & operator. |
---|
67 | .sp |
---|
68 | C users may be tempted to avoid using |
---|
69 | MPI_Address and rely on the availability of the address operator &. |
---|
70 | Note, however, that & cast-expression is a pointer, not an address. |
---|
71 | ANSI C does not require that the value of a pointer (or the pointer |
---|
72 | cast to int) be the absolute address of the object pointed at although |
---|
73 | this is commonly the case. Furthermore, referencing may not have a unique |
---|
74 | definition on machines with a segmented address space. The use of |
---|
75 | MPI_Address to "reference" C variables guarantees portability to |
---|
76 | such machines as well. |
---|
77 | |
---|
78 | .SH ERRORS |
---|
79 | 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. |
---|
80 | .sp |
---|
81 | Before the error value is returned, the current MPI error handler is |
---|
82 | called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler |
---|
83 | 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. |
---|
84 | |
---|