sc_hypervisor_config.h 2.9 KB

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