replicate_refcnt 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/bash
  2. #
  3. # StarPU --- Runtime system for heterogeneous multicore architectures.
  4. #
  5. # Copyright (C) 2015 Université de Bordeaux
  6. # Copyright (C) 2012 Inria
  7. #
  8. # StarPU is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU Lesser General Public License as published by
  10. # the Free Software Foundation; either version 2.1 of the License, or (at
  11. # your option) any later version.
  12. #
  13. # StarPU is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. #
  17. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  18. replicate.refcnt usage
  19. ======================
  20. It is used to make sure the replicate still exists on some memory node.
  21. It is thus used
  22. - during task duration for each data
  23. - during data requests, to make sure that the source and target still exist
  24. - during data reduction, to keep the per-worker data available for reduction
  25. - during application data acquisition
  26. Function detail
  27. ---------------
  28. * makes sure there is at least a reference:
  29. - copy_data_1_to_1_generic()
  30. - _starpu_driver_copy_data_1_to_1()
  31. - _starpu_post_data_request()
  32. - starpu_handle_data_request()
  33. * creates a reference:
  34. * Released by starpu_handle_data_request_completion:
  35. - _starpu_create_data_request():
  36. - 1 on dst_replicate
  37. - 1 on src_replicate if (mode & STARPU_R)
  38. - _starpu_search_existing_data_request() on src_replicate when turning a request without STARPU_R into one that does.
  39. * Released by _starpu_data_end_reduction_mode_terminate:
  40. - _starpu_data_end_reduction_mode() for each initialized per-worker buffer, creates a reduction_tmp_handles for them
  41. * Released by _starpu_release_data_on_node or inside _starpu_prefetch_data_on_node_with_mode:
  42. - _starpu_fetch_data_on_node() when !detached
  43. * indirectly creates a reference:
  44. * Released by _starpu_push_task_output():
  45. - fetch_data()
  46. - _starpu_fetch_task_input() through fetch_data() for each task data (one per unique data)
  47. * Released by starpu_data_release():
  48. - starpu_data_acquire_cb()
  49. * releases a reference:
  50. - starpu_handle_data_request_completion()
  51. - 1 on dst_replicate
  52. - 1 on src_replicate if (mode & STARPU_R)
  53. - _starpu_data_end_reduction_mode_terminate() for each per-worker buffer which has a reduction_tmp_handles
  54. - _starpu_release_data_on_node()
  55. * indirectly releases a reference:
  56. - starpu_handle_data_request() through starpu_handle_data_request_completion() when returning 0.
  57. - _starpu_push_task_output() for each task data (one per unique data)
  58. - starpu_data_release()
  59. - _starpu_handle_node_data_requests() through _starpu_handle_node_data_requests() for each completed request, which is not put back on any list.
  60. * temporarily increases, and decreases after:
  61. - transfer_subtree_to_node()
  62. - _starpu_allocate_interface()
  63. - _starpu_prefetch_data_on_node_with_mode(), when produced by the call to _starpu_fetch_data_on_node (!detached)
  64. - starpu_data_prefetch_on_node(),
  65. - starpu_data_idle_prefetch_on_node(),
  66. - starpu_data_invalidate()
  67. - _starpu_data_unregister()
  68. - _starpu_benchmark_ping_pong()