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,
124 p_pool->
data = p_data;
181 for (i = 0; i < num_units; i++) {
197 for (i = 0; i < num_units; i++) {
210 double time_start = 0.0;
213 &p_data->
mutex) == 0) {
219 if (time_start == 0.0) {
223 if (elapsed > time_secs)
227 const int sleep_nsecs = 100;
228 struct timespec ts = { 0, sleep_nsecs };
229 nanosleep(&ts, NULL);
239 &p_data->
mutex) == 0) {
246 const int sleep_nsecs = 100;
247 struct timespec ts = { 0, sleep_nsecs };
248 nanosleep(&ts, NULL);
261 &p_data->
mutex) == 0) {
280 size_t max_threads,
size_t *num_popped,
286 if (max_threads != 0 &&
288 &p_data->
mutex) == 0) {
290 for (i = 0; i < max_threads; i++) {
304 size_t max_threads,
size_t *num_popped,
311 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.
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
ABTU_ret_err int ABTI_pool_get_fifo_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)
static ABT_thread pool_pop_wait(ABT_pool pool, double time_secs, ABT_pool_context context)
static ABT_unit ABTI_unit_get_builtin_unit(ABTI_thread *p_thread)
#define ABTI_CHECK_ERROR(abt_errno)
static ABT_bool pool_unit_is_in_pool(ABT_unit unit)
static ABTU_ret_err int thread_queue_acquire_spinlock_if_not_empty(thread_queue_t *p_queue, ABTD_spinlock *p_lock)
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 void pool_pop_many_private(ABT_pool pool, ABT_thread *threads, size_t max_threads, size_t *num_popped, ABT_pool_context context)
static int pool_remove_private(ABT_pool pool, ABT_unit unit)
ABT_pool_pop_timedwait_fn p_pop_timedwait
static size_t pool_get_size(ABT_pool pool)
static ABT_unit pool_pop_timedwait(ABT_pool pool, double abstime_secs)
ABT_unit_is_in_pool_fn u_is_in_pool
static void ABTD_spinlock_acquire(ABTD_spinlock *p_lock)
#define ABTI_HANDLE_ERROR(n)
static ABT_bool pool_is_empty(ABT_pool pool)
static void pool_free(ABT_pool pool)
struct ABT_pool_config_opaque * ABT_pool_config
Pool configuration handle type.
static ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr)
#define ABT_ERR_INV_POOL_ACCESS
Error code: invalid pool access type.
ABT_pool_user_pop_wait_fn p_pop_wait
static int pool_remove_shared(ABT_pool pool, ABT_unit unit)
struct ABT_unit_opaque * ABT_unit
Work unit handle type for scheduling.
#define ABTI_ASSERT(cond)
static void pool_push_many_private(ABT_pool pool, const ABT_unit *units, size_t num_units, ABT_pool_context context)
ABTD_atomic_int is_in_pool
#define ABT_SUCCESS
Error code: the routine returns successfully.
static ABT_bool thread_queue_is_empty(const thread_queue_t *p_queue)
static void pool_free_unit(ABT_pool pool, ABT_unit unit)
static int ABTD_atomic_acquire_load_int(const ABTD_atomic_int *ptr)
static void pool_push_shared(ABT_pool pool, ABT_unit unit, ABT_pool_context context)
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 ABT_thread pool_pop_shared(ABT_pool pool, 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)
static data_t * pool_get_data_ptr(void *p_data)
#define ABT_FALSE
False constant for ABT_bool.
static void pool_push_many_shared(ABT_pool pool, const ABT_unit *units, size_t num_units, ABT_pool_context context)
ABT_pool_user_pop_many_fn p_pop_many
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_print_all(ABT_pool pool, void *arg, void(*print_fn)(void *, ABT_thread))
static int pool_init(ABT_pool pool, ABT_pool_config config)
static ABTI_thread * thread_queue_pop_head(thread_queue_t *p_queue)
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 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 ABT_thread pool_pop_private(ABT_pool pool, ABT_pool_context context)
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
ABT_pool_user_free_fn p_free
static void pool_push_private(ABT_pool pool, ABT_unit unit, ABT_pool_context context)
static ABT_unit pool_create_unit(ABT_pool pool, ABT_thread thread)
static size_t thread_queue_get_size(const thread_queue_t *p_queue)
ABT_pool_access
Pool access type.