1
1

Rather than using fragment size to determine fragment type, use an enum.

Do this rather than the my_list pointer because we need to do some
things that are somewhat special because we pre-pin eager fragments but
not send fragments.  Also makes a couple ideas I have slightly easier to
play around with.

This commit was SVN r10127.
Этот коммит содержится в:
Brian Barrett 2006-05-31 03:34:32 +00:00
родитель 0b09ba928c
Коммит c723d196c5
3 изменённых файлов: 14 добавлений и 3 удалений

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

@ -264,16 +264,18 @@ mca_btl_portals_free(struct mca_btl_base_module_t* btl_base,
assert(&mca_btl_portals_module == (mca_btl_portals_module_t*) btl_base);
if (frag->size == mca_btl_portals_module.super.btl_eager_limit){
if (BTL_PORTALS_FRAG_TYPE_EAGER == frag->type) {
/* don't ever unlink eager frags */
OMPI_BTL_PORTALS_FRAG_RETURN_EAGER(&mca_btl_portals_module.super, frag);
} else if (frag->size == mca_btl_portals_module.super.btl_max_send_size) {
} else if (BTL_PORTALS_FRAG_TYPE_MAX == frag->type) {
if (frag->md_h != PTL_INVALID_HANDLE) {
PtlMDUnlink(frag->md_h);
frag->md_h = PTL_INVALID_HANDLE;
}
OMPI_BTL_PORTALS_FRAG_RETURN_MAX(&mca_btl_portals_module.super, frag);
} else if (frag->size == 0) {
} else if (BTL_PORTALS_FRAG_TYPE_USER == frag->type) {
if (frag->md_h != PTL_INVALID_HANDLE) {
PtlMDUnlink(frag->md_h);
frag->md_h = PTL_INVALID_HANDLE;

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

@ -43,6 +43,7 @@ mca_btl_portals_frag_eager_constructor(mca_btl_portals_frag_t* frag)
{
frag->size = mca_btl_portals_module.super.btl_eager_limit;
mca_btl_portals_frag_common_send_constructor(frag);
frag->type = BTL_PORTALS_FRAG_TYPE_EAGER;
}
@ -61,6 +62,7 @@ mca_btl_portals_frag_max_constructor(mca_btl_portals_frag_t* frag)
{
frag->size = mca_btl_portals_module.super.btl_max_send_size;
mca_btl_portals_frag_common_send_constructor(frag);
frag->type = BTL_PORTALS_FRAG_TYPE_MAX;
}
@ -73,6 +75,7 @@ mca_btl_portals_frag_user_constructor(mca_btl_portals_frag_t* frag)
frag->base.des_src = 0;
frag->base.des_src_cnt = 0;
frag->size = 0;
frag->type = BTL_PORTALS_FRAG_TYPE_USER;
}
static void

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

@ -41,6 +41,9 @@ struct mca_btl_portals_frag_t {
we need to send */
size_t size;
enum { BTL_PORTALS_FRAG_TYPE_EAGER,
BTL_PORTALS_FRAG_TYPE_MAX,
BTL_PORTALS_FRAG_TYPE_USER } type;
};
typedef struct mca_btl_portals_frag_t mca_btl_portals_frag_t;
OBJ_CLASS_DECLARATION(mca_btl_portals_frag_t);
@ -77,6 +80,7 @@ OBJ_CLASS_DECLARATION(mca_btl_portals_frag_recv_t);
#define OMPI_BTL_PORTALS_FRAG_RETURN_EAGER(btl_macro, frag) \
{ \
assert(BTL_PORTALS_FRAG_TYPE_EAGER == frag->type); \
OMPI_FREE_LIST_RETURN(&((mca_btl_portals_module_t*)btl_macro)->portals_frag_eager, \
(opal_list_item_t*)(frag)); \
}
@ -93,6 +97,7 @@ OBJ_CLASS_DECLARATION(mca_btl_portals_frag_recv_t);
#define OMPI_BTL_PORTALS_FRAG_RETURN_MAX(btl_macro, frag) \
{ \
assert(BTL_PORTALS_FRAG_TYPE_MAX == frag->type); \
OMPI_FREE_LIST_RETURN(&((mca_btl_portals_module_t*)btl_macro)->portals_frag_max, \
(opal_list_item_t*)(frag)); \
}
@ -108,6 +113,7 @@ OBJ_CLASS_DECLARATION(mca_btl_portals_frag_recv_t);
#define OMPI_BTL_PORTALS_FRAG_RETURN_USER(btl_macro, frag) \
{ \
assert(BTL_PORTALS_FRAG_TYPE_USER == frag->type); \
OMPI_FREE_LIST_RETURN(&((mca_btl_portals_module_t*)btl_macro)->portals_frag_user, \
(opal_list_item_t*)(frag)); \
}