18 .get_migr_pool = NULL };
22 #ifdef ABT_CONFIG_USE_SCHED_SLEEP 23 struct timespec sleep_time;
34 return (sched_data *)data;
41 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
42 ABTI_CHECK_NULL_SCHED_PTR(p_sched);
45 sched_data *p_data = (sched_data *)
ABTU_malloc(
sizeof(sched_data));
46 p_data->event_freq = ABTI_global_get_sched_event_freq();
47 #ifdef ABT_CONFIG_USE_SCHED_SLEEP 48 p_data->sleep_time.tv_sec = 0;
49 p_data->sleep_time.tv_nsec = ABTI_global_get_sched_sleep_nsec();
53 void *p_event_freq = &p_data->event_freq;
54 ABTI_sched_config_read(config, 1, 1, &p_event_freq);
56 p_sched->data = p_data;
68 ABTI_local *p_local = ABTI_local_get_local();
69 uint32_t work_count = 0;
77 ABTI_xstream *p_xstream = p_local->p_xstream;
78 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
82 event_freq = p_data->event_freq;
85 num_pools = p_sched->num_pools;
87 memcpy(p_pools, p_sched->pools,
sizeof(
ABT_pool) * num_pools);
94 for (i = 0; i < num_pools; i++) {
96 ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
97 ABT_unit unit = ABTI_pool_pop(p_pool);
99 ABTI_xstream_run_unit(&p_local, p_xstream, unit, p_pool);
105 if (++work_count >= event_freq) {
107 ABTI_sched_has_to_stop(&p_local, p_sched, p_xstream);
111 ABTI_xstream_check_events(p_xstream, sched);
121 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
122 ABTI_ASSERT(p_sched);
struct ABT_unit_opaque * ABT_unit
struct ABT_sched_opaque * ABT_sched
static ABT_sched_def sched_prio_def
static sched_data * sched_data_get_ptr(void *data)
static void sched_run(ABT_sched sched)
static int sched_init(ABT_sched sched, ABT_sched_config config)
static void * ABTU_malloc(size_t size)
struct ABT_pool_opaque * ABT_pool
#define HANDLE_ERROR_WITH_CODE(msg, n)
static int sched_free(ABT_sched)
#define SCHED_SLEEP(c, t)
struct ABT_sched_config_opaque * ABT_sched_config
static void ABTU_free(void *ptr)