1
1

Short & Long messages working.

This commit was SVN r2903.
Этот коммит содержится в:
Sayantan Sur 2004-10-01 15:24:59 +00:00
родитель 5b03c18c07
Коммит ca2273ed7c
6 изменённых файлов: 47 добавлений и 39 удалений

Просмотреть файл

@ -83,6 +83,7 @@ int mca_ptl_ib_put( struct mca_ptl_base_module_t* ptl,
}
/* Send FIN to receiver */
#if 0
send_frag_fin = mca_ptl_ib_alloc_send_frag(ptl, req);
@ -95,11 +96,17 @@ int mca_ptl_ib_put( struct mca_ptl_base_module_t* ptl,
if(rc != OMPI_SUCCESS) {
return rc;
}
#endif
rc = mca_ptl_ib_put_frag_init(send_frag, ptl_peer,
req, offset, &size, flags);
if(rc != OMPI_SUCCESS) {
return rc;
}
/* Update offset */
req->req_offset += size;
rc = mca_ptl_ib_peer_send(ptl_peer, send_frag_fin);
rc = mca_ptl_ib_peer_send(ptl_peer, send_frag);
return rc;
}
@ -182,6 +189,7 @@ int mca_ptl_ib_finalize(struct mca_ptl_base_module_t* ptl)
int mca_ptl_ib_request_init( struct mca_ptl_base_module_t* ptl,
struct mca_pml_base_send_request_t* request)
{
#if 0
mca_ptl_ib_send_request_t *ib_send_req;
mca_ptl_ib_send_frag_t *ib_send_frag;
@ -200,7 +208,8 @@ int mca_ptl_ib_request_init( struct mca_ptl_base_module_t* ptl,
memset(ib_send_req->req_buf, 7, 8);
}
return OMPI_SUCCESS;
#endif
return OMPI_ERROR;
}
void mca_ptl_ib_request_fini( struct mca_ptl_base_module_t* ptl,
@ -225,8 +234,23 @@ int mca_ptl_ib_send( struct mca_ptl_base_module_t* ptl,
int flags)
{
mca_ptl_ib_send_frag_t* sendfrag;
mca_ptl_ib_send_request_t *ib_send_req;
int rc = OMPI_SUCCESS;
sendfrag = mca_ptl_ib_alloc_send_frag(ptl,
sendreq);
if(NULL == sendfrag) {
D_PRINT("Unable to allocate ib_send_frag");
return OMPI_ERR_OUT_OF_RESOURCE;
} else {
ib_send_req = (mca_ptl_ib_send_request_t *) sendreq;
ib_send_req->req_frag = sendfrag;
memset(ib_send_req->req_buf, 7, 8);
}
#if 0
if (0 == offset) {
sendfrag = (mca_ptl_ib_send_frag_t *)
((mca_ptl_ib_send_request_t*)sendreq)->req_frag;
@ -240,6 +264,7 @@ int mca_ptl_ib_send( struct mca_ptl_base_module_t* ptl,
ompi_output(0,"Unable to allocate send fragment");
}
}
#endif
rc = mca_ptl_ib_send_frag_init(sendfrag, ptl_peer,
sendreq, offset, &size, flags);

Просмотреть файл

@ -103,7 +103,7 @@ int mca_ptl_ib_component_open(void)
/* register IB component parameters */
mca_ptl_ib_component.ib_free_list_num =
mca_ptl_ib_param_register_int ("free_list_num", 32);
mca_ptl_ib_param_register_int ("free_list_num", 64);
mca_ptl_ib_component.ib_free_list_max =
mca_ptl_ib_param_register_int ("free_list_max", 1024);
mca_ptl_ib_component.ib_free_list_inc =

Просмотреть файл

@ -6,7 +6,7 @@
#include "ptl_ib_vapi.h"
#define NUM_IB_SEND_BUF (10)
#define NUM_IB_RECV_BUF (10)
#define NUM_IB_RECV_BUF (1000)
#define MCA_PTL_IB_FIRST_FRAG_SIZE (65536)

Просмотреть файл

@ -91,7 +91,7 @@ static void mca_ptl_ib_data_frag(mca_ptl_base_module_t *module,
if (!matched) {
/* Oh my GOD
* !!! */
D_PRINT("Can't match buffer. Mama is unhappy\n");
//ompi_output(0, "Can't match buffer. Mama is unhappy\n");
memcpy (recv_frag->unex_buf,
(char *) header + sizeof (mca_ptl_base_header_t),
header->hdr_frag.hdr_frag_length);

Просмотреть файл

@ -152,38 +152,6 @@ int mca_ptl_ib_send_frag_init(mca_ptl_ib_send_frag_t* sendfrag,
return OMPI_SUCCESS;
}
static ompi_list_item_t * my_ompi_list_remove_first(ompi_list_t *list)
{
volatile ompi_list_item_t *item;
if ( 0 == list->ompi_list_length ) {
return (ompi_list_item_t *)NULL;
}
A_PRINT("");
/* reset list length counter */
list->ompi_list_length--;
/* get pointer to first element on the list */
item = list->ompi_list_head.ompi_list_next;
A_PRINT("item : %p", item);
/* reset previous pointer of next item on the list */
item->ompi_list_next->ompi_list_prev=item->ompi_list_prev;
A_PRINT("");
/* reset the head next pointer */
list->ompi_list_head.ompi_list_next=item->ompi_list_next;
A_PRINT("");
#if OMPI_ENABLE_DEBUG
/* debug code */
item->ompi_list_prev=(ompi_list_item_t *)NULL;
item->ompi_list_next=(ompi_list_item_t *)NULL;
#endif
return (ompi_list_item_t *) item;
}
/*
* Allocate a IB send descriptor
*
@ -198,7 +166,7 @@ mca_ptl_ib_send_frag_t* mca_ptl_ib_alloc_send_frag(
flist = &((mca_ptl_ib_module_t *)ptl)->send_free;
item = my_ompi_list_remove_first(&((flist)->super));
item = ompi_list_remove_first(&((flist)->super));
while(NULL == item) {
@ -212,6 +180,8 @@ mca_ptl_ib_send_frag_t* mca_ptl_ib_alloc_send_frag(
ib_send_frag = (mca_ptl_ib_send_frag_t *)item;
B_PRINT("Allocated frag : %p", ib_send_frag);
return ib_send_frag;
}
@ -267,6 +237,7 @@ int mca_ptl_ib_register_send_frags(mca_ptl_base_module_t *ptl)
void mca_ptl_ib_process_rdma_w_comp(mca_ptl_base_module_t *module,
void* comp_addr)
{
#if 0
mca_ptl_ib_send_frag_t *sendfrag;
ompi_free_list_t *flist;
@ -281,6 +252,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));
#endif
}
/*
@ -337,6 +309,8 @@ void mca_ptl_ib_process_send_comp(mca_ptl_base_module_t *module,
header->hdr_frag.hdr_frag_length);
/* Return sendfrag to free list */
B_PRINT("Return frag : %p", sendfrag);
OMPI_FREE_LIST_RETURN(flist,
((ompi_list_item_t *) sendfrag));
} 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); \
@ -61,4 +61,13 @@
#define A_PRINT(fmt, args...)
#endif
#if 0
#define B_PRINT(fmt, args...) { \
ompi_output(0, "[%s:%d:%s] " fmt, __FILE__, __LINE__, __func__, \
##args); \
}
#else
#define B_PRINT(fmt, args...)
#endif
#endif