hwlocality_helper_distribute.3 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .TH "hwlocality_helper_distribute" 3 "Thu Sep 7 2023" "Version 2.9.3" "Hardware Locality (hwloc)" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. hwlocality_helper_distribute \- Distributing items over a topology
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .SS "Enumerations"
  10. .in +1c
  11. .ti -1c
  12. .RI "enum \fBhwloc_distrib_flags_e\fP { \fBHWLOC_DISTRIB_FLAG_REVERSE\fP }"
  13. .br
  14. .in -1c
  15. .SS "Functions"
  16. .in +1c
  17. .ti -1c
  18. .RI "static int \fBhwloc_distrib\fP (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP *roots, unsigned n_roots, \fBhwloc_cpuset_t\fP *set, unsigned n, int until, unsigned long flags)"
  19. .br
  20. .in -1c
  21. .SH "Detailed Description"
  22. .PP
  23. .SH "Enumeration Type Documentation"
  24. .PP
  25. .SS "enum \fBhwloc_distrib_flags_e\fP"
  26. .PP
  27. Flags to be given to \fBhwloc_distrib()\fP\&.
  28. .PP
  29. \fBEnumerator\fP
  30. .in +1c
  31. .TP
  32. \fB\fIHWLOC_DISTRIB_FLAG_REVERSE \fP\fP
  33. Distrib in reverse order, starting from the last objects\&.
  34. .SH "Function Documentation"
  35. .PP
  36. .SS "static int hwloc_distrib (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP * roots, unsigned n_roots, \fBhwloc_cpuset_t\fP * set, unsigned n, int until, unsigned long flags)\fC [inline]\fP, \fC [static]\fP"
  37. .PP
  38. Distribute \fCn\fP items over the topology under \fCroots\fP\&. Array \fCset\fP will be filled with \fCn\fP cpusets recursively distributed linearly over the topology under objects \fCroots\fP, down to depth \fCuntil\fP (which can be INT_MAX to distribute down to the finest level)\&.
  39. .PP
  40. \fCn_roots\fP is usually 1 and \fCroots\fP only contains the topology root object so as to distribute over the entire topology\&.
  41. .PP
  42. This is typically useful when an application wants to distribute \fCn\fP threads over a machine, giving each of them as much private cache as possible and keeping them locally in number order\&.
  43. .PP
  44. The caller may typically want to also call \fBhwloc_bitmap_singlify()\fP before binding a thread so that it does not move at all\&.
  45. .PP
  46. \fCflags\fP should be 0 or a OR'ed set of \fBhwloc_distrib_flags_e\fP\&.
  47. .PP
  48. \fBReturns\fP
  49. .RS 4
  50. 0 on success, -1 on error\&.
  51. .RE
  52. .PP
  53. \fBNote\fP
  54. .RS 4
  55. This function requires the \fCroots\fP objects to have a CPU set\&.
  56. .RE
  57. .PP
  58. .SH "Author"
  59. .PP
  60. Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&.