sched_ctx_hypervisor.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include <starpu.h>
  2. #include <../common/config.h>
  3. #include <../common/htable32.h>
  4. #include <pthread.h>
  5. /* ioctl properties*/
  6. #define HYPERVISOR_MAX_IDLE 1
  7. #define HYPERVISOR_MIN_WORKING 2
  8. #define HYPERVISOR_PRIORITY 3
  9. #define HYPERVISOR_MIN_PROCS 4
  10. #define HYPERVISOR_MAX_PROCS 5
  11. #define HYPERVISOR_GRANULARITY 6
  12. #define HYPERVISOR_FIXED_PROCS 7
  13. #define HYPERVISOR_MIN_TASKS 8
  14. #define HYPERVISOR_NEW_WORKERS_MAX_IDLE 9
  15. #define HYPERVISOR_TIME_TO_APPLY 10
  16. struct sched_ctx_hypervisor_reply{
  17. int procs[STARPU_NMAXWORKERS];
  18. int nprocs;
  19. };
  20. pthread_mutex_t act_hypervisor_mutex;
  21. struct starpu_sched_ctx_hypervisor_criteria* sched_ctx_hypervisor_init(int type);
  22. void sched_ctx_hypervisor_shutdown(void);
  23. void sched_ctx_hypervisor_handle_ctx(unsigned sched_ctx);
  24. void sched_ctx_hypervisor_ignore_ctx(unsigned sched_ctx);
  25. void sched_ctx_hypervisor_resize(unsigned sender_sched_ctx, unsigned receier_sched_ctx, int *workers_to_move, unsigned nworkers_to_movex);
  26. void sched_ctx_hypervisor_set_config(unsigned sched_ctx, void *config);
  27. void* sched_ctx_hypervisor_get_config(unsigned sched_ctx);
  28. void sched_ctx_hypervisor_ioctl(unsigned sched_ctx, ...);
  29. void sched_ctx_hypervisor_advise(unsigned sched_ctx, int *workers, int nworkers, int task_tag);
  30. struct sched_ctx_hypervisor_reply* sched_ctx_hypervisor_request(unsigned sched_ctx, int *workers, int nworkers);
  31. /* hypervisor policies */
  32. #define SIMPLE_POLICY 1
  33. struct hypervisor_policy {
  34. void (*init)(void);
  35. void (*deinit)(void);
  36. void (*add_sched_ctx)(unsigned sched_ctx);
  37. void(*remove_sched_ctx)(unsigned sched_ctx);
  38. void* (*ioctl)(unsigned sched_ctx, va_list varg_list, unsigned later);
  39. void (*manage_idle_time)(unsigned req_sched_ctx, int *sched_ctxs, unsigned nsched_ctxs, int worker, double idle_time);
  40. };