LAPI_Addr_set Subroutine

Purpose

Registers the address of a function.

Library

Availability Library (liblapi_r.a)

C Syntax

#include <lapi.h>
 
int LAPI_Addr_set(hndl, addr, addr_hndl)
lapi_handle_t  hndl;
void          *addr;
int            addr_hndl;

FORTRAN Syntax

include 'lapif.h'
 
LAPI_ADDR_SET(hndl, addr, addr_hndl, ierror)
INTEGER hndl
INTEGER (KIND=LAPI_ADDR_TYPE) :: addr
INTEGER addr_hndl
INTEGER ierror

Description

Type of call: local address manipulation

Use this subroutine to register the address of a function (addr). LAPI maintains the function address in an internal table. The function address is indexed at location addr_hndl. In subsequent LAPI calls, addr_hndl can be used in place of addr. The value of addr_hndl must be in the range 1 <= addr_hndl < LOC_ADDRTBL_SZ.

For active message communication, you can use addr_hndl in place of the corresponding header handler address. LAPI only supports this indexed substitution for remote header handler addresses (but not other remote addresses, such as target counters or base data addresses). For these other types of addresses, the actual address value must be passed to the API call.

Parameters

INPUT
hndl
Specifies the LAPI handle.
addr
Specifies the address of the function handler that the user wants to register with LAPI.
addr_hndl
Specifies a user function address that can be passed to LAPI calls in place of a header handler address. The value of this parameter must be in the range 1 <= addr_hndl < LOC_ADDRTBL_SZ.
OUTPUT
ierror
Specifies a FORTRAN return code. This is always the last parameter.

C Examples

To register a header handler address:
lapi_handle_t  hndl;      /* the LAPI handle                   */
void          *addr;      /* the remote header handler address */
int            addr_hndl; /* the index to associate            */
      
⋮      

addr = my_func;      
addr_hndl = 1;
LAPI_Addr_set(hndl, addr, addr_hndl);
      
/* addr_hndl can now be used in place of addr in LAPI_Amsend, */ 
/* LAPI_Amsendv, and LAPI_Xfer calls                          */ 

⋮

Return Values

LAPI_SUCCESS
Indicates that the function call completed successfully.
LAPI_ERR_ADDR_HNDL_RANGE
Indicates that the value of addr_hndl is not in the range 1 <= addr_hndl < LOC_ADDRTBL_SZ.
LAPI_ERR_HNDL_INVALID
Indicates that the hndl passed in is not valid (not initialized or in terminated state).

Location

/usr/lib/liblapi_r.a