hwlocality_setsource.3 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. .TH "hwlocality_setsource" 3 "Thu Sep 7 2023" "Version 2.9.3" "Hardware Locality (hwloc)" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. hwlocality_setsource \- Changing the Source of Topology Discovery
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .SS "Enumerations"
  10. .in +1c
  11. .ti -1c
  12. .RI "enum \fBhwloc_topology_components_flag_e\fP { \fBHWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST\fP }"
  13. .br
  14. .in -1c
  15. .SS "Functions"
  16. .in +1c
  17. .ti -1c
  18. .RI "int \fBhwloc_topology_set_pid\fP (\fBhwloc_topology_t\fP restrict topology, hwloc_pid_t pid)"
  19. .br
  20. .ti -1c
  21. .RI "int \fBhwloc_topology_set_synthetic\fP (\fBhwloc_topology_t\fP restrict topology, const char *restrict description)"
  22. .br
  23. .ti -1c
  24. .RI "int \fBhwloc_topology_set_xml\fP (\fBhwloc_topology_t\fP restrict topology, const char *restrict xmlpath)"
  25. .br
  26. .ti -1c
  27. .RI "int \fBhwloc_topology_set_xmlbuffer\fP (\fBhwloc_topology_t\fP restrict topology, const char *restrict buffer, int size)"
  28. .br
  29. .ti -1c
  30. .RI "int \fBhwloc_topology_set_components\fP (\fBhwloc_topology_t\fP restrict topology, unsigned long flags, const char *restrict name)"
  31. .br
  32. .in -1c
  33. .SH "Detailed Description"
  34. .PP
  35. These functions must be called between \fBhwloc_topology_init()\fP and \fBhwloc_topology_load()\fP\&. Otherwise, they will return -1 with errno set to \fCEBUSY\fP\&.
  36. .PP
  37. If none of the functions below is called, the default is to detect all the objects of the machine that the caller is allowed to access\&.
  38. .PP
  39. This default behavior may also be modified through environment variables if the application did not modify it already\&. Setting HWLOC_XMLFILE in the environment enforces the discovery from a XML file as if \fBhwloc_topology_set_xml()\fP had been called\&. Setting HWLOC_SYNTHETIC enforces a synthetic topology as if \fBhwloc_topology_set_synthetic()\fP had been called\&.
  40. .PP
  41. Finally, HWLOC_THISSYSTEM enforces the return value of \fBhwloc_topology_is_thissystem()\fP\&.
  42. .SH "Enumeration Type Documentation"
  43. .PP
  44. .SS "enum \fBhwloc_topology_components_flag_e\fP"
  45. .PP
  46. Flags to be passed to \fBhwloc_topology_set_components()\fP
  47. .PP
  48. \fBEnumerator\fP
  49. .in +1c
  50. .TP
  51. \fB\fIHWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST \fP\fP
  52. Blacklist the target component from being used\&.
  53. .SH "Function Documentation"
  54. .PP
  55. .SS "int hwloc_topology_set_components (\fBhwloc_topology_t\fP restrict topology, unsigned long flags, const char *restrict name)"
  56. .PP
  57. Prevent a discovery component from being used for a topology\&. \fCname\fP is the name of the discovery component that should not be used when loading topology \fCtopology\fP\&. The name is a string such as 'cuda'\&.
  58. .PP
  59. For components with multiple phases, it may also be suffixed with the name of a phase, for instance 'linux:io'\&.
  60. .PP
  61. \fCflags\fP should be \fBHWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST\fP\&.
  62. .PP
  63. This may be used to avoid expensive parts of the discovery process\&. For instance, CUDA-specific discovery may be expensive and unneeded while generic I/O discovery could still be useful\&.
  64. .PP
  65. \fBReturns\fP
  66. .RS 4
  67. 0 on success\&.
  68. .PP
  69. -1 on error, for instance if flags are invalid\&.
  70. .RE
  71. .PP
  72. .SS "int hwloc_topology_set_pid (\fBhwloc_topology_t\fP restrict topology, hwloc_pid_t pid)"
  73. .PP
  74. Change which process the topology is viewed from\&. On some systems, processes may have different views of the machine, for instance the set of allowed CPUs\&. By default, hwloc exposes the view from the current process\&. Calling \fBhwloc_topology_set_pid()\fP permits to make it expose the topology of the machine from the point of view of another process\&.
  75. .PP
  76. \fBNote\fP
  77. .RS 4
  78. \fChwloc_pid_t\fP is \fCpid_t\fP on Unix platforms, and \fCHANDLE\fP on native Windows platforms\&.
  79. .PP
  80. -1 is returned and errno is set to \fCENOSYS\fP on platforms that do not support this feature\&.
  81. .RE
  82. .PP
  83. \fBReturns\fP
  84. .RS 4
  85. 0 on success, -1 on error\&.
  86. .RE
  87. .PP
  88. .SS "int hwloc_topology_set_synthetic (\fBhwloc_topology_t\fP restrict topology, const char *restrict description)"
  89. .PP
  90. Enable synthetic topology\&. Gather topology information from the given \fCdescription\fP, a space-separated string of <type:number> describing the object type and arity at each level\&. All types may be omitted (space-separated string of numbers) so that hwloc chooses all types according to usual topologies\&. See also the \fBSynthetic topologies\fP\&.
  91. .PP
  92. Setting the environment variable HWLOC_SYNTHETIC may also result in this behavior\&.
  93. .PP
  94. If \fCdescription\fP was properly parsed and describes a valid topology configuration, this function returns 0\&. Otherwise -1 is returned and errno is set to \fCEINVAL\fP\&.
  95. .PP
  96. Note that this function does not actually load topology information; it just tells hwloc where to load it from\&. You'll still need to invoke \fBhwloc_topology_load()\fP to actually load the topology information\&.
  97. .PP
  98. \fBReturns\fP
  99. .RS 4
  100. 0 on success\&.
  101. .PP
  102. -1 with errno set to \fCEINVAL\fP if the description was invalid\&.
  103. .RE
  104. .PP
  105. \fBNote\fP
  106. .RS 4
  107. For convenience, this backend provides empty binding hooks which just return success\&.
  108. .PP
  109. On success, the synthetic component replaces the previously enabled component (if any), but the topology is not actually modified until \fBhwloc_topology_load()\fP\&.
  110. .RE
  111. .PP
  112. .SS "int hwloc_topology_set_xml (\fBhwloc_topology_t\fP restrict topology, const char *restrict xmlpath)"
  113. .PP
  114. Enable XML-file based topology\&. Gather topology information from the XML file given at \fCxmlpath\fP\&. Setting the environment variable HWLOC_XMLFILE may also result in this behavior\&. This file may have been generated earlier with \fBhwloc_topology_export_xml()\fP in \fBhwloc/export\&.h\fP, or lstopo file\&.xml\&.
  115. .PP
  116. Note that this function does not actually load topology information; it just tells hwloc where to load it from\&. You'll still need to invoke \fBhwloc_topology_load()\fP to actually load the topology information\&.
  117. .PP
  118. \fBReturns\fP
  119. .RS 4
  120. 0 on success\&.
  121. .PP
  122. -1 with errno set to \fCEINVAL\fP on failure to read the XML file\&.
  123. .RE
  124. .PP
  125. \fBNote\fP
  126. .RS 4
  127. See also \fBhwloc_topology_set_userdata_import_callback()\fP for importing application-specific object userdata\&.
  128. .PP
  129. For convenience, this backend provides empty binding hooks which just return success\&. To have hwloc still actually call OS-specific hooks, the \fBHWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM\fP has to be set to assert that the loaded file is really the underlying system\&.
  130. .PP
  131. On success, the XML component replaces the previously enabled component (if any), but the topology is not actually modified until \fBhwloc_topology_load()\fP\&.
  132. .RE
  133. .PP
  134. .SS "int hwloc_topology_set_xmlbuffer (\fBhwloc_topology_t\fP restrict topology, const char *restrict buffer, int size)"
  135. .PP
  136. Enable XML based topology using a memory buffer (instead of a file, as with \fBhwloc_topology_set_xml()\fP)\&. Gather topology information from the XML memory buffer given at \fCbuffer\fP and of length \fCsize\fP\&. This buffer may have been filled earlier with \fBhwloc_topology_export_xmlbuffer()\fP in \fBhwloc/export\&.h\fP\&.
  137. .PP
  138. Note that this function does not actually load topology information; it just tells hwloc where to load it from\&. You'll still need to invoke \fBhwloc_topology_load()\fP to actually load the topology information\&.
  139. .PP
  140. \fBReturns\fP
  141. .RS 4
  142. 0 on success\&.
  143. .PP
  144. -1 with errno set to \fCEINVAL\fP on failure to read the XML buffer\&.
  145. .RE
  146. .PP
  147. \fBNote\fP
  148. .RS 4
  149. See also \fBhwloc_topology_set_userdata_import_callback()\fP for importing application-specific object userdata\&.
  150. .PP
  151. For convenience, this backend provides empty binding hooks which just return success\&. To have hwloc still actually call OS-specific hooks, the \fBHWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM\fP has to be set to assert that the loaded file is really the underlying system\&.
  152. .PP
  153. On success, the XML component replaces the previously enabled component (if any), but the topology is not actually modified until \fBhwloc_topology_load()\fP\&.
  154. .RE
  155. .PP
  156. .SH "Author"
  157. .PP
  158. Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&.