ARGOBOTS  1227c643f7a7f974f1f1778a9ffebd29d7dafecf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
info.c
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 #include "abti.h"
7 
9  ABTI_pool *p_pool);
11  FILE *fp, double timeout, void (*cb_func)(ABT_bool, void *), void *arg);
12 
116 int ABT_info_query_config(ABT_info_query_kind query_kind, void *val)
117 {
118  int abt_errno = ABT_SUCCESS;
120 
121  switch (query_kind) {
123  *((ABT_bool *)val) = gp_ABTI_global->use_debug;
124  break;
126 #ifdef ABT_CONFIG_PRINT_ABT_ERRNO
127  *((ABT_bool *)val) = ABT_TRUE;
128 #else
129  *((ABT_bool *)val) = ABT_FALSE;
130 #endif
131  break;
133  *((ABT_bool *)val) = gp_ABTI_global->use_logging;
134  break;
136 #ifdef HAVE_VALGRIND_SUPPORT
137  *((ABT_bool *)val) = ABT_TRUE;
138 #else
139  *((ABT_bool *)val) = ABT_FALSE;
140 #endif
141  break;
143 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
144  *((ABT_bool *)val) = ABT_TRUE;
145 #else
146  *((ABT_bool *)val) = ABT_FALSE;
147 #endif
148  break;
150  *((ABT_bool *)val) = ABT_FALSE;
151  break;
153  *((ABT_bool *)val) = ABT_FALSE;
154  break;
156 #ifdef ABTD_FCONTEXT_PRESERVE_FPU
157  *((ABT_bool *)val) = ABT_TRUE;
158 #else
159  *((ABT_bool *)val) = ABT_FALSE;
160 #endif
161  break;
163 #ifndef ABT_CONFIG_DISABLE_THREAD_CANCEL
164  *((ABT_bool *)val) = ABT_TRUE;
165 #else
166  *((ABT_bool *)val) = ABT_FALSE;
167 #endif
168  break;
170 #ifndef ABT_CONFIG_DISABLE_TASK_CANCEL
171  *((ABT_bool *)val) = ABT_TRUE;
172 #else
173  *((ABT_bool *)val) = ABT_FALSE;
174 #endif
175  break;
177 #ifndef ABT_CONFIG_DISABLE_MIGRATION
178  *((ABT_bool *)val) = ABT_TRUE;
179 #else
180  *((ABT_bool *)val) = ABT_FALSE;
181 #endif
182  break;
184  *((ABT_bool *)val) = ABT_TRUE;
185  break;
187 #ifndef ABT_CONFIG_DISABLE_EXT_THREAD
188  *((ABT_bool *)val) = ABT_TRUE;
189 #else
190  *((ABT_bool *)val) = ABT_FALSE;
191 #endif
192  break;
194 #ifdef ABT_CONFIG_USE_SCHED_SLEEP
195  *((ABT_bool *)val) = ABT_TRUE;
196 #else
197  *((ABT_bool *)val) = ABT_FALSE;
198 #endif
199  break;
201  *((ABT_bool *)val) = gp_ABTI_global->print_config;
202  break;
204  *((ABT_bool *)val) = gp_ABTI_global->set_affinity;
205  break;
207  *((unsigned int *)val) = gp_ABTI_global->max_xstreams;
208  break;
210  *((size_t *)val) = gp_ABTI_global->thread_stacksize;
211  break;
213  *((size_t *)val) = gp_ABTI_global->sched_stacksize;
214  break;
216  *((uint64_t *)val) = gp_ABTI_global->sched_event_freq;
217  break;
219  *((uint64_t *)val) = gp_ABTI_global->sched_sleep_nsec;
220  break;
222 #ifndef ABT_CONFIG_DISABLE_TOOL_INTERFACE
223  *((ABT_bool *)val) = ABT_TRUE;
224 #else
225  *((ABT_bool *)val) = ABT_FALSE;
226 #endif
227  break;
228  default:
229  abt_errno = ABT_ERR_INV_QUERY_KIND;
230  ABTI_CHECK_ERROR(abt_errno);
231  break;
232  }
233 
234 fn_exit:
235  return abt_errno;
236 
237 fn_fail:
238  HANDLE_ERROR_FUNC_WITH_CODE(abt_errno);
239  goto fn_exit;
240 }
241 
255 {
256  int abt_errno = ABT_SUCCESS;
258 
260 
261 fn_exit:
262  return abt_errno;
263 
264 fn_fail:
265  HANDLE_ERROR_FUNC_WITH_CODE(abt_errno);
266  goto fn_exit;
267 }
268 
282 {
283  int abt_errno = ABT_SUCCESS;
285 
286  ABTI_global *p_global = gp_ABTI_global;
287 
289 
290  fprintf(fp, "# of created ESs: %d\n", p_global->num_xstreams);
291 
292  ABTI_xstream *p_xstream = p_global->p_xstream_head;
293  while (p_xstream) {
294  ABTI_xstream_print(p_xstream, fp, 0, ABT_FALSE);
295  p_xstream = p_xstream->p_next;
296  }
297 
299 
300  fflush(fp);
301 
302 fn_exit:
303  return abt_errno;
304 
305 fn_fail:
306  HANDLE_ERROR_FUNC_WITH_CODE(abt_errno);
307  goto fn_exit;
308 }
309 
322 int ABT_info_print_xstream(FILE *fp, ABT_xstream xstream)
323 {
324  int abt_errno = ABT_SUCCESS;
325  ABTI_xstream *p_xstream = ABTI_xstream_get_ptr(xstream);
326  ABTI_CHECK_NULL_XSTREAM_PTR(p_xstream);
327 
328  ABTI_xstream_print(p_xstream, fp, 0, ABT_FALSE);
329 
330 fn_exit:
331  return abt_errno;
332 
333 fn_fail:
334  HANDLE_ERROR_FUNC_WITH_CODE(abt_errno);
335  goto fn_exit;
336 }
337 
350 int ABT_info_print_sched(FILE *fp, ABT_sched sched)
351 {
352  int abt_errno = ABT_SUCCESS;
353  ABTI_sched *p_sched = ABTI_sched_get_ptr(sched);
354  ABTI_CHECK_NULL_SCHED_PTR(p_sched);
355 
356  ABTI_sched_print(p_sched, fp, 0, ABT_TRUE);
357 
358 fn_exit:
359  return abt_errno;
360 
361 fn_fail:
362  HANDLE_ERROR_FUNC_WITH_CODE(abt_errno);
363  goto fn_exit;
364 }
365 
378 int ABT_info_print_pool(FILE *fp, ABT_pool pool)
379 {
380  int abt_errno = ABT_SUCCESS;
381  ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
382  ABTI_CHECK_NULL_POOL_PTR(p_pool);
383 
384  ABTI_pool_print(p_pool, fp, 0);
385 
386 fn_exit:
387  return abt_errno;
388 
389 fn_fail:
390  HANDLE_ERROR_FUNC_WITH_CODE(abt_errno);
391  goto fn_exit;
392 }
393 
406 int ABT_info_print_thread(FILE *fp, ABT_thread thread)
407 {
408  int abt_errno = ABT_SUCCESS;
409  ABTI_thread *p_thread = ABTI_thread_get_ptr(thread);
410  ABTI_CHECK_NULL_THREAD_PTR(p_thread);
411 
412  ABTI_thread_print(p_thread, fp, 0);
413 
414 fn_exit:
415  return abt_errno;
416 
417 fn_fail:
418  HANDLE_ERROR_FUNC_WITH_CODE(abt_errno);
419  goto fn_exit;
420 }
421 
436 {
437  int abt_errno = ABT_SUCCESS;
440 
441  ABTI_thread_attr_print(p_attr, fp, 0);
442 
443 fn_exit:
444  return abt_errno;
445 
446 fn_fail:
447  HANDLE_ERROR_FUNC_WITH_CODE(abt_errno);
448  goto fn_exit;
449 }
450 
451 #ifdef ABT_CONFIG_USE_DOXYGEN
452 
464 int ABT_info_print_task(FILE *fp, ABT_task task);
465 #endif
466 
480 {
481  int abt_errno = ABT_SUCCESS;
482  ABTI_thread *p_thread = ABTI_thread_get_ptr(thread);
483  ABTI_CHECK_NULL_THREAD_PTR(p_thread);
484  ABTI_ythread *p_ythread;
485  ABTI_CHECK_YIELDABLE(p_thread, &p_ythread, ABT_ERR_INV_THREAD);
486 
487  ABTI_ythread_print_stack(p_ythread, fp);
488 
489 fn_exit:
490  return abt_errno;
491 
492 fn_fail:
493  HANDLE_ERROR_FUNC_WITH_CODE(abt_errno);
494  goto fn_exit;
495 }
496 
511 {
512  int abt_errno = ABT_SUCCESS;
513  ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
514  ABTI_CHECK_NULL_POOL_PTR(p_pool);
515 
516  abt_errno = info_print_thread_stacks_in_pool(fp, p_pool);
517  ABTI_CHECK_ERROR(abt_errno);
518 
519 fn_exit:
520  return abt_errno;
521 
522 fn_fail:
523  HANDLE_ERROR_FUNC_WITH_CODE(abt_errno);
524  goto fn_exit;
525 }
526 
563 int ABT_info_trigger_print_all_thread_stacks(FILE *fp, double timeout,
564  void (*cb_func)(ABT_bool, void *),
565  void *arg)
566 {
567  info_trigger_print_all_thread_stacks(fp, timeout, cb_func, arg);
568  return ABT_SUCCESS;
569 }
570 
571 /*****************************************************************************/
572 /* Private APIs */
573 /*****************************************************************************/
574 
576  FILE *fp;
578 };
579 
582  size_t num;
583  size_t len;
584 };
585 
586 ABTU_ret_err static inline int
588 ABTU_ret_err static inline int info_add_pool_set(ABT_pool pool,
589  struct info_pool_set_t *p_set);
590 static inline void info_finalize_pool_set(struct info_pool_set_t *p_set);
591 
592 #define PRINT_STACK_FLAG_UNSET 0
593 #define PRINT_STACK_FLAG_INITIALIZE 1
594 #define PRINT_STACK_FLAG_WAIT 2
595 #define PRINT_STACK_FLAG_FINALIZE 3
596 
599 static FILE *print_stack_fp = NULL;
600 static double print_stack_timeout = 0.0;
601 static void (*print_cb_func)(ABT_bool, void *) = NULL;
602 static void *print_arg = NULL;
605 
607 {
608  if (ABTD_atomic_acquire_load_uint32(&print_stack_flag) !=
610  return;
611 
612  /* Wait for the other execution streams using a barrier mechanism. */
613  uint32_t self_value = ABTD_atomic_fetch_add_uint32(&print_stack_barrier, 1);
614  if (self_value == 0) {
615  /* This ES becomes the main ES. */
616  double start_time = ABTI_get_wtime();
617  ABT_bool force_print = ABT_FALSE;
618 
619  /* xstreams_lock is acquired to avoid dynamic ES creation while
620  * printing data. */
622  while (1) {
623  if (ABTD_atomic_acquire_load_uint32(&print_stack_barrier) >=
625  break;
626  }
627  if (print_stack_timeout >= 0.0 &&
628  (ABTI_get_wtime() - start_time) >= print_stack_timeout) {
629  force_print = ABT_TRUE;
630  break;
631  }
635  }
636  /* All the available ESs are (supposed to be) stopped. We *assume* that
637  * no ES is calling and will call Argobots functions except this
638  * function while printing stack information. */
639  int i, abt_errno;
640 
641  FILE *fp = print_stack_fp;
642  if (force_print) {
643  fprintf(fp,
644  "ABT_info_trigger_print_all_thread_stacks: "
645  "timeout (only %d ESs stop)\n",
646  (int)ABTD_atomic_acquire_load_uint32(&print_stack_barrier));
647  }
648 
649  struct info_pool_set_t pool_set;
650  abt_errno = info_initialize_pool_set(&pool_set);
651  if (ABTI_IS_ERROR_CHECK_ENABLED && abt_errno != ABT_SUCCESS)
652  goto print_fail;
654  while (p_xstream) {
655  ABTI_sched *p_main_sched = p_xstream->p_main_sched;
656  fprintf(fp, "= xstream[%d] (%p) =\n", p_xstream->rank,
657  (void *)p_xstream);
658  fprintf(fp, "main_sched : %p\n", (void *)p_main_sched);
659  if (!p_main_sched)
660  continue;
661  for (i = 0; i < p_main_sched->num_pools; i++) {
662  ABT_pool pool = p_main_sched->pools[i];
663  ABTI_ASSERT(pool != ABT_POOL_NULL);
664  fprintf(fp, " pools[%d] : %p\n", i,
665  (void *)ABTI_pool_get_ptr(pool));
666  abt_errno = info_add_pool_set(pool, &pool_set);
667  if (ABTI_IS_ERROR_CHECK_ENABLED && abt_errno != ABT_SUCCESS) {
668  info_finalize_pool_set(&pool_set);
669  goto print_fail;
670  }
671  }
672  p_xstream = p_xstream->p_next;
673  }
674  for (i = 0; i < pool_set.num; i++) {
675  ABT_pool pool = pool_set.pools[i];
676  ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
677  abt_errno = info_print_thread_stacks_in_pool(fp, p_pool);
678  if (abt_errno != ABT_SUCCESS)
679  fprintf(fp, " Failed to print (errno = %d).\n", abt_errno);
680  }
681  info_finalize_pool_set(&pool_set);
682  goto print_exit;
683 
684  print_fail:
685  fprintf(fp, "ABT_info_trigger_print_all_thread_stacks: "
686  "failed because of memory error.\n");
687  print_exit:
688  /* Release the lock that protects ES data. */
690  if (print_cb_func)
691  print_cb_func(force_print, print_arg);
692  /* Update print_stack_flag to 3. */
693  ABTD_atomic_release_store_uint32(&print_stack_flag,
695  } else {
696  /* Wait for the main ES's work. */
697  while (ABTD_atomic_acquire_load_uint32(&print_stack_flag) !=
700  }
701  ABTI_ASSERT(ABTD_atomic_acquire_load_uint32(&print_stack_flag) ==
703 
704  /* Decrement the barrier value. */
705  uint32_t dec_value = ABTD_atomic_fetch_sub_uint32(&print_stack_barrier, 1);
706  if (dec_value == 0) {
707  /* The last execution stream resets the flag. */
708  ABTD_atomic_release_store_uint32(&print_stack_flag,
710  }
711 }
712 
714 {
715  ABTI_global *p_global = gp_ABTI_global;
716 
717  fprintf(fp, "Argobots Configuration:\n");
718  fprintf(fp, " - # of cores: %d\n", p_global->num_cores);
719  fprintf(fp, " - cache line size: %u\n", ABT_CONFIG_STATIC_CACHELINE_SIZE);
720  fprintf(fp, " - OS page size: %u\n", p_global->os_page_size);
721  fprintf(fp, " - huge page size: %u\n", p_global->huge_page_size);
722  fprintf(fp, " - max. # of ESs: %d\n", p_global->max_xstreams);
723  fprintf(fp, " - cur. # of ESs: %d\n", p_global->num_xstreams);
724  fprintf(fp, " - ES affinity: %s\n",
725  (p_global->set_affinity == ABT_TRUE) ? "on" : "off");
726  fprintf(fp, " - logging: %s\n",
727  (p_global->use_logging == ABT_TRUE) ? "on" : "off");
728  fprintf(fp, " - debug output: %s\n",
729  (p_global->use_debug == ABT_TRUE) ? "on" : "off");
730  fprintf(fp, " - key table entries: %d\n", p_global->key_table_size);
731  fprintf(fp, " - ULT stack size: %u KB\n",
732  (unsigned)(p_global->thread_stacksize / 1024));
733  fprintf(fp, " - scheduler stack size: %u KB\n",
734  (unsigned)(p_global->sched_stacksize / 1024));
735  fprintf(fp, " - scheduler event check frequency: %u\n",
736  p_global->sched_event_freq);
737 
738  fprintf(fp, " - timer function: "
739 #if defined(ABT_CONFIG_USE_CLOCK_GETTIME)
740  "clock_gettime"
741 #elif defined(ABT_CONFIG_USE_MACH_ABSOLUTE_TIME)
742  "mach_absolute_time"
743 #elif defined(ABT_CONFIG_USE_GETTIMEOFDAY)
744  "gettimeofday"
745 #endif
746  "\n");
747 
748 #ifdef ABT_CONFIG_USE_MEM_POOL
749  fprintf(fp, "Memory Pool:\n");
750  fprintf(fp, " - page size for allocation: %u KB\n",
751  p_global->mem_page_size / 1024);
752  fprintf(fp, " - stack page size: %u KB\n", p_global->mem_sp_size / 1024);
753  fprintf(fp, " - max. # of stacks per ES: %u\n", p_global->mem_max_stacks);
754  switch (p_global->mem_lp_alloc) {
755  case ABTI_MEM_LP_MALLOC:
756  fprintf(fp, " - large page allocation: malloc\n");
757  break;
758  case ABTI_MEM_LP_MMAP_RP:
759  fprintf(fp, " - large page allocation: mmap regular pages\n");
760  break;
762  fprintf(fp, " - large page allocation: mmap huge pages + "
763  "regular pages\n");
764  break;
766  fprintf(fp, " - large page allocation: mmap huge pages + THPs\n");
767  break;
768  case ABTI_MEM_LP_THP:
769  fprintf(fp, " - large page allocation: THPs\n");
770  break;
771  }
772 #endif /* ABT_CONFIG_USE_MEM_POOL */
773 
774  fflush(fp);
775 }
776 
777 /*****************************************************************************/
778 /* Internal static functions */
779 /*****************************************************************************/
780 
781 static void info_print_unit(void *arg, ABT_unit unit)
782 {
783  /* This function may not have any side effect on unit because it is passed
784  * to p_print_all. */
785  struct info_print_unit_arg_t *p_arg;
786  p_arg = (struct info_print_unit_arg_t *)arg;
787  FILE *fp = p_arg->fp;
788  ABT_pool pool = p_arg->pool;
789  ABTI_pool *p_pool = ABTI_pool_get_ptr(pool);
790  ABT_unit_type type = p_pool->u_get_type(unit);
791 
792  if (type == ABT_UNIT_TYPE_THREAD) {
793  fprintf(fp, "=== ULT (%p) ===\n", (void *)unit);
794  ABT_thread thread = p_pool->u_get_thread(unit);
795  ABTI_ythread *p_ythread = ABTI_ythread_get_ptr(thread);
796  ABT_unit_id thread_id = ABTI_thread_get_id(&p_ythread->thread);
797  fprintf(fp,
798  "id : %" PRIu64 "\n"
799  "ctx : %p\n",
800  (uint64_t)thread_id, (void *)&p_ythread->ctx);
801  ABTD_ythread_print_context(p_ythread, fp, 2);
802  fprintf(fp,
803  "stack : %p\n"
804  "stacksize : %" PRIu64 "\n",
805  p_ythread->p_stack, (uint64_t)p_ythread->stacksize);
806  ABTI_ythread_print_stack(p_ythread, fp);
807  } else if (type == ABT_UNIT_TYPE_TASK) {
808  fprintf(fp, "=== tasklet (%p) ===\n", (void *)unit);
809  } else {
810  fprintf(fp, "=== unknown (%p) ===\n", (void *)unit);
811  }
812 }
813 
815  ABTI_pool *p_pool)
816 {
818 
819  if (!p_pool->p_print_all) {
820  return ABT_ERR_POOL;
821  }
822  fprintf(fp, "== pool (%p) ==\n", (void *)p_pool);
823  struct info_print_unit_arg_t arg;
824  arg.fp = fp;
825  arg.pool = pool;
826  p_pool->p_print_all(pool, &arg, info_print_unit);
827  return ABT_SUCCESS;
828 }
829 
830 ABTU_ret_err static inline int
832 {
833  size_t default_len = 16;
834  int abt_errno =
835  ABTU_malloc(sizeof(ABT_pool) * default_len, (void **)&p_set->pools);
836  ABTI_CHECK_ERROR_RET(abt_errno);
837  p_set->num = 0;
838  p_set->len = default_len;
839  return ABT_SUCCESS;
840 }
841 
842 static inline void info_finalize_pool_set(struct info_pool_set_t *p_set)
843 {
844  ABTU_free(p_set->pools);
845 }
846 
848  struct info_pool_set_t *p_set)
849 {
850  size_t i;
851  for (i = 0; i < p_set->num; i++) {
852  if (p_set->pools[i] == pool)
853  return ABT_SUCCESS;
854  }
855  /* Add pool to p_set. */
856  if (p_set->num == p_set->len) {
857  size_t new_len = p_set->len * 2;
858  int abt_errno =
859  ABTU_realloc(sizeof(ABT_pool) * p_set->len,
860  sizeof(ABT_pool) * new_len, (void **)&p_set->pools);
861  ABTI_CHECK_ERROR_RET(abt_errno);
862  p_set->len = new_len;
863  }
864  p_set->pools[p_set->num++] = pool;
865  return ABT_SUCCESS;
866 }
867 
869  FILE *fp, double timeout, void (*cb_func)(ABT_bool, void *), void *arg)
870 {
871  /* This function is signal-safe, so it may not call other functions unless
872  * you really know what the called functions do. */
873  if (ABTD_atomic_acquire_load_uint32(&print_stack_flag) ==
875  if (ABTD_atomic_bool_cas_strong_uint32(&print_stack_flag,
878  /* Save fp and timeout. */
879  print_stack_fp = fp;
880  print_stack_timeout = timeout;
881  print_cb_func = cb_func;
882  print_arg = arg;
883  /* Here print_stack_barrier must be 0. */
884  ABTI_ASSERT(ABTD_atomic_acquire_load_uint32(&print_stack_barrier) ==
885  0);
886  ABTD_atomic_release_store_uint32(&print_stack_flag,
888  }
889  }
890 }
ABT_pool_print_all_fn p_print_all
Definition: abti.h:309
static ABTI_ythread * ABTI_ythread_get_ptr(ABT_thread thread)
Definition: abti_ythread.h:11
struct ABT_thread_attr_opaque * ABT_thread_attr
Definition: abt.h:345
struct ABT_unit_opaque * ABT_unit
Definition: abt.h:337
#define ABTI_CHECK_NULL_SCHED_PTR(p)
Definition: abti_error.h:182
static ABT_pool ABTI_pool_get_handle(ABTI_pool *p_pool)
Definition: abti_pool.h:26
int key_table_size
Definition: abti.h:181
#define ABT_POOL_NULL
Definition: abt.h:413
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
int ABT_info_print_sched(FILE *fp, ABT_sched sched) ABT_API_PUBLIC
Write the information of the target scheduler to the output stream.
Definition: info.c:350
struct ABT_xstream_opaque * ABT_xstream
Definition: abt.h:313
struct ABT_sched_opaque * ABT_sched
Definition: abt.h:319
ABT_pool pool
Definition: info.c:577
int ABT_info_print_thread_stacks_in_pool(FILE *fp, ABT_pool pool) ABT_API_PUBLIC
Dump stack information of all the threads in the target pool.
Definition: info.c:510
ABT_pool * pools
Definition: abti.h:265
int ABT_info_print_config(FILE *fp) ABT_API_PUBLIC
Write the configuration information to the output stream.
Definition: info.c:254
void ABTI_xstream_print(ABTI_xstream *p_xstream, FILE *p_os, int indent, ABT_bool print_sub)
Definition: stream.c:1156
#define PRINT_STACK_FLAG_FINALIZE
Definition: info.c:595
int ABT_info_print_pool(FILE *fp, ABT_pool pool) ABT_API_PUBLIC
Write the information of the target pool to the output stream.
Definition: info.c:378
void ABTD_ythread_print_context(ABTI_ythread *p_ythread, FILE *p_os, int indent)
Definition: abtd_ythread.c:148
#define ABT_ERR_INV_QUERY_KIND
Definition: abt.h:92
size_t num
Definition: info.c:582
int max_xstreams
Definition: abti.h:170
#define PRINT_STACK_FLAG_INITIALIZE
Definition: info.c:593
static double print_stack_timeout
Definition: info.c:600
#define ABTI_SETUP_WITH_INIT_CHECK()
Definition: abti_error.h:24
static ABTI_thread * ABTI_thread_get_ptr(ABT_thread thread)
Definition: abti_thread.h:9
struct ABT_thread_opaque * ABT_task
Definition: abt.h:353
#define ABT_ERR_INV_THREAD
Definition: abt.h:80
size_t sched_stacksize
Definition: abti.h:183
static ABTU_ret_err int info_add_pool_set(ABT_pool pool, struct info_pool_set_t *p_set)
Definition: info.c:847
static void ABTD_atomic_release_store_uint32(ABTD_atomic_uint32 *ptr, uint32_t val)
Definition: abtd_atomic.h:947
void ABTI_thread_attr_print(ABTI_thread_attr *p_attr, FILE *p_os, int indent)
Definition: thread_attr.c:318
int ABT_info_print_xstream(FILE *fp, ABT_xstream xstream) ABT_API_PUBLIC
Write the information of the target ES to the output stream.
Definition: info.c:322
int ABT_bool
Definition: abt.h:373
#define ABT_CONFIG_STATIC_CACHELINE_SIZE
Definition: abt_config.h:57
void ABTI_info_check_print_all_thread_stacks(void)
Definition: info.c:606
static void info_trigger_print_all_thread_stacks(FILE *fp, double timeout, void(*cb_func)(ABT_bool, void *), void *arg)
Definition: info.c:868
long sched_sleep_nsec
Definition: abti.h:185
struct ABT_pool_opaque * ABT_pool
Definition: abt.h:329
ABT_unit_get_thread_fn u_get_thread
Definition: abti.h:293
#define ABTI_CHECK_NULL_THREAD_ATTR_PTR(p)
Definition: abti_error.h:209
#define ABTI_CHECK_YIELDABLE(p_thread, pp_ythread, err)
Definition: abti_error.h:126
ABTI_sched * p_main_sched
Definition: abti.h:242
ABT_bool use_debug
Definition: abti.h:180
ABT_unit_id ABTI_thread_get_id(ABTI_thread *p_thread)
Definition: thread.c:1847
static ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr)
Definition: abtu.h:142
static FILE * print_stack_fp
Definition: info.c:599
static uint32_t ABTD_atomic_fetch_add_uint32(ABTD_atomic_uint32 *ptr, uint32_t v)
Definition: abtd_atomic.h:391
int ABT_info_trigger_print_all_thread_stacks(FILE *fp, double timeout, void(*cb_func)(ABT_bool, void *), void *arg) ABT_API_PUBLIC
Dump stacks of threads in pools existing in Argobots.
Definition: info.c:563
static ABTI_xstream * ABTI_xstream_get_ptr(ABT_xstream xstream)
Definition: abti_stream.h:11
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:726
int ABT_info_print_thread_attr(FILE *fp, ABT_thread_attr attr) ABT_API_PUBLIC
Write the information of the target ULT attribute to the output stream.
Definition: info.c:435
#define ABT_FALSE
Definition: abt.h:285
ABTI_xstream * p_next
Definition: abti.h:237
ABTI_spinlock xstream_list_lock
Definition: abti.h:174
#define PRINT_STACK_FLAG_WAIT
Definition: info.c:594
struct ABT_thread_opaque * ABT_thread
Definition: abt.h:343
size_t stacksize
Definition: abti.h:351
int rank
Definition: abti.h:239
static ABTU_ret_err int ABTU_realloc(size_t old_size, size_t new_size, void **p_ptr)
Definition: abtu.h:165
uint32_t mem_page_size
Definition: abti.h:193
int ABT_info_print_all_xstreams(FILE *fp) ABT_API_PUBLIC
Write the information of all created ESs to the output stream.
Definition: info.c:281
static uint32_t ABTD_atomic_acquire_load_uint32(const ABTD_atomic_uint32 *ptr)
Definition: abtd_atomic.h:797
int num_pools
Definition: abti.h:266
static void(* print_cb_func)(ABT_bool, void *)
Definition: info.c:601
static void * print_arg
Definition: info.c:602
#define HANDLE_ERROR_FUNC_WITH_CODE(n)
Definition: abti_error.h:353
int ABT_info_print_task(FILE *fp, ABT_task task)
Write the information of the target tasklet to the output stream.
static ABTI_pool * ABTI_pool_get_ptr(ABT_pool pool)
Definition: abti_pool.h:11
int ABT_info_query_config(ABT_info_query_kind query_kind, void *val) ABT_API_PUBLIC
Get the configuration information associated with query_kind.
Definition: info.c:116
static void ABTI_spinlock_release(ABTI_spinlock *p_lock)
Definition: abti_spinlock.h:31
ABTI_global * gp_ABTI_global
Definition: global.c:14
ABTI_thread thread
Definition: abti.h:348
#define ABT_SUCCESS
Definition: abt.h:64
size_t len
Definition: info.c:583
uint32_t huge_page_size
Definition: abti.h:191
ABTI_xstream * p_xstream_head
Definition: abti.h:172
#define ABT_TRUE
Definition: abt.h:284
ABT_unit_type
Definition: abt.h:169
static ABTU_ret_err int info_print_thread_stacks_in_pool(FILE *fp, ABTI_pool *p_pool)
Definition: info.c:814
static void info_print_unit(void *arg, ABT_unit unit)
Definition: info.c:781
static ABTI_thread_attr * ABTI_thread_attr_get_ptr(ABT_thread_attr attr)
int ABT_info_print_thread_stack(FILE *fp, ABT_thread thread) ABT_API_PUBLIC
Dump the stack of the target thread to the output stream.
Definition: info.c:479
#define ABTI_CHECK_NULL_XSTREAM_PTR(p)
Definition: abti_error.h:164
static ABTU_ret_err int info_initialize_pool_set(struct info_pool_set_t *p_set)
Definition: info.c:831
ABT_bool print_config
Definition: abti.h:211
static void ABTI_spinlock_acquire(ABTI_spinlock *p_lock)
Definition: abti_spinlock.h:23
int ABT_info_print_thread(FILE *fp, ABT_thread thread) ABT_API_PUBLIC
Write the information of the target ULT to the output stream.
Definition: info.c:406
uint32_t os_page_size
Definition: abti.h:190
void ABTI_info_print_config(FILE *fp)
Definition: info.c:713
void ABTI_pool_print(ABTI_pool *p_pool, FILE *p_os, int indent)
Definition: pool.c:540
void ABTI_thread_print(ABTI_thread *p_thread, FILE *p_os, int indent)
Definition: thread.c:1779
static double ABTI_get_wtime(void)
Definition: abti_timer.h:11
#define ABTI_CHECK_NULL_POOL_PTR(p)
Definition: abti_error.h:173
static uint32_t ABTD_atomic_fetch_sub_uint32(ABTD_atomic_uint32 *ptr, uint32_t v)
Definition: abtd_atomic.h:440
static ABTD_atomic_uint32 print_stack_flag
Definition: info.c:597
static int ABTD_atomic_bool_cas_strong_uint32(ABTD_atomic_uint32 *ptr, uint32_t oldv, uint32_t newv)
Definition: abtd_atomic.h:346
ABTD_ythread_context ctx
Definition: abti.h:349
static ABTI_sched * ABTI_sched_get_ptr(ABT_sched sched)
Definition: abti_sched.h:11
void * p_stack
Definition: abti.h:350
#define ABTI_ASSERT(cond)
Definition: abti_error.h:12
static void ABTD_atomic_pause(void)
Definition: abtd_atomic.h:1091
#define ABTI_CHECK_ERROR(abt_errno)
Definition: abti_error.h:86
void ABTI_ythread_print_stack(ABTI_ythread *p_ythread, FILE *p_os)
Definition: ythread.c:85
uint32_t sched_event_freq
Definition: abti.h:184
static void info_finalize_pool_set(struct info_pool_set_t *p_set)
Definition: info.c:842
ABT_info_query_kind
Definition: abt.h:180
ABT_pool * pools
Definition: info.c:581
uint32_t mem_max_stacks
Definition: abti.h:195
#define ABTI_IS_ERROR_CHECK_ENABLED
Definition: abti.h:20
static void ABTU_free(void *ptr)
Definition: abtu.h:135
int num_cores
Definition: abti.h:177
#define ABTI_CHECK_ERROR_RET(abt_errno)
Definition: abti_error.h:103
int num_xstreams
Definition: abti.h:171
uint32_t mem_sp_size
Definition: abti.h:194
#define ABT_ERR_POOL
Definition: abt.h:99
static ABTD_atomic_uint32 print_stack_barrier
Definition: info.c:603
#define ABTD_ATOMIC_UINT32_STATIC_INITIALIZER(val)
Definition: abtd_atomic.h:51
#define ABTI_CHECK_NULL_THREAD_PTR(p)
Definition: abti_error.h:191
#define PRINT_STACK_FLAG_UNSET
Definition: info.c:592
#define ABTU_ret_err
Definition: abtu.h:49
size_t thread_stacksize
Definition: abti.h:182
ABT_bool use_logging
Definition: abti.h:179
#define ABT_CONFIG_USE_CLOCK_GETTIME
Definition: abt_config.h:66