replicate_refcnt 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. replicate.refcnt usage
  18. ======================
  19. It is used to make sure the replicate still exists on some memory node.
  20. It is thus used
  21. - during task duration for each data
  22. - during data requests, to make sure that the source and target still exist
  23. - during data reduction, to keep the per-worker data available for reduction
  24. - during application data acquisition
  25. Function detail
  26. ---------------
  27. * makes sure there is at least a reference:
  28. - copy_data_1_to_1_generic()
  29. - _starpu_driver_copy_data_1_to_1()
  30. - _starpu_post_data_request()
  31. - starpu_handle_data_request()
  32. * creates a reference:
  33. * Released by starpu_handle_data_request_completion:
  34. - _starpu_create_data_request():
  35. - 1 on dst_replicate
  36. - 1 on src_replicate if (mode & STARPU_R)
  37. - _starpu_search_existing_data_request() on src_replicate when turning a request without STARPU_R into one that does.
  38. * Released by _starpu_data_end_reduction_mode_terminate:
  39. - _starpu_data_end_reduction_mode() for each initialized per-worker buffer, creates a reduction_tmp_handles for them
  40. * Released by _starpu_release_data_on_node or inside _starpu_prefetch_data_on_node_with_mode:
  41. - _starpu_fetch_data_on_node() when !detached
  42. * indirectly creates a reference:
  43. * Released by _starpu_push_task_output():
  44. - fetch_data()
  45. - _starpu_fetch_task_input() through fetch_data() for each task data (one per unique data)
  46. * Released by starpu_data_release():
  47. - starpu_data_acquire_cb()
  48. * releases a reference:
  49. - starpu_handle_data_request_completion()
  50. - 1 on dst_replicate
  51. - 1 on src_replicate if (mode & STARPU_R)
  52. - _starpu_data_end_reduction_mode_terminate() for each per-worker buffer which has a reduction_tmp_handles
  53. - _starpu_release_data_on_node()
  54. * indirectly releases a reference:
  55. - starpu_handle_data_request() through starpu_handle_data_request_completion() when returning 0.
  56. - _starpu_push_task_output() for each task data (one per unique data)
  57. - starpu_data_release()
  58. - _starpu_handle_node_data_requests() through _starpu_handle_node_data_requests() for each completed request, which is not put back on any list.
  59. * temporarily increases, and decreases after:
  60. - transfer_subtree_to_node()
  61. - _starpu_allocate_interface()
  62. - _starpu_prefetch_data_on_node_with_mode(), when produced by the call to _starpu_fetch_data_on_node (!detached)
  63. - starpu_data_prefetch_on_node(),
  64. - starpu_data_idle_prefetch_on_node(),
  65. - starpu_data_invalidate()
  66. - _starpu_data_unregister()
  67. - _starpu_benchmark_ping_pong()