ARGOBOTS
dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
|
Go to the documentation of this file.
57 ABTI_UB_ASSERT(ABTI_initialized());
58 ABTI_UB_ASSERT(newdef);
59 ABTI_UB_ASSERT(p_create_unit);
60 ABTI_UB_ASSERT(p_free_unit);
61 ABTI_UB_ASSERT(p_is_empty);
62 ABTI_UB_ASSERT(p_pop);
63 ABTI_UB_ASSERT(p_push);
65 ABTI_pool_user_def *p_newdef;
67 ABTU_calloc(1,
sizeof(ABTI_pool_user_def), (
void **)&p_newdef);
68 ABTI_CHECK_ERROR(abt_errno);
70 ABTI_UB_ASSERT(p_newdef->symbol == NULL);
72 p_newdef->required_def.p_create_unit = p_create_unit;
73 p_newdef->required_def.p_free_unit = p_free_unit;
74 p_newdef->required_def.p_is_empty = p_is_empty;
75 p_newdef->required_def.p_pop = p_pop;
76 p_newdef->required_def.p_push = p_push;
78 *newdef = ABTI_pool_user_def_get_handle(p_newdef);
106 ABTI_UB_ASSERT(ABTI_initialized());
110 ABTI_pool_user_def *p_def = ABTI_pool_user_def_get_ptr(h_def);
111 ABTI_CHECK_NULL_POOL_USER_DEF_PTR(p_def);
145 ABTI_UB_ASSERT(ABTI_initialized());
147 ABTI_pool_user_def *p_def = ABTI_pool_user_def_get_ptr(def);
148 ABTI_CHECK_NULL_POOL_USER_DEF_PTR(p_def);
150 p_def->optional_def.p_init = p_init;
180 ABTI_UB_ASSERT(ABTI_initialized());
182 ABTI_pool_user_def *p_def = ABTI_pool_user_def_get_ptr(def);
183 ABTI_CHECK_NULL_POOL_USER_DEF_PTR(p_def);
185 p_def->optional_def.p_free = p_free;
215 ABTI_UB_ASSERT(ABTI_initialized());
217 ABTI_pool_user_def *p_def = ABTI_pool_user_def_get_ptr(def);
218 ABTI_CHECK_NULL_POOL_USER_DEF_PTR(p_def);
220 p_def->optional_def.p_get_size = p_get_size;
250 ABTI_UB_ASSERT(ABTI_initialized());
252 ABTI_pool_user_def *p_def = ABTI_pool_user_def_get_ptr(def);
253 ABTI_CHECK_NULL_POOL_USER_DEF_PTR(p_def);
255 p_def->optional_def.p_pop_wait = p_pop_wait;
285 ABTI_UB_ASSERT(ABTI_initialized());
287 ABTI_pool_user_def *p_def = ABTI_pool_user_def_get_ptr(def);
288 ABTI_CHECK_NULL_POOL_USER_DEF_PTR(p_def);
290 p_def->optional_def.p_pop_many = p_pop_many;
320 ABTI_UB_ASSERT(ABTI_initialized());
322 ABTI_pool_user_def *p_def = ABTI_pool_user_def_get_ptr(def);
323 ABTI_CHECK_NULL_POOL_USER_DEF_PTR(p_def);
325 p_def->optional_def.p_push_many = p_push_many;
355 ABTI_UB_ASSERT(ABTI_initialized());
357 ABTI_pool_user_def *p_def = ABTI_pool_user_def_get_ptr(def);
358 ABTI_CHECK_NULL_POOL_USER_DEF_PTR(p_def);
360 p_def->optional_def.p_print_all = p_print_all;
int ABT_pool_user_def_set_print_all(ABT_pool_user_def def, ABT_pool_user_print_all_fn p_print_all)
Register a print-all function to a pool definition.
int ABT_bool
Boolean type.
int ABT_pool_user_def_free(ABT_pool_user_def *def)
Free a pool definition.
int ABT_pool_user_def_set_get_size(ABT_pool_user_def def, ABT_pool_user_get_size_fn p_get_size)
Register a size inquiry function to a pool definition.
void(* ABT_pool_user_print_all_fn)(ABT_pool, void *arg, void(*)(void *, ABT_thread))
Function that applies a user-given function to all work units in a pool.
ABT_unit(* ABT_pool_user_create_unit_fn)(ABT_pool, ABT_thread)
Function that creates an ABT_unit handle that is associated with an ABT_thread handle.
void(* ABT_pool_user_push_many_fn)(ABT_pool, const ABT_unit *, size_t, ABT_pool_context)
Function that pushes work units to a pool.
size_t(* ABT_pool_user_get_size_fn)(ABT_pool)
Function that returns the number of work units in a pool.
int ABT_pool_user_def_create(ABT_pool_user_create_unit_fn p_create_unit, ABT_pool_user_free_unit_fn p_free_unit, ABT_pool_user_is_empty_fn p_is_empty, ABT_pool_user_pop_fn p_pop, ABT_pool_user_push_fn p_push, ABT_pool_user_def *newdef)
Create a new pool definition.
void(* ABT_pool_user_push_fn)(ABT_pool, ABT_unit, ABT_pool_context)
Function that pushes a work unit to a pool.
int ABT_pool_user_def_set_pop_wait(ABT_pool_user_def def, ABT_pool_user_pop_wait_fn p_pop_wait)
Register a pop-wait function to a pool definition.
int ABT_pool_user_def_set_init(ABT_pool_user_def def, ABT_pool_user_init_fn p_init)
Register a pool initialization function to a pool definition.
A struct that defines a pool.
void(* ABT_pool_user_pop_many_fn)(ABT_pool, ABT_thread *, size_t, size_t *, ABT_pool_context)
Function that pops work units from a pool.
int ABT_pool_user_def_set_free(ABT_pool_user_def def, ABT_pool_user_free_fn p_free)
Register a pool finalization function to a pool definition.
static ABTU_ret_err int ABTU_calloc(size_t num, size_t size, void **p_ptr)
#define ABT_SUCCESS
Error code: the routine returns successfully.
ABT_thread(* ABT_pool_user_pop_wait_fn)(ABT_pool, double, ABT_pool_context)
Function that pops a work unit from a pool with wait.
void(* ABT_pool_user_free_fn)(ABT_pool)
Function that frees a pool.
#define ABT_TRUE
True constant for ABT_bool.
void(* ABT_pool_user_free_unit_fn)(ABT_pool, ABT_unit)
Function that frees an ABT_unit handle.
#define ABT_FALSE
False constant for ABT_bool.
ABT_bool(* ABT_pool_user_is_empty_fn)(ABT_pool)
Function that returns if a pool is empty.
static void ABTU_free(void *ptr)
ABT_thread(* ABT_pool_user_pop_fn)(ABT_pool, ABT_pool_context)
Function that pops a work unit from a pool.
ABT_unit_create_from_thread_fn u_create_from_thread
Function that creates an ABT_unit handle that is associated with an ABT_thread handle.
int ABT_pool_user_def_set_push_many(ABT_pool_user_def def, ABT_pool_user_push_many_fn p_push_many)
Register a push-many function to a pool definition.
#define ABT_POOL_USER_DEF_NULL
int(* ABT_pool_user_init_fn)(ABT_pool, ABT_pool_config)
Function that creates a pool.
int ABT_pool_user_def_set_pop_many(ABT_pool_user_def def, ABT_pool_user_pop_many_fn p_pop_many)
Register a pop-many function to a pool definition.