LAPI_Address Subroutine

Purpose

Returns an unsigned long value for a specified user address.

Library

Availability Library (liblapi_r.a)

C Syntax

#include <lapi.h>
 
int LAPI_Address(my_addr, ret_addr)
void   *my_addr;
ulong  *ret_addr;
Note: This subroutine is meant to be used by FORTRAN programs. The C version of LAPI_Address is provided for compatibility purposes only.

FORTRAN Syntax

include 'lapif.h'
 
LAPI_ADDRESS(my_addr, ret_addr, ierror)
INTEGER (KIND=any_type) :: my_addr
INTEGER (KIND=LAPI_ADDR_TYPE) :: ret_addr
INTEGER ierror
where:
any_type
Is any FORTRAN datatype. This type declaration has the same meaning as the type void * in C.

Description

Type of call: local address manipulation

Use this subroutine in FORTRAN programs when you need to store specified addresses in an array. In FORTRAN, the concept of address (&) does not exist as it does in C. LAPI_Address provides FORTRAN programmers with this function.

Parameters

INPUT
my_addr
Specifies the address to convert. The value of this parameter cannot be NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
OUTPUT
ret_addr
Returns the address that is stored in my_addr as an unsigned long for use in LAPI calls. The value of this parameter cannot be NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
ierror
Specifies a FORTRAN return code. This is always the last parameter.

FORTRAN Examples

To retrieve the address of a variable:
! Contains the address of the target counter  
integer (KIND=LAPI_ADDR_TYPE) :: cntr_addr              
      
! Target Counter
type (LAPI_CNTR_T) :: tgt_cntr                                              
      
! Return code
integer :: ierror                                      
      
call LAPI_ADDRESS(tgt_cntr, cntr_addr, ierror)
      
!  cntr_addr now contains the address of tgt_cntr

Return Values

LAPI_SUCCESS
Indicates that the function call completed successfully.
LAPI_ERR_ORG_ADDR_NULL
Indicates that the value of my_addr is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
LAPI_ERR_TGT_ADDR_NULL
Indicates that the value of ret_addr is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).

Location

/usr/lib/liblapi_r.a