sched_ctx_hypervisor_intern.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011, 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. #include <sched_ctx_hypervisor.h>
  17. #include <common/htable32.h>
  18. struct size_request {
  19. int *workers;
  20. int nworkers;
  21. int *sched_ctxs;
  22. int nsched_ctxs;
  23. };
  24. struct sched_ctx_hypervisor {
  25. struct sched_ctx_wrapper sched_ctx_w[STARPU_NMAX_SCHED_CTXS];
  26. int sched_ctxs[STARPU_NMAX_SCHED_CTXS];
  27. unsigned nsched_ctxs;
  28. unsigned resize[STARPU_NMAX_SCHED_CTXS];
  29. int min_tasks;
  30. struct hypervisor_policy policy;
  31. struct starpu_htbl32_node *configurations[STARPU_NMAX_SCHED_CTXS];
  32. struct starpu_htbl32_node *resize_requests[STARPU_NMAX_SCHED_CTXS];
  33. pthread_mutex_t conf_mut[STARPU_NMAX_SCHED_CTXS];
  34. pthread_mutex_t resize_mut[STARPU_NMAX_SCHED_CTXS];
  35. struct size_request *sr;
  36. int check_min_tasks[STARPU_NMAX_SCHED_CTXS];
  37. };
  38. struct sched_ctx_hypervisor_adjustment {
  39. int workerids[STARPU_NMAXWORKERS];
  40. int nworkers;
  41. };
  42. struct sched_ctx_hypervisor hypervisor;
  43. void _add_config(unsigned sched_ctx);
  44. void _remove_config(unsigned sched_ctx);