handle_refcnt 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2012-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  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. handle.refcnt usage
  18. ===================
  19. It is the counter for a software rwlock, accounting the number of readers
  20. (mode == STARPU_R) or writers (mode == STARPU_W)
  21. It is thus used
  22. - during task duration for each data
  23. - right after completion of a data request
  24. - during application data acquisition
  25. * Creates a reference:
  26. * Released by _starpu_notify_data_dependencies():
  27. - _starpu_attempt_to_submit_data_request() immediately when returning 0, but otherwise (1) when the pending request is given control
  28. * Released by _starpu_notify_data_dependencies():
  29. - _starpu_notify_data_dependencies() when may_unlock_data_req_list_head returned a request which can proceed
  30. * Indirectly creates a reference:
  31. * Released by starpu_data_release():
  32. - _starpu_attempt_to_submit_data_request_from_apps() when returning 0
  33. - starpu_data_acquire_cb()
  34. - starpu_data_acquire()
  35. * Released by _starpu_notify_data_dependencies():
  36. - attempt_to_submit_data_request_from_job() when returning 0
  37. * Released by _starpu_push_task_output():
  38. - _submit_job_enforce_data_deps() for each data.
  39. * Releases a reference:
  40. - _starpu_notify_data_dependencies()
  41. * Indirectly releases a reference:
  42. - _starpu_release_data_on_node()
  43. - _starpu_push_task_output() for each data
  44. - starpu_data_release()
  45. * Temporarily creates a reference, released immediately:
  46. - _starpu_write_through_data() for needed write-throughs, released by wt_callback
  47. - _starpu_benchmark_ping_pong()
  48. - _starpu_data_unregister()
  49. - _starpu_prefetch_data_on_node_with_mode()
  50. - starpu_data_invalidate()
  51. TODO: unclear conversion use