ARGOBOTS
dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
|
Go to the documentation of this file.
29 size_t max_threads,
size_t *num_popped,
32 size_t max_threads,
size_t *num_popped,
45 #define POOL_CONTEXT_PUSH_HEAD \
46 (ABT_POOL_CONTEXT_OP_THREAD_CREATE | \
47 ABT_POOL_CONTEXT_OP_THREAD_CREATE_TO | \
48 ABT_POOL_CONTEXT_OP_THREAD_REVIVE | ABT_POOL_CONTEXT_OP_THREAD_REVIVE_TO)
49 #define POOL_CONTEXT_POP_TAIL (ABT_POOL_CONTEXT_OWNER_SECONDARY)
130 p_pool->
data = p_data;
192 for (i = 0; i < num_units; i++) {
211 for (i = 0; i < num_units; i++) {
227 double time_start = 0.0;
230 &p_data->
mutex) == 0) {
241 if (time_start == 0.0) {
245 if (elapsed > time_secs)
249 const int sleep_nsecs = 100;
250 struct timespec ts = { 0, sleep_nsecs };
251 nanosleep(&ts, NULL);
261 &p_data->
mutex) == 0) {
268 const int sleep_nsecs = 100;
269 struct timespec ts = { 0, sleep_nsecs };
270 nanosleep(&ts, NULL);
282 &p_data->
mutex) == 0) {
310 size_t max_threads,
size_t *num_popped,
315 if (max_threads != 0 &&
317 &p_data->
mutex) == 0) {
319 for (i = 0; i < max_threads; i++) {
338 size_t max_threads,
size_t *num_popped,
344 for (i = 0; i < max_threads; i++) {
ABT_pool_user_get_size_fn p_get_size
ABT_pool_user_init_fn p_init
ABT_pool_remove_fn p_remove
int ABT_bool
Boolean type.
static void thread_queue_free(thread_queue_t *p_queue)
uint64_t ABT_pool_context
A pool context value.
static void pool_push_many_private(ABT_pool pool, const ABT_unit *units, size_t num_units, ABT_pool_context context)
struct ABT_thread_opaque * ABT_thread
Work unit handle type.
ABT_pool_user_push_fn p_push
ABT_pool_user_pop_fn p_pop
ABT_pool_user_print_all_fn p_print_all
static void pool_pop_many_shared(ABT_pool pool, ABT_thread *threads, size_t max_threads, size_t *num_popped, ABT_pool_context context)
static ABT_unit pool_create_unit(ABT_pool pool, ABT_thread thread)
static ABT_unit ABTI_unit_get_builtin_unit(ABTI_thread *p_thread)
#define ABTI_CHECK_ERROR(abt_errno)
static ABTU_ret_err int thread_queue_acquire_spinlock_if_not_empty(thread_queue_t *p_queue, ABTD_spinlock *p_lock)
static void pool_free(ABT_pool pool)
static ABTI_thread * ABTI_unit_get_thread_from_builtin_unit(ABT_unit unit)
static ABT_thread ABTI_thread_get_handle(ABTI_thread *p_thread)
ABT_pool_user_free_unit_fn p_free_unit
struct ABT_pool_opaque * ABT_pool
Pool handle type.
static int pool_init(ABT_pool pool, ABT_pool_config config)
static ABT_thread pool_pop_private(ABT_pool pool, ABT_pool_context context)
ABT_pool_pop_timedwait_fn p_pop_timedwait
static void pool_push_many_shared(ABT_pool pool, const ABT_unit *units, size_t num_units, ABT_pool_context context)
static ABT_bool pool_unit_is_in_pool(ABT_unit unit)
ABT_unit_is_in_pool_fn u_is_in_pool
static void ABTD_spinlock_acquire(ABTD_spinlock *p_lock)
static size_t pool_get_size(ABT_pool pool)
#define ABTI_HANDLE_ERROR(n)
struct ABT_pool_config_opaque * ABT_pool_config
Pool configuration handle type.
static int pool_remove_private(ABT_pool pool, ABT_unit unit)
static ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr)
static ABT_thread pool_pop_wait(ABT_pool pool, double time_secs, ABT_pool_context context)
#define ABT_ERR_INV_POOL_ACCESS
Error code: invalid pool access type.
ABT_pool_user_pop_wait_fn p_pop_wait
static ABT_unit pool_pop_timedwait(ABT_pool pool, double abstime_secs)
struct ABT_unit_opaque * ABT_unit
Work unit handle type for scheduling.
static void pool_print_all(ABT_pool pool, void *arg, void(*print_fn)(void *, ABT_thread))
#define ABTI_ASSERT(cond)
ABTD_atomic_int is_in_pool
ABTU_ret_err int ABTI_pool_get_randws_def(ABT_pool_access access, ABTI_pool_required_def *p_required_def, ABTI_pool_optional_def *p_optional_def, ABTI_pool_deprecated_def *p_deprecated_def)
#define ABT_SUCCESS
Error code: the routine returns successfully.
static ABT_bool thread_queue_is_empty(const thread_queue_t *p_queue)
static ABT_thread pool_pop_shared(ABT_pool pool, ABT_pool_context context)
static void pool_free_unit(ABT_pool pool, ABT_unit unit)
static ABTI_thread * thread_queue_pop_tail(thread_queue_t *p_queue)
static int ABTD_atomic_acquire_load_int(const ABTD_atomic_int *ptr)
ABT_pool_user_push_many_fn p_push_many
static ABTU_ret_err int thread_queue_remove(thread_queue_t *p_queue, ABTI_thread *p_thread)
static void pool_push_private(ABT_pool pool, ABT_unit unit, ABT_pool_context context)
#define ABT_TRUE
True constant for ABT_bool.
static ABTI_pool * ABTI_pool_get_ptr(ABT_pool pool)
static void ABTD_spinlock_clear(ABTD_spinlock *p_lock)
#define ABT_FALSE
False constant for ABT_bool.
ABT_pool_user_pop_many_fn p_pop_many
static void pool_push_shared(ABT_pool pool, ABT_unit unit, ABT_pool_context context)
static void ABTU_free(void *ptr)
static void ABTD_spinlock_release(ABTD_spinlock *p_lock)
static void thread_queue_push_tail(thread_queue_t *p_queue, ABTI_thread *p_thread)
static void pool_pop_many_private(ABT_pool pool, ABT_thread *threads, size_t max_threads, size_t *num_popped, ABT_pool_context context)
static ABTI_thread * thread_queue_pop_head(thread_queue_t *p_queue)
static data_t * pool_get_data_ptr(void *p_data)
static void thread_queue_print_all(const thread_queue_t *p_queue, void *arg, void(*print_fn)(void *, ABT_thread))
ABT_pool_user_is_empty_fn p_is_empty
static void thread_queue_push_head(thread_queue_t *p_queue, ABTI_thread *p_thread)
static int pool_remove_shared(ABT_pool pool, ABT_unit unit)
static void thread_queue_init(thread_queue_t *p_queue)
static double ABTI_get_wtime(void)
ABT_pool_user_create_unit_fn p_create_unit
#define POOL_CONTEXT_POP_TAIL
ABT_pool_user_free_fn p_free
#define POOL_CONTEXT_PUSH_HEAD
static ABT_bool pool_is_empty(ABT_pool pool)
static size_t thread_queue_get_size(const thread_queue_t *p_queue)
ABT_pool_access
Pool access type.