18 .get_migr_pool = NULL,
34 return (sched_data *)data;
41 ABTI_global *p_global = ABTI_global_get_global();
43 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
44 ABTI_CHECK_NULL_SCHED_PTR(p_sched);
45 ABTI_sched_config *p_config = ABTI_sched_config_get_ptr(config);
49 abt_errno =
ABTU_malloc(
sizeof(sched_data), (
void **)&p_data);
50 ABTI_CHECK_ERROR(abt_errno);
53 p_data->event_freq = p_global->sched_event_freq;
60 p_data->event_freq = event_freq;
65 num_pools = p_sched->num_pools;
66 p_data->num_pools = num_pools;
69 if (ABTI_IS_ERROR_CHECK_ENABLED && abt_errno !=
ABT_SUCCESS) {
71 ABTI_CHECK_ERROR(abt_errno);
73 memcpy(p_data->pools, p_sched->pools,
sizeof(
ABT_pool) * num_pools);
81 p_sched->data = p_data;
87 ABTI_global *p_global = ABTI_global_get_global();
88 ABTI_xstream *p_local_xstream =
89 ABTI_local_get_xstream(ABTI_local_get_local());
90 uint32_t work_count = 0;
98 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
102 event_freq = p_data->event_freq;
103 num_pools = p_data->num_pools;
104 pools = p_data->pools;
110 for (i = 0; i < num_pools; i++) {
112 ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
117 ABTI_thread *p_thread = ABTI_thread_get_ptr(thread);
118 ABTI_ythread_schedule(p_global, &p_local_xstream, p_thread);
126 if (!run_cnt_nowait) {
127 ABTI_pool *p_pool = ABTI_pool_get_ptr(pools[0]);
129 if (p_pool->optional_def.p_pop_wait) {
130 thread = ABTI_pool_pop_wait(p_pool, 0.1,
132 }
else if (p_pool->deprecated_def.p_pop_timedwait) {
134 ABTI_pool_pop_timedwait(p_pool, ABTI_get_wtime() + 0.1);
140 ABTI_thread *p_thread = ABTI_thread_get_ptr(thread);
141 ABTI_ythread_schedule(p_global, &p_local_xstream, p_thread);
150 if (!run_cnt_nowait || (++work_count >= event_freq)) {
151 ABTI_xstream_check_events(p_local_xstream, p_sched);
152 if (ABTI_sched_has_to_stop(p_sched) ==
ABT_TRUE)
161 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
162 ABTI_ASSERT(p_sched);
175 access = ABTI_pool_get_ptr(*p_pool)->access;
198 int p1_access, p2_access;
203 if (p1_access > p2_access) {
205 }
else if (p1_access < p2_access) {