Removed the send descriptors from a per-connection resource to
a `module' resource in order to allow for `request_init' to correctly return a usable descriptor. This commit was SVN r2645.
Этот коммит содержится в:
родитель
c93d99835c
Коммит
1fb4653445
@ -14,7 +14,7 @@
|
||||
#include "mca/ptl/base/ptl_base_recvfrag.h"
|
||||
#include "mca/base/mca_base_module_exchange.h"
|
||||
#include "ptl_ib.h"
|
||||
#include "ptl_ib_sendfrag.h"
|
||||
//#include "ptl_ib_sendfrag.h"
|
||||
|
||||
mca_ptl_ib_module_t mca_ptl_ib_module = {
|
||||
{
|
||||
@ -164,7 +164,8 @@ int mca_ptl_ib_send( struct mca_ptl_base_module_t* ptl,
|
||||
D_PRINT("");
|
||||
|
||||
if (0 == offset) {
|
||||
sendfrag = &((mca_ptl_ib_send_request_t*)sendreq)->req_frag;
|
||||
sendfrag = (mca_ptl_ib_send_frag_t *)
|
||||
&((mca_ptl_ib_send_request_t*)sendreq)->req_frag;
|
||||
} else {
|
||||
|
||||
/* TODO: Implementation for messages > frag size */
|
||||
|
@ -28,6 +28,7 @@
|
||||
/* Other IB ptl includes */
|
||||
#include "ptl_ib_sendreq.h"
|
||||
#include "ptl_ib_recvfrag.h"
|
||||
#include "ptl_ib_sendfrag.h"
|
||||
|
||||
/**
|
||||
* IB PTL component.
|
||||
|
@ -250,6 +250,13 @@ mca_ptl_base_module_t** mca_ptl_ib_component_init(int *num_ptl_modules,
|
||||
mca_ptl_ib_component.ib_free_list_inc,
|
||||
NULL);
|
||||
|
||||
/* Initialize the send descriptors */
|
||||
if(mca_ptl_ib_register_send_frags((mca_ptl_base_module_t *) &ib_modules[i])
|
||||
!= OMPI_SUCCESS) {
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DUMP_IB_STATE(ib_modules[i].ib_state);
|
||||
}
|
||||
|
||||
|
@ -376,7 +376,7 @@ int mca_ptl_ib_get_num_hcas(uint32_t* num_hcas)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
static int mca_ptl_ib_register_mem(VAPI_hca_hndl_t nic, VAPI_pd_hndl_t ptag,
|
||||
int mca_ptl_ib_register_mem(VAPI_hca_hndl_t nic, VAPI_pd_hndl_t ptag,
|
||||
void* buf, int len, vapi_memhandle_t* memhandle)
|
||||
{
|
||||
VAPI_ret_t ret;
|
||||
@ -453,7 +453,6 @@ int mca_ptl_ib_peer_connect(mca_ptl_ib_state_t *ib_state,
|
||||
{
|
||||
int rc, i;
|
||||
VAPI_ret_t ret;
|
||||
VAPI_qp_num_t qp_num;
|
||||
ib_buffer_t *ib_buf_ptr;
|
||||
|
||||
/* Establish Reliable Connection */
|
||||
@ -467,13 +466,6 @@ int mca_ptl_ib_peer_connect(mca_ptl_ib_state_t *ib_state,
|
||||
}
|
||||
|
||||
/* Allocate resources to this connection */
|
||||
peer_conn->lres->send = (ib_buffer_t*)
|
||||
malloc(sizeof(ib_buffer_t) * NUM_IB_SEND_BUF);
|
||||
|
||||
if(NULL == peer_conn->lres->send) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
peer_conn->lres->recv = (ib_buffer_t*)
|
||||
malloc(sizeof(ib_buffer_t) * NUM_IB_RECV_BUF);
|
||||
|
||||
@ -481,23 +473,7 @@ int mca_ptl_ib_peer_connect(mca_ptl_ib_state_t *ib_state,
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
qp_num = peer_conn->rres->qp_num;
|
||||
|
||||
/* Register the buffers */
|
||||
for(i = 0; i < NUM_IB_SEND_BUF; i++) {
|
||||
|
||||
rc = mca_ptl_ib_register_mem(ib_state->nic, ib_state->ptag,
|
||||
(void*) peer_conn->lres->send[i].buf,
|
||||
4096, &peer_conn->lres->send[i].hndl);
|
||||
if(rc != OMPI_SUCCESS) {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
ib_buf_ptr = &peer_conn->lres->send[i];
|
||||
|
||||
IB_PREPARE_SEND_DESC(ib_buf_ptr, qp_num);
|
||||
}
|
||||
|
||||
for(i = 0; i < NUM_IB_RECV_BUF; i++) {
|
||||
|
||||
rc = mca_ptl_ib_register_mem(ib_state->nic, ib_state->ptag,
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define MCA_PTL_IB_PRIV_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "class/ompi_free_list.h"
|
||||
#include "ptl_ib_vapi.h"
|
||||
|
||||
#define NUM_IB_SEND_BUF (10)
|
||||
@ -89,9 +90,6 @@ struct mca_ptl_ib_peer_local_res_t {
|
||||
VAPI_qp_prop_t qp_prop;
|
||||
/* Local QP properties */
|
||||
|
||||
ib_buffer_t *send;
|
||||
/* Pointer to send buffers */
|
||||
|
||||
ib_buffer_t *recv;
|
||||
/* Pointer to recv buffers */
|
||||
};
|
||||
@ -171,5 +169,7 @@ int mca_ptl_ib_get_num_hcas(uint32_t*);
|
||||
int mca_ptl_ib_init_peer(mca_ptl_ib_state_t*, mca_ptl_ib_peer_conn_t*);
|
||||
int mca_ptl_ib_peer_connect(mca_ptl_ib_state_t*,
|
||||
mca_ptl_ib_peer_conn_t*);
|
||||
int mca_ptl_ib_register_mem(VAPI_hca_hndl_t nic, VAPI_pd_hndl_t ptag,
|
||||
void* buf, int len, vapi_memhandle_t* memhandle);
|
||||
|
||||
#endif /* MCA_PTL_IB_PRIV_H */
|
||||
|
@ -83,7 +83,6 @@ static mca_ptl_ib_proc_t* mca_ptl_ib_proc_lookup_ompi(ompi_proc_t* ompi_proc)
|
||||
|
||||
mca_ptl_ib_proc_t* mca_ptl_ib_proc_create(ompi_proc_t* ompi_proc)
|
||||
{
|
||||
size_t size;
|
||||
mca_ptl_ib_proc_t* module_proc = NULL;
|
||||
|
||||
/* Check if we have already created a IB proc
|
||||
|
@ -174,3 +174,45 @@ mca_ptl_ib_send_frag_t* mca_ptl_ib_alloc_send_frag(
|
||||
|
||||
return ib_send_frag;
|
||||
}
|
||||
|
||||
|
||||
int mca_ptl_ib_register_send_frags(mca_ptl_base_module_t *ptl)
|
||||
{
|
||||
int i, rc, num_send_frags;
|
||||
ompi_list_item_t *item;
|
||||
ompi_free_list_t *flist;
|
||||
ib_buffer_t *ib_buf_ptr;
|
||||
mca_ptl_ib_send_frag_t *ib_send_frag;
|
||||
mca_ptl_ib_state_t *ib_state;
|
||||
|
||||
D_PRINT("");
|
||||
|
||||
flist = &((mca_ptl_ib_module_t *)ptl)->send_free;
|
||||
|
||||
ib_state = ((mca_ptl_ib_module_t *)ptl)->ib_state;
|
||||
|
||||
num_send_frags = ompi_list_get_size(&(flist->super));
|
||||
|
||||
/* Register the buffers */
|
||||
for(i = 0; i < num_send_frags; i++) {
|
||||
|
||||
item = ompi_list_remove_first (&((flist)->super));
|
||||
|
||||
ib_send_frag = (mca_ptl_ib_send_frag_t *) item;
|
||||
|
||||
ib_buf_ptr = (ib_buffer_t *) &ib_send_frag->ib_buf;
|
||||
|
||||
rc = mca_ptl_ib_register_mem(ib_state->nic, ib_state->ptag,
|
||||
(void*) ib_buf_ptr->buf,
|
||||
4096, &ib_buf_ptr->hndl);
|
||||
if(rc != OMPI_SUCCESS) {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
IB_PREPARE_SEND_DESC(ib_buf_ptr, 0);
|
||||
|
||||
ompi_list_append(&((flist)->super), item);
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
@ -56,4 +56,6 @@ mca_ptl_ib_send_frag_t* mca_ptl_ib_alloc_send_frag(
|
||||
mca_ptl_base_module_t* ptl,
|
||||
mca_pml_base_send_request_t* request);
|
||||
|
||||
int mca_ptl_ib_register_send_frags(mca_ptl_base_module_t *ptl);
|
||||
|
||||
#endif
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user