2005-06-28 01:21:15 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#ifndef MCA_BTL_TEMPLATE_FRAG_H
|
|
|
|
#define MCA_BTL_TEMPLATE_FRAG_H
|
2005-06-28 01:21:15 +04:00
|
|
|
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#define MCA_BTL_TEMPLATE_FRAG_ALIGN (8)
|
2005-06-28 01:21:15 +04:00
|
|
|
#include "ompi_config.h"
|
2005-06-30 09:50:55 +04:00
|
|
|
#include "btl_template.h"
|
2005-06-28 01:21:15 +04:00
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2005-06-30 09:50:55 +04:00
|
|
|
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_btl_template_frag_t);
|
2005-06-28 01:21:15 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TEMPLATE send fratemplateent derived type.
|
|
|
|
*/
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_template_frag_t {
|
|
|
|
mca_btl_base_descriptor_t base;
|
|
|
|
mca_btl_base_segment_t segment;
|
|
|
|
struct mca_btl_base_endpoint_t *endpoint;
|
|
|
|
mca_btl_base_header_t *hdr;
|
2005-06-28 01:21:15 +04:00
|
|
|
size_t size;
|
2005-06-30 09:50:55 +04:00
|
|
|
#if MCA_BTL_HAS_MPOOL
|
2005-06-28 01:21:15 +04:00
|
|
|
struct mca_mpool_base_registration_t* registration;
|
|
|
|
#endif
|
|
|
|
};
|
2005-06-30 09:50:55 +04:00
|
|
|
typedef struct mca_btl_template_frag_t mca_btl_template_frag_t;
|
|
|
|
OBJ_CLASS_DECLARATION(mca_btl_template_frag_t);
|
2005-06-28 01:21:15 +04:00
|
|
|
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
typedef struct mca_btl_template_frag_t mca_btl_template_frag_eager_t;
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
OBJ_CLASS_DECLARATION(mca_btl_template_frag_eager_t);
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
typedef struct mca_btl_template_frag_t mca_btl_template_frag_max_t;
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
OBJ_CLASS_DECLARATION(mca_btl_template_frag_max_t);
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
typedef struct mca_btl_template_frag_t mca_btl_template_frag_user_t;
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
OBJ_CLASS_DECLARATION(mca_btl_template_frag_user_t);
|
2005-06-28 01:21:15 +04:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Macros to allocate/return descriptors from module specific
|
|
|
|
* free list(s).
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#define MCA_BTL_TEMPLATE_FRAG_ALLOC_EAGER(btl, frag, rc) \
|
2005-06-28 01:21:15 +04:00
|
|
|
{ \
|
|
|
|
\
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t *item; \
|
2005-06-30 09:50:55 +04:00
|
|
|
OMPI_FREE_LIST_WAIT(&((mca_btl_template_module_t*)btl)->template_frag_eager, item, rc); \
|
|
|
|
frag = (mca_btl_template_frag_t*) item; \
|
2005-06-28 01:21:15 +04:00
|
|
|
}
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#define MCA_BTL_TEMPLATE_FRAG_RETURN_EAGER(btl, frag) \
|
2005-06-28 01:21:15 +04:00
|
|
|
{ \
|
2005-06-30 09:50:55 +04:00
|
|
|
OMPI_FREE_LIST_RETURN(&((mca_btl_template_module_t*)btl)->template_frag_eager, \
|
2005-07-03 20:22:16 +04:00
|
|
|
(opal_list_item_t*)(frag)); \
|
2005-06-28 01:21:15 +04:00
|
|
|
}
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#define MCA_BTL_TEMPLATE_FRAG_ALLOC_MAX(btl, frag, rc) \
|
2005-06-28 01:21:15 +04:00
|
|
|
{ \
|
|
|
|
\
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t *item; \
|
2005-06-30 09:50:55 +04:00
|
|
|
OMPI_FREE_LIST_WAIT(&((mca_btl_template_module_t*)btl)->template_frag_max, item, rc); \
|
|
|
|
frag = (mca_btl_template_frag_t*) item; \
|
2005-06-28 01:21:15 +04:00
|
|
|
}
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#define MCA_BTL_TEMPLATE_FRAG_RETURN_MAX(btl, frag) \
|
2005-06-28 01:21:15 +04:00
|
|
|
{ \
|
2005-06-30 09:50:55 +04:00
|
|
|
OMPI_FREE_LIST_RETURN(&((mca_btl_template_module_t*)btl)->template_frag_max, \
|
2005-07-03 20:22:16 +04:00
|
|
|
(opal_list_item_t*)(frag)); \
|
2005-06-28 01:21:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#define MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(btl, frag, rc) \
|
2005-06-28 01:21:15 +04:00
|
|
|
{ \
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t *item; \
|
2005-06-30 09:50:55 +04:00
|
|
|
OMPI_FREE_LIST_WAIT(&((mca_btl_template_module_t*)btl)->template_frag_user, item, rc); \
|
|
|
|
frag = (mca_btl_template_frag_t*) item; \
|
2005-06-28 01:21:15 +04:00
|
|
|
}
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#define MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl, frag) \
|
2005-06-28 01:21:15 +04:00
|
|
|
{ \
|
2005-06-30 09:50:55 +04:00
|
|
|
OMPI_FREE_LIST_RETURN(&((mca_btl_template_module_t*)btl)->template_frag_user, \
|
2005-07-03 20:22:16 +04:00
|
|
|
(opal_list_item_t*)(frag)); \
|
2005-06-28 01:21:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|