starpu_sched_ctx_hypervisor.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010,2012,2013,2015 Inria
  4. * Copyright (C) 2013,2017,2019 CNRS
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. #ifndef __STARPU_SCHED_CTX_HYPERVISOR_H__
  18. #define __STARPU_SCHED_CTX_HYPERVISOR_H__
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. /**
  24. @ingroup API_Scheduling_Contexts
  25. @{
  26. */
  27. /**
  28. @name Scheduling Context Link with Hypervisor
  29. @{
  30. */
  31. /**
  32. Performance counters used by the starpu to indicate the hypervisor
  33. how the application and the resources are executing.
  34. */
  35. struct starpu_sched_ctx_performance_counters
  36. {
  37. /**
  38. Inform the hypervisor for how long a worker has been idle
  39. in the specified context
  40. */
  41. void (*notify_idle_cycle)(unsigned sched_ctx_id, int worker, double idle_time);
  42. /**
  43. Inform the hypervisor that a task executing a specified
  44. number of instructions has been poped from the worker
  45. */
  46. void (*notify_poped_task)(unsigned sched_ctx_id, int worker);
  47. /**
  48. Notify the hypervisor that a task has been scheduled on
  49. the queue of the worker corresponding to the specified
  50. context
  51. */
  52. void (*notify_pushed_task)(unsigned sched_ctx_id, int worker);
  53. /**
  54. Notify the hypervisor that a task has just been executed
  55. */
  56. void (*notify_post_exec_task)(struct starpu_task *task, size_t data_size, uint32_t footprint, int hypervisor_tag, double flops);
  57. /**
  58. Notify the hypervisor that a task has just been submitted
  59. */
  60. void (*notify_submitted_job)(struct starpu_task *task, uint32_t footprint, size_t data_size);
  61. void (*notify_empty_ctx)(unsigned sched_ctx_id, struct starpu_task *task);
  62. /**
  63. Notify the hypervisor that the context was deleted
  64. */
  65. void (*notify_delete_context)(unsigned sched_ctx);
  66. };
  67. /**
  68. Indicate to starpu the pointer to the performance counter
  69. */
  70. void starpu_sched_ctx_set_perf_counters(unsigned sched_ctx_id, void *perf_counters);
  71. /**
  72. Callback that lets the scheduling policy tell the hypervisor that a
  73. task was pushed on a worker
  74. */
  75. void starpu_sched_ctx_call_pushed_task_cb(int workerid, unsigned sched_ctx_id);
  76. /**
  77. Allow the hypervisor to let starpu know it's initialised
  78. */
  79. void starpu_sched_ctx_notify_hypervisor_exists(void);
  80. /**
  81. Ask starpu if it is informed if the hypervisor is initialised
  82. */
  83. unsigned starpu_sched_ctx_check_if_hypervisor_exists(void);
  84. void starpu_sched_ctx_update_start_resizing_sample(unsigned sched_ctx_id, double start_sample);
  85. /** @} */
  86. /** @} */
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif /* __STARPU_SCHED_CTX_HYPERVISOR_H__ */