starpu_top.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011 Inria
  4. * Copyright (C) 2011-2013,2017 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. #include <starpu.h>
  22. #include <stdlib.h>
  23. #include <time.h>
  24. #ifdef __cplusplus
  25. extern "C"
  26. {
  27. #endif
  28. enum starpu_top_data_type
  29. {
  30. STARPU_TOP_DATA_BOOLEAN,
  31. STARPU_TOP_DATA_INTEGER,
  32. STARPU_TOP_DATA_FLOAT
  33. };
  34. struct starpu_top_data
  35. {
  36. unsigned int id;
  37. const char *name;
  38. int int_min_value;
  39. int int_max_value;
  40. double double_min_value;
  41. double double_max_value;
  42. int active;
  43. enum starpu_top_data_type type;
  44. struct starpu_top_data *next;
  45. };
  46. enum starpu_top_param_type
  47. {
  48. STARPU_TOP_PARAM_BOOLEAN,
  49. STARPU_TOP_PARAM_INTEGER,
  50. STARPU_TOP_PARAM_FLOAT,
  51. STARPU_TOP_PARAM_ENUM
  52. };
  53. struct starpu_top_param
  54. {
  55. unsigned int id;
  56. const char *name;
  57. enum starpu_top_param_type type;
  58. void *value;
  59. char **enum_values;
  60. int nb_values;
  61. void (*callback)(struct starpu_top_param*);
  62. int int_min_value;
  63. int int_max_value;
  64. double double_min_value;
  65. double double_max_value;
  66. struct starpu_top_param *next;
  67. };
  68. enum starpu_top_message_type
  69. {
  70. TOP_TYPE_GO,
  71. TOP_TYPE_SET,
  72. TOP_TYPE_CONTINUE,
  73. TOP_TYPE_ENABLE,
  74. TOP_TYPE_DISABLE,
  75. TOP_TYPE_DEBUG,
  76. TOP_TYPE_UNKNOW
  77. };
  78. struct starpu_top_data *starpu_top_add_data_boolean(const char *data_name, int active);
  79. struct starpu_top_data *starpu_top_add_data_integer(const char *data_name, int minimum_value, int maximum_value, int active);
  80. struct starpu_top_data *starpu_top_add_data_float(const char *data_name, double minimum_value, double maximum_value, int active);
  81. struct starpu_top_param *starpu_top_register_parameter_boolean(const char *param_name, int *parameter_field, void (*callback)(struct starpu_top_param*));
  82. 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*));
  83. 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*));
  84. 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*));
  85. void starpu_top_init_and_wait(const char *server_name);
  86. void starpu_top_update_parameter(const struct starpu_top_param *param);
  87. void starpu_top_update_data_boolean(const struct starpu_top_data *data, int value);
  88. void starpu_top_update_data_integer(const struct starpu_top_data *data, int value);
  89. void starpu_top_update_data_float(const struct starpu_top_data *data, double value);
  90. void starpu_top_task_prevision(struct starpu_task *task, int devid, unsigned long long start, unsigned long long end);
  91. void starpu_top_debug_log(const char *message);
  92. void starpu_top_debug_lock(const char *message);
  93. #ifdef __cplusplus
  94. }
  95. #endif
  96. #endif /* __STARPU_TOP_H__ */