ARGOBOTS  7496202f85916e93d6d143320764c2aba5026d93
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
abti.h
Go to the documentation of this file.
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  * See COPYRIGHT in top-level directory.
4  */
5 
6 #ifndef ABTI_H_INCLUDED
7 #define ABTI_H_INCLUDED
8 
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <stdint.h>
12 #include <inttypes.h>
13 #include <string.h>
14 #include <limits.h>
15 
16 #include "abt_config.h"
17 #include "abt.h"
18 
19 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
20 #define ABTI_IS_ERROR_CHECK_ENABLED 1
21 #else
22 #define ABTI_IS_ERROR_CHECK_ENABLED 0
23 #endif
24 
25 #ifdef ABT_CONFIG_DISABLE_EXT_THREAD
26 #define ABTI_IS_EXT_THREAD_ENABLED 0
27 #else
28 #define ABTI_IS_EXT_THREAD_ENABLED 1
29 #endif
30 
31 #include "abtu.h"
32 #include "abti_error.h"
33 #include "abti_valgrind.h"
34 
35 /* Constants */
36 #define ABTI_SCHED_NUM_PRIO 3
37 
38 #define ABTI_SCHED_REQ_FINISH (1 << 0)
39 #define ABTI_SCHED_REQ_EXIT (1 << 1)
40 
41 #define ABTI_THREAD_REQ_JOIN (1 << 0)
42 #define ABTI_THREAD_REQ_TERMINATE (1 << 1)
43 #define ABTI_THREAD_REQ_CANCEL (1 << 2)
44 #define ABTI_THREAD_REQ_MIGRATE (1 << 3)
45 #define ABTI_THREAD_REQ_BLOCK (1 << 4)
46 #define ABTI_THREAD_REQ_ORPHAN (1 << 5)
47 #define ABTI_THREAD_REQ_NOPUSH (1 << 6)
48 #define ABTI_THREAD_REQ_NON_YIELD \
49  (ABTI_THREAD_REQ_CANCEL | ABTI_THREAD_REQ_MIGRATE | \
50  ABTI_THREAD_REQ_TERMINATE | ABTI_THREAD_REQ_BLOCK | \
51  ABTI_THREAD_REQ_ORPHAN | ABTI_THREAD_REQ_NOPUSH)
52 
53 #define ABTI_THREAD_INIT_ID 0xFFFFFFFFFFFFFFFF
54 #define ABTI_TASK_INIT_ID 0xFFFFFFFFFFFFFFFF
55 
56 #define ABTI_INDENT 4
57 
58 #define ABT_THREAD_TYPE_FULLY_FLEDGED 0
59 #define ABT_THREAD_TYPE_DYNAMIC_PROMOTION 1
60 
64 };
65 
70 };
71 
72 #define ABTI_THREAD_TYPE_EXT ((ABTI_thread_type)0)
73 #define ABTI_THREAD_TYPE_THREAD ((ABTI_thread_type)(0x1 << 0))
74 #define ABTI_THREAD_TYPE_ROOT ((ABTI_thread_type)(0x1 << 1))
75 #define ABTI_THREAD_TYPE_MAIN ((ABTI_thread_type)(0x1 << 2))
76 #define ABTI_THREAD_TYPE_MAIN_SCHED ((ABTI_thread_type)(0x1 << 3))
77 #define ABTI_THREAD_TYPE_YIELDABLE ((ABTI_thread_type)(0x1 << 4))
78 #define ABTI_THREAD_TYPE_NAMED ((ABTI_thread_type)(0x1 << 5))
79 #define ABTI_THREAD_TYPE_MIGRATABLE ((ABTI_thread_type)(0x1 << 6))
80 
81 #define ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC ((ABTI_thread_type)(0x1 << 7))
82 #define ABTI_THREAD_TYPE_MEM_MALLOC_DESC ((ABTI_thread_type)(0x1 << 8))
83 #define ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC_STACK ((ABTI_thread_type)(0x1 << 9))
84 #define ABTI_THREAD_TYPE_MEM_MALLOC_DESC_STACK ((ABTI_thread_type)(0x1 << 10))
85 
86 #define ABTI_THREAD_TYPES_MEM \
87  (ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC | ABTI_THREAD_TYPE_MEM_MALLOC_DESC | \
88  ABTI_THREAD_TYPE_MEM_MEMPOOL_DESC_STACK | \
89  ABTI_THREAD_TYPE_MEM_MALLOC_DESC_STACK)
90 
94 };
95 
96 /* Macro functions */
97 #define ABTI_UNUSED(a) (void)(a)
98 
99 /* Data Types */
100 typedef struct ABTI_global ABTI_global;
101 typedef struct ABTI_local ABTI_local;
103 typedef struct ABTI_xstream ABTI_xstream;
105 typedef struct ABTI_sched ABTI_sched;
106 typedef char *ABTI_sched_config;
108 typedef void *ABTI_sched_id; /* Scheduler id */
109 typedef uintptr_t ABTI_sched_kind; /* Scheduler kind */
110 typedef struct ABTI_pool ABTI_pool;
111 typedef struct ABTI_thread ABTI_thread;
113 typedef struct ABTI_ythread ABTI_ythread;
115 typedef uint32_t ABTI_thread_type;
118 typedef struct ABTI_key ABTI_key;
119 typedef struct ABTI_ktelem ABTI_ktelem;
120 typedef struct ABTI_ktable ABTI_ktable;
122 typedef struct ABTI_mutex ABTI_mutex;
123 typedef struct ABTI_cond ABTI_cond;
124 typedef struct ABTI_rwlock ABTI_rwlock;
126 typedef struct ABTI_future ABTI_future;
127 typedef struct ABTI_barrier ABTI_barrier;
129 typedef struct ABTI_timer ABTI_timer;
130 #ifndef ABT_CONFIG_DISABLE_TOOL_INTERFACE
131 typedef struct ABTI_tool_context ABTI_tool_context;
132 #endif
133 /* ID associated with native thread (e.g, Pthreads), which can distinguish
134  * execution streams and external threads */
135 struct ABTI_native_thread_id_opaque;
136 typedef struct ABTI_native_thread_id_opaque *ABTI_native_thread_id;
137 /* ID associated with thread (i.e., ULTs, tasklets, and external threads) */
138 struct ABTI_thread_id_opaque;
139 typedef struct ABTI_thread_id_opaque *ABTI_thread_id;
140 
141 /* Architecture-Dependent Definitions */
142 #include "abtd.h"
143 
144 /* Spinlock */
146 #include "abti_spinlock.h"
147 
148 /* Basic data structure and memory pool. */
149 #include "abti_sync_lifo.h"
150 #include "abti_mem_pool.h"
151 
152 /* Definitions */
154  uint32_t attrs; /* bit-or'ed attributes */
155  uint32_t nesting_cnt; /* nesting count */
156  ABTI_thread_id owner_id; /* owner's ID */
157  uint32_t max_handovers; /* max. # of handovers */
158  uint32_t max_wakeups; /* max. # of wakeups */
159 };
160 
161 struct ABTI_mutex {
162  ABTD_atomic_uint32 val; /* 0: unlocked, 1: locked */
163  ABTI_mutex_attr attr; /* attributes */
164  ABTI_ythread_htable *p_htable; /* a set of queues */
165  ABTI_ythread *p_handover; /* next ULT for the mutex handover */
166  ABTI_ythread *p_giver; /* current ULT that hands over the mutex */
167 };
168 
169 struct ABTI_global {
170  int max_xstreams; /* Largest rank used in Argobots. */
171  int num_xstreams; /* Current # of ESs */
172  ABTI_xstream *p_xstream_head; /* List of ESs (head). The list is sorted. */
174  xstream_list_lock; /* Spinlock protecting ES list. Any read and
175  * write to this list requires a lock.*/
176 
177  int num_cores; /* Number of CPU cores */
178  ABT_bool set_affinity; /* Whether CPU affinity is used */
179  ABT_bool use_logging; /* Whether logging is used */
180  ABT_bool use_debug; /* Whether debug output is used */
181  int key_table_size; /* Default key table size */
182  size_t thread_stacksize; /* Default stack size for ULT (in bytes) */
183  size_t sched_stacksize; /* Default stack size for sched (in bytes) */
184  uint32_t sched_event_freq; /* Default check frequency for sched */
185  long sched_sleep_nsec; /* Default nanoseconds for scheduler sleep */
186  ABTI_ythread *p_main_ythread; /* ULT of the main function */
187 
188  uint32_t mutex_max_handovers; /* Default max. # of local handovers */
189  uint32_t mutex_max_wakeups; /* Default max. # of wakeups */
190  uint32_t os_page_size; /* OS page size */
191  uint32_t huge_page_size; /* Huge page size */
192 #ifdef ABT_CONFIG_USE_MEM_POOL
193  uint32_t mem_page_size; /* Page size for memory allocation */
194  uint32_t mem_sp_size; /* Stack page size */
195  uint32_t mem_max_stacks; /* Max. # of stacks kept in each ES */
196  uint32_t mem_max_descs; /* Max. # of descriptors kept in each ES */
197  int mem_lp_alloc; /* How to allocate large pages */
198 
199  ABTI_mem_pool_global_pool mem_pool_stack; /* Pool of stack (default size) */
200  ABTI_mem_pool_global_pool mem_pool_desc; /* Pool of descriptors that can
201  * store ABTI_task. */
202 #ifndef ABT_CONFIG_DISABLE_EXT_THREAD
203  /* They are used for external threads. */
208 #endif
209 #endif
210 
211  ABT_bool print_config; /* Whether to print config on ABT_init */
212 
213 #ifndef ABT_CONFIG_DISABLE_TOOL_INTERFACE
214  ABTI_spinlock tool_writer_lock;
215 
216  ABT_tool_thread_callback_fn tool_thread_cb_f;
217  void *tool_thread_user_arg;
218  ABT_tool_task_callback_fn tool_task_cb_f;
219  void *tool_task_user_arg;
220  ABTD_atomic_uint64 tool_thread_event_mask_tagged;
221 #endif
222 };
223 
224 struct ABTI_local; /* Empty. */
225 
228  ABTI_local *(*get_local_f)(void);
230  void *(*get_local_ptr_f)(void);
232 };
233 
234 struct ABTI_xstream {
235  /* Linked list to manage all execution streams. */
238 
239  int rank; /* Rank */
241  ABTD_atomic_int state; /* State (ABT_xstream_state) */
242  ABTI_sched *p_main_sched; /* Main scheduler, which is the bottom of the
243  * linked list of schedulers */
244  ABTD_xstream_context ctx; /* ES context */
245 
247  *p_root_ythread; /* Root thread that schedulers the main scheduler. */
248  ABTI_pool *p_root_pool; /* Root pool that stores the main scheduler. */
249 
251  ABTI_thread *p_thread; /* Current running ULT/tasklet */
252 
253 #ifdef ABT_CONFIG_USE_MEM_POOL
256 #endif
257 };
258 
259 struct ABTI_sched {
260  ABTI_sched_used used; /* To know if it is used and how */
261  ABT_bool automatic; /* To know if automatic data free */
262  ABTI_sched_kind kind; /* Kind of the scheduler */
263  ABT_sched_type type; /* Can yield or not (ULT or task) */
265  ABT_pool *pools; /* Thread pools */
266  int num_pools; /* Number of thread pools */
267  ABTI_ythread *p_ythread; /* Associated ULT */
268  void *data; /* Data for a specific scheduler */
269 
270  /* Scheduler functions */
275 
276 #ifdef ABT_CONFIG_USE_DEBUG_LOG
277  uint64_t id; /* ID */
278 #endif
279 };
280 
281 struct ABTI_pool {
282  ABT_pool_access access; /* Access mode */
283  ABT_bool automatic; /* To know if automatic data free */
284  /* NOTE: int32_t to check if still positive */
285  ABTD_atomic_int32 num_scheds; /* Number of associated schedulers */
286  ABTD_atomic_int32 num_blocked; /* Number of blocked ULTs */
287  ABTD_atomic_int32 num_migrations; /* Number of migrating ULTs */
288  void *data; /* Specific data */
289  uint64_t id; /* ID */
290 
291  /* Functions to manage units */
299 
300  /* Functions to manage the pool */
310 };
311 
312 struct ABTI_thread {
315  ABTD_atomic_int is_in_pool; /* Whether this thread is in a pool. */
316  ABTI_thread_type type; /* Thread type */
317  ABT_unit unit; /* Unit enclosing this thread */
318  ABTI_xstream *p_last_xstream; /* Last ES where it ran */
319  ABTI_thread *p_parent; /* Parent thread */
320  void (*f_thread)(void *); /* Thread function */
321  void *p_arg; /* Thread function argument */
322  ABTD_atomic_int state; /* State (ABT_thread_state) */
324  ABTI_pool *p_pool; /* Associated pool */
325  ABTD_atomic_ptr p_keytable; /* Thread-specific data (ABTI_ktable *) */
326  ABT_unit_id id; /* ID */
327 };
328 
330  void *p_stack; /* Stack address */
331  size_t stacksize; /* Stack size (in bytes) */
332  ABTI_thread_type thread_type; /* Thread type */
333 #ifndef ABT_CONFIG_DISABLE_MIGRATION
334  ABT_bool migratable; /* Migratability */
335  void (*f_cb)(ABT_thread, void *); /* Callback function */
336  void *p_cb_arg; /* Callback function argument */
337 #endif
338 };
339 
341  void (*f_migration_cb)(ABT_thread, void *); /* Callback function */
342  void *p_migration_cb_arg; /* Callback function argument */
344  p_migration_pool; /* Destination of migration (ABTI_pool *) */
345 };
346 
347 struct ABTI_ythread {
348  ABTI_thread thread; /* Common thread definition */
349  ABTD_ythread_context ctx; /* Context */
350  void *p_stack; /* Stack address */
351  size_t stacksize; /* Stack size (in bytes) */
352 };
353 
354 struct ABTI_key {
355  void (*f_destructor)(void *value);
356  uint32_t id;
357 };
358 
359 struct ABTI_ktelem {
360  /* information of ABTI_key */
361  void (*f_destructor)(void *value);
362  uint32_t key_id;
363  void *value;
364  ABTD_atomic_ptr p_next; /* Next element (ABTI_ktelem *) */
365 };
366 
367 struct ABTI_ktable {
368  int size; /* size of the table */
369  ABTI_spinlock lock; /* Protects any new entry creation. */
370  void *p_used_mem;
371  void *p_extra_mem;
373  ABTD_atomic_ptr p_elems[1]; /* element array (ABTI_ktelem *) */
374 };
375 
376 struct ABTI_cond {
379  size_t num_waiters;
380  ABTI_thread *p_head; /* Head of waiters */
381  ABTI_thread *p_tail; /* Tail of waiters */
382 };
383 
384 struct ABTI_rwlock {
387  size_t reader_count;
389 };
390 
394  void *value;
395  int nbytes;
396  ABTI_thread *p_head; /* Head of waiters */
397  ABTI_thread *p_tail; /* Tail of waiters */
398 };
399 
400 struct ABTI_future {
403  uint32_t compartments;
404  void **array;
405  void (*p_callback)(void **arg);
406  ABTI_thread *p_head; /* Head of waiters */
407  ABTI_thread *p_tail; /* Tail of waiters */
408 };
409 
410 struct ABTI_barrier {
411  uint32_t num_waiters;
412  volatile uint32_t counter;
416 };
417 
419  uint32_t num_waiters;
421 };
422 
423 struct ABTI_timer {
426 };
427 
428 #ifndef ABT_CONFIG_DISABLE_TOOL_INTERFACE
429 struct ABTI_tool_context {
430  ABTI_thread *p_caller;
431  ABTI_pool *p_pool;
433  *p_parent; /* Parent of the target thread. Used to get the depth */
434  ABT_sync_event_type sync_event_type;
435  void *p_sync_object; /* ABTI type */
436 };
437 #endif
438 
439 /* Global Data */
442 
443 /* ES Local Data */
445 
446 /* Execution Stream (ES) */
448 void ABTI_xstream_start_primary(ABTI_xstream **pp_local_xstream,
449  ABTI_xstream *p_xstream,
450  ABTI_ythread *p_ythread);
451 void ABTI_xstream_free(ABTI_local *p_local, ABTI_xstream *p_xstream,
452  ABT_bool force_free);
453 void ABTI_xstream_schedule(void *p_arg);
454 void ABTI_xstream_run_unit(ABTI_xstream **pp_local_xstream, ABT_unit unit,
455  ABTI_pool *p_pool);
456 void ABTI_xstream_check_events(ABTI_xstream *p_xstream, ABTI_sched *p_sched);
457 void ABTI_xstream_print(ABTI_xstream *p_xstream, FILE *p_os, int indent,
458  ABT_bool print_sub);
459 
460 /* Scheduler */
465 void ABTI_sched_finish(ABTI_sched *p_sched);
466 void ABTI_sched_exit(ABTI_sched *p_sched);
467 ABTU_ret_err int ABTI_sched_create_basic(ABT_sched_predef predef, int num_pools,
468  ABT_pool *pools,
469  ABT_sched_config config,
470  ABTI_sched **pp_newsched);
471 void ABTI_sched_free(ABTI_local *p_local, ABTI_sched *p_sched,
472  ABT_bool force_free);
474  ABTI_pool **);
476 size_t ABTI_sched_get_size(ABTI_sched *p_sched);
477 size_t ABTI_sched_get_total_size(ABTI_sched *p_sched);
478 size_t ABTI_sched_get_effective_size(ABTI_local *p_local, ABTI_sched *p_sched);
479 void ABTI_sched_print(ABTI_sched *p_sched, FILE *p_os, int indent,
480  ABT_bool print_sub);
481 void ABTI_sched_reset_id(void);
482 
483 /* Scheduler config */
485  int num_vars, void **variables);
487  ABT_pool_access *access,
488  ABT_bool *automatic);
489 
490 /* Pool */
492  ABT_pool_access access,
493  ABT_bool automatic,
494  ABTI_pool **pp_newpool);
495 void ABTI_pool_free(ABTI_pool *p_pool);
497  ABT_pool_def *p_def);
499  ABT_pool_def *p_def);
500 void ABTI_pool_print(ABTI_pool *p_pool, FILE *p_os, int indent);
501 void ABTI_pool_reset_id(void);
502 
503 /* Work Unit */
505 
506 /* Threads */
508  ABTI_thread *p_thread,
509  ABTI_thread_mig_data **pp_mig_data);
510 void ABTI_thread_revive(ABTI_local *p_local, ABTI_pool *p_pool,
511  void (*thread_func)(void *), void *arg,
512  ABTI_thread *p_thread);
513 void ABTI_thread_join(ABTI_local **pp_local, ABTI_thread *p_thread);
514 void ABTI_thread_free(ABTI_local *p_local, ABTI_thread *p_thread);
515 void ABTI_thread_print(ABTI_thread *p_thread, FILE *p_os, int indent);
516 void ABTI_thread_reset_id(void);
518 
519 /* Yieldable threads */
521  ABTI_xstream *p_xstream,
522  ABTI_ythread **pp_root_ythread);
524  ABTI_xstream *p_xstream,
525  ABTI_ythread **p_ythread);
527  ABTI_xstream *p_xstream,
528  ABTI_sched *p_sched);
530  ABTI_pool *p_pool,
531  ABTI_sched *p_sched);
532 ABTU_noreturn void ABTI_ythread_exit(ABTI_xstream *p_local_xstream,
533  ABTI_ythread *p_ythread);
534 void ABTI_ythread_free_main(ABTI_local *p_local, ABTI_ythread *p_ythread);
535 void ABTI_ythread_free_root(ABTI_local *p_local, ABTI_ythread *p_ythread);
536 void ABTI_ythread_set_blocked(ABTI_ythread *p_ythread);
537 void ABTI_ythread_suspend(ABTI_xstream **pp_local_xstream,
538  ABTI_ythread *p_ythread,
539  ABT_sync_event_type sync_event_type, void *p_sync);
540 void ABTI_ythread_set_ready(ABTI_local *p_local, ABTI_ythread *p_ythread);
541 void ABTI_ythread_print_stack(ABTI_ythread *p_ythread, FILE *p_os);
542 
543 /* Thread attributes */
544 void ABTI_thread_attr_print(ABTI_thread_attr *p_attr, FILE *p_os, int indent);
545 ABTU_ret_err int
547  ABTI_thread_attr **pp_dup_attr) ABTU_ret_err;
548 
549 /* Thread hash table */
550 ABTU_ret_err int ABTI_ythread_htable_create(uint32_t num_rows,
551  ABTI_ythread_htable **pp_htable);
553 void ABTI_ythread_htable_push(ABTI_ythread_htable *p_htable, int idx,
554  ABTI_ythread *p_ythread);
555 void ABTI_ythread_htable_push_low(ABTI_ythread_htable *p_htable, int idx,
556  ABTI_ythread *p_ythread);
558  ABTI_ythread_queue *p_queue);
560  ABTI_ythread_queue *p_queue);
562  ABTI_ythread_queue *p_queue,
563  ABTI_ythread *p_ythread,
564  ABTI_ythread_htable *p_htable,
565  ABT_sync_event_type sync_event_type,
566  void *p_sync);
567 /* Key */
568 void ABTI_ktable_free(ABTI_local *p_local, ABTI_ktable *p_ktable);
569 
570 /* Mutex */
571 void ABTI_mutex_wait(ABTI_xstream **pp_local_xstream, ABTI_mutex *p_mutex,
572  int val);
573 void ABTI_mutex_wait_low(ABTI_xstream **pp_local_xstream, ABTI_mutex *p_mutex,
574  int val);
575 void ABTI_mutex_wake_de(ABTI_local *p_local, ABTI_mutex *p_mutex);
576 
577 /* Information */
578 void ABTI_info_print_config(FILE *fp);
580 
581 #include "abti_log.h"
582 #include "abti_local.h"
583 #include "abti_self.h"
584 #include "abti_pool.h"
585 #include "abti_sched.h"
586 #include "abti_config.h"
587 #include "abti_stream.h"
588 #include "abti_thread.h"
589 #include "abti_tool.h"
590 #include "abti_ythread.h"
591 #include "abti_thread_attr.h"
592 #include "abti_mutex.h"
593 #include "abti_mutex_attr.h"
594 #include "abti_cond.h"
595 #include "abti_rwlock.h"
596 #include "abti_eventual.h"
597 #include "abti_future.h"
598 #include "abti_barrier.h"
599 #include "abti_stream_barrier.h"
600 #include "abti_timer.h"
601 #include "abti_mem.h"
602 #include "abti_key.h"
603 
604 #endif /* ABTI_H_INCLUDED */
ABTD_atomic_int32 num_scheds
Definition: abti.h:285
uint32_t max_handovers
Definition: abti.h:157
ABT_pool_print_all_fn p_print_all
Definition: abti.h:309
ABTI_spinlock lock
Definition: abti.h:377
void ** array
Definition: abti.h:404
int write_flag
Definition: abti.h:388
ABTD_xstream_barrier bar
Definition: abti.h:420
ABTI_pool * p_pool
Definition: abti.h:324
struct ABT_unit_opaque * ABT_unit
Definition: abt.h:337
ABT_bool automatic
Definition: abti.h:283
ABTD_atomic_uint32 request
Definition: abti.h:323
void(* f_migration_cb)(ABT_thread, void *)
Definition: abti.h:341
struct ABTI_native_thread_id_opaque * ABTI_native_thread_id
Definition: abti.h:136
ABTU_ret_err int ABTI_sched_config_read_global(ABT_sched_config config, ABT_pool_access *access, ABT_bool *automatic)
Definition: config.c:209
void ABTI_xstream_schedule(void *p_arg)
ABTI_spinlock lock
Definition: abti.h:369
ABTI_spinlock mem_pool_stack_lock
Definition: abti.h:204
int key_table_size
Definition: abti.h:181
void * value
Definition: abti.h:363
int mem_lp_alloc
Definition: abti.h:197
ABT_unit_get_type_fn u_get_type
Definition: abti.h:292
uint64_t ABT_unit_id
Definition: abt.h:341
ABT_sched_predef
Definition: abt.h:143
void ABTI_ythread_htable_push(ABTI_ythread_htable *p_htable, int idx, ABTI_ythread *p_ythread)
ABT_unit_create_from_thread_fn u_create_from_thread
Definition: abti.h:296
ABTI_sched_used
Definition: abti.h:66
ABTI_ythread * p_ythread
Definition: abti.h:267
ABT_unit(* ABT_pool_pop_wait_fn)(ABT_pool, double)
Definition: abt.h:481
char padding2[ABT_CONFIG_STATIC_CACHELINE_SIZE]
Definition: abti.h:231
ABT_unit_id id
Definition: abti.h:326
ABTD_atomic_int state
Definition: abti.h:241
uint32_t num_waiters
Definition: abti.h:411
int(* ABT_pool_free_fn)(ABT_pool)
Definition: abt.h:484
int size
Definition: abti.h:368
ABT_pool_pop_timedwait_fn p_pop_timedwait
Definition: abti.h:306
ABTU_ret_err int ABTI_ythread_htable_create(uint32_t num_rows, ABTI_ythread_htable **pp_htable)
Definition: ythread_htable.c:9
ABT_pool * pools
Definition: abti.h:265
ABT_bool ready
Definition: abti.h:393
void ABTI_pool_free(ABTI_pool *p_pool)
Definition: pool.c:408
ABTI_sched_kind kind
Definition: abti.h:262
void ABTI_xstream_print(ABTI_xstream *p_xstream, FILE *p_os, int indent, ABT_bool print_sub)
Definition: stream.c:974
void ABTI_mutex_wake_de(ABTI_local *p_local, ABTI_mutex *p_mutex)
Definition: mutex.c:502
ABTI_thread * p_head
Definition: abti.h:380
size_t ABTI_sched_get_total_size(ABTI_sched *p_sched)
Definition: sched.c:586
ABTI_thread * p_prev
Definition: abti.h:313
ABT_unit_type(* ABT_unit_get_type_fn)(ABT_unit)
Definition: abt.h:470
ABT_unit(* ABT_pool_pop_timedwait_fn)(ABT_pool, double)
Definition: abt.h:482
ABTI_thread * p_tail
Definition: abti.h:407
struct ABTI_local ABTI_local
Definition: abti.h:101
ABT_sched_get_migr_pool_fn get_migr_pool
Definition: abti.h:274
ABTU_ret_err int ABTI_ythread_create_root(ABTI_local *p_local, ABTI_xstream *p_xstream, ABTI_ythread **pp_root_ythread)
Definition: thread.c:1406
uint32_t max_wakeups
Definition: abti.h:158
void * p_migration_cb_arg
Definition: abti.h:342
int max_xstreams
Definition: abti.h:170
ABTI_mutex mutex
Definition: abti.h:385
void * p_cb_arg
Definition: abti.h:336
void(* f_thread)(void *)
Definition: abti.h:320
ABTU_ret_err int ABTI_sched_config_read(ABT_sched_config config, int type, int num_vars, void **variables)
Definition: config.c:239
ABTI_thread_type type
Definition: abti.h:316
char * ABTI_sched_config
Definition: abti.h:106
void ABTI_sched_reset_id(void)
Definition: sched.c:719
uint32_t attrs
Definition: abti.h:154
uint32_t nesting_cnt
Definition: abti.h:155
ABTU_ret_err int ABTI_ythread_create_sched(ABTI_local *p_local, ABTI_pool *p_pool, ABTI_sched *p_sched)
Definition: thread.c:1452
size_t sched_stacksize
Definition: abti.h:183
void(* ABT_unit_free_fn)(ABT_unit *)
Definition: abt.h:476
pthread_barrier_t ABTD_xstream_barrier
Definition: abtd.h:31
uint32_t num_waiters
Definition: abti.h:419
ABTI_thread * p_thread
Definition: abti.h:251
size_t ABTI_sched_get_effective_size(ABTI_local *p_local, ABTI_sched *p_sched)
Definition: sched.c:604
void ABTI_thread_reset_id(void)
Definition: thread.c:1595
void ABTI_xstream_check_events(ABTI_xstream *p_xstream, ABTI_sched *p_sched)
Definition: stream.c:922
ABTU_ret_err int ABTI_pool_get_fifo_wait_def(ABT_pool_access access, ABT_pool_def *p_def)
Definition: fifo_wait.c:42
ABTD_atomic_uint32 val
Definition: abti.h:162
size_t num_waiters
Definition: abti.h:379
void ABTI_thread_attr_print(ABTI_thread_attr *p_attr, FILE *p_os, int indent)
Definition: thread_attr.c:256
int ABT_bool
Definition: abt.h:373
void * p_extra_mem
Definition: abti.h:371
Definition: abti.h:354
void ABTI_ktable_free(ABTI_local *p_local, ABTI_ktable *p_ktable)
Definition: key.c:139
uint32_t compartments
Definition: abti.h:403
ABTI_thread * p_tail
Definition: abti.h:381
ABTI_mem_pool_global_pool mem_pool_stack
Definition: abti.h:199
void ABTI_sched_exit(ABTI_sched *p_sched)
Definition: sched.c:349
ABTI_xstream_type type
Definition: abti.h:240
#define ABT_CONFIG_STATIC_CACHELINE_SIZE
Definition: abt_config.h:57
ABTD_atomic_int is_in_pool
Definition: abti.h:315
ABTI_ythread_htable * p_htable
Definition: abti.h:164
void ABTI_ythread_free_main(ABTI_local *p_local, ABTI_ythread *p_ythread)
Definition: thread.c:1484
void(* ABT_tool_thread_callback_fn)(ABT_thread, ABT_xstream, uint64_t event, ABT_tool_context context, void *user_arg)
Definition: abt.h:515
ABTU_ret_err int ABTI_ythread_create_main(ABTI_local *p_local, ABTI_xstream *p_xstream, ABTI_ythread **p_ythread)
Definition: thread.c:1378
uint32_t id
Definition: abti.h:356
void ABTI_info_check_print_all_thread_stacks(void)
Definition: info.c:535
ABT_bool(* ABT_unit_is_in_pool_fn)(ABT_unit)
Definition: abt.h:473
long sched_sleep_nsec
Definition: abti.h:185
ABTI_ythread * p_root_ythread
Definition: abti.h:247
ABT_sched_def * ABTI_sched_get_prio_def(void)
Definition: prio.c:29
ABT_pool_push_fn p_push
Definition: abti.h:303
ABT_unit_get_task_fn u_get_task
Definition: abti.h:294
struct ABTI_thread_id_opaque * ABTI_thread_id
Definition: abti.h:139
struct ABT_pool_opaque * ABT_pool
Definition: abt.h:329
ABT_unit_get_thread_fn u_get_thread
Definition: abti.h:293
ABTI_ythread * p_handover
Definition: abti.h:165
ABT_unit(* ABT_pool_pop_fn)(ABT_pool)
Definition: abt.h:480
int(* ABT_pool_init_fn)(ABT_pool, ABT_pool_config)
Definition: abt.h:477
void * p_used_mem
Definition: abti.h:370
void * p_stack
Definition: abti.h:330
ABT_pool_get_size_fn p_get_size
Definition: abti.h:302
ABT_unit_create_from_task_fn u_create_from_task
Definition: abti.h:297
uint32_t mutex_max_handovers
Definition: abti.h:188
ABTI_sched * p_main_sched
Definition: abti.h:242
void ABTI_xstream_start_primary(ABTI_xstream **pp_local_xstream, ABTI_xstream *p_xstream, ABTI_ythread *p_ythread)
Definition: stream.c:875
ABT_bool use_debug
Definition: abti.h:180
ABT_unit_id ABTI_thread_get_id(ABTI_thread *p_thread)
Definition: thread.c:1600
ABT_unit_is_in_pool_fn u_is_in_pool
Definition: abti.h:295
ABTI_pool * p_root_pool
Definition: abti.h:248
void(* set_local_xstream_f)(ABTI_xstream *)
Definition: abti.h:229
ABT_pool_pop_wait_fn p_pop_wait
Definition: abti.h:305
#define ABTD_XSTREAM_LOCAL
Definition: abtd.h:41
ABT_bool set_affinity
Definition: abti.h:178
void ABTI_sched_print(ABTI_sched *p_sched, FILE *p_os, int indent, ABT_bool print_sub)
Definition: sched.c:636
ABTI_xstream * p_next
Definition: abti.h:237
ABTI_spinlock xstream_list_lock
Definition: abti.h:174
ABTD_atomic_ptr p_migration_pool
Definition: abti.h:344
ABTI_thread_id owner_id
Definition: abti.h:156
ABTI_ythread * ABTI_ythread_htable_pop(ABTI_ythread_htable *p_htable, ABTI_ythread_queue *p_queue)
uint32_t mutex_max_wakeups
Definition: abti.h:189
struct ABT_thread_opaque * ABT_thread
Definition: abt.h:343
ABTI_xstream * p_last_xstream
Definition: abti.h:318
size_t stacksize
Definition: abti.h:351
void ABTI_thread_join(ABTI_local **pp_local, ABTI_thread *p_thread)
Definition: thread.c:1470
int rank
Definition: abti.h:239
uint32_t mem_page_size
Definition: abti.h:193
ABT_pool_remove_fn p_remove
Definition: abti.h:307
uint32_t ABTI_thread_type
Definition: abti.h:115
int num_pools
Definition: abti.h:266
ABTD_atomic_int state
Definition: abti.h:322
ABT_pool_pop_fn p_pop
Definition: abti.h:304
void ABTI_sched_free(ABTI_local *p_local, ABTI_sched *p_sched, ABT_bool force_free)
Definition: sched.c:497
void * ABTI_sched_id
Definition: abti.h:108
ABT_bool migratable
Definition: abti.h:334
ABTI_thread * p_head
Definition: abti.h:406
ABTD_atomic_uint32 request
Definition: abti.h:264
uint32_t key_id
Definition: abti.h:362
void(* f_destructor)(void *value)
Definition: abti.h:361
ABT_sched_init_fn init
Definition: abti.h:271
ABT_bool automatic
Definition: abti.h:261
ABT_pool(* ABT_sched_get_migr_pool_fn)(ABT_sched)
Definition: abt.h:457
ABT_sched_def * ABTI_sched_get_basic_wait_def(void)
Definition: basic_wait.c:35
ABT_unit_free_fn u_free
Definition: abti.h:298
ABT_sched_type type
Definition: abti.h:263
void * p_arg
Definition: abti.h:321
ABTD_atomic_ptr p_next
Definition: abti.h:364
ABT_pool_init_fn p_init
Definition: abti.h:301
void ABTI_mutex_wait(ABTI_xstream **pp_local_xstream, ABTI_mutex *p_mutex, int val)
Definition: mutex.c:430
ABTI_global * gp_ABTI_global
Definition: global.c:18
ABTI_thread thread
Definition: abti.h:348
ABT_unit_type * waiter_type
Definition: abti.h:414
void * data
Definition: abti.h:288
void ABTI_xstream_run_unit(ABTI_xstream **pp_local_xstream, ABT_unit unit, ABTI_pool *p_pool)
Definition: stream.c:903
ABTU_ret_err int ABTI_sched_create_basic(ABT_sched_predef predef, int num_pools, ABT_pool *pools, ABT_sched_config config, ABTI_sched **pp_newsched)
Definition: sched.c:354
ABTD_atomic_uint32 counter
Definition: abti.h:402
ABT_bool ABTI_sched_has_to_stop(ABTI_local **pp_local, ABTI_sched *p_sched)
Definition: sched.c:526
size_t ABTI_sched_get_size(ABTI_sched *p_sched)
Definition: sched.c:307
uint32_t huge_page_size
Definition: abti.h:191
ABT_pool_access
Definition: abt.h:161
ABTI_xstream * p_xstream_head
Definition: abti.h:172
ABT_sched_run_fn run
Definition: abti.h:272
ABT_unit_type
Definition: abt.h:169
ABTI_thread * p_head
Definition: abti.h:396
int(* ABT_sched_init_fn)(ABT_sched, ABT_sched_config)
Definition: abt.h:453
void(* p_callback)(void **arg)
Definition: abti.h:405
void ABTI_thread_free(ABTI_local *p_local, ABTI_thread *p_thread)
Definition: thread.c:1475
ABT_unit(* ABT_unit_create_from_task_fn)(ABT_task)
Definition: abt.h:475
ABTU_ret_err int ABTI_thread_get_mig_data(ABTI_local *p_local, ABTI_thread *p_thread, ABTI_thread_mig_data **pp_mig_data)
Definition: thread.c:1508
size_t(* ABT_pool_get_size_fn)(ABT_pool)
Definition: abt.h:478
ABTI_mem_pool_local_pool mem_pool_desc_ext
Definition: abti.h:207
#define ABTU_align_member_var(size)
Definition: abtu.h:64
ABTI_mem_pool_local_pool mem_pool_desc
Definition: abti.h:255
void(* ABT_sched_run_fn)(ABT_sched)
Definition: abt.h:454
void(* f_cb)(ABT_thread, void *)
Definition: abti.h:335
ABTI_ythread * p_giver
Definition: abti.h:166
ABT_pool_access access
Definition: abti.h:282
ABT_bool print_config
Definition: abti.h:211
ABT_sched_free_fn free
Definition: abti.h:273
ABTI_spinlock lock
Definition: abti.h:415
uint32_t os_page_size
Definition: abti.h:190
ABTI_local_func gp_ABTI_local_func
Definition: local.c:23
ABTI_mem_pool_local_pool mem_pool_stack_ext
Definition: abti.h:205
void ABTI_info_print_config(FILE *fp)
Definition: info.c:642
ABTD_XSTREAM_LOCAL ABTI_local * lp_ABTI_local
Definition: local.c:29
ABT_pool_kind
Definition: abt.h:156
void ABTI_pool_print(ABTI_pool *p_pool, FILE *p_os, int indent)
Definition: pool.c:416
void ABTI_thread_print(ABTI_thread *p_thread, FILE *p_os, int indent)
Definition: thread.c:1532
ABTI_mutex * p_waiter_mutex
Definition: abti.h:378
ABTU_ret_err int ABTI_xstream_create_primary(ABTI_xstream **pp_xstream)
Definition: stream.c:855
ABTD_xstream_context ctx
Definition: abti.h:244
ABTU_ret_err int ABTI_thread_attr_dup(const ABTI_thread_attr *p_attr, ABTI_thread_attr **pp_dup_attr) ABTU_ret_err
Definition: thread_attr.c:300
ABTD_atomic_ptr p_elems[1]
Definition: abti.h:373
void(* ABT_pool_push_fn)(ABT_pool, ABT_unit)
Definition: abt.h:479
void ABTI_unit_set_associated_pool(ABT_unit unit, ABTI_pool *p_pool)
Definition: unit.c:40
ABTU_ret_err int ABTI_ythread_create_main_sched(ABTI_local *p_local, ABTI_xstream *p_xstream, ABTI_sched *p_sched)
Definition: thread.c:1432
#define ABTU_noreturn
Definition: abtu.h:31
ABTI_mutex_attr attr
Definition: abti.h:163
ABTU_ret_err int ABTI_pool_get_fifo_def(ABT_pool_access access, ABT_pool_def *p_def)
Definition: fifo.c:47
ABT_bool ABTI_ythread_htable_switch_low(ABTI_xstream **pp_local_xstream, ABTI_ythread_queue *p_queue, ABTI_ythread *p_ythread, ABTI_ythread_htable *p_htable, ABT_sync_event_type sync_event_type, void *p_sync)
ABTI_spinlock mem_pool_desc_lock
Definition: abti.h:206
ABTU_ret_err int ABTI_pool_create_basic(ABT_pool_kind kind, ABT_pool_access access, ABT_bool automatic, ABTI_pool **pp_newpool)
Definition: pool.c:382
ABT_sched_type
Definition: abt.h:151
int(* ABT_pool_print_all_fn)(ABT_pool, void *arg, void(*)(void *, ABT_unit))
Definition: abt.h:485
ABTU_ret_err int ABTI_sched_get_migration_pool(ABTI_sched *, ABTI_pool *, ABTI_pool **)
Definition: sched.c:567
void(* f_destructor)(void *value)
Definition: abti.h:355
size_t stacksize
Definition: abti.h:331
ABTI_xstream_type
Definition: abti.h:61
void ABTI_ythread_free_root(ABTI_local *p_local, ABTI_ythread *p_ythread)
Definition: thread.c:1492
ABTD_ythread_context ctx
Definition: abti.h:349
uint32_t mem_max_descs
Definition: abti.h:196
ABT_sched_def * ABTI_sched_get_basic_def(void)
Definition: basic.c:37
void ABTI_mutex_wait_low(ABTI_xstream **pp_local_xstream, ABTI_mutex *p_mutex, int val)
Definition: mutex.c:466
ABTI_thread * p_tail
Definition: abti.h:397
void * p_stack
Definition: abti.h:350
ABTI_ythread ** waiters
Definition: abti.h:413
int(* ABT_pool_remove_fn)(ABT_pool, ABT_unit)
Definition: abt.h:483
int(* ABT_sched_free_fn)(ABT_sched)
Definition: abt.h:455
ABTI_xstream * p_prev
Definition: abti.h:236
ABT_pool_free_fn p_free
Definition: abti.h:308
struct ABT_sched_config_opaque * ABT_sched_config
Definition: abt.h:321
struct timespec ABTD_time
Definition: abtd.h:88
size_t extra_mem_size
Definition: abti.h:372
void ABTI_ythread_htable_push_low(ABTI_ythread_htable *p_htable, int idx, ABTI_ythread *p_ythread)
uint64_t id
Definition: abti.h:289
ABTD_atomic_int32 num_migrations
Definition: abti.h:287
ABT_unit(* ABT_unit_create_from_thread_fn)(ABT_thread)
Definition: abt.h:474
void ABTI_ythread_htable_free(ABTI_ythread_htable *p_htable)
void ABTI_xstream_free(ABTI_local *p_local, ABTI_xstream *p_xstream, ABT_bool force_free)
Definition: stream.c:938
void ABTI_ythread_print_stack(ABTI_ythread *p_ythread, FILE *p_os)
Definition: ythread.c:85
void ABTI_sched_finish(ABTI_sched *p_sched)
Definition: sched.c:344
ABTD_atomic_ptr p_keytable
Definition: abti.h:325
ABTI_thread * p_next
Definition: abti.h:314
ABTI_ythread * p_main_ythread
Definition: abti.h:186
ABT_sched_def * ABTI_sched_get_randws_def(void)
Definition: randws.c:31
ABTI_sched_used used
Definition: abti.h:260
ABT_unit unit
Definition: abti.h:317
ABTI_ythread * ABTI_ythread_htable_pop_low(ABTI_ythread_htable *p_htable, ABTI_ythread_queue *p_queue)
uint32_t sched_event_freq
Definition: abti.h:184
void ABTI_pool_reset_id(void)
Definition: pool.c:467
void ABTI_thread_revive(ABTI_local *p_local, ABTI_pool *p_pool, void(*thread_func)(void *), void *arg, ABTI_thread *p_thread)
Definition: thread.c:1325
ABTI_spinlock lock
Definition: abti.h:401
void ABTI_ythread_set_ready(ABTI_local *p_local, ABTI_ythread *p_ythread)
Definition: ythread.c:50
ABTI_cond cond
Definition: abti.h:386
ABTI_spinlock lock
Definition: abti.h:392
void ABTI_ythread_set_blocked(ABTI_ythread *p_ythread)
Definition: ythread.c:8
ABTD_time end
Definition: abti.h:425
int nbytes
Definition: abti.h:395
ABT_sync_event_type
Definition: abt.h:244
uint32_t mem_max_stacks
Definition: abti.h:195
void * data
Definition: abti.h:268
void(* ABT_tool_task_callback_fn)(ABT_task, ABT_xstream, uint64_t event, ABT_tool_context context, void *user_arg)
Definition: abt.h:517
ABTI_thread_type thread_type
Definition: abti.h:332
char padding1[ABT_CONFIG_STATIC_CACHELINE_SIZE]
Definition: abti.h:227
ABT_task(* ABT_unit_get_task_fn)(ABT_unit)
Definition: abt.h:472
ABTD_time start
Definition: abti.h:424
int num_cores
Definition: abti.h:177
size_t reader_count
Definition: abti.h:387
ABT_thread(* ABT_unit_get_thread_fn)(ABT_unit)
Definition: abt.h:471
uintptr_t ABTI_sched_kind
Definition: abti.h:109
int num_xstreams
Definition: abti.h:171
uint32_t mem_sp_size
Definition: abti.h:194
ABTI_mutex_attr_val
Definition: abti.h:91
void * value
Definition: abti.h:394
void ABTI_ythread_suspend(ABTI_xstream **pp_local_xstream, ABTI_ythread *p_ythread, ABT_sync_event_type sync_event_type, void *p_sync)
Definition: ythread.c:30
ABTI_thread * p_parent
Definition: abti.h:319
#define ABTU_ret_err
Definition: abtu.h:49
size_t thread_stacksize
Definition: abti.h:182
ABT_bool use_logging
Definition: abti.h:179
ABTI_mem_pool_global_pool mem_pool_desc
Definition: abti.h:200
ABTU_noreturn void ABTI_ythread_exit(ABTI_xstream *p_local_xstream, ABTI_ythread *p_ythread)
Definition: thread.c:1497
ABTI_mem_pool_local_pool mem_pool_stack
Definition: abti.h:254
volatile uint32_t counter
Definition: abti.h:412
ABTD_atomic_int32 num_blocked
Definition: abti.h:286