18 .get_migr_pool = NULL,
25 #ifdef ABT_CONFIG_USE_SCHED_SLEEP
26 struct timespec sleep_time;
37 return (sched_data *)data;
44 ABTI_global *p_global = ABTI_global_get_global();
46 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
47 ABTI_CHECK_NULL_SCHED_PTR(p_sched);
48 ABTI_sched_config *p_config = ABTI_sched_config_get_ptr(config);
52 abt_errno =
ABTU_malloc(
sizeof(sched_data), (
void **)&p_data);
53 ABTI_CHECK_ERROR(abt_errno);
55 #ifdef ABT_CONFIG_USE_SCHED_SLEEP
56 p_data->sleep_time.tv_sec = 0;
57 p_data->sleep_time.tv_nsec = p_global->sched_sleep_nsec;
61 p_data->event_freq = p_global->sched_event_freq;
68 p_data->event_freq = event_freq;
73 num_pools = p_sched->num_pools;
74 p_data->num_pools = num_pools;
77 if (ABTI_IS_ERROR_CHECK_ENABLED && abt_errno !=
ABT_SUCCESS) {
79 ABTI_CHECK_ERROR(abt_errno);
81 memcpy(p_data->pools, p_sched->pools,
sizeof(
ABT_pool) * num_pools);
89 p_sched->data = p_data;
95 ABTI_global *p_global = ABTI_global_get_global();
96 ABTI_xstream *p_local_xstream =
97 ABTI_local_get_xstream(ABTI_local_get_local());
99 uint32_t pop_count = 0;
106 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
107 ABTI_ASSERT(p_sched);
110 event_freq = p_data->event_freq;
111 num_pools = p_data->num_pools;
112 pools = p_data->pools;
115 for (i = 0; i < num_pools; i++) {
116 ABTI_pool *p_pool = ABTI_pool_get_ptr(pools[i]);
120 ABTI_thread *p_thread = ABTI_thread_get_ptr(thread);
121 ABTI_ythread_schedule(p_global, &p_local_xstream, p_thread);
126 if (pop_count >= event_freq) {
127 ABTI_xstream_check_events(p_local_xstream, p_sched);
128 if (ABTI_sched_has_to_stop(p_sched) ==
ABT_TRUE)
138 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
139 ABTI_ASSERT(p_sched);
152 access = ABTI_pool_get_ptr(*p_pool)->access;
175 int p1_access, p2_access;
180 if (p1_access > p2_access) {
182 }
else if (p1_access < p2_access) {