22 .get_migr_pool = NULL,
42 return (sched_data *)data;
50 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
51 ABTI_CHECK_NULL_SCHED_PTR(p_sched);
54 sched_data *p_data = (sched_data *)
ABTU_malloc(
sizeof(sched_data));
55 p_data->event_freq = ABTI_global_get_sched_event_freq();
58 void *p_event_freq = &p_data->event_freq;
59 ABTI_sched_config_read(config, 1, 1, &p_event_freq);
62 num_pools = p_sched->num_pools;
63 p_data->num_pools = num_pools;
65 memcpy(p_data->pools, p_sched->pools,
sizeof(
ABT_pool) * num_pools);
73 p_sched->data = p_data;
85 ABTI_local *p_local = ABTI_local_get_local();
86 uint32_t work_count = 0;
94 ABTI_xstream *p_xstream = p_local->p_xstream;
95 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
99 event_freq = p_data->event_freq;
100 num_pools = p_data->num_pools;
101 pools = p_data->pools;
107 for (i = 0; i < num_pools; i++) {
109 ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
111 ABT_unit unit = ABTI_pool_pop(p_pool);
113 ABTI_xstream_run_unit(&p_local, p_xstream, unit, p_pool);
122 if (!run_cnt_nowait) {
123 double abstime = ABTI_get_wtime();
126 ABTI_pool_pop_timedwait(ABTI_pool_get_ptr(pools[0]), abstime);
128 ABTI_xstream_run_unit(&p_local, p_xstream, unit,
129 ABTI_pool_get_ptr(pools[0]));
140 if (!run_cnt_nowait || (++work_count >= event_freq)) {
141 ABTI_xstream_check_events(p_xstream, sched);
143 ABTI_sched_has_to_stop(&p_local, p_sched, p_xstream);
153 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
154 ABTI_ASSERT(p_sched);
167 access = ABTI_pool_get_ptr(*p_pool)->access;
190 int p1_access, p2_access;
195 if (p1_access > p2_access) {
197 }
else if (p1_access < p2_access) {
struct ABT_unit_opaque * ABT_unit
struct ABT_sched_opaque * ABT_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
ABT_sched_config_var ABT_sched_basic_wait_freq
static int sched_free(ABT_sched)
#define HANDLE_ERROR_WITH_CODE(msg, n)
static sched_data * sched_data_get_ptr(void *data)
static int sched_cmp_pools(const void *p1, const void *p2)
static void sched_run(ABT_sched sched)
static ABT_sched_def sched_basic_wait_def
static void sched_sort_pools(int num_pools, ABT_pool *pools)
struct ABT_sched_config_opaque * ABT_sched_config
static void ABTU_free(void *ptr)
static int pool_get_access_num(ABT_pool *p_pool)