Finalization of arbitrary message implementation.
Cleanups left. This commit was SVN r2775.
Этот коммит содержится в:
родитель
a9cfc982f5
Коммит
28c4de3d9b
@ -75,7 +75,8 @@ int mca_ptl_ib_put( struct mca_ptl_base_module_t* ptl,
|
||||
rkey = *(VAPI_rkey_t *)(((mca_ptl_ib_send_request_t *)req)->req_buf);
|
||||
|
||||
rc = mca_ptl_ib_rdma_write(ib_state, peer_conn,
|
||||
&send_frag->ib_buf, local_addr, size, remote_addr, rkey);
|
||||
&send_frag->ib_buf, local_addr, size, remote_addr, rkey,
|
||||
(void*) send_frag);
|
||||
|
||||
if(rc != OMPI_SUCCESS) {
|
||||
return OMPI_ERROR;
|
||||
|
@ -505,13 +505,15 @@ int mca_ptl_ib_peer_send(mca_ptl_base_peer_t* peer,
|
||||
|
||||
/* Send the frag off */
|
||||
|
||||
A_PRINT("Send to : %d, len : %d, frag : %p",
|
||||
peer->peer_proc->proc_guid.vpid,
|
||||
frag->ib_buf.desc.sg_entry.len,
|
||||
frag);
|
||||
|
||||
rc = mca_ptl_ib_post_send(peer->peer_module->ib_state,
|
||||
peer->peer_conn,
|
||||
&frag->ib_buf, (void*) frag);
|
||||
|
||||
A_PRINT("Send to : %d, len : %d",
|
||||
peer->peer_proc->proc_guid.vpid,
|
||||
frag->ib_buf.desc.sg_entry.len);
|
||||
|
||||
break;
|
||||
default:
|
||||
|
@ -513,10 +513,14 @@ int mca_ptl_ib_post_send(mca_ptl_ib_state_t *ib_state,
|
||||
ib_buffer_t *ib_buf, void* addr)
|
||||
{
|
||||
VAPI_ret_t ret;
|
||||
int msg_len = ib_buf->desc.sg_entry.len;
|
||||
|
||||
IB_SET_REMOTE_QP_NUM(ib_buf, (peer_conn->rres->qp_num));
|
||||
//IB_SET_REMOTE_QP_NUM(ib_buf, (peer_conn->rres->qp_num));
|
||||
|
||||
IB_SET_SEND_DESC_ID(ib_buf, addr);
|
||||
//IB_SET_SEND_DESC_ID(ib_buf, addr);
|
||||
|
||||
IB_PREPARE_SEND_DESC(ib_buf, (peer_conn->rres->qp_num),
|
||||
msg_len, addr);
|
||||
|
||||
D_PRINT("length : %d, qp_num = %d",
|
||||
ib_buf->desc.sg_entry.len,
|
||||
@ -543,9 +547,9 @@ void mca_ptl_ib_drain_network(VAPI_hca_hndl_t nic,
|
||||
ret = VAPI_poll_cq(nic, cq_hndl, &comp);
|
||||
if(VAPI_OK == ret) {
|
||||
if(comp.status != VAPI_SUCCESS) {
|
||||
ompi_output(0, "Got error : %s, Vendor code : %d\n",
|
||||
ompi_output(0, "Got error : %s, Vendor code : %d Frag : %p",
|
||||
VAPI_wc_status_sym(comp.status),
|
||||
comp.vendor_err_syndrome);
|
||||
comp.vendor_err_syndrome, comp.id);
|
||||
|
||||
*comp_type = IB_COMP_ERROR;
|
||||
*comp_addr = NULL;
|
||||
@ -630,7 +634,7 @@ void mca_ptl_ib_prepare_ack(mca_ptl_ib_state_t *ib_state,
|
||||
int mca_ptl_ib_rdma_write(mca_ptl_ib_state_t *ib_state,
|
||||
mca_ptl_ib_peer_conn_t *peer_conn, ib_buffer_t *ib_buf,
|
||||
void* send_buf, size_t send_len, void* remote_buf,
|
||||
VAPI_rkey_t remote_key)
|
||||
VAPI_rkey_t remote_key, void* id_buf)
|
||||
{
|
||||
VAPI_ret_t ret;
|
||||
VAPI_mrw_t mr_in, mr_out;
|
||||
@ -654,7 +658,8 @@ int mca_ptl_ib_rdma_write(mca_ptl_ib_state_t *ib_state,
|
||||
|
||||
/* Prepare descriptor */
|
||||
IB_PREPARE_RDMA_W_DESC(ib_buf, (peer_conn->rres->qp_num),
|
||||
send_len, send_buf, (mr_out.l_key), remote_key, remote_buf);
|
||||
send_len, send_buf, (mr_out.l_key), remote_key,
|
||||
id_buf, remote_buf);
|
||||
|
||||
ret = VAPI_post_sr(ib_state->nic,
|
||||
peer_conn->lres->qp_hndl,
|
||||
|
@ -162,13 +162,14 @@ typedef struct mca_ptl_ib_peer_conn_t mca_ptl_ib_peer_conn_t;
|
||||
(MT_virt_addr_t) ib_buf_ptr->buf; \
|
||||
}
|
||||
|
||||
#define IB_PREPARE_SEND_DESC(ib_buf_ptr, qp, msg_len) { \
|
||||
#define IB_PREPARE_SEND_DESC(ib_buf_ptr, qp, msg_len, \
|
||||
id_buf) { \
|
||||
ib_buf_ptr->desc.sr.comp_type = VAPI_SIGNALED; \
|
||||
ib_buf_ptr->desc.sr.opcode = VAPI_SEND; \
|
||||
ib_buf_ptr->desc.sr.remote_qkey = 0; \
|
||||
ib_buf_ptr->desc.sr.remote_qp = qp; \
|
||||
ib_buf_ptr->desc.sr.id = (VAPI_virt_addr_t) \
|
||||
(MT_virt_addr_t) ib_buf_ptr; \
|
||||
(MT_virt_addr_t) id_buf; \
|
||||
ib_buf_ptr->desc.sr.sg_lst_len = 1; \
|
||||
ib_buf_ptr->desc.sr.sg_lst_p = &ib_buf_ptr->desc.sg_entry; \
|
||||
ib_buf_ptr->desc.sg_entry.len = msg_len; \
|
||||
@ -191,20 +192,22 @@ typedef struct mca_ptl_ib_peer_conn_t mca_ptl_ib_peer_conn_t;
|
||||
}
|
||||
|
||||
#define IB_PREPARE_RDMA_W_DESC(ib_buf_ptr, qp, \
|
||||
msg_len, user_buf, local_key, remote_key, remote_buf) { \
|
||||
msg_len, user_buf, local_key, remote_key, \
|
||||
id_buf, remote_buf) { \
|
||||
ib_buf_ptr->desc.sr.comp_type = VAPI_SIGNALED; \
|
||||
ib_buf_ptr->desc.sr.opcode = VAPI_RDMA_WRITE; \
|
||||
ib_buf_ptr->desc.sr.remote_qkey = 0; \
|
||||
ib_buf_ptr->desc.sr.remote_qp = qp; \
|
||||
ib_buf_ptr->desc.sr.id = (VAPI_virt_addr_t) \
|
||||
(MT_virt_addr_t) ib_buf_ptr; \
|
||||
(MT_virt_addr_t) id_buf; \
|
||||
ib_buf_ptr->desc.sr.sg_lst_len = 1; \
|
||||
ib_buf_ptr->desc.sr.sg_lst_p = &ib_buf_ptr->desc.sg_entry; \
|
||||
ib_buf_ptr->desc.sg_entry.len = msg_len; \
|
||||
ib_buf_ptr->desc.sg_entry.lkey = local_key; \
|
||||
ib_buf_ptr->desc.sg_entry.addr = (VAPI_virt_addr_t) \
|
||||
(MT_virt_addr_t) user_buf; \
|
||||
ib_buf_ptr->desc.sr.remote_addr = remote_buf; \
|
||||
ib_buf_ptr->desc.sr.remote_addr = (VAPI_virt_addr_t) \
|
||||
(MT_virt_addr_t) remote_buf; \
|
||||
ib_buf_ptr->desc.sr.r_key = remote_key; \
|
||||
}
|
||||
|
||||
@ -226,4 +229,8 @@ void mca_ptl_ib_buffer_repost(VAPI_hca_hndl_t nic,
|
||||
void mca_ptl_ib_prepare_ack(mca_ptl_ib_state_t *ib_state,
|
||||
void* addr_to_reg, int len_to_reg,
|
||||
void* ack_buf, int* len_added);
|
||||
int mca_ptl_ib_rdma_write(mca_ptl_ib_state_t *ib_state,
|
||||
mca_ptl_ib_peer_conn_t *peer_conn, ib_buffer_t *ib_buf,
|
||||
void* send_buf, size_t send_len, void* remote_buf,
|
||||
VAPI_rkey_t remote_key, void*);
|
||||
#endif /* MCA_PTL_IB_PRIV_H */
|
||||
|
@ -51,7 +51,6 @@ static void mca_ptl_ib_data_frag(mca_ptl_base_module_t *module,
|
||||
{
|
||||
bool matched;
|
||||
int rc;
|
||||
ib_buffer_t *ib_buf;
|
||||
ompi_list_item_t *item;
|
||||
mca_ptl_ib_recv_frag_t *recv_frag;
|
||||
|
||||
@ -171,6 +170,7 @@ void mca_ptl_ib_process_recv(mca_ptl_base_module_t *module, void* addr)
|
||||
mca_ptl_ib_ctrl_frag(module, header);
|
||||
break;
|
||||
case MCA_PTL_HDR_TYPE_FIN :
|
||||
A_PRINT("Fin");
|
||||
mca_ptl_ib_last_frag(module, header);
|
||||
break;
|
||||
default :
|
||||
|
@ -126,18 +126,10 @@ int mca_ptl_ib_send_frag_init(mca_ptl_ib_send_frag_t* sendfrag,
|
||||
/* adjust size and request offset to reflect actual
|
||||
* number of bytes packed by convertor */
|
||||
size_out = iov.iov_len;
|
||||
#if 0
|
||||
IB_PREPARE_SEND_DESC((&sendfrag->ib_buf), 0,
|
||||
(header_length + iov.iov_len));
|
||||
#endif
|
||||
IB_SET_SEND_DESC_LEN((&sendfrag->ib_buf),
|
||||
(header_length + iov.iov_len));
|
||||
} else {
|
||||
size_out = size_in;
|
||||
#if 0
|
||||
IB_PREPARE_SEND_DESC((&sendfrag->ib_buf), 0,
|
||||
(header_length + size_in));
|
||||
#endif
|
||||
IB_SET_SEND_DESC_LEN((&sendfrag->ib_buf),
|
||||
(header_length + size_in));
|
||||
}
|
||||
@ -227,7 +219,7 @@ int mca_ptl_ib_register_send_frags(mca_ptl_base_module_t *ptl)
|
||||
}
|
||||
|
||||
IB_PREPARE_SEND_DESC(ib_buf_ptr, 0,
|
||||
MCA_PTL_IB_FIRST_FRAG_SIZE);
|
||||
MCA_PTL_IB_FIRST_FRAG_SIZE, ib_buf_ptr);
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
@ -245,6 +237,8 @@ void mca_ptl_ib_process_rdma_w_comp(mca_ptl_base_module_t *module,
|
||||
mca_ptl_ib_send_frag_t *sendfrag;
|
||||
ompi_free_list_t *flist;
|
||||
|
||||
A_PRINT("Free RDMA send descriptor : %p", comp_addr);
|
||||
|
||||
sendfrag = (mca_ptl_ib_send_frag_t *) comp_addr;
|
||||
|
||||
flist = &(sendfrag->
|
||||
@ -253,6 +247,7 @@ void mca_ptl_ib_process_rdma_w_comp(mca_ptl_base_module_t *module,
|
||||
|
||||
OMPI_FREE_LIST_RETURN(flist,
|
||||
((ompi_list_item_t *) sendfrag));
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -284,6 +279,18 @@ void mca_ptl_ib_process_send_comp(mca_ptl_base_module_t *module,
|
||||
|
||||
OMPI_FREE_LIST_RETURN(flist,
|
||||
((ompi_list_item_t *) sendfrag));
|
||||
|
||||
} else if(header->hdr_common.hdr_type == MCA_PTL_HDR_TYPE_FIN) {
|
||||
|
||||
A_PRINT("Completion of fin");
|
||||
|
||||
module->ptl_send_progress(module,
|
||||
sendfrag->frag_send.frag_request,
|
||||
header->hdr_frag.hdr_frag_length);
|
||||
|
||||
OMPI_FREE_LIST_RETURN(flist,
|
||||
((ompi_list_item_t *) sendfrag));
|
||||
|
||||
} else if(NULL == req) {
|
||||
/* An ack descriptor ? Don't know what to do! */
|
||||
OMPI_FREE_LIST_RETURN(flist,
|
||||
@ -354,7 +361,7 @@ int mca_ptl_ib_put_frag_init(mca_ptl_ib_send_frag_t *sendfrag,
|
||||
if (rc < 0) {
|
||||
ompi_output (0, "[%s:%d] Unable to pack data\n",
|
||||
__FILE__, __LINE__);
|
||||
return;
|
||||
return rc;
|
||||
}
|
||||
size_out = iov.iov_len;
|
||||
} else {
|
||||
|
@ -52,7 +52,7 @@
|
||||
#define D_PRINT(fmt, args...)
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
#define A_PRINT(fmt, args...) { \
|
||||
ompi_output(0, "[%s:%d:%s] " fmt, __FILE__, __LINE__, __func__, \
|
||||
##args); \
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user