starpu_sched_ctx_hypervisor.h 3.0 KB

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