LCI
|
Management for memory buffers registered to the network. More...
Typedefs | |
typedef struct LCII_mr_t * | LCI_segment_t |
LCI memory segment. More... | |
Functions | |
LCI_API LCI_error_t | LCI_memory_register (LCI_device_t device, void *address, size_t length, LCI_segment_t *segment) |
Register a memory region to a device. More... | |
LCI_API LCI_error_t | LCI_memory_deregister (LCI_segment_t *segment) |
Deregister a memory region. More... | |
LCI_API LCI_error_t | LCI_mbuffer_alloc (LCI_device_t device, LCI_mbuffer_t *mbuffer) |
Get a pre-registered memory buffer of size LCI_MEDIUM_SIZE. More... | |
LCI_API LCI_error_t | LCI_mbuffer_free (LCI_mbuffer_t mbuffer) |
Return a pre-registered memory buffer to the LCI runtime. More... | |
LCI_API LCI_error_t | LCI_lbuffer_alloc (LCI_device_t device, size_t size, LCI_lbuffer_t *lbuffer) |
Allocate a memory buffer of arbitrary size and register it. More... | |
LCI_API LCI_error_t | LCI_lbuffer_memalign (LCI_device_t device, size_t size, size_t alignment, LCI_lbuffer_t *lbuffer) |
Allocate a memory buffer of arbitrary size with a specific alignment and register it. More... | |
LCI_API LCI_error_t | LCI_lbuffer_free (LCI_lbuffer_t lbuffer) |
Deregister and free a memory buffer. More... | |
Variables | |
int | LCI_PACKET_RETURN_THRESHOLD |
The packet returning threshold. More... | |
int | LCI_IBV_USE_ODP |
Whether or what to use IBV on-demand paging. More... | |
int | LCI_TOUCH_LBUFFER |
Whether touch every page of lbuffers allocated by LCI_lbuffer_alloc. More... | |
int | LCI_USE_DREG |
Whether or what to use LCI-provided registration cache. More... | |
int | LCI_IBV_USE_PREFETCH |
Whether or what to use IBV prefetch. More... | |
int | LCI_PACKET_SIZE |
Size of each packet. More... | |
int | LCI_SERVER_NUM_PKTS |
Total number of packets. More... | |
Management for memory buffers registered to the network.
In most of the cases, memory buffers participated in a network operations need to be registered to the network. The LCI runtime can do this for users through either memory copies to a pre-registered buffers or dynamical registering and deregistering. LCI also exposes relevant functions regarding registered memory allocation and memory registration to the users so users can do communication operations more efficiently.
For small messages, the send data does not need to be registered since the data will be packed into the low-level network operation descriptors.
For medium messages, the send and receive buffers need to be registered. If users are using the "copy" version of operations (e.g. LCI_sendm, LCI_putm, LCI_recvm), the data will be copied to/from pre-registered buffers by the runtime. If users are using the "no-copy"version of operations (e.g. LCI_sendmn, LCI_putmn, LCI_recvmn), users will directly get access to the LCI internal pre-registered buffers through either LCI_mbuffer_alloc (for send buffers) or completion mechanisms (for receive buffers).
For long messages, the send and receive buffers need to be registered, and the cost of memory copies to pre-registered buffers is considered unworthy. As a result, either users or the runtime needs to explicitly register the buffers.
typedef struct LCII_mr_t* LCI_segment_t |
LCI memory segment.
All LCI communication must take place in memory segments, which represent memory regions registered to devices.
LCI_API LCI_error_t LCI_lbuffer_alloc | ( | LCI_device_t | device, |
size_t | size, | ||
LCI_lbuffer_t * | lbuffer | ||
) |
Allocate a memory buffer of arbitrary size and register it.
[in] | device | The device to register the buffer. |
[in] | size | The size of the buffer to allocate. |
[out] | lbuffer | The resulting buffer. |
LCI_API LCI_error_t LCI_lbuffer_free | ( | LCI_lbuffer_t | lbuffer | ) |
Deregister and free a memory buffer.
[in] | lbuffer | The buffer to deregister and free. |
LCI_API LCI_error_t LCI_lbuffer_memalign | ( | LCI_device_t | device, |
size_t | size, | ||
size_t | alignment, | ||
LCI_lbuffer_t * | lbuffer | ||
) |
Allocate a memory buffer of arbitrary size with a specific alignment and register it.
[in] | device | The device to register the buffer. |
[in] | size | The size of the buffer to allocate. |
[in] | alignment | The alignment of the buffer to allocate. |
[out] | lbuffer | The resulting buffer. |
LCI_API LCI_error_t LCI_mbuffer_alloc | ( | LCI_device_t | device, |
LCI_mbuffer_t * | mbuffer | ||
) |
Get a pre-registered memory buffer of size LCI_MEDIUM_SIZE.
[in] | device | The device the buffer is registered to. |
[out] | mbuffer | The pre-registered memory buffer. |
LCI_API LCI_error_t LCI_mbuffer_free | ( | LCI_mbuffer_t | mbuffer | ) |
Return a pre-registered memory buffer to the LCI runtime.
[in] | mbuffer | The pre-registered memory buffer to return. |
LCI_API LCI_error_t LCI_memory_deregister | ( | LCI_segment_t * | segment | ) |
Deregister a memory region.
[in,out] | segment | The registration descriptor to deregister. |
LCI_API LCI_error_t LCI_memory_register | ( | LCI_device_t | device, |
void * | address, | ||
size_t | length, | ||
LCI_segment_t * | segment | ||
) |
Register a memory region to a device.
[in] | device | The device to register. |
[in] | address | The starting address of the memory region. |
[in] | length | The length of the memory region. |
[out] | segment | The registration descriptor. |
int LCI_IBV_USE_ODP |
Whether or what to use IBV on-demand paging.
0: Don't use ODP 1: Use explicit ODP 2: Use implicit ODP
int LCI_IBV_USE_PREFETCH |
Whether or what to use IBV prefetch.
0: Don't use. 1: Use. (Only make sense when LCI_IBV_USE_ODP is 1 or 2)
int LCI_PACKET_RETURN_THRESHOLD |
The packet returning threshold.
Apply to LCI_sendm and LCI_sendmn. if size > LCI_PACKET_RETURN_THRESHOLD: the packet will be returned to the compute thread's pool. else: the packet will be returned to the progress thread's pool.
int LCI_PACKET_SIZE |
Size of each packet.
int LCI_SERVER_NUM_PKTS |
Total number of packets.
int LCI_TOUCH_LBUFFER |
Whether touch every page of lbuffers allocated by LCI_lbuffer_alloc.
int LCI_USE_DREG |
Whether or what to use LCI-provided registration cache.
0: Don't use. 1: Use.