starpu_fxt.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2012,2013,2016 Inria
  4. * Copyright (C) 2013 Joris Pablo
  5. * Copyright (C) 2010-2015,2017,2018,2019 CNRS
  6. * Copyright (C) 2010,2011,2013-2018 Université de Bordeaux
  7. * Copyright (C) 2013 Thibaut Lambert
  8. *
  9. * StarPU is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU Lesser General Public License as published by
  11. * the Free Software Foundation; either version 2.1 of the License, or (at
  12. * your option) any later version.
  13. *
  14. * StarPU is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. *
  18. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  19. */
  20. #ifndef __STARPU_FXT_H__
  21. #define __STARPU_FXT_H__
  22. #include <starpu_perfmodel.h>
  23. #ifdef __cplusplus
  24. extern "C"
  25. {
  26. #endif
  27. /**
  28. @defgroup API_FxT_Support FxT Support
  29. @{
  30. */
  31. #define STARPU_FXT_MAX_FILES 64
  32. struct starpu_fxt_codelet_event
  33. {
  34. char symbol[256];
  35. int workerid;
  36. char perfmodel_archname[256];
  37. uint32_t hash;
  38. size_t size;
  39. float time;
  40. };
  41. struct starpu_fxt_options
  42. {
  43. unsigned per_task_colour;
  44. unsigned no_events;
  45. unsigned no_counter;
  46. unsigned no_bus;
  47. unsigned no_flops;
  48. unsigned ninputfiles;
  49. unsigned no_smooth;
  50. unsigned no_acquire;
  51. unsigned memory_states;
  52. unsigned internal;
  53. unsigned label_deps;
  54. char *filenames[STARPU_FXT_MAX_FILES];
  55. char *out_paje_path;
  56. char *distrib_time_path;
  57. char *activity_path;
  58. char *dag_path;
  59. char *tasks_path;
  60. char *data_path;
  61. char *anim_path;
  62. char *states_path;
  63. /**
  64. In case we are going to gather multiple traces (e.g in the case of
  65. MPI processes), we may need to prefix the name of the containers.
  66. */
  67. char *file_prefix;
  68. /**
  69. In case we are going to gather multiple traces (e.g in the case of
  70. MPI processes), we may need to prefix the name of the containers.
  71. */
  72. uint64_t file_offset;
  73. /**
  74. In case we are going to gather multiple traces (e.g in the case of
  75. MPI processes), we may need to prefix the name of the containers.
  76. */
  77. int file_rank;
  78. /**
  79. Output parameters
  80. */
  81. char worker_names[STARPU_NMAXWORKERS][256];
  82. /**
  83. Output parameters
  84. */
  85. struct starpu_perfmodel_arch worker_archtypes[STARPU_NMAXWORKERS];
  86. /**
  87. Output parameters
  88. */
  89. int nworkers;
  90. /**
  91. In case we want to dump the list of codelets to an external tool
  92. */
  93. struct starpu_fxt_codelet_event **dumped_codelets;
  94. /**
  95. In case we want to dump the list of codelets to an external tool
  96. */
  97. long dumped_codelets_count;
  98. };
  99. void starpu_fxt_options_init(struct starpu_fxt_options *options);
  100. void starpu_fxt_generate_trace(struct starpu_fxt_options *options);
  101. /**
  102. Determine whether profiling should be started by starpu_init(), or only when
  103. starpu_fxt_start_profiling() is called. \p autostart should be 1 to do so, or 0 to
  104. prevent it.
  105. */
  106. void starpu_fxt_autostart_profiling(int autostart);
  107. /**
  108. Start recording the trace. The trace is by default started from
  109. starpu_init() call, but can be paused by using
  110. starpu_fxt_stop_profiling(), in which case
  111. starpu_fxt_start_profiling() should be called to resume recording
  112. events.
  113. */
  114. void starpu_fxt_start_profiling(void);
  115. /**
  116. Stop recording the trace. The trace is by default stopped when calling
  117. starpu_shutdown(). starpu_fxt_stop_profiling() can however be used to
  118. stop it earlier. starpu_fxt_start_profiling() can then be called to
  119. start recording it again, etc.
  120. */
  121. void starpu_fxt_stop_profiling(void);
  122. void starpu_fxt_write_data_trace(char *filename_in);
  123. /**
  124. Add an event in the execution trace if FxT is enabled.
  125. */
  126. void starpu_fxt_trace_user_event(unsigned long code);
  127. /**
  128. Add a string event in the execution trace if FxT is enabled.
  129. */
  130. void starpu_fxt_trace_user_event_string(const char *s);
  131. /** @} */
  132. #ifdef __cplusplus
  133. }
  134. #endif
  135. #endif /* __STARPU_FXT_H__ */