added request allocator to ptl
This commit was SVN r314.
Этот коммит содержится в:
родитель
60c3cdbd1a
Коммит
f5039f70e1
@ -7,7 +7,7 @@
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "lam/lfc/list.h"
|
||||
#include "lam/threads/mutex.h"
|
||||
#include "lam/constants.h"
|
||||
#include "lam/mem/seg_list.h"
|
||||
#include "lam/mem/mem_pool.h"
|
||||
|
||||
@ -16,47 +16,37 @@ extern lam_class_info_t lam_free_lists_cls;
|
||||
|
||||
struct lam_free_list_t
|
||||
{
|
||||
lam_object_t super;
|
||||
int fl_is_shared;
|
||||
lam_mem_pool_t *fl_pool;
|
||||
const char *fl_description;
|
||||
int fl_elt_per_chunk;
|
||||
size_t fl_elt_size;
|
||||
lam_seg_list_t *fl_free_list;
|
||||
int fl_retry_more_resources;
|
||||
int fl_enforce_affinity;
|
||||
int fl_threshold_grow;
|
||||
lam_class_info_t *fl_elt_cls; /* this will be used to create new free list elements. */
|
||||
lam_mutex_t fl_lock;
|
||||
|
||||
/* for mem profiling */
|
||||
int *fl_elt_out;
|
||||
int *fl_elt_max;
|
||||
int *fl_elt_sum;
|
||||
int *fl_nevents;
|
||||
#if LAM_ENABLE_DEBUG
|
||||
int *fl_chunks_req;
|
||||
int *fl_chunks_returned;
|
||||
#endif
|
||||
lam_list_t super;
|
||||
int fl_max_to_alloc;
|
||||
int fl_num_allocated;
|
||||
int fl_num_per_alloc;
|
||||
lam_allocator_t fl_allocator;
|
||||
};
|
||||
typedef struct lam_free_list_t lam_free_list_t;
|
||||
|
||||
|
||||
|
||||
void lam_free_list_init(lam_free_list_t *flist);
|
||||
void lam_free_list_destroy(lam_free_list_t *flist);
|
||||
|
||||
|
||||
/* lam_free_list_init() must have been called prior to calling this function */
|
||||
int lam_free_list_init_with(
|
||||
lam_free_list_t *flist,
|
||||
size_t element_size,
|
||||
int min_pages,
|
||||
int max_pages,
|
||||
int num_pages_per_alloc,
|
||||
lam_mem_pool_t *pool);
|
||||
lam_free_list_t *flist,
|
||||
size_t element_size,
|
||||
int num_elements_to_alloc,
|
||||
int max_elements_to_alloc,
|
||||
int num_elements_per_alloc,
|
||||
lam_allocator_t);
|
||||
|
||||
lam_list_item_t *lam_free_list_get(lam_free_list_t *, int *);
|
||||
int lam_free_list_return(lam_free_list_t *, lam_list_item_t *);
|
||||
static inline lam_list_item_t *lam_free_list_get(lam_free_list_t * list, int *rc)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int lam_free_list_return(lam_free_list_t *list, lam_list_item_t *rc)
|
||||
{
|
||||
return LAM_ERROR;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -25,14 +25,14 @@ typedef struct mca_ptl_1_0_0_t mca_ptl_t;
|
||||
* PTL module functions.
|
||||
*/
|
||||
|
||||
typedef bool (*mca_ptl_init_1_0_0_fn_t)(struct mca_ptl_1_0_0_t** ptls, int* num_ptls, int *thread_min, int *thread_max);
|
||||
typedef int (*mca_ptl_init_1_0_0_fn_t)(struct mca_ptl_1_0_0_t** ptls, int* num_ptls, int *thread_min, int *thread_max);
|
||||
typedef int (*mca_ptl_fini_1_0_0_fn_t)(struct mca_ptl_1_0_0_t*);
|
||||
|
||||
/*
|
||||
* PTL action functions.
|
||||
*/
|
||||
|
||||
typedef mca_pml_base_send_request_t* (*mca_ptl_send_request_alloc_fn_t)(mca_ptl_t*);
|
||||
typedef mca_pml_base_send_request_t* (*mca_ptl_request_alloc_fn_t)(mca_ptl_t*);
|
||||
typedef int (*mca_ptl_fragment_fn_t)(mca_ptl_t*, mca_pml_base_send_request_t*, size_t);
|
||||
typedef int (*mca_ptl_progress_fn_t)(mca_ptl_t*, mca_pml_base_tstamp_t);
|
||||
|
||||
@ -44,10 +44,8 @@ typedef int (*mca_ptl_progress_fn_t)(mca_ptl_t*, mca_pml_base_tstamp_t);
|
||||
struct mca_ptl_module_1_0_0_t {
|
||||
mca_base_module_t ptlm_version;
|
||||
mca_base_module_data_1_0_0_t ptlm_data;
|
||||
|
||||
mca_ptl_init_1_0_0_fn_t ptlm_init;
|
||||
};
|
||||
|
||||
typedef struct mca_ptl_module_1_0_0_t mca_ptl_module_1_0_0_t;
|
||||
|
||||
/*
|
||||
@ -66,13 +64,11 @@ struct mca_ptl_1_0_0_t {
|
||||
size_t ptl_endpoint_count; /* number endpoints supported by this CDI */
|
||||
|
||||
/* PTL function table */
|
||||
mca_ptl_send_request_alloc_fn_t ptl_send_request_alloc;
|
||||
mca_ptl_request_alloc_fn_t ptl_request_alloc;
|
||||
mca_ptl_fragment_fn_t ptl_fragment;
|
||||
mca_ptl_progress_fn_t ptl_progress;
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef struct mca_ptl_1_0_0_t mca_ptl_1_0_0_t;
|
||||
|
||||
/*
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user