sc_hypervisor_policy.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2012 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 SCHED_CTX_HYPERVISOR_POLICY_H
  17. #define SCHED_CTX_HYPERVISOR_POLICY_H
  18. #include <sc_hypervisor.h>
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. #define HYPERVISOR_REDIM_SAMPLE 0.02
  24. #define HYPERVISOR_START_REDIM_SAMPLE 0.1
  25. struct bound_task_pool
  26. {
  27. /* Which codelet has been executed */
  28. struct starpu_codelet *cl;
  29. /* Task footprint key */
  30. uint32_t footprint;
  31. /* Context the task belongs to */
  32. unsigned sched_ctx_id;
  33. /* Number of tasks of this kind */
  34. unsigned long n;
  35. /* Other task kinds */
  36. struct bound_task_pool *next;
  37. };
  38. unsigned _find_poor_sched_ctx(unsigned req_sched_ctx, int nworkers_to_move);
  39. int* _get_first_workers(unsigned sched_ctx, int *nworkers, enum starpu_archtype arch);
  40. int* _get_first_workers_in_list(int *start, int *workers, int nall_workers, int *nworkers, enum starpu_archtype arch);
  41. unsigned _get_potential_nworkers(struct sc_hypervisor_policy_config *config, unsigned sched_ctx, enum starpu_archtype arch);
  42. int _get_nworkers_to_move(unsigned req_sched_ctx);
  43. unsigned _resize(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, unsigned force_resize, unsigned now);
  44. unsigned _resize_to_unknown_receiver(unsigned sender_sched_ctx, unsigned now);
  45. double _get_ctx_velocity(struct sc_hypervisor_wrapper* sc_w);
  46. double _get_slowest_ctx_exec_time(void);
  47. double _get_fastest_ctx_exec_time(void);
  48. double _get_velocity_per_worker(struct sc_hypervisor_wrapper *sc_w, unsigned worker);
  49. double _get_velocity_per_worker_type(struct sc_hypervisor_wrapper* sc_w, enum starpu_archtype arch);
  50. double _get_ref_velocity_per_worker_type(struct sc_hypervisor_wrapper* sc_w, enum starpu_archtype arch);
  51. int _velocity_gap_btw_ctxs(void);
  52. void _get_total_nw(int *workers, int nworkers, int ntypes_of_workers, int total_nw[ntypes_of_workers]);
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif