internal.notes.txt 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2013 Simon Archipoff
  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. Mutex policy
  16. scheduler have to be protected when the hypervisor is modifying it.
  17. there is a mutex in struct starpu_sched_tree wich should be taken by
  18. the application to push a task
  19. and one mutex per worker wich should be taken by workers when they pop
  20. or push a task.
  21. The hypervisor must take all of them to modifying the scheduler.
  22. Creation/Destruction
  23. All the struct starpu_sched_component * starpu_sched_component_foo_create()
  24. function return a initialized struct starpu_sched_component.
  25. The void starpu_sched_component_destroy(struct starpu_sched_component * component)
  26. function call component->deinit_data(component) to free data allocated during
  27. creation
  28. Workers components are particulars, there is no creation function, only
  29. accessor to guaranty uniqueness of worker components. worker_component->workers and
  30. worker_component->workers_in_ctx should not be modified.
  31. Add/Remove workers
  32. I see 2 way for adding/removing workers of the scheduler
  33. The hypervisor block all the scheduling and modify the scheduler in
  34. the way it wants, and then update all component->workers_in_ctx bitmaps, and
  35. all component->push_task should respect it.
  36. And the second one may be done in an atomic way. The struct
  37. starpu_sched_tree hold a struct starpu_bitmap * that represent
  38. available workers in context. All component can make a call to struct starpu_bitmap
  39. * starpu_sched_component_get_worker_mask(unsigned sched_ctx_id) to see
  40. where they can push a task according to available workers.
  41. But with this way we have a problem for component->estimated_end, in case
  42. of fifo, we have to know how many workers are available to the fifo
  43. component. We also have a problem for shared object. The first way seems to
  44. be better.
  45. Hierarchical construction
  46. Bugs everywhere, works only in simple and particulars cases.
  47. Its difficult to guess where we should plug accelerators because we cant rely on
  48. hwloc topology. Hierarchical heft seems to work on simple machines with numa components
  49. and GPUs
  50. this fail if hwloc_socket_composed_sched_component or hwloc_cache_composed_sched_component is not
  51. NULL
  52. Various things
  53. In several place realloc is used (in prio_deque and for
  54. starpu_sched_component_add_child), because we should not have a lot
  55. different priority level nor adding too many childs.