sc_hypervisor_config.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011 - 2013 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 SC_HYPERVISOR_CONFIG_H
  17. #define SC_HYPERVISOR_CONFIG_H
  18. #include <sc_hypervisor.h>
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. /* ctl properties*/
  24. #define SC_HYPERVISOR_MAX_IDLE -1
  25. #define SC_HYPERVISOR_MIN_WORKING -2
  26. #define SC_HYPERVISOR_PRIORITY -3
  27. #define SC_HYPERVISOR_MIN_WORKERS -4
  28. #define SC_HYPERVISOR_MAX_WORKERS -5
  29. #define SC_HYPERVISOR_GRANULARITY -6
  30. #define SC_HYPERVISOR_FIXED_WORKERS -7
  31. #define SC_HYPERVISOR_MIN_TASKS -8
  32. #define SC_HYPERVISOR_NEW_WORKERS_MAX_IDLE -9
  33. #define SC_HYPERVISOR_TIME_TO_APPLY -10
  34. #define SC_HYPERVISOR_NULL -11
  35. #define SC_HYPERVISOR_ISPEED_W_SAMPLE -12
  36. #define SC_HYPERVISOR_ISPEED_CTX_SAMPLE -13
  37. #define MAX_IDLE_TIME 5000000000
  38. #define MIN_WORKING_TIME 500
  39. struct sc_hypervisor_policy_config
  40. {
  41. /* underneath this limit we cannot resize */
  42. int min_nworkers;
  43. /* above this limit we cannot resize */
  44. int max_nworkers;
  45. /*resize granularity */
  46. int granularity;
  47. /* priority for a worker to stay in this context */
  48. /* the smaller the priority the faster it will be moved */
  49. /* to another context */
  50. int priority[STARPU_NMAXWORKERS];
  51. /* above this limit the priority of the worker is reduced */
  52. double max_idle[STARPU_NMAXWORKERS];
  53. /* underneath this limit the priority of the worker is reduced */
  54. double min_working[STARPU_NMAXWORKERS];
  55. /* workers that will not move */
  56. int fixed_workers[STARPU_NMAXWORKERS];
  57. /* max idle for the workers that will be added during the resizing process*/
  58. double new_workers_max_idle;
  59. /* sample used to compute the instant speed per worker*/
  60. double ispeed_w_sample[STARPU_NMAXWORKERS];
  61. /* sample used to compute the instant speed per ctx*/
  62. double ispeed_ctx_sample;
  63. };
  64. /* set a certain configuration to a context */
  65. void sc_hypervisor_set_config(unsigned sched_ctx, void *config);
  66. /* check out the configuration of a context */
  67. struct sc_hypervisor_policy_config *sc_hypervisor_get_config(unsigned sched_ctx);
  68. /* impose different parameters to a configuration of a context */
  69. void sc_hypervisor_ctl(unsigned sched_ctx, ...);
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #endif