starpu_top.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011 Inria
  4. * Copyright (C) 2011-2013,2017,2019 CNRS
  5. * Copyright (C) 2011-2013 Université de Bordeaux
  6. * Copyright (C) 2011 William Braik, Yann Courtois, Jean-Marie Couteyen, Anthony
  7. *
  8. * StarPU is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation; either version 2.1 of the License, or (at
  11. * your option) any later version.
  12. *
  13. * StarPU is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. *
  17. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  18. */
  19. #ifndef __STARPU_TOP_H__
  20. #define __STARPU_TOP_H__
  21. /** @defgroup
  22. *
  23. * @{
  24. */
  25. #include <starpu.h>
  26. #include <stdlib.h>
  27. #include <time.h>
  28. #ifdef __cplusplus
  29. extern "C"
  30. {
  31. #endif
  32. enum starpu_top_data_type
  33. {
  34. STARPU_TOP_DATA_BOOLEAN,
  35. STARPU_TOP_DATA_INTEGER,
  36. STARPU_TOP_DATA_FLOAT
  37. };
  38. struct starpu_top_data
  39. {
  40. unsigned int id;
  41. const char *name;
  42. int int_min_value;
  43. int int_max_value;
  44. double double_min_value;
  45. double double_max_value;
  46. int active;
  47. enum starpu_top_data_type type;
  48. struct starpu_top_data *next;
  49. };
  50. enum starpu_top_param_type
  51. {
  52. STARPU_TOP_PARAM_BOOLEAN,
  53. STARPU_TOP_PARAM_INTEGER,
  54. STARPU_TOP_PARAM_FLOAT,
  55. STARPU_TOP_PARAM_ENUM
  56. };
  57. struct starpu_top_param
  58. {
  59. unsigned int id;
  60. const char *name;
  61. enum starpu_top_param_type type;
  62. void *value;
  63. char **enum_values;
  64. int nb_values;
  65. void (*callback)(struct starpu_top_param*);
  66. int int_min_value;
  67. int int_max_value;
  68. double double_min_value;
  69. double double_max_value;
  70. struct starpu_top_param *next;
  71. };
  72. enum starpu_top_message_type
  73. {
  74. TOP_TYPE_GO,
  75. TOP_TYPE_SET,
  76. TOP_TYPE_CONTINUE,
  77. TOP_TYPE_ENABLE,
  78. TOP_TYPE_DISABLE,
  79. TOP_TYPE_DEBUG,
  80. TOP_TYPE_UNKNOW
  81. };
  82. struct starpu_top_data *starpu_top_add_data_boolean(const char *data_name, int active);
  83. struct starpu_top_data *starpu_top_add_data_integer(const char *data_name, int minimum_value, int maximum_value, int active);
  84. struct starpu_top_data *starpu_top_add_data_float(const char *data_name, double minimum_value, double maximum_value, int active);
  85. struct starpu_top_param *starpu_top_register_parameter_boolean(const char *param_name, int *parameter_field, void (*callback)(struct starpu_top_param*));
  86. struct starpu_top_param *starpu_top_register_parameter_integer(const char *param_name, int *parameter_field, int minimum_value, int maximum_value, void (*callback)(struct starpu_top_param*));
  87. struct starpu_top_param *starpu_top_register_parameter_float(const char *param_name, double *parameter_field, double minimum_value, double maximum_value, void (*callback)(struct starpu_top_param*));
  88. struct starpu_top_param *starpu_top_register_parameter_enum(const char *param_name, int *parameter_field, char **values, int nb_values, void (*callback)(struct starpu_top_param*));
  89. void starpu_top_init_and_wait(const char *server_name);
  90. void starpu_top_update_parameter(const struct starpu_top_param *param);
  91. void starpu_top_update_data_boolean(const struct starpu_top_data *data, int value);
  92. void starpu_top_update_data_integer(const struct starpu_top_data *data, int value);
  93. void starpu_top_update_data_float(const struct starpu_top_data *data, double value);
  94. void starpu_top_task_prevision(struct starpu_task *task, int devid, unsigned long long start, unsigned long long end);
  95. void starpu_top_debug_log(const char *message);
  96. void starpu_top_debug_lock(const char *message);
  97. #ifdef __cplusplus
  98. }
  99. #endif
  100. /** @} */
  101. #endif /* __STARPU_TOP_H__ */