LAPI_Xfer Subroutine

Purpose

Serves as a wrapper function for LAPI data transfer functions.

Library

Availability Library (liblapi_r.a)

C Syntax

#include <lapi.h>
 
int LAPI_Xfer(hndl, xfer_cmd)
lapi_handle_t hndl;
lapi_xfer_t *xfer_cmd;
 

typedef struct {
    uint            src;          /* Target task ID    */
    uint            reason;       /* LAPI return codes */
    ulong           reserve[6];   /* Reserved          */
} lapi_sh_info_t;


typedef void (scompl_hndlr_t)(lapi_handle_t *hndl, void *completion_param,
                              lapi_sh_info_t *info);
 

FORTRAN Syntax

include 'lapif.h'
 
LAPI_XFER(hndl, xfer_cmd, ierror)
INTEGER hndl
TYPE (fortran_xfer_type) :: xfer_cmd
INTEGER ierror

Description

Type of call: point-to-point communication (non-blocking)

The LAPI_Xfer subroutine provides a superset of the functionality of these subroutines: LAPI_Amsend, LAPI_Amsendv, LAPI_Put, LAPI_Putv, LAPI_Get, LAPI_Getv, and LAPI_Rmw. In addition, LAPI_Xfer provides data gather/scatter program (DGSP) messages transfer.

In C, the LAPI_Xfer command is passed a pointer to a union. It examines the first member of the union, Xfer_type, to determine the transfer type, and to determine which union member was passed. LAPI_Xfer expects every field of the identified union member to be set. It does not examine or modify any memory outside of the identified union member. LAPI_Xfer treats all union members (except status) as read-only data.

This subroutine provides the following functions:
  • The remote address fields are expanded to be of type lapi_long_t, which is long enough for a 64-bit address. This allows a 32-bit task to send data to 64-bit addresses, which may be important in client/server programs.
  • LAPI_Xfer allows the origin counter to be replaced with a send completion callback.
  • LAPI_Xfer is used to transfer data using LAPI's data gather/scatter program (DGSP) interface.
The lapi_xfer_t structure is defined as:
typedef union {
        lapi_xfer_type_t   Xfer_type;
        lapi_get_t         Get;
        lapi_am_t          Am;
        lapi_rmw_t         Rmw;
        lapi_put_t         Put;
        lapi_getv_t        Getv;
        lapi_putv_t        Putv; 
        lapi_amv_t         Amv;
        lapi_amdgsp_t      Dgsp;
} lapi_xfer_t;
Though the lapi_xfer_t structure applies only to the C version of LAPI_Xfer, the following tables include the FORTRAN equivalents of the C datatypes.
Table 1 list the values of the lapi_xfer_type_t structure for C and the explicit Xfer_type values for FORTRAN.
Table 1. LAPI_Xfer structure types
Value of Xfer_type (C or FORTRAN) Union member as interpreted by LAPI_Xfer (C) Value of fortran_xfer_type (FORTRAN)
LAPI_AM_XFER lapi_am_t LAPI_AM_T
LAPI_AMV_XFER lapi_amv_t LAPI_AMV_T
LAPI_DGSP_XFER lapi_amdgsp_t LAPI_AMDGSP_T
LAPI_GET_XFER lapi_get_t LAPI_GET_T
LAPI_GETV_XFER lapi_getv_t LAPI_GETV_T
LAPI_PUT_XFER lapi_put_t LAPI_PUT_T
LAPI_PUTV_XFER lapi_putv_t LAPI_PUTV_T
LAPI_RMW_XFER lapi_rmw_t LAPI_RMW_T

lapi_am_t details

Table 2 shows the correspondence among the parameters of the LAPI_Amsend subroutine, the fields of the C lapi_am_t structure and their datatypes, and the equivalent FORTRAN datatypes. The lapi_am_t fields are listed in Table 2 in the order that they occur in the lapi_xfer_t structure.
Table 2. LAPI_Amsend and lapi_am_t equivalents
lapi_am_t field name (C) lapi_am_t field type (C) Equivalent FORTRAN datatype Equivalent LAPI_Amsend parameter
Xfer_type lapi_xfer_type_t INTEGER(KIND = 4) implicit in C

LAPI_Xfer value in FORTRAN: LAPI_AM_XFER

flags int INTEGER(KIND = 4) none

LAPI_Xfer parameter in FORTRAN: flags

tgt uint INTEGER(KIND = 4) tgt
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN: pad
hdr_hdl lapi_long_t INTEGER(KIND = 8) hdr_hdl
uhdr_len uint INTEGER(KIND = 4) uhdr_len
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN (64-bit): pad2
uhdr void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

uhdr
udata void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

udata
udata_len ulong

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

udata_len
shdlr scompl_hndlr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: shdlr

sinfo void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: sinfo

tgt_cntr lapi_long_t INTEGER(KIND = 8) tgt_cntr
org_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_cntr
cmpl_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

cmpl_cntr
When the origin data buffer is free to be used, the pointer to the send completion handler (shdlr) is called with the send completion data (sinfo) if shdlr is not a NULL pointer (in C) or LAPI_ADDR_NULL (in FORTRAN). Otherwise, the behavior is identical to that of LAPI_Amsend.

lapi_amv_t details

Table 3 shows the correspondence among the parameters of the LAPI_Amsendv subroutine, the fields of the C lapi_amv_t structure and their datatypes, and the equivalent FORTRAN datatypes. The lapi_amv_t fields are listed in Table 3 in the order that they occur in the lapi_xfer_t structure.
Table 3. LAPI_Amsendv and lapi_amv_t equivalents
lapi_amv_t field name (C) lapi_amv_t field type (C) Equivalent FORTRAN datatype Equivalent LAPI_Amsendv parameter
Xfer_type lapi_xfer_type_t INTEGER(KIND = 4) implicit in C

LAPI_Xfer value in FORTRAN: LAPI_AMV_XFER

flags int INTEGER(KIND = 4) none

LAPI_Xfer parameter in FORTRAN: flags

tgt uint INTEGER(KIND = 4) tgt
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN: pad
hdr_hdl lapi_long_t INTEGER(KIND = 8) hdr_hdl
uhdr_len uint INTEGER(KIND = 4) uhdr_len
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN (64-bit): pad2
uhdr void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

uhdr
shdlr scompl_hndlr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: shdlr

sinfo void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: sinfo

org_vec lapi_vec_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_vec
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN (32-bit): pad2
tgt_cntr lapi_long_t INTEGER(KIND = 8) tgt_cntr
org_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_cntr
cmpl_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

cmpl_cntr

lapi_amdgsp_t details

Table 4 shows the correspondence among the fields of the C lapi_amdgsp_t structure and their datatypes, how they are used in LAPI_Xfer, and the equivalent FORTRAN datatypes. The lapi_amdgsp_t fields are listed in Table 4 in the order that they occur in the lapi_xfer_t structure.
Table 4. The lapi_amdgsp_t fields
lapi_amdgsp_t field name (C) lapi_amdgsp_t field type (C) Equivalent FORTRAN datatype LAPI_Xfer usage
Xfer_type lapi_xfer_type_t INTEGER(KIND = 4) LAPI_DGSP_XFER
flags int INTEGER(KIND = 4) This field allows users to specify directives or hints to LAPI. If you do not want to use any directives or hints, you must set this field to 0. See The lapi_amdgsp_t flags field for more information.
tgt uint INTEGER(KIND = 4) target task
none none INTEGER(KIND = 4) pad (padding alignment for FORTRAN only)
hdr_hdl lapi_long_t INTEGER(KIND = 8) header handler to invoke at target
uhdr_len uint INTEGER(KIND = 4) user header length (multiple of processor's doubleword size)
none none INTEGER(KIND = 4) pad2 (padding alignment for 64-bit FORTRAN only)
uhdr void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

pointer to user header
udata void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

pointer to user data
udata_len ulong

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

user data length
shdlr scompl_hndlr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

send completion handler (optional)
sinfo void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

data pointer to pass to send completion handler (optional)
tgt_cntr lapi_long_t INTEGER(KIND = 8) target counter (optional)
org_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

origin counter (optional)
cmpl_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

completion counter (optional)
dgsp lapi_dg_handle_t

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

Handle of a registered DGSP
status lapi_status_t

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

Status to return (future use)
none none INTEGER(KIND = 4) pad3 (padding alignment for 64-bit FORTRAN only)

When the origin data buffer is free to be modified, the send completion handler (shdlr) is called with the send completion data (sinfo), if shdlr is not a NULL pointer (in C) or LAPI_ADDR_NULL (in FORTRAN).

See Using lapi_am_dgsp_t for scatter-side DGSP processing for more information.

The lapi_amdgsp_t flags field

One or more flags can be set using the | (bitwise or) operator. User directives are always followed and could result in incorrect results if used improperly. Appropriate hints might improve performance, but they may be ignored by LAPI. Inappropriate hints might degrade performance, but they will not cause incorrect results.

The following directive flags are defined:
USE_TGT_VEC_TYPE
Instructs LAPI to use the vector type of the target vector (tgt_vec). In other words, tgt_vec is to be interpreted as type lapi_vec_t; otherwise, it is interpreted as type lapi_lvec_t. The lapi_lvec_t type uses lapi_long_t. The lapi_vec_t type uses void * or long. Incorrect results will occur if one type is used in place of the other.
BUFFER_BOTH_CONTIGUOUS
Instructs LAPI to treat all data to be transferred as contiguous, which can improve performance. If this flag is set when non-contiguous data is sent, data will likely be corrupted.
The following hint flags are defined:
LAPI_NOT_USE_BULK_XFER
Instructs LAPI not to use bulk transfer, independent of the current setting for the task.
LAPI_USE_BULK_XFER
Instructs LAPI to use bulk transfer, independent of the current setting for the task.
If neither of these hint flags is set, LAPI will use the behavior defined for the task. If both of these hint flags are set, LAPI_NOT_USE_BULK_XFER will take precedence.

These hints may or may not be honored by the communication library.

Using lapi_am_dgsp_t for scatter-side DGSP processing

Beginning with AIX® 5.2, LAPI allows additional information to be returned from the header handler through the use of the lapi_return_info_t datatype. See RSCT for AIX 5L™: LAPI Programming Guide for more information about lapi_return_info_t. In the case of transfer type lapi_am_dgsp_t, this mechanism can be used to instruct LAPI to run a user DGSP to scatter data on the receive side.

To use this mechanism, pass a lapi_return_info_t * pointer back to LAPI through the msg_len member of the user header handler. The dgsp_handle member of the passed structure must point to a DGSP description that has been registered on the receive side. See LAPI_Util and RSCT for AIX 5L: LAPI Programming Guide for details on building and registering DGSPs.

lapi_get_t details

Table 5 shows the correspondence among the parameters of the LAPI_Get subroutine, the fields of the C lapi_get_t structure and their datatypes, and the equivalent FORTRAN datatypes. The lapi_get_t fields are listed in Table 5 in the order that they occur in the lapi_xfer_t structure.
Table 5. LAPI_Get and lapi_get_t equivalents
lapi_get_t field name (C) lapi_get_t field type (C) Equivalent FORTRAN datatype Equivalent LAPI_Get parameter
Xfer_type lapi_xfer_type_t INTEGER(KIND = 4) implicit in C

LAPI_Xfer value in FORTRAN: LAPI_GET_XFER

flags int INTEGER(KIND = 4) none

LAPI_Xfer parameter in FORTRAN: flags

tgt uint INTEGER(KIND = 4) tgt
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN: pad
tgt_addr lapi_long_t INTEGER(KIND = 8) tgt_addr
org_addr void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_addr
len ulong

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

len
tgt_cntr lapi_long_t INTEGER(KIND = 8) tgt_cntr
org_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_cntr
chndlr compl_hndlr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: chndlr

cinfo void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: cinfo

When the origin data buffer has completely arrived, the pointer to the completion handler (chndlr) is called with the completion data (cinfo), if chndlr is not a NULL pointer (in C) or LAPI_ADDR_NULL (in FORTRAN). Otherwise, the behavior is identical to that of LAPI_Get.

lapi_getv_t details

Table 6 shows the correspondence among the parameters of the LAPI_Getv subroutine, the fields of the C lapi_getv_t structure and their datatypes, and the equivalent FORTRAN datatypes. The lapi_getv_t fields are listed in Table 5 in the order that they occur in the lapi_xfer_t structure.
Table 6. LAPI_Getv and lapi_getv_t equivalents
lapi_getv_t field name (C) lapi_getv_t field type (C) Equivalent FORTRAN datatype Equivalent LAPI_Getv parameter
Xfer_type lapi_xfer_type_t INTEGER(KIND = 4) implicit in C

LAPI_Xfer value in FORTRAN: LAPI_GETV_XFER

flags int INTEGER(KIND = 4) none

LAPI_Xfer parameter in FORTRAN: flags

tgt uint INTEGER(KIND = 4) tgt
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN (64-bit): pad
org_vec lapi_vec_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_vec
tgt_vec void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

tgt_vec
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN (32-bit): pad
tgt_cntr lapi_long_t INTEGER(KIND = 8) tgt_cntr
org_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_cntr
chndlr compl_hndlr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: chndlr

cinfo void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: cinfo

none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN (32-bit): pad2
The flags field accepts USE_TGT_VEC_TYPE (see lapi_amdgsp_t flags field) to indicate that tgt_vec is to be interpreted as type lapi_vec_t; otherwise, it is interpreted as type lapi_lvec_t. Note the corresponding field is lapi_vec_t in the LAPI_Getv call.

When the origin data buffer has completely arrived, the pointer to the completion handler (chndlr) is called with the completion data (cinfo) if chndlr is not a NULL pointer (in C) or LAPI_ADDR_NULL (in FORTRAN). Otherwise, the behavior is identical to that of LAPI_Getv.

lapi_put_t details

Table 7 shows the correspondence among the parameters of the LAPI_Put subroutine, the fields of the C lapi_put_t structure and their datatypes, and the equivalent FORTRAN datatypes. The lapi_put_t fields are listed in Table 7 in the order that they occur in the lapi_xfer_t structure.
Table 7. LAPI_Put and lapi_put_t equivalents
lapi_put_t field name (C) lapi_put_t field type (C) Equivalent FORTRAN datatype Equivalent LAPI_Put parameter
Xfer_type lapi_xfer_type_t INTEGER(KIND = 4) implicit in C

LAPI_Xfer value in FORTRAN: LAPI_PUT_XFER

flags int INTEGER(KIND = 4) none

LAPI_Xfer parameter in FORTRAN: flags

tgt uint INTEGER(KIND = 4) tgt
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN: pad
tgt_addr lapi_long_t INTEGER(KIND = 8) tgt_addr
org_addr void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_addr
len ulong

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

len
shdlr scompl_hndlr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: shdlr

sinfo void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: sinfo

tgt_cntr lapi_long_t INTEGER(KIND = 8) tgt_cntr
org_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_cntr
cmpl_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

cmpl_cntr
When the origin data buffer is free to be used, the pointer to the send completion handler (shdlr) is called with the send completion data (sinfo), if shdlr is not a NULL pointer (in C) or LAPI_ADDR_NULL (in FORTRAN). Otherwise, the behavior is identical to that of LAPI_Put.

lapi_putv_t details

Table 8 shows the correspondence among the parameters of the LAPI_Putv subroutine, the fields of the C lapi_putv_t structure and their datatypes, and the equivalent FORTRAN datatypes. The lapi_putv_t fields are listed in Table 7 in the order that they occur in the lapi_xfer_t structure.
Table 8. LAPI_Putv and lapi_putv_t equivalents
lapi_putv_t field name (C) lapi_putv_t field type (C) Equivalent FORTRAN datatype Equivalent LAPI_Putv parameter
Xfer_type lapi_xfer_type_t INTEGER(KIND = 4) implicit in C

LAPI_Xfer value in FORTRAN: LAPI_PUT_XFER

flags int INTEGER(KIND = 4) none

LAPI_Xfer parameter in FORTRAN: flags

tgt uint INTEGER(KIND = 4) tgt
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN (64-bit): pad
shdlr scompl_hndlr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: shdlr

sinfo void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: sinfo

org_vec lapi_vec_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_vec
tgt_vec void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

tgt_vec
none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN (32-bit): pad
tgt_cntr lapi_long_t INTEGER(KIND = 8) tgt_cntr
org_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_cntr
cmpl_cntr lapi_cntr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

cmpl_cntr
The flags field accepts USE_TGT_VEC_TYPE (see lapi_amdgsp_t flags field) to indicate that tgt_vec is to be interpreted as lapi_vec_t; otherwise, it is interpreted as a lapi_lvec_t. Note that the corresponding field is lapi_vec_t in the LAPI_Putv call.

When the origin data buffer is free to be modified, the pointer to the send completion handler (shdlr) is called with the send completion data (sinfo), if shdlr is not a NULL pointer (in C) or LAPI_ADDR_NULL (in FORTRAN). Otherwise, the behavior is identical to that of LAPI_Putv.

lapi_rmw_t details

Table 9 shows the correspondence among the parameters of the LAPI_Rmw subroutine, the fields of the C lapi_rmw_t structure and their datatypes, and the equivalent FORTRAN datatypes. The lapi_rmw_t fields are listed in Table 7 in the order that they occur in the lapi_xfer_t structure.
Table 9. LAPI_Rmw and lapi_rmw_t equivalents
lapi_rmw_t field name (C) lapi_rmw_t field type (C) Equivalent FORTRAN datatype Equivalent LAPI_Rmw parameter
Xfer_type lapi_xfer_type_t INTEGER(KIND = 4) implicit in C

LAPI_Xfer value in FORTRAN: LAPI_RMW_XFER

op Rmw_ops_t INTEGER(KIND = 4) op
tgt uint INTEGER(KIND = 4) tgt
size uint INTEGER(KIND = 4) implicit in C

LAPI_Xfer parameter in FORTRAN: size (must be 32 or 64)

tgt_var lapi_long_t INTEGER(KIND = 8) tgt_var
in_val void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

in_val
prev_tgt_val void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

prev_tgt_val
org_cntr lapi_cntr t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

org_cntr
shdlr scompl_hndlr_t *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: shdlr

sinfo void *

INTEGER(KIND = 4) (32-bit)
INTEGER(KIND = 8) (64-bit)

none

LAPI_Xfer parameter in FORTRAN: shdlr

none none INTEGER(KIND = 4) LAPI_Xfer parameter in FORTRAN (32-bit): pad
When the origin data buffer is free to be used, the pointer to the send completion handler (shdlr) is called with the send completion data (sinfo), if shdlr is not a NULL pointer (in C) or LAPI_ADDR_NULL (in FORTRAN). The size value must be either 32 or 64, indicating whether you want the in_val and prev_tgt_val fields to point to a 32-bit or 64-bit quantity, respectively. Otherwise, the behavior is identical to that of LAPI_Rmw.

Parameters

INPUT
hndl
Specifies the LAPI handle.
xfer_cmd
Specifies the name and parameters of the data transfer function.
OUTPUT
ierror
Specifies a FORTRAN return code. This is always the last parameter.

Return Values

LAPI_SUCCESS
Indicates that the function call completed successfully.
LAPI_ERR_DATA_LEN
Indicates that the value of udata_len or len is greater than the value of LAPI constant LAPI_MAX_MSG_SZ.
LAPI_ERR_DGSP
Indicates that the DGSP that was passed in is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN) or is not a registered DGSP.
LAPI_ERR_DGSP_ATOM
Indicates that the DGSP has an atom_size that is less than 0 or greater than MAX_ATOM_SIZE.
LAPI_ERR_DGSP_BRANCH
Indicates that the DGSP attempted a branch that fell outside the code array.
LAPI_ERR_DGSP_CTL
Indicates that a DGSP control instruction was encountered in a non-valid context (such as a gather-side control or scatter-side control with an atom size of 0 at gather, for example).
LAPI_ERR_DGSP_OPC
Indicates that the DGSP op-code is not valid.
LAPI_ERR_DGSP_STACK
Indicates that the DGSP has greater GOSUB depth than the allocated stack supports. Stack allocation is specified by the dgsp->depth member.
LAPI_ERR_HDR_HNDLR_NULL
Indicates that the hdr_hdl passed in is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
LAPI_ERR_HNDL_INVALID
Indicates that the hndl passed in is not valid (not initialized or in terminated state).
LAPI_ERR_IN_VAL_NULL
Indicates that the in_val pointer is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
LAPI_ERR_MEMORY_EXHAUSTED
LAPI is unable to obtain memory from the system.
LAPI_ERR_OP_SZ
Indicates that the lapi_rmw_t size field is not set to 32 or 64.
LAPI_ERR_ORG_ADDR_NULL
Indicates either that the udata parameter passed in is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN) and udata_len is greater than 0, or that the org_addr passed in is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN) and len is greater than 0.

Note: if Xfer_type = LAPI_DGSP_XFER, the case in which udata is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN) and udata_len is greater than 0 is valid, so an error is not returned.

LAPI_ERR_ORG_EXTENT
Indicates that the org_vec's extent (stride * num_vecs) is greater than the value of LAPI constant LAPI_MAX_MSG_SZ.
LAPI_ERR_ORG_STRIDE
Indicates that the org_vec stride is less than block.
LAPI_ERR_ORG_VEC_ADDR
Indicates that the org_vec->info[i] is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN), but its length (org_vec->len[i]) is not 0.
LAPI_ERR_ORG_VEC_LEN
Indicates that the sum of org_vec->len is greater than the value of LAPI constant LAPI_MAX_MSG_SZ.
LAPI_ERR_ORG_VEC_NULL
Indicates that the org_vec value is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
LAPI_ERR_ORG_VEC_TYPE
Indicates that the org_vec->vec_type is not valid.
LAPI_ERR_RMW_OP
Indicates the op is not valid.
LAPI_ERR_STRIDE_ORG_VEC_ADDR_NULL
Indicates that the strided vector address org_vec->info[0] is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
LAPI_ERR_STRIDE_TGT_VEC_ADDR_NULL
Indicates that the strided vector address tgt_vec->info[0] is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
LAPI_ERR_TGT
Indicates that the tgt passed in is outside the range of tasks defined in the job.
LAPI_ERR_TGT_ADDR_NULL
Indicates that ret_addr is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
LAPI_ERR_TGT_EXTENT
Indicates that tgt_vec's extent (stride * num_vecs) is greater than the value of LAPI constant LAPI_MAX_MSG_SZ.
LAPI_ERR_TGT_PURGED
Indicates that the subroutine returned early because LAPI_Purge_totask() was called.
LAPI_ERR_TGT_STRIDE
Indicates that the tgt_vec stride is less than block.
LAPI_ERR_TGT_VAR_NULL
Indicates that the tgt_var address is NULL (in C) or that the value of tgt_var is LAPI_ADDR_NULL (in FORTRAN).
LAPI_ERR_TGT_VEC_ADDR
Indicates that the tgt_vec->info[i] is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN), but its length (tgt_vec->len[i]) is not 0.
LAPI_ERR_TGT_VEC_LEN
Indicates that the sum of tgt_vec->len is greater than the value of LAPI constant LAPI_MAX_MSG_SZ.
LAPI_ERR_TGT_VEC_NULL
Indicates that tgt_vec is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN).
LAPI_ERR_TGT_VEC_TYPE
Indicates that the tgt_vec->vec_type is not valid.
LAPI_ERR_UHDR_LEN
Indicates that the uhdr_len value passed in is greater than MAX_UHDR_SZ or is not a multiple of the processor's doubleword size.
LAPI_ERR_UHDR_NULL
Indicates that the uhdr passed in is NULL (in C) or LAPI_ADDR_NULL (in FORTRAN), but uhdr_len is not 0.
LAPI_ERR_VEC_LEN_DIFF
Indicates that org_vec and tgt_vec have different lengths (len[ ]).
LAPI_ERR_VEC_NUM_DIFF
Indicates that org_vec and tgt_vec have different num_vecs.
LAPI_ERR_VEC_TYPE_DIFF
Indicates that org_vec and tgt_vec have different vector types (vec_type).
LAPI_ERR_XFER_CMD
Indicates that the Xfer_cmd is not valid.

C Examples

  1. To run the sample code shown in LAPI_Get using the LAPI_Xfer interface:
    {
    
          lapi_xfer_t xfer_struct;
    
          /* initialize the table buffer for the data addresses */
       
          /* get remote data buffer addresses */
          LAPI_Address_init(hndl,(void *)data_buffer,data_buffer_list);
          .    
          . 
          .
          /* retrieve data_len bytes from address data_buffer_list[tgt] on */
          /* task tgt. write the data starting at address data_buffer.     */
          /* tgt_cntr and org_cntr can be NULL.                            */ 
    
          xfer_struct.Get.Xfer_type = LAPI_GET_XFER;
          xfer_struct.Get.flags = 0;
          xfer_struct.Get.tgt = tgt;
          xfer_struct.Get.tgt_addr = data_buffer_list[tgt];
          xfer_struct.Get.org_addr = data_buffer;
          xfer_struct.Get.len = data_len;
          xfer_struct.Get.tgt_cntr = tgt_cntr;
          xfer_struct.Get.org_cntr = org_cntr;
        
          LAPI_Xfer(hndl, &xfer_struct);  
    
    }
  2. To implement the LAPI_STRIDED_VECTOR example from LAPI_Amsendv using the LAPI_Xfer interface:
    {
        lapi_xfer_t   xfer_struct;                        /* info for LAPI_Xfer call */
        lapi_vec_t    vec;                                /* data for data transfer  */
        .
        .
        .
        vec->num_vecs = NUM_VECS;        /* NUM_VECS = number of vectors to transfer */ 
                                         /* must match that of the target vector     */
        vec->vec_type = LAPI_GEN_STRIDED_XFER;              /* same as target vector */
    
       
        vec->info[0]  = buffer_address;    /* starting address for data copy         */
        vec->info[1]  = block_size;        /* bytes of data to copy                  */
        vec->info[2]  = stride;            /* distance from copy block to copy block */
        /* data will be copied as follows:                                           */
        /* block_size bytes will be copied from buffer_address                       */
        /* block_size bytes will be copied from buffer_address+stride                */
        /* block_size bytes will be copied from buffer_address+(2*stride)            */
        /* block_size bytes will be copied from buffer_address+(3*stride)            */
        .
        .
        .
        /* block_size bytes will be copied from buffer_address+((NUM_VECS-1)*stride) */
        .
        .
        .
        xfer_struct.Amv.Xfer_type = LAPI_AMV_XFER;
        xfer_struct.Amv.flags     = 0;
        xfer_struct.Amv.tgt       = tgt;
        xfer_struct.Amv.hdr_hdl   = hdr_hdl_list[tgt];
        xfer_struct.Amv.uhdr_len  = uhdr_len;  /* user header length */
        xfer_struct.Amv.uhdr      = uhdr;
    
    
        /* LAPI_AMV_XFER allows the use of a send completion handler */
        /* If non-null, the shdlr function is invoked at the point   */
        /* the origin counter would increment.  Note that both the   */
        /* org_cntr and shdlr can be used.                           */
        /* The user's shdlr must be of type scompl_hndlr_t *.        */
        /* scompl_hndlr_t is defined in /usr/include/lapi.h          */
        xfer_struct.shdlr = shdlr; 
    
        /* Use sinfo to pass user-defined data into the send         */
        /* completion handler, if desired.                           */
        xfer_struct.sinfo     = sinfo;       /* send completion data */
        
        xfer_struct.org_vec   = vec;
        xfer_struct.tgt_cntr  = tgt_cntr;
        xfer_struct.org_cntr  = org_cntr;
        xfer_struct.cmpl_cntr = cmpl_cntr;
    
    
        LAPI_Xfer(hndl, &xfer_struct);
        .
        .
        .
    }
See the LAPI_Amsendv subroutine for more information about the header handler definition.

Location

/usr/lib/liblapi_r.a