Mercury
Functions
mercury_bulk.h File Reference
#include "mercury_types.h"
Include dependency graph for mercury_bulk.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

HG_EXPORT hg_return_t HG_Bulk_init (na_class_t *na_class)
 Initialize the Mercury bulk layer. More...
 
HG_EXPORT hg_return_t HG_Bulk_finalize (void)
 Finalize the Mercury bulk layer. More...
 
HG_EXPORT hg_return_t HG_Bulk_initialized (hg_bool_t *flag, na_class_t **na_class)
 Indicate whether HG_Bulk_init has been called and return associated network class. More...
 
HG_EXPORT hg_return_t HG_Bulk_handle_create (size_t count, void **buf_ptrs, const size_t *buf_sizes, unsigned long flags, hg_bulk_t *handle)
 Create abstract bulk handle from specified memory segments. More...
 
HG_EXPORT hg_return_t HG_Bulk_handle_free (hg_bulk_t handle)
 Free bulk handle. More...
 
HG_EXPORT hg_return_t HG_Bulk_handle_access (hg_bulk_t handle, size_t offset, size_t size, unsigned long flags, unsigned int max_count, void **buf_ptrs, size_t *buf_sizes, unsigned int *actual_count)
 Access bulk handle to retrieve memory segments abstracted by handle. More...
 
HG_EXPORT size_t HG_Bulk_handle_get_size (hg_bulk_t handle)
 Get total size of data abstracted by bulk handle. More...
 
HG_EXPORT size_t HG_Bulk_handle_get_segment_count (hg_bulk_t handle)
 Get total number of segments abstracted by bulk handle. More...
 
HG_EXPORT size_t HG_Bulk_handle_get_serialize_size (hg_bulk_t handle)
 Get size required to serialize bulk handle. More...
 
HG_EXPORT hg_return_t HG_Bulk_handle_serialize (void *buf, size_t buf_size, hg_bulk_t handle)
 Serialize bulk handle into a buffer. More...
 
HG_EXPORT hg_return_t HG_Bulk_handle_deserialize (hg_bulk_t *handle, const void *buf, size_t buf_size)
 Deserialize bulk handle from a buffer. More...
 
HG_EXPORT hg_return_t HG_Bulk_transfer (hg_bulk_op_t op, na_addr_t origin_addr, hg_bulk_t origin_handle, size_t origin_offset, hg_bulk_t local_handle, size_t local_offset, size_t size, hg_bulk_request_t *request)
 Transfer data to/from origin using abstract bulk handles. More...
 
HG_EXPORT hg_return_t HG_Bulk_wait (hg_bulk_request_t request, unsigned int timeout, hg_status_t *status)
 Wait for a bulk operation request to complete. More...
 

Function Documentation

HG_EXPORT hg_return_t HG_Bulk_init ( na_class_t na_class)

Initialize the Mercury bulk layer.

The NA class can be different from the one used for the RPC interface.

Parameters
na_class[IN] pointer to network class
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Bulk_finalize ( void  )

Finalize the Mercury bulk layer.

Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Bulk_initialized ( hg_bool_t *  flag,
na_class_t **  na_class 
)

Indicate whether HG_Bulk_init has been called and return associated network class.

Parameters
flag[OUT] pointer to boolean
na_class[OUT] pointer to returned network class pointer
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Bulk_handle_create ( size_t  count,
void **  buf_ptrs,
const size_t *  buf_sizes,
unsigned long  flags,
hg_bulk_t handle 
)

Create abstract bulk handle from specified memory segments.

Note. If NULL is passed to buf_ptrs, i.e., HG_Bulk_handle_create(count, NULL, buf_sizes, flags, &handle) memory for the missing buf_ptrs array will be internally allocated. Memory allocated is then freed when HG_Bulk_handle_free is called.

Parameters
count[IN] number of segments
buf_ptrs[IN] array of pointers
buf_sizes[IN] array of sizes
flags[IN] permission flag:
  • HG_BULK_READWRITE
  • HG_BULK_READ_ONLY
  • HG_BULK_WRITE_ONLY
handle[OUT] pointer to returned abstract bulk handle
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Bulk_handle_free ( hg_bulk_t  handle)

Free bulk handle.

Parameters
handle[IN/OUT] abstract bulk handle
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Bulk_handle_access ( hg_bulk_t  handle,
size_t  offset,
size_t  size,
unsigned long  flags,
unsigned int  max_count,
void **  buf_ptrs,
size_t *  buf_sizes,
unsigned int *  actual_count 
)

Access bulk handle to retrieve memory segments abstracted by handle.

When using mercury in coresident mode (i.e., when addr passed is self addr), it is possible to avoid copy of bulk data by accessing pointers from an existing bulk handle directly.

Parameters
handle[IN] abstract bulk handle
offset[IN] bulk offset
size[IN] bulk size
flags[IN] permission flag:
  • HG_BULK_READWRITE
  • HG_BULK_READ_ONLY
max_count[IN] maximum number of segments to be returned
buf_ptrs[IN/OUT] array of buffer pointers
buf_sizes[IN/OUT] array of buffer sizes
actual_count[OUT] actual number of segments returned
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT size_t HG_Bulk_handle_get_size ( hg_bulk_t  handle)

Get total size of data abstracted by bulk handle.

Parameters
handle[IN] abstract bulk handle
Returns
Non-negative value
HG_EXPORT size_t HG_Bulk_handle_get_segment_count ( hg_bulk_t  handle)

Get total number of segments abstracted by bulk handle.

Parameters
handle[IN] abstract bulk handle
Returns
Non-negative value
HG_EXPORT size_t HG_Bulk_handle_get_serialize_size ( hg_bulk_t  handle)

Get size required to serialize bulk handle.

Parameters
handle[IN] abstract bulk handle
Returns
Non-negative value
HG_EXPORT hg_return_t HG_Bulk_handle_serialize ( void *  buf,
size_t  buf_size,
hg_bulk_t  handle 
)

Serialize bulk handle into a buffer.

Parameters
buf[IN/OUT] pointer to buffer
buf_size[IN] buffer size
handle[IN] abstract bulk handle
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Bulk_handle_deserialize ( hg_bulk_t handle,
const void *  buf,
size_t  buf_size 
)

Deserialize bulk handle from a buffer.

Parameters
handle[OUT] abstract bulk handle
buf[IN] pointer to buffer
buf_size[IN] buffer size
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Bulk_transfer ( hg_bulk_op_t  op,
na_addr_t  origin_addr,
hg_bulk_t  origin_handle,
size_t  origin_offset,
hg_bulk_t  local_handle,
size_t  local_offset,
size_t  size,
hg_bulk_request_t request 
)

Transfer data to/from origin using abstract bulk handles.

Parameters
op[IN] transfer operation:
  • HG_BULK_PUSH
  • HG_BULK_PULL
origin_addr[IN] abstract NA address of origin
origin_handle[IN] abstract bulk handle
origin_offset[IN] offset
local_handle[IN] abstract bulk handle
local_offset[IN] offset
size[IN] size of data to be transferred
request[OUT] pointer to returned bulk request
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Bulk_wait ( hg_bulk_request_t  request,
unsigned int  timeout,
hg_status_t status 
)

Wait for a bulk operation request to complete.

Parameters
request[IN] bulk request
timeout[IN] timeout (in milliseconds)
status[OUT] pointer to returned status
Returns
HG_SUCCESS or corresponding HG error code