LCI

Communication operations to send and receive messages across processes. More...

Collaboration diagram for LCI communication operations:

Classes

struct  LCI_lbuffer_t
 LCI long communication buffer. More...
 
struct  LCI_mbuffer_t
 LCI medium communication buffer. More...
 
union  LCI_short_t
 LCI short data. More...
 
struct  LCI_iovec_t
 LCI iovec, which is comprised of a piggyback buffer and multiple long buffers. More...
 

Macros

#define LCI_SHORT_SIZE   32
 The size of LCI short data. More...
 

Typedefs

typedef uint32_t LCI_tag_t
 Tag type. More...
 

Enumerations

enum  LCI_match_t { LCI_MATCH_RANKTAG = 0, LCI_MATCH_TAG }
 LCI Match type. Define the matching rule between sends and receives. More...
 

Functions

LCI_API LCI_error_t LCI_sends (LCI_endpoint_t ep, LCI_short_t src, int rank, LCI_tag_t tag)
 Send a short message (up to LCI_SHORT_SIZE bytes). The send buffer can be immediately reused. More...
 
LCI_API LCI_error_t LCI_sendm (LCI_endpoint_t ep, LCI_mbuffer_t buffer, int rank, LCI_tag_t tag)
 Send a medium message with a user-provided buffer (up to LCI_MEDIUM_SIZE bytes). The send buffer can be immediately reused. More...
 
LCI_API LCI_error_t LCI_sendmn (LCI_endpoint_t ep, LCI_mbuffer_t buffer, int rank, LCI_tag_t tag)
 Send a medium message with a LCI-provided buffer (allocated by LCI_mbuffer_alloc, up to LCI_MEDIUM_SIZE bytes). The send buffer will be directly returned to LCI if send succeeds so users should not use it anymore. More...
 
LCI_API LCI_error_t LCI_sendl (LCI_endpoint_t ep, LCI_lbuffer_t buffer, int rank, LCI_tag_t tag, LCI_comp_t completion, void *user_context)
 Send a long message with a user-provided buffer. The send buffer cannot be reused until the associated completion object marks this operation as completed. More...
 
LCI_API LCI_error_t LCI_recvs (LCI_endpoint_t ep, int rank, LCI_tag_t tag, LCI_comp_t completion, void *user_context)
 Receive a short message (up to LCI_SHORT_SIZE bytes). The received message will be delivered through the completion object. More...
 
LCI_API LCI_error_t LCI_recvm (LCI_endpoint_t ep, LCI_mbuffer_t buffer, int rank, LCI_tag_t tag, LCI_comp_t completion, void *user_context)
 Receive a medium message (up to LCI_MEDIUM_SIZE bytes) into a user-provided buffer. More...
 
LCI_API LCI_error_t LCI_recvmn (LCI_endpoint_t ep, int rank, LCI_tag_t tag, LCI_comp_t completion, void *user_context)
 Receive a medium message (up to LCI_MEDIUM_SIZE bytes) into a LCI-provided buffer. The receive buffer will be delivered to users through the completion object and should be returned to the runtime through LCI_mbuffer_free. More...
 
LCI_API LCI_error_t LCI_recvl (LCI_endpoint_t ep, LCI_lbuffer_t buffer, int rank, LCI_tag_t tag, LCI_comp_t completion, void *user_context)
 Receive a long message into a user-provided buffer. More...
 
LCI_API LCI_error_t LCI_puts (LCI_endpoint_t ep, LCI_short_t src, int rank, LCI_tag_t tag, uintptr_t remote_completion)
 Send a short message (up to LCI_SHORT_SIZE bytes). The send buffer can be immediately reused. On the receive side, No receive needs to be posted and the data will be delivered through the remote completion object. More...
 
LCI_API LCI_error_t LCI_putma (LCI_endpoint_t ep, LCI_mbuffer_t buffer, int rank, LCI_tag_t tag, uintptr_t remote_completion)
 Send a medium message with a user-provided buffer (up to LCI_MEDIUM_SIZE bytes). The send buffer can be immediately reused. On the receive side, No receive needs to be posted and the data will be delivered through the remote completion object. More...
 
LCI_API LCI_error_t LCI_putmna (LCI_endpoint_t ep, LCI_mbuffer_t buffer, int rank, LCI_tag_t tag, uintptr_t remote_completion)
 Send a medium message with a LCI-provided buffer (allocated by LCI_mbuffer_alloc, up to LCI_MEDIUM_SIZE bytes). The send buffer will be directly returned to LCI if send succeeds so users should not use it anymore. On the receive side, No receive needs to be posted and the data will be delivered through the remote completion object. More...
 
LCI_API LCI_error_t LCI_putla (LCI_endpoint_t ep, LCI_lbuffer_t buffer, LCI_comp_t completion, int rank, LCI_tag_t tag, uintptr_t remote_completion, void *user_context)
 Send a long message with a user-provided buffer. The send buffer cannot be reused until the associated completion object marks this operation as completed. On the receive side, No receive needs to be posted and the data will be delivered through the remote completion object. More...
 
LCI_API LCI_error_t LCI_putva (LCI_endpoint_t ep, LCI_iovec_t iovec, LCI_comp_t completion, int rank, LCI_tag_t tag, uintptr_t remote_completion, void *user_context)
 Send an iovec with user-provided buffers. The piggyback buffer can be immediately reused. The long buffers cannot be reused until the associated completion object marks this operation as completed. On the receive side, No receive needs to be posted and the data will be delivered through the remote completion object. More...
 
LCI_API size_t LCI_get_iovec_piggy_back_size (int count)
 Return the maximum size of the piggyback buffer in an iovec with given number of long buffers. More...
 

Variables

int LCI_MAX_TAG
 The largest allowed tag value. More...
 
int LCI_MEDIUM_SIZE
 The maximum size (in byte) of a buffer that can be used in medium messages. More...
 
int LCI_IOVEC_SIZE
 The maximum number of long buffers in an IO vector. More...
 
int LCI_SEND_SLOW_DOWN_USEC
 Manually slow down LCI backend send function. More...
 
int LCI_RECV_SLOW_DOWN_USEC
 Manually slow down LCI backend recv function. More...
 

Detailed Description

Communication operations to send and receive messages across processes.

The LCI runtime offers users various communication operations for sending and receiving messages. According to the size and number, the messages can be divided into short, medium, long, and iovec messages. LCI provided different operations (with s, m, l, v as suffix) for those messages. LCI uses different protocols for these messages. According to who provides the send and receive buffers, the operations can be divided into 2sided and 1sided operations (send/recv v.s. put/get). For medium send/recv buffers and long recv buffers, the communication operations can either use user-allocated buffer or LCI-provided buffer. The later one can save one memory copy.

Macro Definition Documentation

◆ LCI_SHORT_SIZE

#define LCI_SHORT_SIZE   32

The size of LCI short data.

Typedef Documentation

◆ LCI_tag_t

typedef uint32_t LCI_tag_t

Tag type.

The largest tag allowed by the runtime is defined by LCI_MAX_TAG.

Enumeration Type Documentation

◆ LCI_match_t

LCI Match type. Define the matching rule between sends and receives.

Enumerator
LCI_MATCH_RANKTAG 

Match send and receive by (source rank, target rank, tag)

LCI_MATCH_TAG 

Match send and receive by (tag)

Function Documentation

◆ LCI_get_iovec_piggy_back_size()

LCI_API size_t LCI_get_iovec_piggy_back_size ( int  count)

Return the maximum size of the piggyback buffer in an iovec with given number of long buffers.

Parameters
[in]countThe number of long buffers in this iovec.
Returns
The maximum size of the piggyback buffer.

◆ LCI_putla()

LCI_API LCI_error_t LCI_putla ( LCI_endpoint_t  ep,
LCI_lbuffer_t  buffer,
LCI_comp_t  completion,
int  rank,
LCI_tag_t  tag,
uintptr_t  remote_completion,
void *  user_context 
)

Send a long message with a user-provided buffer. The send buffer cannot be reused until the associated completion object marks this operation as completed. On the receive side, No receive needs to be posted and the data will be delivered through the remote completion object.

Parameters
[in]epThe endpoint to post this send to.
[in]bufferThe buffer to send.
[in]completionThe completion object to be associated with.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
[in]remote_completionThe completion object to signal on the receiver side. It has to be LCI_DEFAULT_COMP_REMOTE for now.
[in]user_contextArbitrary data the user want to attach to this operation. It will be returned the user through the completion object.
Returns
LCI_OK if the send succeeds. LCI_ERR_RETRY if the send fails due to temporarily unavailable resources. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_putma()

LCI_API LCI_error_t LCI_putma ( LCI_endpoint_t  ep,
LCI_mbuffer_t  buffer,
int  rank,
LCI_tag_t  tag,
uintptr_t  remote_completion 
)

Send a medium message with a user-provided buffer (up to LCI_MEDIUM_SIZE bytes). The send buffer can be immediately reused. On the receive side, No receive needs to be posted and the data will be delivered through the remote completion object.

Parameters
[in]epThe endpoint to post this receive to.
[in]bufferThe buffer to send.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
[in]remote_completionThe completion object to signal on the receiver side. It has to be LCI_DEFAULT_COMP_REMOTE for now.
Returns
LCI_OK if the send succeeds. LCI_ERR_RETRY if the send fails due to temporarily unavailable resources. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_putmna()

LCI_API LCI_error_t LCI_putmna ( LCI_endpoint_t  ep,
LCI_mbuffer_t  buffer,
int  rank,
LCI_tag_t  tag,
uintptr_t  remote_completion 
)

Send a medium message with a LCI-provided buffer (allocated by LCI_mbuffer_alloc, up to LCI_MEDIUM_SIZE bytes). The send buffer will be directly returned to LCI if send succeeds so users should not use it anymore. On the receive side, No receive needs to be posted and the data will be delivered through the remote completion object.

Parameters
[in]epThe endpoint to post this receive to.
[in]bufferThe buffer to send.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
[in]remote_completionThe completion object to signal on the receiver side. It has to be LCI_DEFAULT_COMP_REMOTE for now.
Returns
LCI_OK if the send succeeds. LCI_ERR_RETRY if the send fails due to temporarily unavailable resources. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_puts()

LCI_API LCI_error_t LCI_puts ( LCI_endpoint_t  ep,
LCI_short_t  src,
int  rank,
LCI_tag_t  tag,
uintptr_t  remote_completion 
)

Send a short message (up to LCI_SHORT_SIZE bytes). The send buffer can be immediately reused. On the receive side, No receive needs to be posted and the data will be delivered through the remote completion object.

Parameters
[in]epThe endpoint to post this receive to.
[in]srcThe data to send.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
[in]remote_completionThe completion object to signal on the receiver side. It has to be LCI_DEFAULT_COMP_REMOTE for now.
Returns
LCI_OK if the send succeeds. LCI_ERR_RETRY if the send fails due to temporarily unavailable resources. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_putva()

LCI_API LCI_error_t LCI_putva ( LCI_endpoint_t  ep,
LCI_iovec_t  iovec,
LCI_comp_t  completion,
int  rank,
LCI_tag_t  tag,
uintptr_t  remote_completion,
void *  user_context 
)

Send an iovec with user-provided buffers. The piggyback buffer can be immediately reused. The long buffers cannot be reused until the associated completion object marks this operation as completed. On the receive side, No receive needs to be posted and the data will be delivered through the remote completion object.

Parameters
[in]epThe endpoint to post this send to.
[in]iovecThe iovec to send.
[in]completionThe completion object to be associated with.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
[in]remote_completionThe completion object to signal on the receiver side. It has to be LCI_DEFAULT_COMP_REMOTE for now.
[in]user_contextArbitrary data the user want to attach to this operation. It will be returned the user through the completion object.
Returns
LCI_OK if the send succeeds. LCI_ERR_RETRY if the send fails due to temporarily unavailable resources. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_recvl()

LCI_API LCI_error_t LCI_recvl ( LCI_endpoint_t  ep,
LCI_lbuffer_t  buffer,
int  rank,
LCI_tag_t  tag,
LCI_comp_t  completion,
void *  user_context 
)

Receive a long message into a user-provided buffer.

Parameters
[in]epThe endpoint to post this receive to.
[in]bufferThe user-provided buffer to receive the message.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
[in]completionThe completion object to be associated with.
[in]user_contextArbitrary data the user want to attach to this operation. It will be returned the user through the completion object.
Returns
Should always be LCI_OK. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_recvm()

LCI_API LCI_error_t LCI_recvm ( LCI_endpoint_t  ep,
LCI_mbuffer_t  buffer,
int  rank,
LCI_tag_t  tag,
LCI_comp_t  completion,
void *  user_context 
)

Receive a medium message (up to LCI_MEDIUM_SIZE bytes) into a user-provided buffer.

Parameters
[in]epThe endpoint to post this receive to.
[in]bufferThe user-provided buffer to receive the message.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
[in]completionThe completion object to be associated with.
[in]user_contextArbitrary data the user want to attach to this operation. It will be returned the user through the completion object.
Returns
Should always be LCI_OK. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_recvmn()

LCI_API LCI_error_t LCI_recvmn ( LCI_endpoint_t  ep,
int  rank,
LCI_tag_t  tag,
LCI_comp_t  completion,
void *  user_context 
)

Receive a medium message (up to LCI_MEDIUM_SIZE bytes) into a LCI-provided buffer. The receive buffer will be delivered to users through the completion object and should be returned to the runtime through LCI_mbuffer_free.

Parameters
[in]epThe endpoint to post this receive to.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
[in]completionThe completion object to be associated with.
[in]user_contextArbitrary data the user want to attach to this operation. It will be returned the user through the completion object.
Returns
Should always be LCI_OK. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_recvs()

LCI_API LCI_error_t LCI_recvs ( LCI_endpoint_t  ep,
int  rank,
LCI_tag_t  tag,
LCI_comp_t  completion,
void *  user_context 
)

Receive a short message (up to LCI_SHORT_SIZE bytes). The received message will be delivered through the completion object.

Parameters
[in]epThe endpoint to post this receive to.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
[in]completionThe completion object to be associated with.
[in]user_contextArbitrary data the user want to attach to this operation. It will be returned the user through the completion object.
Returns
Should always be LCI_OK. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_sendl()

LCI_API LCI_error_t LCI_sendl ( LCI_endpoint_t  ep,
LCI_lbuffer_t  buffer,
int  rank,
LCI_tag_t  tag,
LCI_comp_t  completion,
void *  user_context 
)

Send a long message with a user-provided buffer. The send buffer cannot be reused until the associated completion object marks this operation as completed.

Parameters
[in]epThe endpoint to post this send to.
[in]bufferThe buffer to send.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
[in]completionThe completion object to be associated with.
[in]user_contextArbitrary data the user want to attach to this operation. It will be returned the user through the completion object.
Returns
LCI_OK if the send succeeds. LCI_ERR_RETRY if the send fails due to temporarily unavailable resources. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_sendm()

LCI_API LCI_error_t LCI_sendm ( LCI_endpoint_t  ep,
LCI_mbuffer_t  buffer,
int  rank,
LCI_tag_t  tag 
)

Send a medium message with a user-provided buffer (up to LCI_MEDIUM_SIZE bytes). The send buffer can be immediately reused.

Parameters
[in]epThe endpoint to post this send to.
[in]bufferThe buffer to send.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
Returns
LCI_OK if the send succeeds. LCI_ERR_RETRY if the send fails due to temporarily unavailable resources. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_sendmn()

LCI_API LCI_error_t LCI_sendmn ( LCI_endpoint_t  ep,
LCI_mbuffer_t  buffer,
int  rank,
LCI_tag_t  tag 
)

Send a medium message with a LCI-provided buffer (allocated by LCI_mbuffer_alloc, up to LCI_MEDIUM_SIZE bytes). The send buffer will be directly returned to LCI if send succeeds so users should not use it anymore.

Parameters
[in]epThe endpoint to post this send to.
[in]bufferThe buffer to send. The buffer should be allocated by LCI_mbuffer_alloc.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
Returns
LCI_OK if the send succeeds. LCI_ERR_RETRY if the send fails due to temporarily unavailable resources. All the other errors are fatal as defined by LCI_error_t.

◆ LCI_sends()

LCI_API LCI_error_t LCI_sends ( LCI_endpoint_t  ep,
LCI_short_t  src,
int  rank,
LCI_tag_t  tag 
)

Send a short message (up to LCI_SHORT_SIZE bytes). The send buffer can be immediately reused.

Parameters
[in]epThe endpoint to post this send to.
[in]srcThe data to send.
[in]rankThe rank of the destination process.
[in]tagThe tag of this message.
Returns
LCI_OK if the send succeeds. LCI_ERR_RETRY if the send fails due to temporarily unavailable resources. All the other errors are fatal as defined by LCI_error_t.

Variable Documentation

◆ LCI_IOVEC_SIZE

int LCI_IOVEC_SIZE

The maximum number of long buffers in an IO vector.

◆ LCI_MAX_TAG

int LCI_MAX_TAG

The largest allowed tag value.

◆ LCI_MEDIUM_SIZE

int LCI_MEDIUM_SIZE

The maximum size (in byte) of a buffer that can be used in medium messages.

◆ LCI_RECV_SLOW_DOWN_USEC

int LCI_RECV_SLOW_DOWN_USEC

Manually slow down LCI backend recv function.

◆ LCI_SEND_SLOW_DOWN_USEC

int LCI_SEND_SLOW_DOWN_USEC

Manually slow down LCI backend send function.