111 ABTI_CHECK_INITIALIZED();
113 switch (query_kind) {
118 #ifdef ABT_CONFIG_PRINT_ABT_ERRNO 128 #ifdef HAVE_VALGRIND_SUPPORT 135 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK 142 #ifndef ABT_CONFIG_DISABLE_POOL_PRODUCER_CHECK 149 #ifndef ABT_CONFIG_DISABLE_POOL_CONSUMER_CHECK 156 #ifdef ABTD_FCONTEXT_PRESERVE_FPU 163 #ifndef ABT_CONFIG_DISABLE_THREAD_CANCEL 170 #ifndef ABT_CONFIG_DISABLE_TASK_CANCEL 177 #ifndef ABT_CONFIG_DISABLE_MIGRATION 184 #ifndef ABT_CONFIG_DISABLE_STACKABLE_SCHED 191 #ifndef ABT_CONFIG_DISABLE_EXT_THREAD 198 #ifdef ABT_CONFIG_USE_SCHED_SLEEP 227 ABTI_CHECK_ERROR(abt_errno);
253 return ABTI_info_print_config(fp);
271 ABTI_CHECK_INITIALIZED();
276 ABTI_spinlock_acquire(&p_global->xstreams_lock);
278 fprintf(fp,
"# of created ESs: %d\n", p_global->num_xstreams);
279 for (i = 0; i < p_global->num_xstreams; i++) {
280 ABTI_xstream *p_xstream = p_global->p_xstreams[i];
282 ABTI_xstream_print(p_xstream, fp, 0,
ABT_FALSE);
286 ABTI_spinlock_release(&p_global->xstreams_lock);
313 ABTI_xstream *p_xstream = ABTI_xstream_get_ptr(xstream);
314 ABTI_CHECK_NULL_XSTREAM_PTR(p_xstream);
316 ABTI_xstream_print(p_xstream, fp, 0,
ABT_FALSE);
341 ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
342 ABTI_CHECK_NULL_SCHED_PTR(p_sched);
344 ABTI_sched_print(p_sched, fp, 0,
ABT_FALSE);
369 ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
370 ABTI_CHECK_NULL_POOL_PTR(p_pool);
372 ABTI_pool_print(p_pool, fp, 0);
397 ABTI_thread *p_thread = ABTI_thread_get_ptr(thread);
398 ABTI_CHECK_NULL_THREAD_PTR(p_thread);
400 ABTI_thread_print(p_thread, fp, 0);
426 ABTI_thread_attr *p_attr = ABTI_thread_attr_get_ptr(attr);
427 ABTI_CHECK_NULL_THREAD_ATTR_PTR(p_attr);
429 ABTI_thread_attr_print(p_attr, fp, 0);
454 ABTI_task *p_task = ABTI_task_get_ptr(task);
455 ABTI_CHECK_NULL_TASK_PTR(p_task);
457 ABTI_task_print(p_task, fp, 0);
482 ABTI_thread *p_thread = ABTI_thread_get_ptr(thread);
483 ABTI_CHECK_NULL_THREAD_PTR(p_thread);
485 abt_errno = ABTI_thread_print_stack(p_thread, fp);
495 struct ABTI_info_print_unit_arg_t {
500 static void ABTI_info_print_unit(
void *arg,
ABT_unit unit)
504 struct ABTI_info_print_unit_arg_t *p_arg;
505 p_arg = (
struct ABTI_info_print_unit_arg_t *)arg;
506 FILE *fp = p_arg->fp;
508 ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
512 fprintf(fp,
"=== ULT (%p) ===\n", (
void *)unit);
513 ABT_thread thread = p_pool->u_get_thread(unit);
514 ABTI_thread *p_thread = ABTI_thread_get_ptr(thread);
519 (uint64_t)thread_id, (
void *)&p_thread->ctx);
520 ABTD_thread_print_context(p_thread, fp, 2);
523 "stacksize : %" PRIu64
"\n",
524 p_thread->attr.p_stack, (uint64_t)p_thread->attr.stacksize);
525 int abt_errno = ABTI_thread_print_stack(p_thread, fp);
527 fprintf(fp,
"Failed to print stack.\n");
529 fprintf(fp,
"=== tasklet (%p) ===\n", (
void *)unit);
531 fprintf(fp,
"=== unknown (%p) ===\n", (
void *)unit);
535 int ABTI_info_print_thread_stacks_in_pool(FILE *fp, ABTI_pool *p_pool);
553 ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
554 ABTI_CHECK_NULL_POOL_PTR(p_pool);
556 abt_errno = ABTI_info_print_thread_stacks_in_pool(fp, p_pool);
557 ABTI_CHECK_ERROR(abt_errno);
567 int ABTI_info_print_thread_stacks_in_pool(FILE *fp, ABTI_pool *p_pool)
570 ABT_pool pool = ABTI_pool_get_handle(p_pool);
572 if (!p_pool->p_print_all) {
576 fprintf(fp,
"== pool (%p) ==\n", (
void *)p_pool);
577 struct ABTI_info_print_unit_arg_t arg;
580 p_pool->p_print_all(pool, &arg, ABTI_info_print_unit);
590 struct ABTI_info_pool_set_t {
597 ABTI_info_initialize_pool_set(
struct ABTI_info_pool_set_t *p_set)
599 size_t default_len = 16;
602 p_set->len = default_len;
606 ABTI_info_finalize_pool_set(
struct ABTI_info_pool_set_t *p_set)
611 static inline void ABTI_info_add_pool_set(
ABT_pool pool,
612 struct ABTI_info_pool_set_t *p_set)
615 for (i = 0; i < p_set->num; i++) {
616 if (p_set->pools[i] == pool)
620 if (p_set->num == p_set->len) {
621 size_t new_len = p_set->len * 2;
625 p_set->len = new_len;
627 p_set->pools[p_set->num++] = pool;
630 #define PRINT_STACK_FLAG_UNSET 0 631 #define PRINT_STACK_FLAG_INITIALIZE 1 632 #define PRINT_STACK_FLAG_WAIT 2 633 #define PRINT_STACK_FLAG_FINALIZE 3 642 ABTD_ATOMIC_UINT32_STATIC_INITIALIZER(0);
706 void ABTI_info_check_print_all_thread_stacks(
void)
714 if (self_value == 0) {
716 double start_time = ABTI_get_wtime();
740 struct ABTI_info_pool_set_t pool_set;
741 ABTI_info_initialize_pool_set(&pool_set);
745 "ABT_info_trigger_print_all_thread_stacks: " 746 "timeout (only %d ESs stop)\n",
751 ABTI_sched *p_main_sched = p_xstream->p_main_sched;
752 fprintf(fp,
"= xstream[%d] (%p) =\n", i, (
void *)p_xstream);
753 fprintf(fp,
"main_sched : %p\n", (
void *)p_main_sched);
756 for (j = 0; j < p_main_sched->num_pools; j++) {
757 ABT_pool pool = p_main_sched->pools[j];
759 fprintf(fp,
" pools[%d] : %p\n", j,
760 (
void *)ABTI_pool_get_ptr(pool));
761 ABTI_info_add_pool_set(pool, &pool_set);
764 for (i = 0; i < pool_set.num; i++) {
766 ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
767 int abt_errno = ABTI_info_print_thread_stacks_in_pool(fp, p_pool);
769 fprintf(fp,
" Failed to print (errno = %d).\n", abt_errno);
776 ABTI_info_finalize_pool_set(&pool_set);
791 if (dec_value == 0) {
798 int ABTI_info_print_config(FILE *fp)
801 ABTI_CHECK_INITIALIZED();
805 fprintf(fp,
"Argobots Configuration:\n");
806 fprintf(fp,
" - # of cores: %d\n", p_global->num_cores);
808 fprintf(fp,
" - OS page size: %u\n", p_global->os_page_size);
809 fprintf(fp,
" - huge page size: %u\n", p_global->huge_page_size);
810 fprintf(fp,
" - max. # of ESs: %d\n", p_global->max_xstreams);
811 fprintf(fp,
" - cur. # of ESs: %d\n", p_global->num_xstreams);
812 fprintf(fp,
" - ES affinity: %s\n",
813 (p_global->set_affinity ==
ABT_TRUE) ?
"on" :
"off");
814 fprintf(fp,
" - logging: %s\n",
815 (p_global->use_logging ==
ABT_TRUE) ?
"on" :
"off");
816 fprintf(fp,
" - debug output: %s\n",
817 (p_global->use_debug ==
ABT_TRUE) ?
"on" :
"off");
818 fprintf(fp,
" - key table entries: %d\n", p_global->key_table_size);
819 fprintf(fp,
" - ULT stack size: %u KB\n",
820 (
unsigned)(p_global->thread_stacksize / 1024));
821 fprintf(fp,
" - scheduler stack size: %u KB\n",
822 (
unsigned)(p_global->sched_stacksize / 1024));
823 fprintf(fp,
" - scheduler event check frequency: %u\n",
824 p_global->sched_event_freq);
826 fprintf(fp,
" - timer function: " 829 #elif defined(ABT_CONFIG_USE_MACH_ABSOLUTE_TIME)
831 #elif defined(ABT_CONFIG_USE_GETTIMEOFDAY)
836 #ifdef ABT_CONFIG_USE_MEM_POOL 837 fprintf(fp,
"Memory Pool:\n");
838 fprintf(fp,
" - page size for allocation: %u KB\n",
839 p_global->mem_page_size / 1024);
840 fprintf(fp,
" - stack page size: %u KB\n", p_global->mem_sp_size / 1024);
841 fprintf(fp,
" - max. # of stacks per ES: %u\n", p_global->mem_max_stacks);
842 switch (p_global->mem_lp_alloc) {
843 case ABTI_MEM_LP_MALLOC:
844 fprintf(fp,
" - large page allocation: malloc\n");
846 case ABTI_MEM_LP_MMAP_RP:
847 fprintf(fp,
" - large page allocation: mmap regular pages\n");
849 case ABTI_MEM_LP_MMAP_HP_RP:
850 fprintf(fp,
" - large page allocation: mmap huge pages + " 853 case ABTI_MEM_LP_MMAP_HP_THP:
854 fprintf(fp,
" - large page allocation: mmap huge pages + THPs\n");
856 case ABTI_MEM_LP_THP:
857 fprintf(fp,
" - large page allocation: THPs\n");
struct ABT_thread_attr_opaque * ABT_thread_attr
struct ABT_unit_opaque * ABT_unit
int ABT_info_print_sched(FILE *fp, ABT_sched sched)
Write the information of the target scheduler to the output stream.
struct ABT_xstream_opaque * ABT_xstream
struct ABT_sched_opaque * ABT_sched
int ABT_info_print_thread_stacks_in_pool(FILE *fp, ABT_pool pool)
Dump stack information of all the threads in the target pool.
int ABT_info_print_config(FILE *fp)
Write the configuration information to the output stream.
#define PRINT_STACK_FLAG_FINALIZE
int ABT_info_print_pool(FILE *fp, ABT_pool pool)
Write the information of the target pool to the output stream.
#define ABT_ERR_INV_QUERY_KIND
#define PRINT_STACK_FLAG_INITIALIZE
static double print_stack_timeout
struct ABT_task_opaque * ABT_task
static void * ABTU_malloc(size_t size)
int ABT_info_print_xstream(FILE *fp, ABT_xstream xstream)
Write the information of the target ES to the output stream.
#define ABT_CONFIG_STATIC_CACHELINE_SIZE
struct ABT_pool_opaque * ABT_pool
static FILE * print_stack_fp
int ABT_info_trigger_print_all_thread_stacks(FILE *fp, double timeout, void(*cb_func)(ABT_bool, void *), void *arg)
Dump stacks of threads in pools existing in Argobots.
int ABT_info_print_thread_attr(FILE *fp, ABT_thread_attr attr)
Write the information of the target ULT attribute to the output stream.
static void(* print_cb_func)(ABT_bool, void *)
#define PRINT_STACK_FLAG_WAIT
struct ABT_thread_opaque * ABT_thread
int ABT_info_print_all_xstreams(FILE *fp)
Write the information of all created ESs to the output stream.
#define HANDLE_ERROR_FUNC_WITH_CODE(n)
int ABT_info_print_task(FILE *fp, ABT_task task)
Write the information of the target tasklet to the output stream.
static void * ABTU_realloc(void *ptr, size_t old_size, size_t new_size)
int ABT_info_query_config(ABT_info_query_kind query_kind, void *val)
Get the configuration information associated with query_kind.
ABTI_global * gp_ABTI_global
int ABT_info_print_thread_stack(FILE *fp, ABT_thread thread)
Dump the stack of the target thread to the output stream.
int ABT_info_print_thread(FILE *fp, ABT_thread thread)
Write the information of the target ULT to the output stream.
static ABTD_atomic_uint32 print_stack_flag
static void ABTU_free(void *ptr)
static ABTD_atomic_uint32 print_stack_barrier
#define PRINT_STACK_FLAG_UNSET
#define ABT_CONFIG_USE_CLOCK_GETTIME