22 .get_migr_pool = NULL,
29 #ifdef ABT_CONFIG_USE_SCHED_SLEEP 30 struct timespec sleep_time;
44 return (sched_data *)data;
52 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
53 ABTI_CHECK_NULL_SCHED_PTR(p_sched);
56 sched_data *p_data = (sched_data *)
ABTU_malloc(
sizeof(sched_data));
57 p_data->event_freq = ABTI_global_get_sched_event_freq();
58 #ifdef ABT_CONFIG_USE_SCHED_SLEEP 59 p_data->sleep_time.tv_sec = 0;
60 p_data->sleep_time.tv_nsec = ABTI_global_get_sched_sleep_nsec();
64 void *p_event_freq = &p_data->event_freq;
65 ABTI_sched_config_read(config, 1, 1, &p_event_freq);
68 num_pools = p_sched->num_pools;
69 p_data->num_pools = num_pools;
71 memcpy(p_data->pools, p_sched->pools,
sizeof(
ABT_pool) * num_pools);
79 p_sched->data = p_data;
91 ABTI_local *p_local = ABTI_local_get_local();
93 uint32_t pop_count = 0;
100 ABTI_xstream *p_xstream = p_local->p_xstream;
101 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
102 ABTI_ASSERT(p_sched);
105 event_freq = p_data->event_freq;
106 num_pools = p_data->num_pools;
107 pools = p_data->pools;
110 for (i = 0; i < num_pools; i++) {
111 ABTI_pool *p_pool = ABTI_pool_get_ptr(pools[i]);
114 ABTI_xstream_run_unit(&p_local, p_xstream, unit, p_pool);
119 if (pop_count >= event_freq) {
120 ABTI_xstream_check_events(p_xstream, sched);
121 if (ABTI_sched_has_to_stop(&p_local, p_sched, p_xstream) ==
132 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
133 ABTI_ASSERT(p_sched);
146 access = ABTI_pool_get_ptr(*p_pool)->access;
169 int p1_access, p2_access;
174 if (p1_access > p2_access) {
176 }
else if (p1_access < p2_access) {
struct ABT_unit_opaque * ABT_unit
static int pool_get_access_num(ABT_pool *p_pool)
struct ABT_sched_opaque * ABT_sched
static void * ABTU_malloc(size_t size)
static int sched_free(ABT_sched)
struct ABT_pool_opaque * ABT_pool
#define HANDLE_ERROR_WITH_CODE(msg, n)
static int sched_cmp_pools(const void *p1, const void *p2)
static int sched_init(ABT_sched sched, ABT_sched_config config)
static void sched_run(ABT_sched sched)
static sched_data * sched_data_get_ptr(void *data)
static ABT_sched_def sched_basic_def
ABT_sched_config_var ABT_sched_basic_freq
#define SCHED_SLEEP(c, t)
struct ABT_sched_config_opaque * ABT_sched_config
static void sched_sort_pools(int num_pools, ABT_pool *pools)
static void ABTU_free(void *ptr)