Copies data from a remote task to a local task.
Availability Library (liblapi_r.a)
#include <lapi.h>
int LAPI_Get(hndl, tgt, len, tgt_addr, org_addr, tgt_cntr, org_cntr)
lapi_handle_t hndl;
uint tgt;
ulong len;
void *tgt_addr;
void *org_addr;
lapi_cntr_t *tgt_cntr;
lapi_cntr_t *org_cntr;
include 'lapif.h'
LAPI_GET(hndl, tgt, len, tgt_addr, org_addr, tgt_cntr, org_cntr, ierror)
INTEGER hndl
INTEGER tgt
INTEGER (KIND=LAPI_LONG_TYPE) :: len
INTEGER (KIND=LAPI_ADDR_TYPE) :: tgt_addr
INTEGER (KIND=LAPI_ADDR_TYPE) :: org_addr
INTEGER (KIND=LAPI_ADDR_TYPE) :: tgt_cntr
TYPE (LAPI_CNTR_T) :: org_cntr
INTEGER ierror
Type of call: point-to-point communication (non-blocking)
Use this subroutine to transfer data from a remote (target) task to a local (origin) task. Note that in this case the origin task is actually the receiver of the data. This difference in transfer type makes the counter behavior slightly different than in the normal case of origin sending to target.
The origin buffer will still increment on the origin task upon availability of the origin buffer. But in this case, the origin buffer becomes available once the transfer of data is complete. Similarly, the target counter will increment once the target buffer is available. Target buffer availability in this case refers to LAPI no longer needing to access the data in the buffer.
This is a non-blocking call. The caller cannot assume that data transfer has completed upon the return of the function. Instead, counters should be used to ensure correct buffer addresses as defined above.
Note that a zero-byte message does not transfer data, but it does have the same semantic with respect to counters as that of any other message.
{
/* initialize the table buffer for the data addresses */
/* get remote data buffer addresses */
LAPI_Address_init(hndl,(void *)data_buffer,data_buffer_list);
.
.
.
LAPI_Get(hndl, tgt, (ulong) data_len, (void *) (data_buffer_list[tgt]),
(void *) data_buffer, tgt_cntr, org_cntr);
/* 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. */
}