1
1

Use OMPI_FREE_LIST_GET not the blocking OMPI_FREE_LIST_WAIT, this allows GM

to take advantage of PML OB1 resource management.. Tested with intel test
suite p2p_c on 4 nodes. 

This commit was SVN r12075.
Этот коммит содержится в:
Galen Shipman 2006-10-10 14:56:55 +00:00
родитель 33f300f636
Коммит 7102d39415
4 изменённых файлов: 69 добавлений и 17 удалений

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

@ -208,9 +208,18 @@ mca_btl_base_descriptor_t* mca_btl_gm_alloc(
if(size <= btl->btl_eager_limit) {
MCA_BTL_GM_FRAG_ALLOC_EAGER(gm_btl, frag, rc);
if(NULL == frag) {
return NULL;
}
frag->type=MCA_BTL_GM_EAGER;
frag->segment.seg_len = size;
} else if(size <= btl->btl_max_send_size) {
MCA_BTL_GM_FRAG_ALLOC_MAX(gm_btl, frag, rc);
if(NULL == frag) {
return NULL;
}
frag->type=MCA_BTL_GM_SEND;
frag->segment.seg_len = size;
} else {
return NULL;
@ -276,6 +285,11 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
if(NULL == frag){
return NULL;
}
/*
* just assign it something..
* we will assign the real value in put/get
*/
frag->type = MCA_BTL_GM_PUT;
iov.iov_len = max_data;
iov.iov_base = NULL;
@ -308,6 +322,11 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
if(NULL == frag){
return NULL;
}
/*
* just assign it something..
* we will assign the real value in put/get
*/
frag->type = MCA_BTL_GM_PUT;
iov.iov_len = max_data;
iov.iov_base = NULL;
@ -339,6 +358,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
if(NULL == frag) {
return NULL;
}
frag->type = MCA_BTL_GM_EAGER;
iov.iov_len = max_data;
iov.iov_base = (unsigned char*) frag->segment.seg_addr.pval + reserve;
@ -362,6 +382,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
if(NULL == frag) {
return NULL;
}
frag->type = MCA_BTL_GM_SEND;
if(max_data + reserve > btl->btl_max_send_size){
max_data = btl->btl_max_send_size - reserve;
}
@ -419,8 +440,20 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_dst(
if(NULL == frag) {
return NULL;
}
/*
* just assign it something..
* we will assign the real value in put/get
*/
frag->type = MCA_BTL_GM_PUT;
ompi_ddt_type_lb(convertor->pDesc, &lb);
/*
* we don't know that this is for a PUT,
* but it doesn't matter.. they belong
* on the same list eventually anyway
*/
frag->type = MCA_BTL_GM_PUT;
frag->segment.seg_len = *size;
frag->segment.seg_addr.pval = convertor->pBaseBuf + lb + convertor->bConverted;
@ -553,7 +586,6 @@ static int mca_btl_gm_send_nl(
frag->btl = gm_btl;
frag->endpoint = endpoint;
frag->hdr->tag = tag;
frag->type = MCA_BTL_GM_SEND;
/* queue the descriptor if there are no send tokens */
MCA_BTL_GM_ACQUIRE_TOKEN_NL(gm_btl, frag);
@ -614,8 +646,7 @@ int mca_btl_gm_send(
frag->btl = gm_btl;
frag->endpoint = endpoint;
frag->hdr->tag = tag;
frag->type = MCA_BTL_GM_SEND;
/* queue the descriptor if there are no send tokens */
OPAL_THREAD_LOCK(&mca_btl_gm_component.gm_lock);
MCA_BTL_GM_ACQUIRE_TOKEN(gm_btl, frag);

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

@ -380,6 +380,7 @@ do {
if(NULL != frag) { \
switch(frag->type) { \
case MCA_BTL_GM_SEND: \
case MCA_BTL_GM_EAGER: \
mca_btl_gm_send_nl(&btl->super, frag->endpoint, &frag->base, frag->hdr->tag); \
break; \
case MCA_BTL_GM_PUT: \

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

@ -286,6 +286,7 @@ mca_btl_gm_module_init (mca_btl_gm_module_t * btl)
if(NULL == frag) {
return rc;
}
frag->type = MCA_BTL_GM_EAGER;
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;
frag->base.des_dst = &frag->segment;
@ -300,6 +301,7 @@ mca_btl_gm_module_init (mca_btl_gm_module_t * btl)
if(NULL == frag) {
return rc;
}
frag->type = MCA_BTL_GM_SEND;
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;
frag->base.des_dst = &frag->segment;

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

@ -23,12 +23,15 @@
#define MCA_BTL_GM_FRAG_ALIGN (8)
#include "ompi_config.h"
#include "btl_gm.h"
#include "ompi/mca/btl/base/btl_base_error.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
typedef enum {
MCA_BTL_GM_EAGER,
MCA_BTL_GM_SEND,
MCA_BTL_GM_PUT,
MCA_BTL_GM_GET
@ -48,7 +51,7 @@ struct mca_btl_gm_frag_t {
size_t size;
enum gm_priority priority;
mca_btl_gm_frag_type_t type;
ompi_free_list_t* my_list;
};
typedef struct mca_btl_gm_frag_t mca_btl_gm_frag_t;
@ -75,34 +78,49 @@ OBJ_CLASS_DECLARATION(mca_btl_gm_frag_user_t);
{ \
\
ompi_free_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&((mca_btl_gm_module_t*)btl)->gm_frag_eager, item, rc); \
OMPI_FREE_LIST_GET(&((mca_btl_gm_module_t*)btl)->gm_frag_eager, item, rc); \
frag = (mca_btl_gm_frag_t*) item; \
frag->my_list = &((mca_btl_gm_module_t*)btl)->gm_frag_eager; \
}
#define MCA_BTL_GM_FRAG_ALLOC_MAX(btl, frag, rc) \
{ \
\
ompi_free_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&((mca_btl_gm_module_t*)btl)->gm_frag_max, item, rc); \
frag = (mca_btl_gm_frag_t*) item; \
frag->my_list = &((mca_btl_gm_module_t*)btl)->gm_frag_max; \
OMPI_FREE_LIST_GET(&((mca_btl_gm_module_t*)btl)->gm_frag_max, item, rc); \
frag = (mca_btl_gm_frag_t*) item; \
}
#define MCA_BTL_GM_FRAG_ALLOC_USER(btl, frag, rc) \
{ \
ompi_free_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&((mca_btl_gm_module_t*)btl)->gm_frag_user, item, rc); \
OMPI_FREE_LIST_GET(&((mca_btl_gm_module_t*)btl)->gm_frag_user, item, rc); \
frag = (mca_btl_gm_frag_t*) item; \
frag->my_list = &((mca_btl_gm_module_t*)btl)->gm_frag_user; \
}
#define MCA_BTL_GM_FRAG_RETURN(btl, frag) \
{ \
OMPI_FREE_LIST_RETURN(frag->my_list, \
(ompi_free_list_item_t*)(frag)); \
}
do { \
ompi_free_list_t* mylist; \
mca_btl_gm_module_t* btl_gm = (mca_btl_gm_module_t*) btl; \
mca_btl_gm_frag_t* frag_gm = (mca_btl_gm_frag_t*) frag; \
switch(frag_gm->type) { \
case MCA_BTL_GM_EAGER: \
mylist = &btl_gm->gm_frag_eager; \
break; \
case MCA_BTL_GM_SEND: \
mylist = &btl_gm->gm_frag_max; \
break; \
case MCA_BTL_GM_PUT: \
case MCA_BTL_GM_GET: \
mylist = &btl_gm->gm_frag_user; \
break; \
default: \
BTL_ERROR(("Unknown frag type\n")); \
break; \
} \
OMPI_FREE_LIST_RETURN(mylist, \
(ompi_free_list_item_t*)(frag)); \
} while (0);
/* called with mca_btl_gm_component.gm_lock held */