ARGOBOTS
dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
|
Go to the documentation of this file.
14 #ifdef ABT_CONFIG_USE_DEBUG_LOG
15 static inline uint64_t sched_get_new_id(
void);
100 #ifndef ABT_CONFIG_ENABLE_VER_20_API
112 sched_create(def, num_pools, pools, p_config, def_automatic, &p_sched);
187 #ifndef ABT_CONFIG_ENABLE_VER_20_API
255 #ifndef ABT_CONFIG_ENABLE_VER_20_API
349 #ifndef ABT_CONFIG_ENABLE_VER_20_API
355 for (p = idx; p < (size_t)idx + max_pools; p++) {
360 pools[p - idx] = p_sched->
pools[p];
487 #ifndef ABT_CONFIG_ENABLE_VER_20_API
492 #ifndef ABT_CONFIG_ENABLE_VER_20_API
608 #ifndef ABT_CONFIG_ENABLE_VER_20_API
616 for (p = 0; p < p_sched->
num_pools; p++) {
622 size_t pool_size = 0;
623 for (p = 0; p < p_sched->
num_pools; p++) {
673 #ifndef ABT_CONFIG_ENABLE_VER_20_API
681 for (p = 0; p < p_sched->
num_pools; p++) {
687 size_t pool_size = 0;
688 for (p = 0; p < p_sched->
num_pools; p++) {
732 for (p = 0; p < num_pools; p++) {
742 for (i = 0; i < p; i++) {
753 pool_list[p] = pools[p];
766 pool_list, p_config, def_automatic,
771 num_pools, pool_list, p_config,
772 def_automatic, pp_newsched);
776 pool_list, p_config, def_automatic,
781 pool_list, p_config, def_automatic,
791 for (i = 0; i < num_pools; i++) {
831 for (p = 0; p < num_pools; p++)
833 for (p = 0; p < num_pools; p++) {
840 for (i = 0; i < p; i++) {
854 pool_list, p_config, def_automatic,
859 num_pools, pool_list, p_config,
860 def_automatic, pp_newsched);
864 pool_list, p_config, def_automatic,
869 pool_list, p_config, def_automatic,
879 for (i = 0; i < num_pools; i++) {
900 for (p = 0; p < p_sched->
num_pools; p++) {
920 p_sched->
data = NULL;
955 size_t p, num_pools = p_sched->
num_pools;
956 for (p = 0; p < num_pools; p++) {
1003 if (p_sched == NULL) {
1004 fprintf(p_os,
"%*s== NULL SCHED ==\n", indent,
"");
1007 const char *kind_str, *used;
1009 kind = p_sched->
kind;
1013 kind_str =
"BASIC_WAIT";
1017 kind_str =
"RANDWS";
1022 switch (p_sched->
used) {
1038 "%*s== SCHED (%p) ==\n"
1039 #ifdef ABT_CONFIG_USE_DEBUG_LOG
1040 "%*sid : %" PRIu64
"\n"
1042 "%*skind : %" PRIxPTR
" (%s)\n"
1044 "%*sautomatic: %s\n"
1045 "%*srequest : 0x%x\n"
1046 "%*snum_pools: %zu\n"
1047 "%*shas_unit : %s\n"
1050 indent,
"", (
void *)p_sched,
1051 #ifdef ABT_CONFIG_USE_DEBUG_LOG
1052 indent,
"", p_sched->id,
1054 indent,
"", p_sched->
kind, kind_str, indent,
"", used, indent,
1055 "", (p_sched->automatic ==
ABT_TRUE) ?
"TRUE" :
"FALSE", indent,
1057 "", p_sched->num_pools, indent,
"",
1059 (
void *)p_sched->p_ythread, indent,
"", p_sched->data);
1062 for (i = 0; i < p_sched->num_pools; i++) {
1099 ABT_bool automatic = def_automatic;
1101 int automatic_val = 0;
1117 for (p = 0; p < num_pools; p++) {
1125 for (i = 0; i < p; i++) {
1135 pool_list[p] = pools[p];
1139 for (p = 0; p < num_pools; p++) {
1144 p_sched->automatic = automatic;
1146 p_sched->p_replace_sched = NULL;
1147 p_sched->p_replace_waiter = NULL;
1149 p_sched->pools = pool_list;
1150 p_sched->num_pools = num_pools;
1151 p_sched->type = def->
type;
1152 p_sched->p_ythread = NULL;
1153 p_sched->data = NULL;
1155 p_sched->init = def->
init;
1156 p_sched->run = def->
run;
1157 p_sched->free = def->
free;
1160 #ifdef ABT_CONFIG_USE_DEBUG_LOG
1161 p_sched->id = sched_get_new_id();
1168 if (p_sched->init) {
1170 abt_errno = p_sched->init(newsched, config);
1172 for (p = 0; p < num_pools; p++) {
1185 *pp_newsched = p_sched;
1190 #ifdef ABT_CONFIG_USE_DEBUG_LOG
1191 static inline uint64_t sched_get_new_id(
void)
ABT_pool_user_get_size_fn p_get_size
#define ABTI_CHECK_NULL_SCHED_PTR(p)
ABT_sched_predef
Predefined scheduler type.
static ABTI_sched * ABTI_sched_get_ptr(ABT_sched sched)
void ABTI_sched_reset_id(void)
ABTD_atomic_int32 num_blocked
static void ABTD_atomic_relaxed_store_uint64(ABTD_atomic_uint64 *ptr, uint64_t val)
int ABT_sched_create_basic(ABT_sched_predef predef, int num_pools, ABT_pool *pools, ABT_sched_config config, ABT_sched *newsched)
Create a new scheduler with a predefined scheduler type.
int ABT_bool
Boolean type.
static uint32_t ABTD_atomic_acquire_load_uint32(const ABTD_atomic_uint32 *ptr)
ABT_sched_type type
Unused value.
#define ABTI_SETUP_GLOBAL(pp_global)
void ABTI_sched_print(ABTI_sched *p_sched, FILE *p_os, int indent, ABT_bool print_sub)
ABTU_ret_err int ABTI_sched_create_basic(ABT_sched_predef predef, int num_pools, ABT_pool *pools, ABTI_sched_config *p_config, ABTI_sched **pp_newsched)
#define ABT_ERR_INV_XSTREAM
Error code: invalid execution stream.
#define ABT_ERR_INV_SCHED_PREDEF
Error code: invalid predefined scheduler type.
#define ABTI_SCHED_NUM_PRIO
#define ABT_ERR_POOL
Error code: error related to a pool.
void ABTI_sched_free(ABTI_global *p_global, ABTI_local *p_local, ABTI_sched *p_sched, ABT_bool force_free)
#define ABTI_CHECK_ERROR(abt_errno)
int ABT_sched_exit(ABT_sched sched)
Request a scheduler to finish.
ABT_bool ABTI_sched_has_unit(ABTI_sched *p_sched)
static ABT_sched ABTI_sched_get_handle(ABTI_sched *p_sched)
ABT_sched_run_fn run
Function that defines a kernel of a scheduler.
struct ABT_sched_config_opaque * ABT_sched_config
Scheduler configuration handle type.
void ABTI_thread_free(ABTI_global *p_global, ABTI_local *p_local, ABTI_thread *p_thread)
static size_t ABTI_pool_get_size(ABTI_pool *p_pool)
#define ABTI_IS_ERROR_CHECK_ENABLED
static ABTD_atomic_uint64 g_sched_id
struct ABT_pool_opaque * ABT_pool
Pool handle type.
ABT_sched_config_var ABT_sched_config_automatic
Predefined ABT_sched_config_var to configure whether the scheduler is freed automatically or not.
int ABT_sched_finish(ABT_sched sched)
Request a scheduler to finish after its pools get empty.
struct ABT_sched_opaque * ABT_sched
Scheduler handle type.
static int32_t ABTD_atomic_acquire_load_int32(const ABTD_atomic_int32 *ptr)
ABT_sched_def * ABTI_sched_get_basic_wait_def(void)
ABTU_ret_err int ABTI_sched_get_migration_pool(ABTI_sched *p_sched, ABTI_pool *source_pool, ABTI_pool **pp_pool)
void ABTI_pool_free(ABTI_pool *p_pool)
static ABTI_sched_kind sched_get_kind(ABT_sched_def *def)
#define ABTI_SCHED_REQ_REPLACE
static void ABTD_atomic_relaxed_store_uint32(ABTD_atomic_uint32 *ptr, uint32_t val)
static ABT_sched_config ABTI_sched_config_get_handle(ABTI_sched_config *p_config)
#define ABTI_SCHED_REQ_EXIT
#define ABTI_HANDLE_ERROR(n)
static ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr)
#define ABT_ERR_SCHED
Error code: error related to a scheduler.
static ABTU_ret_err int sched_create(ABT_sched_def *def, int num_pools, ABT_pool *pools, ABTI_sched_config *p_config, ABT_bool def_automatic, ABTI_sched **pp_newsched)
#define ABTD_ATOMIC_UINT64_STATIC_INITIALIZER(val)
ABTU_ret_err int ABTI_pool_create_basic(ABT_pool_kind kind, ABT_pool_access access, ABT_bool automatic, ABTI_pool **pp_newpool)
ABT_sched_get_migr_pool_fn get_migr_pool
static size_t ABTI_pool_get_total_size(ABTI_pool *p_pool)
ABT_sched_def * ABTI_sched_get_basic_def(void)
ABTU_ret_err int ABTI_sched_config_read(const ABTI_sched_config *p_config, int idx, void *p_val)
ABT_sched_def * ABTI_sched_get_randws_def(void)
int ABT_sched_get_total_size(ABT_sched sched, size_t *size)
Obtain the sum of the total sizes of pools associated with a scheduler.
#define ABTI_ASSERT(cond)
static void ABTI_sched_set_request(ABTI_sched *p_sched, uint32_t req)
ABT_bool ABTI_initialized(void)
#define ABT_ERR_MIGRATION_TARGET
Error code: error related to a migration target.
static ABTI_local * ABTI_local_get_local(void)
#define ABT_SUCCESS
Error code: the routine returns successfully.
ABT_sched_get_migr_pool_fn get_migr_pool
Function that returns a pool for migration.
int ABT_sched_get_num_pools(ABT_sched sched, int *num_pools)
Obtain the number of pools associated with a scheduler.
#define ABT_TRUE
True constant for ABT_bool.
static ABTI_pool * ABTI_pool_get_ptr(ABT_pool pool)
ABTD_atomic_uint32 request
#define ABT_FALSE
False constant for ABT_bool.
uintptr_t ABTI_sched_kind
ABT_sched_free_fn free
Function that frees a scheduler.
int ABT_sched_set_data(ABT_sched sched, void *data)
Associate a user value with a scheduler.
#define ABTI_UB_ASSERT(cond)
#define ABT_ERR_INV_ARG
Error code: invalid user argument.
static uint64_t ABTD_atomic_fetch_add_uint64(ABTD_atomic_uint64 *ptr, uint64_t v)
static void ABTU_free(void *ptr)
ABT_bool ABTI_sched_has_to_stop(ABTI_sched *p_sched)
A struct that defines a scheduler.
struct ABTI_local ABTI_local
void ABTI_sched_finish(ABTI_sched *p_sched)
void ABTI_pool_print(ABTI_pool *p_pool, FILE *p_os, int indent)
static ABT_bool ABTI_pool_is_empty(ABTI_pool *p_pool)
#define ABTI_CHECK_TRUE(cond, abt_errno)
int ABT_sched_has_to_stop(ABT_sched sched, ABT_bool *stop)
Check if a scheduler needs to stop.
ABT_sched_init_fn init
Function that initializes a scheduler.
int ABT_sched_free(ABT_sched *sched)
Free a scheduler.
ABTI_pool_optional_def optional_def
static int32_t ABTI_pool_release(ABTI_pool *p_pool)
int ABT_sched_get_pools(ABT_sched sched, int max_pools, int idx, ABT_pool *pools)
Retrieve pools associated with a scheduler.
static void ABTI_pool_retain(ABTI_pool *p_pool)
ABT_pool_kind
Predefined pool type.
int ABT_sched_get_data(ABT_sched sched, void **data)
Retrieve a user value associated with a scheduler.
ABTD_atomic_int32 num_scheds
#define ABTI_SCHED_REQ_FINISH
static ABT_pool ABTI_pool_get_handle(ABTI_pool *p_pool)
static ABTI_sched_config * ABTI_sched_config_get_ptr(ABT_sched_config config)
int ABT_sched_create(ABT_sched_def *def, int num_pools, ABT_pool *pools, ABT_sched_config config, ABT_sched *newsched)
Create a new scheduler with a scheduler definition.
int ABT_sched_get_size(ABT_sched sched, size_t *size)
Obtain the sum of sizes of pools associated with a scheduler.
ABT_sched_def * ABTI_sched_get_prio_def(void)
ABT_pool_access
Pool access type.
void ABTI_sched_exit(ABTI_sched *p_sched)