Go to the documentation of this file.
18 #ifndef ABT_CONFIG_DISABLE_MIGRATION
91 #ifndef ABT_CONFIG_ENABLE_VER_20_API
108 int abt_errno =
ythread_create(p_global, p_local, p_pool, thread_func, arg,
169 void (*thread_func)(
void *),
void *arg,
172 #ifndef ABT_CONFIG_ENABLE_VER_20_API
191 int abt_errno =
ythread_create(p_global, p_local, p_pool, thread_func, arg,
252 void (**thread_func_list)(
void *),
void **arg_list,
269 if (newthread_list == NULL) {
270 for (i = 0; i < num_threads; i++) {
276 void (*thread_f)(
void *) = thread_func_list[i];
277 void *arg = arg_list ? arg_list[i] : NULL;
278 int abt_errno =
ythread_create(p_global, p_local, p_pool, thread_f,
285 for (i = 0; i < num_threads; i++) {
291 void (*thread_f)(
void *) = thread_func_list[i];
292 void *arg = arg_list ? arg_list[i] : NULL;
293 int abt_errno =
ythread_create(p_global, p_local, p_pool, thread_f,
485 for (i = 0; i < num_threads; i++) {
587 for (i = 0; i < num_threads; i++) {
629 #ifndef ABT_CONFIG_ENABLE_VER_20_API
674 #ifdef ABT_CONFIG_DISABLE_THREAD_CANCEL
725 #ifndef ABT_CONFIG_ENABLE_VER_20_API
774 #ifndef ABT_CONFIG_ENABLE_VER_20_API
970 *unit = p_thread->
unit;
1069 #ifndef ABT_CONFIG_ENABLE_VER_20_API
1093 LOG_DEBUG(
"[U%" PRIu64
":E%d] yield_to -> U%" PRIu64
"\n",
1183 #ifndef ABT_CONFIG_ENABLE_VER_20_API
1240 #ifndef ABT_CONFIG_ENABLE_VER_20_API
1304 #ifndef ABT_CONFIG_DISABLE_MIGRATION
1321 for (p = 0; p < p_sched->
num_pools; p++)
1390 #ifndef ABT_CONFIG_DISABLE_MIGRATION
1406 for (p = 0; p < p_sched->
num_pools; p++)
1473 #ifndef ABT_CONFIG_DISABLE_MIGRATION
1550 #ifndef ABT_CONFIG_DISABLE_MIGRATION
1564 int i, num_xstreams, abt_errno;
1574 xstreams[i++] = p_xstream;
1575 p_xstream = p_xstream->
p_next;
1583 for (i = 0; i < num_xstreams; i++) {
1594 for (p = 0; p < p_sched->
num_pools; p++) {
1661 void (*cb_func)(
ABT_thread thread,
void *cb_arg),
1664 #ifndef ABT_CONFIG_DISABLE_MIGRATION
1724 #ifndef ABT_CONFIG_DISABLE_MIGRATION
1728 #ifndef ABT_CONFIG_ENABLE_VER_20_API
1729 if (p_thread->
type &
1781 #ifndef ABT_CONFIG_DISABLE_MIGRATION
2021 p_thread->
p_arg = arg;
2056 *arg = p_thread->
p_arg;
2218 #ifndef ABT_CONFIG_ENABLE_VER_20_API
2230 #ifndef ABT_CONFIG_DISABLE_MIGRATION
2240 thread_attr.
f_cb = NULL;
2257 void (*thread_func)(
void *),
void *arg,
2267 p_thread->
p_arg = arg;
2278 size_t stacksize = p_ythread->
stacksize;
2321 NULL, push_pool, p_ythread);
2349 *pp_root_ythread = p_root_ythread;
2385 (
void (*)(
void *))p_sched->
run,
2412 LOG_DEBUG(
"[U%" PRIu64
":E%d] primary ULT freed\n",
2455 *pp_mig_data = p_mig_data;
2461 if (p_thread == NULL) {
2462 fprintf(p_os,
"%*s== NULL thread ==\n", indent,
"");
2465 int xstream_rank = p_xstream ? p_xstream->
rank : 0;
2466 const char *type, *yieldable, *state, *named, *migratable;
2471 type =
"MAIN_SCHED";
2503 state =
"TERMINATED";
2512 void *p_migration_cb_arg =
2516 "%*s== Thread (%p) ==\n"
2517 "%*sid : %" PRIu64
"\n"
2519 "%*syieldable : %s\n"
2521 "%*slast_ES : %p (%d)\n"
2526 "%*smigratable : %s\n"
2527 "%*srequest : 0x%x\n"
2528 "%*smig_cb_arg : %p\n"
2529 "%*skeytable : %p\n",
2530 indent,
"", (
void *)p_thread, indent,
"",
2532 yieldable, indent,
"", state, indent,
"", (
void *)p_xstream,
2533 xstream_rank, indent,
"", (
void *)p_thread->p_parent, indent,
2534 "", p_thread->p_arg, indent,
"", (
void *)p_thread->p_pool,
2535 indent,
"", named, indent,
"", migratable, indent,
"",
2537 p_migration_cb_arg, indent,
"",
2544 "%*sstacksize : %zu\n",
2545 indent,
"", p_ythread->
p_stack, indent,
"",
2561 if (p_thread == NULL)
2567 return p_thread->
id;
2589 #ifndef ABT_CONFIG_DISABLE_MIGRATION
2595 #ifdef ABT_CONFIG_USE_MEM_POOL
2597 ABTI_mem_alloc_ythread_mempool_desc_stack(p_global, p_local,
2598 p_attr, &p_newthread);
2617 #ifndef ABT_CONFIG_DISABLE_MIGRATION
2622 (
void **)&p_mig_data);
2628 p_mig_data->f_migration_cb = p_attr->
f_cb;
2629 p_mig_data->p_migration_cb_arg = p_attr->
p_cb_arg;
2632 (
void *)p_mig_data);
2646 if (p_newthread->
p_stack == NULL) {
2653 size_t stack_size = p_newthread->
stacksize;
2654 void *p_stack = p_newthread->
p_stack;
2659 #if ABT_CONFIG_THREAD_TYPE != ABT_THREAD_TYPE_DYNAMIC_PROMOTION
2660 size_t stack_size = p_newthread->
stacksize;
2661 void *p_stack = p_newthread->
p_stack;
2694 #ifdef ABT_CONFIG_USE_DEBUG_LOG
2697 LOG_DEBUG(
"[U%" PRIu64
"] primary ULT created\n", thread_id);
2699 LOG_DEBUG(
"[U%" PRIu64
"] main sched ULT created\n", thread_id);
2701 LOG_DEBUG(
"[U%" PRIu64
"] created\n", thread_id);
2738 *pp_newthread = p_newthread;
2742 #ifndef ABT_CONFIG_DISABLE_MIGRATION
2825 #ifndef ABT_CONFIG_ACTIVE_WAIT_POLICY
2842 &dummy_ythread.
ctx);
2866 p_thread, &p_self->
thread);
2885 #ifdef ABT_CONFIG_ACTIVE_WAIT_POLICY
2893 ABTI_thread *p_self_thread = p_local_xstream->p_thread;
2897 #ifdef ABT_CONFIG_ACTIVE_WAIT_POLICY
2927 LOG_DEBUG(
"[U%" PRIu64
":E%d] blocked to join U%" PRIu64
"\n",
2954 LOG_DEBUG(
"[U%" PRIu64
":E%d] resume after join\n",
2977 p_local_xstream->p_thread = &p_root_ythread->
thread;
3016 LOG_DEBUG(
"[S%" PRIu64
"] start\n", p_sched->id);
3018 LOG_DEBUG(
"[S%" PRIu64
"] end\n", p_sched->id);
3041 p_sched = p_new_sched;
static void ABTD_futex_single_init(ABTD_futex_single *p_futex)
@ ABT_THREAD_STATE_TERMINATED
int ABT_thread_migrate_to_xstream(ABT_thread thread, ABT_xstream xstream)
Request a migration of a work unit to a specific execution stream.
#define ABTI_CHECK_NULL_SCHED_PTR(p)
struct ABT_key_opaque * ABT_key
Work-unit-specific data key handle type.
#define ABT_ERR_INV_THREAD
Error code: invalid work unit.
static ABTI_sched * ABTI_sched_get_ptr(ABT_sched sched)
int ABT_thread_get_arg(ABT_thread thread, void **arg)
Retrieve an argument for a work-unit function of a work unit.
int ABT_thread_resume(ABT_thread thread)
Resume a ULT.
void ABTI_ythread_free_root(ABTI_global *p_global, ABTI_local *p_local, ABTI_ythread *p_ythread)
void ABTI_thread_print(ABTI_thread *p_thread, FILE *p_os, int indent)
int ABT_thread_is_primary(ABT_thread thread, ABT_bool *is_primary)
Check if a work unit is the primary ULT.
void(* f_migration_cb)(ABT_thread, void *)
void ABTD_futex_suspend(ABTD_futex_single *p_futex)
static void ABTI_mem_free_thread(ABTI_global *p_global, ABTI_local *p_local, ABTI_thread *p_thread)
int ABT_bool
Boolean type.
static void ABTD_atomic_release_store_ythread_context_ptr(ABTD_ythread_context_atomic_ptr *ptr, ABTD_ythread_context *p_ctx)
@ ABTI_XSTREAM_TYPE_PRIMARY
#define ABTI_THREAD_REQ_TERMINATE
#define ABTI_THREAD_TYPE_ROOT
#define ABTI_SETUP_LOCAL_XSTREAM(pp_local_xstream)
static void * ABTI_ktable_get(ABTD_atomic_ptr *pp_ktable, ABTI_key *p_key)
static void ABTD_ythread_context_init(ABTD_ythread_context *p_link, ABTD_ythread_context *p_newctx)
static uint32_t ABTD_atomic_acquire_load_uint32(const ABTD_atomic_uint32 *ptr)
void ABTD_ythread_exit(ABTI_xstream *p_local_xstream, ABTI_ythread *p_ythread)
static void thread_main_sched_func(void *arg)
struct ABT_thread_attr_opaque * ABT_thread_attr
ULT attribute handle type.
struct ABT_thread_opaque * ABT_thread
Work unit handle type.
ABTD_atomic_ptr p_migration_pool
static ABTD_atomic_uint64 g_thread_id
int ABT_thread_join_many(int num_threads, ABT_thread *thread_list)
Wait for a set of work units to terminate.
static ABTI_key * ABTI_key_get_ptr(ABT_key key)
int ABT_thread_create_many(int num_threads, ABT_pool *pool_list, void(**thread_func_list)(void *), void **arg_list, ABT_thread_attr attr, ABT_thread *newthread_list)
Create a set of new ULTs.
#define ABTI_SETUP_GLOBAL(pp_global)
static ABTI_ythread * ABTI_ythread_context_switch_to_sibling(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_old, ABTI_ythread *p_new)
ABTD_spinlock xstream_list_lock
int ABT_thread_get_stacksize(ABT_thread thread, size_t *stacksize)
Get a stack size of a work unit.
#define ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC
static ABTI_global * ABTI_global_get_global(void)
ABTU_noreturn void ABTI_ythread_exit(ABTI_xstream *p_local_xstream, ABTI_ythread *p_ythread)
int ABT_thread_set_migratable(ABT_thread thread, ABT_bool migratable)
Set the migratability in a work unit.
#define ABT_ERR_POOL
Error code: error related to a pool.
#define ABTI_THREAD_INIT_ID
#define ABTI_CHECK_ERROR(abt_errno)
void ABTI_ythread_free_primary(ABTI_global *p_global, ABTI_local *p_local, ABTI_ythread *p_ythread)
static ABT_thread_attr ABTI_thread_attr_get_handle(ABTI_thread_attr *p_attr)
int ABT_thread_get_id(ABT_thread thread, ABT_unit_id *thread_id)
Get ID of a work unit.
static ABT_sched ABTI_sched_get_handle(ABTI_sched *p_sched)
#define ABTI_THREAD_TYPE_YIELDABLE
ABTD_atomic_uint32 request
static ABTI_ythread * ABTI_thread_get_ythread(ABTI_thread *p_thread)
ABTU_ret_err int ABTI_ythread_create_sched(ABTI_global *p_global, ABTI_local *p_local, ABTI_pool *p_pool, ABTI_sched *p_sched)
static ABTI_thread * ABTI_unit_get_thread_from_builtin_unit(ABT_unit unit)
static void ABTI_pool_push(ABTI_pool *p_pool, ABT_unit unit)
static ABT_thread ABTI_thread_get_handle(ABTI_thread *p_thread)
static ABTU_ret_err int ABTI_thread_set_associated_pool(ABTI_global *p_global, ABTI_thread *p_thread, ABTI_pool *p_pool)
#define ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC_STACK
void ABTI_thread_reset_id(void)
#define ABTI_IS_ERROR_CHECK_ENABLED
#define ABTI_CHECK_YIELDABLE(p_thread, pp_ythread, abt_errno)
ABTD_ythread_context_atomic_ptr p_link
static ABTI_thread_attr * ABTI_thread_attr_get_ptr(ABT_thread_attr attr)
#define ABTI_KEY_STATIC_INITIALIZER(f_destructor, id)
int ABT_thread_get_state(ABT_thread thread, ABT_thread_state *state)
Get a state of a work unit.
#define ABTI_THREAD_TYPE_EXT
struct ABT_pool_opaque * ABT_pool
Pool handle type.
#define ABT_ERR_THREAD
Error code: error related to a work unit.
ABT_thread_state
State of a work unit.
int ABT_thread_free(ABT_thread *thread)
Free a work unit.
static ABTI_key g_thread_sched_key
struct ABT_sched_opaque * ABT_sched
Scheduler handle type.
static ABTU_ret_err int ABTI_ktable_set(ABTI_global *p_global, ABTI_local *p_local, ABTD_atomic_ptr *pp_ktable, ABTI_key *p_key, void *value)
#define ABTI_THREAD_TYPE_PRIMARY
int ABT_thread_migrate_to_sched(ABT_thread thread, ABT_sched sched)
Request a migration of a work unit to a specific scheduler.
int ABT_thread_exit(void)
Terminate a calling ULT.
static ABT_xstream ABTI_xstream_get_handle(ABTI_xstream *p_xstream)
static void ABTD_atomic_release_store_uint64(ABTD_atomic_uint64 *ptr, uint64_t val)
@ ABT_THREAD_STATE_BLOCKED
#define ABTI_CHECK_NULL_THREAD_PTR(p)
#define ABTI_THREAD_REQ_MIGRATE
int ABT_thread_set_specific(ABT_thread thread, ABT_key key, void *value)
Set a value with a work-unit-specific data key in a work unit.
static void thread_free(ABTI_global *p_global, ABTI_local *p_local, ABTI_thread *p_thread, ABT_bool free_unit)
#define ABTI_SCHED_REQ_REPLACE
static void ABTD_atomic_relaxed_store_uint32(ABTD_atomic_uint32 *ptr, uint32_t val)
static void ABTI_sched_discard_and_free(ABTI_global *p_global, ABTI_local *p_local, ABTI_sched *p_sched, ABT_bool force_free)
static int ABTD_atomic_relaxed_load_int(const ABTD_atomic_int *ptr)
#define ABTI_KEY_ID_STACKABLE_SCHED
uint64_t ABT_unit_id
Work unit ID type.
struct ABT_xstream_opaque * ABT_xstream
Execution stream handle type.
static ABTI_ythread * ABTI_thread_get_ythread_or_null(ABTI_thread *p_thread)
ABT_unit_is_in_pool_fn u_is_in_pool
static void ABTD_spinlock_acquire(ABTD_spinlock *p_lock)
int ABT_thread_yield(void)
Yield the calling ULT to its parent ULT.
int ABT_thread_get_last_pool(ABT_thread thread, ABT_pool *pool)
Get the last pool of a work unit.
#define ABTI_HANDLE_ERROR(n)
static void thread_key_destructor_migration(void *p_value)
static void ABTD_atomic_pause(void)
static ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr)
#define LOG_DEBUG(fmt,...)
#define ABTI_THREAD_TYPE_MIGRATABLE
static ABTU_ret_err int ABTI_pool_remove(ABTI_pool *p_pool, ABT_unit unit)
void ABTI_thread_join(ABTI_local **pp_local, ABTI_thread *p_thread)
static void ABTD_atomic_relaxed_store_int(ABTD_atomic_int *ptr, int val)
int ABT_thread_set_associated_pool(ABT_thread thread, ABT_pool pool)
Set an associated pool for the target work unit.
int ABT_thread_join(ABT_thread thread)
Wait for a work unit to terminate.
#define ABTD_ATOMIC_UINT64_STATIC_INITIALIZER(val)
static uint32_t ABTD_atomic_relaxed_load_uint32(const ABTD_atomic_uint32 *ptr)
ABTI_sched * p_main_sched
ABT_pool_remove_fn p_remove
void * p_migration_cb_arg
#define ABT_ERR_INV_THREAD_ATTR
Error code: invalid ULT attribute.
static void ABTI_thread_attr_init(ABTI_thread_attr *p_attr, void *p_stack, size_t stacksize, ABTI_thread_type thread_type, ABT_bool migratable)
ABTU_ret_err int ABTI_sched_get_migration_pool(ABTI_sched *, ABTI_pool *, ABTI_pool **)
void ABTI_thread_free(ABTI_global *p_global, ABTI_local *p_local, ABTI_thread *p_thread)
static void thread_root_func(void *arg)
struct ABT_unit_opaque * ABT_unit
Work unit handle type for scheduling.
static ABTU_ret_err int thread_migrate_to_pool(ABTI_global *p_global, ABTI_local *p_local, ABTI_thread *p_thread, ABTI_pool *p_pool)
static void thread_join(ABTI_local **pp_local, ABTI_thread *p_thread)
static void ABTD_ythread_context_invalidate(ABTD_ythread_context *p_newctx)
int ABT_thread_is_unnamed(ABT_thread thread, ABT_bool *is_unnamed)
Check if a work unit is unnamed.
#define ABTI_ASSERT(cond)
static ABTU_ret_err int ABTU_calloc(size_t num, size_t size, void **p_ptr)
#define ABT_ERR_MIGRATION_TARGET
Error code: error related to a migration target.
ABTI_sched * p_replace_sched
static ABTU_ret_err int ABTI_mem_alloc_ythread_mempool_desc(ABTI_local *p_local, ABTI_thread_attr *p_attr, ABTI_ythread **pp_ythread)
#define ABT_THREAD_ATTR_NULL
static ABTI_local * ABTI_local_get_local(void)
static ABTI_pool * ABTI_xstream_get_main_pool(ABTI_xstream *p_xstream)
#define ABTI_CHECK_NULL_YTHREAD_PTR(p)
ABTU_ret_err int ABTI_thread_revive(ABTI_global *p_global, ABTI_local *p_local, ABTI_pool *p_pool, void(*thread_func)(void *), void *arg, ABTI_thread *p_thread)
int ABT_thread_create_on_xstream(ABT_xstream xstream, void(*thread_func)(void *), void *arg, ABT_thread_attr attr, ABT_thread *newthread)
Create a new ULT associated with an execution stream.
static void thread_key_destructor_stackable_sched(void *p_value)
static ABTU_ret_err int ABTI_ktable_set_unsafe(ABTI_global *p_global, ABTI_local *p_local, ABTI_ktable **pp_ktable, ABTI_key *p_key, void *value)
ABTI_ythread * p_primary_ythread
int ABT_thread_set_arg(ABT_thread thread, void *arg)
Set an argument for a work-unit function of a work unit.
#define ABT_SUCCESS
Error code: the routine returns successfully.
static ABTI_local * ABTI_local_get_local_uninlined(void)
static ABT_unit_id thread_get_new_id(void)
int ABT_thread_get_last_xstream(ABT_thread thread, ABT_xstream *xstream)
Get an execution stream associated with a work unit.
#define ABTI_SETUP_LOCAL_YTHREAD(pp_local_xstream, pp_ythread)
ABTI_xstream * p_xstream_head
static int ABTD_atomic_acquire_load_int(const ABTD_atomic_int *ptr)
void ABTI_ythread_set_blocked(ABTI_ythread *p_ythread)
#define ABTI_THREAD_REQ_CANCEL
int ABT_thread_migrate(ABT_thread thread)
Request a migration of a work unit to any available execution stream.
static ABTI_xstream * ABTI_local_get_xstream_or_null(ABTI_local *p_local)
int ABT_thread_self_id(ABT_unit_id *id)
Get ID of the calling work unit.
#define ABTI_IS_EXT_THREAD_ENABLED
ABTU_ret_err int ABTI_thread_attr_dup(const ABTI_thread_attr *p_attr, ABTI_thread_attr **pp_dup_attr) ABTU_ret_err
int ABT_thread_self(ABT_thread *thread)
Get the calling work unit.
static ABTI_local * ABTI_xstream_get_local(ABTI_xstream *p_xstream)
uint32_t ABTI_thread_type
int ABT_thread_free_many(int num_threads, ABT_thread *thread_list)
Free a set of work units.
ABTU_ret_err int ABTI_ythread_create_main_sched(ABTI_global *p_global, ABTI_local *p_local, ABTI_xstream *p_xstream, ABTI_sched *p_sched)
#define ABTU_unlikely(cond)
#define ABT_TRUE
True constant for ABT_bool.
static ABTI_pool * ABTI_pool_get_ptr(ABT_pool pool)
ABTD_atomic_uint32 request
static ABT_unit ABTI_pool_pop(ABTI_pool *p_pool)
@ ABT_XSTREAM_STATE_RUNNING
int ABT_thread_set_callback(ABT_thread thread, void(*cb_func)(ABT_thread thread, void *cb_arg), void *cb_arg)
Register a callback function in a work unit.
#define ABT_ERR_MIGRATION_NA
Error code: migration is not supported.
#define ABTI_KTABLE_LOCKED
int ABT_thread_get_thread_func(ABT_thread thread, void(**thread_func)(void *))
Retrieve a work-unit function of a work unit.
ABTI_ythread * p_root_ythread
#define ABT_FALSE
False constant for ABT_bool.
void ABTI_ythread_set_ready(ABTI_local *p_local, ABTI_ythread *p_ythread)
ABTU_ret_err int ABTI_ythread_create_primary(ABTI_global *p_global, ABTI_local *p_local, ABTI_xstream *p_xstream, ABTI_ythread **p_ythread)
int ABT_thread_is_migratable(ABT_thread thread, ABT_bool *is_migratable)
Get the migratability of a work unit.
#define ABTI_THREAD_TYPE_MAIN_SCHED
void ABTI_ythread_suspend(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_ythread, ABT_sync_event_type sync_event_type, void *p_sync)
static void ABTD_ythread_context_create(ABTD_ythread_context *p_link, size_t stacksize, void *p_stack, ABTD_ythread_context *p_newctx)
#define ABTI_CHECK_NULL_POOL_PTR(p)
static uint64_t ABTD_atomic_fetch_add_uint64(ABTD_atomic_uint64 *ptr, uint64_t v)
#define ABTI_CHECK_NULL_XSTREAM_PTR(p)
int ABT_thread_create(ABT_pool pool, void(*thread_func)(void *), void *arg, ABT_thread_attr attr, ABT_thread *newthread)
Create a new ULT.
static void ABTU_free(void *ptr)
int ABT_thread_get_unit(ABT_thread thread, ABT_unit *unit)
Get a unit handle of the target work unit.
static uint32_t ABTD_atomic_fetch_or_uint32(ABTD_atomic_uint32 *ptr, uint32_t v)
static void ABTD_spinlock_release(ABTD_spinlock *p_lock)
void ABTI_xstream_run_thread(ABTI_global *p_global, ABTI_xstream **pp_local_xstream, ABTI_thread *p_thread)
#define ABTI_THREAD_TYPE_NAMED
ABTU_ret_err int ABTI_thread_get_mig_data(ABTI_global *p_global, ABTI_local *p_local, ABTI_thread *p_thread, ABTI_thread_mig_data **pp_mig_data)
static ABTI_xstream * ABTI_xstream_get_ptr(ABT_xstream xstream)
ABTI_xstream * p_last_xstream
void ABTI_sched_free(ABTI_global *p_global, ABTI_local *p_local, ABTI_sched *p_sched, ABT_bool force_free)
ABTD_atomic_ptr p_keytable
static void thread_join_futexwait(ABTI_thread *p_thread)
static void ABTI_pool_inc_num_blocked(ABTI_pool *p_pool)
ABTI_thread_type thread_type
struct ABTI_local ABTI_local
static void thread_join_busywait(ABTI_thread *p_thread)
void(* f_cb)(ABT_thread, void *)
static void ABTI_thread_unset_associated_pool(ABTI_global *p_global, ABTI_thread *p_thread)
static void ABTI_ythread_yield(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_ythread, ABT_sync_event_type sync_event_type, void *p_sync)
static ABTU_noreturn void ABTD_ythread_finish_context(ABTD_ythread_context *p_old, ABTD_ythread_context *p_new)
static void * ABTD_atomic_acquire_load_ptr(const ABTD_atomic_ptr *ptr)
#define ABTI_KEY_ID_MIGRATION
int ABT_thread_yield_to(ABT_thread thread)
Yield the calling ULT to another ULT.
static ABTI_key g_thread_mig_data_key
int ABT_thread_get_last_pool_id(ABT_thread thread, int *id)
Get the last pool's ID of a work unit.
#define ABTI_CHECK_TRUE(cond, abt_errno)
int ABT_thread_revive(ABT_pool pool, void(*thread_func)(void *), void *arg, ABT_thread *thread)
Revive a terminated work unit.
#define ABTI_CHECK_NULL_KEY_PTR(p)
static ABTU_ret_err int ABTI_mem_alloc_ythread_malloc_desc_stack(ABTI_thread_attr *p_attr, ABTI_ythread **pp_ythread)
int ABT_thread_equal(ABT_thread thread1, ABT_thread thread2, ABT_bool *result)
Compare two work unit handles for equality.
#define ABT_ERR_FEATURE_NA
Error code: unsupported feature.
@ ABT_THREAD_STATE_RUNNING
static ABTU_ret_err int ythread_create(ABTI_global *p_global, ABTI_local *p_local, ABTI_pool *p_pool, void(*thread_func)(void *), void *arg, ABTI_thread_attr *p_attr, ABTI_thread_type thread_type, ABTI_sched *p_sched, ABT_bool push_pool, ABTI_ythread **pp_newthread)
static void thread_join_yield_thread(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_self, ABTI_thread *p_thread)
static void ABTD_atomic_relaxed_store_ptr(ABTD_atomic_ptr *ptr, void *val)
void ABTI_ktable_free(ABTI_global *p_global, ABTI_local *p_local, ABTI_ktable *p_ktable)
int ABT_thread_get_specific(ABT_thread thread, ABT_key key, void **value)
Get a value associated with a work-unit-specific data key in a work unit.
int ABT_thread_migrate_to_pool(ABT_thread thread, ABT_pool pool)
Request a migration of a work unit to a specific pool.
static void ABTD_atomic_release_store_uint32(ABTD_atomic_uint32 *ptr, uint32_t val)
static ABTI_xstream * ABTI_local_get_xstream(ABTI_local *p_local)
static ABTU_noreturn void ABTU_unreachable(void)
static ABTU_ret_err int ABTI_thread_init_pool(ABTI_global *p_global, ABTI_thread *p_thread, ABTI_pool *p_pool)
ABTI_ythread * p_replace_waiter
static void ABTD_atomic_release_store_int(ABTD_atomic_int *ptr, int val)
ABT_unit_id ABTI_thread_get_id(ABTI_thread *p_thread)
int ABT_thread_cancel(ABT_thread thread)
Send a cancellation request to a work unit.
#define ABTI_SCHED_REQ_FINISH
static ABTI_thread * ABTI_thread_get_ptr(ABT_thread thread)
static ABT_pool ABTI_pool_get_handle(ABTI_pool *p_pool)
ABTU_ret_err int ABTI_ythread_create_root(ABTI_global *p_global, ABTI_local *p_local, ABTI_xstream *p_xstream, ABTI_ythread **pp_root_ythread)
@ ABT_XSTREAM_STATE_TERMINATED
#define ABTI_THREAD_TYPE_MEM_MALLOC_DESC_STACK
size_t ABTI_sched_get_effective_size(ABTI_local *p_local, ABTI_sched *p_sched)
static void ABTI_pool_dec_num_blocked(ABTI_pool *p_pool)
#define ABTI_THREAD_TYPE_MEM_MALLOC_DESC
static void ABTI_thread_set_request(ABTI_thread *p_thread, uint32_t req)
int ABT_thread_get_attr(ABT_thread thread, ABT_thread_attr *attr)
Get attributes of a work unit.
static ABTU_ret_err int ABTI_mem_alloc_ythread_default(ABTI_global *p_global, ABTI_local *p_local, ABTI_ythread **pp_ythread)
#define ABTI_THREAD_REQ_JOIN