Go to the documentation of this file.
76 #ifndef ABT_CONFIG_ENABLE_VER_20_API
91 #ifdef ABT_CONFIG_ENABLE_VER_20_API
170 #ifndef ABT_CONFIG_ENABLE_VER_20_API
805 #ifndef ABT_CONFIG_ENABLE_VER_20_API
810 #ifndef ABT_CONFIG_ENABLE_VER_20_API
849 *
id = (int)p_pool->
id;
902 if (p_pool == NULL) {
903 fprintf(p_os,
"%*s== NULL POOL ==\n", indent,
"");
929 "%*s== POOL (%p) ==\n"
930 "%*sid : %" PRIu64
"\n"
932 "%*sautomatic : %s\n"
933 "%*snum_scheds : %d\n"
935 "%*snum_blocked : %d\n"
937 indent,
"", (
void *)p_pool, indent,
"", p_pool->
id, indent,
"",
939 (p_pool->automatic ==
ABT_TRUE) ?
"TRUE" :
"FALSE", indent,
"",
968 p_pool->access = def->
access;
969 p_pool->automatic = automatic;
970 p_pool->is_builtin = is_builtin;
978 p_pool->u_free = def->
u_free;
979 p_pool->p_init = def->
p_init;
981 p_pool->p_push = def->
p_push;
982 p_pool->p_pop = def->
p_pop;
986 p_pool->p_free = def->
p_free;
989 LOG_DEBUG(
"[P%" PRIu64
"] created\n", p_pool->id);
992 if (p_pool->p_init) {
999 *pp_newpool = p_pool;
#define ABTI_CHECK_NULL_SCHED_PTR(p)
ABT_pool_get_size_fn p_get_size
static ABTI_sched * ABTI_sched_get_ptr(ABT_sched sched)
int ABT_pool_get_data(ABT_pool pool, void **data)
Retrieve user data from a pool.
int ABT_pool_pop_wait(ABT_pool pool, ABT_unit *p_unit, double time_secs)
Pop a unit from a pool with wait.
int ABT_bool
Boolean type.
int ABT_pool_get_size(ABT_pool pool, size_t *size)
Get the size of a pool.
ABT_pool_print_all_fn p_print_all
int ABT_pool_create(ABT_pool_def *def, ABT_pool_config config, ABT_pool *newpool)
Create a new pool.
ABT_pool_remove_fn p_remove
int ABT_pool_add_sched(ABT_pool pool, ABT_sched sched)
Create a new work unit associated with a scheduler and push it to a pool.
ABT_pool_print_all_fn p_print_all
#define ABTI_SETUP_GLOBAL(pp_global)
static ABTU_ret_err int ABTI_unit_set_associated_pool(ABTI_global *p_global, ABT_unit unit, ABTI_pool *p_pool, ABTI_thread **pp_thread)
static ABTI_global * ABTI_global_get_global(void)
#define ABT_ERR_POOL
Error code: error related to a pool.
#define ABTI_CHECK_ERROR(abt_errno)
ABT_unit_free_fn u_free
Function that frees a work unit.
static void ABTI_pool_push(ABTI_pool *p_pool, ABT_unit unit)
static size_t ABTI_pool_get_size(ABTI_pool *p_pool)
ABT_pool_remove_fn p_remove
Function that removes a work unit from a pool.
static void ABTD_atomic_release_store_int32(ABTD_atomic_int32 *ptr, int32_t val)
ABT_unit_is_in_pool_fn u_is_in_pool
Function that returns whether a work unit is in its associated pool or not.
ABTU_ret_err int ABTI_pool_get_fifo_def(ABT_pool_access access, ABTI_pool_def *p_def)
struct ABT_pool_opaque * ABT_pool
Pool handle type.
struct ABT_sched_opaque * ABT_sched
Scheduler handle type.
static int32_t ABTD_atomic_acquire_load_int32(const ABTD_atomic_int32 *ptr)
#define ABT_ERR_INV_SCHED
Error code: invalid scheduler.
int ABT_pool_print_all(ABT_pool pool, void *arg, void(*print_fn)(void *, ABT_unit))
Apply a print function to every work unit in a pool using a user-defined function.
ABT_unit_is_in_pool_fn u_is_in_pool
static void ABTD_atomic_release_store_uint64(ABTD_atomic_uint64 *ptr, uint64_t val)
A struct that defines a pool.
ABT_pool_pop_wait_fn p_pop_wait
int ABT_pool_remove(ABT_pool pool, ABT_unit unit)
Remove a specified work unit from a pool.
#define ABT_POOL_CONFIG_NULL
#define ABTI_HANDLE_ERROR(n)
static ABTD_atomic_uint64 g_pool_id
struct ABT_pool_config_opaque * ABT_pool_config
Pool configuration handle type.
ABTU_ret_err int ABTI_pool_create_basic(ABT_pool_kind kind, ABT_pool_access access, ABT_bool automatic, ABTI_pool **pp_newpool)
static ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr)
#define LOG_DEBUG(fmt,...)
static ABTU_ret_err int ABTI_pool_remove(ABTI_pool *p_pool, ABT_unit unit)
ABT_pool_pop_timedwait_fn p_pop_timedwait
Function that pops a work unit from a pool with wait.
ABT_pool_pop_fn p_pop
Function that pops a work unit from a pool.
ABT_pool_free_fn p_free
Function that frees a pool.
#define ABT_ERR_INV_UNIT
Error code: invalid work unit for scheduling.
#define ABTD_ATOMIC_UINT64_STATIC_INITIALIZER(val)
ABT_pool_remove_fn p_remove
#define ABT_ERR_INV_POOL_ACCESS
Error code: invalid pool access type.
ABT_pool_print_all_fn p_print_all
Function that applies a user-given function to all work units in a pool.
ABT_pool_access access
Access type.
static size_t ABTI_pool_get_total_size(ABTI_pool *p_pool)
struct ABT_unit_opaque * ABT_unit
Work unit handle type for scheduling.
ABT_unit_create_from_thread_fn u_create_from_thread
ABT_pool_pop_timedwait_fn p_pop_timedwait
static ABTI_local * ABTI_local_get_local(void)
int ABT_pool_pop(ABT_pool pool, ABT_unit *p_unit)
Pop a work unit from a pool.
ABT_pool_get_size_fn p_get_size
Function that returns a work unit.
ABT_pool_push_fn p_push
Function that pushes a work unit to a pool.
#define ABT_SUCCESS
Error code: the routine returns successfully.
int ABT_pool_push(ABT_pool pool, ABT_unit unit)
Push a unit to a pool.
static uint64_t pool_get_new_id(void)
ABT_pool_pop_wait_fn p_pop_wait
int ABT_pool_get_total_size(ABT_pool pool, size_t *size)
Get the total size of a pool.
int ABT_pool_create_basic(ABT_pool_kind kind, ABT_pool_access access, ABT_bool automatic, ABT_pool *newpool)
Create a new pool from a predefined type.
#define ABT_TRUE
True constant for ABT_bool.
static ABTI_pool * ABTI_pool_get_ptr(ABT_pool pool)
static ABT_unit ABTI_pool_pop(ABTI_pool *p_pool)
static ABTU_ret_err int pool_create(ABTI_pool_def *def, ABT_pool_config config, ABT_bool automatic, ABT_bool is_builtin, ABTI_pool **pp_newpool)
#define ABT_FALSE
False constant for ABT_bool.
#define ABTI_CHECK_NULL_POOL_PTR(p)
static uint64_t ABTD_atomic_fetch_add_uint64(ABTD_atomic_uint64 *ptr, uint64_t v)
#define ABT_ERR_INV_POOL_KIND
Error code: invalid pool kind.
void ABTI_pool_reset_id(void)
static void ABTU_free(void *ptr)
int ABT_pool_set_data(ABT_pool pool, void *data)
Set user data in 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.
void ABTI_pool_print(ABTI_pool *p_pool, FILE *p_os, int indent)
ABTU_ret_err int ABTI_pool_get_fifo_wait_def(ABT_pool_access access, ABTI_pool_def *p_def)
static ABT_unit ABTI_pool_pop_wait(ABTI_pool *p_pool, double time_secs)
int ABT_pool_pop_timedwait(ABT_pool pool, ABT_unit *p_unit, double abstime_secs)
Pop a unit from a pool with timed wait.
int ABT_pool_free(ABT_pool *pool)
Free a pool.
struct ABTI_local ABTI_local
static ABT_unit ABTI_pool_pop_timedwait(ABTI_pool *p_pool, double abstime_secs)
#define ABTI_CHECK_TRUE(cond, abt_errno)
void ABTI_pool_free(ABTI_pool *p_pool)
ABT_pool_init_fn p_init
Function that frees a work unit.
ABTU_ret_err int ABTI_ythread_create_sched(ABTI_global *p_global, ABTI_local *p_local, ABTI_pool *p_pool, ABTI_sched *p_sched)
ABT_pool_kind
Predefined pool type.
ABT_pool_pop_timedwait_fn p_pop_timedwait
static ABT_pool ABTI_pool_get_handle(ABTI_pool *p_pool)
int ABT_pool_get_access(ABT_pool pool, ABT_pool_access *access)
Get an access type of a pool.
int ABT_pool_get_id(ABT_pool pool, int *id)
Get ID of a pool.
ABT_pool_access
Pool access type.