sc_hypervisor_config.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 SCHED_CTX_HYPERVISOR_CONFIG_H
  17. #define SCHED_CTX_HYPERVISOR_CONFIG_H
  18. #include <sc_hypervisor.h>
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. /* ioctl properties*/
  24. #define HYPERVISOR_MAX_IDLE -1
  25. #define HYPERVISOR_MIN_WORKING -2
  26. #define HYPERVISOR_PRIORITY -3
  27. #define HYPERVISOR_MIN_WORKERS -4
  28. #define HYPERVISOR_MAX_WORKERS -5
  29. #define HYPERVISOR_GRANULARITY -6
  30. #define HYPERVISOR_FIXED_WORKERS -7
  31. #define HYPERVISOR_MIN_TASKS -8
  32. #define HYPERVISOR_NEW_WORKERS_MAX_IDLE -9
  33. #define HYPERVISOR_TIME_TO_APPLY -10
  34. #define HYPERVISOR_EMPTY_CTX_MAX_IDLE -11
  35. #define HYPERVISOR_NULL -12
  36. #define HYPERVISOR_ISPEED_W_SAMPLE -13
  37. #define HYPERVISOR_ISPEED_CTX_SAMPLE -14
  38. #define MAX_IDLE_TIME 5000000000
  39. #define MIN_WORKING_TIME 500
  40. struct sc_hypervisor_policy_config
  41. {
  42. /* underneath this limit we cannot resize */
  43. int min_nworkers;
  44. /* above this limit we cannot resize */
  45. int max_nworkers;
  46. /*resize granularity */
  47. int granularity;
  48. /* priority for a worker to stay in this context */
  49. /* the smaller the priority the faster it will be moved */
  50. /* to another context */
  51. int priority[STARPU_NMAXWORKERS];
  52. /* above this limit the priority of the worker is reduced */
  53. double max_idle[STARPU_NMAXWORKERS];
  54. /* underneath this limit the priority of the worker is reduced */
  55. double min_working[STARPU_NMAXWORKERS];
  56. /* workers that will not move */
  57. int fixed_workers[STARPU_NMAXWORKERS];
  58. /* max idle for the workers that will be added during the resizing process*/
  59. double new_workers_max_idle;
  60. /* above this context we allow removing all workers */
  61. double empty_ctx_max_idle[STARPU_NMAXWORKERS];
  62. /* sample used to compute the instant speed per worker*/
  63. double ispeed_w_sample[STARPU_NMAXWORKERS];
  64. /* sample used to compute the instant speed per ctx*/
  65. double ispeed_ctx_sample;
  66. };
  67. /* set a certain configuration to a context */
  68. void sc_hypervisor_set_config(unsigned sched_ctx, void *config);
  69. /* check out the configuration of a context */
  70. struct sc_hypervisor_policy_config *sc_hypervisor_get_config(unsigned sched_ctx);
  71. /* impose different parameters to a configuration of a context */
  72. void sc_hypervisor_ioctl(unsigned sched_ctx, ...);
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif