workers.doxy 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /*
  2. * This file is part of the StarPU Handbook.
  3. * Copyright (C) 2009--2011 Universit@'e de Bordeaux 1
  4. * Copyright (C) 2010, 2011, 2012, 2013 Centre National de la Recherche Scientifique
  5. * Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique
  6. * See the file version.doxy for copying conditions.
  7. */
  8. /*! \defgroup API_Workers_Properties Workers’ Properties
  9. \enum starpu_node_kind
  10. \ingroup API_Workers_Properties
  11. TODO
  12. \var starpu_node_kind::STARPU_UNUSED
  13. \ingroup API_Workers_Properties
  14. TODO
  15. \ingroup API_Workers_Properties
  16. \var starpu_node_kind::STARPU_CPU_RAM
  17. \ingroup API_Workers_Properties
  18. TODO
  19. \var starpu_node_kind::STARPU_CUDA_RAM
  20. \ingroup API_Workers_Properties
  21. TODO
  22. \var starpu_node_kind::STARPU_OPENCL_RAM
  23. \ingroup API_Workers_Properties
  24. TODO
  25. \var starpu_node_kind::STARPU_MIC_RAM
  26. \ingroup API_Workers_Properties
  27. TODO
  28. \var starpu_node_kind::STARPU_SCC_RAM
  29. \ingroup API_Workers_Properties
  30. This node kind is not used anymore, but implementations in interfaces
  31. will be useful for MPI.
  32. \var starpu_node_kind::STARPU_SCC_SHM
  33. \ingroup API_Workers_Properties
  34. TODO
  35. \enum starpu_worker_archtype
  36. \ingroup API_Workers_Properties
  37. Worker Architecture Type
  38. \var starpu_worker_archtype::STARPU_ANY_WORKER
  39. \ingroup API_Workers_Properties
  40. any worker, used in the hypervisor
  41. \var starpu_worker_archtype::STARPU_CPU_WORKER
  42. \ingroup API_Workers_Properties
  43. CPU core
  44. \var starpu_worker_archtype::STARPU_CUDA_WORKER
  45. \ingroup API_Workers_Properties
  46. NVIDIA CUDA device
  47. \var starpu_worker_archtype::STARPU_OPENCL_WORKER
  48. \ingroup API_Workers_Properties
  49. OpenCL device
  50. \var starpu_worker_archtype::STARPU_MIC_WORKER
  51. \ingroup API_Workers_Properties
  52. Intel MIC device
  53. \var starpu_worker_archtype::STARPU_SCC_WORKER
  54. \ingroup API_Workers_Properties
  55. Intel SCC device
  56. \fn unsigned starpu_worker_get_count(void)
  57. \ingroup API_Workers_Properties
  58. This function returns the number of workers (i.e. processing
  59. units executing StarPU tasks). The returned value should be at most
  60. \ref STARPU_NMAXWORKERS.
  61. \fn int starpu_worker_get_count_by_type(enum starpu_worker_archtype type)
  62. \ingroup API_Workers_Properties
  63. Returns the number of workers of the given type. A positive (or
  64. NULL) value is returned in case of success, -EINVAL indicates that the
  65. type is not valid otherwise.
  66. \fn unsigned starpu_cpu_worker_get_count(void)
  67. \ingroup API_Workers_Properties
  68. This function returns the number of CPUs controlled by StarPU. The
  69. returned value should be at most \ref STARPU_MAXCPUS.
  70. \fn unsigned starpu_cuda_worker_get_count(void)
  71. \ingroup API_Workers_Properties
  72. This function returns the number of CUDA devices controlled by
  73. StarPU. The returned value should be at most \ref STARPU_MAXCUDADEVS.
  74. \fn unsigned starpu_mic_worker_get_count(void)
  75. \ingroup API_Workers_Properties
  76. This function returns the number of MIC workers controlled by StarPU.
  77. \fn unsigned starpu_mic_device_get_count(void)
  78. \ingroup API_Workers_Properties
  79. This function returns the number of MIC devices controlled by StarPU.
  80. The returned value should be at most \ref STARPU_MAXMICDEVS.
  81. \fn unsigned starpu_scc_worker_get_count(void)
  82. \ingroup API_Workers_Properties
  83. This function returns the number of SCC devices controlled by StarPU.
  84. The returned value should be at most \ref STARPU_MAXSCCDEVS.
  85. \fn unsigned starpu_opencl_worker_get_count(void)
  86. \ingroup API_Workers_Properties
  87. This function returns the number of OpenCL devices controlled by
  88. StarPU. The returned value should be at most \ref STARPU_MAXOPENCLDEVS.
  89. \fn int starpu_worker_get_id(void)
  90. \ingroup API_Workers_Properties
  91. This function returns the identifier of the current worker, i.e
  92. the one associated to the calling thread. The returned value is either
  93. -1 if the current context is not a StarPU worker (i.e. when called
  94. from the application outside a task or a callback), or an integer
  95. between 0 and starpu_worker_get_count() - 1.
  96. \fn int starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize)
  97. \ingroup API_Workers_Properties
  98. This function gets the list of identifiers of workers with the
  99. given type. It fills the array \p workerids with the identifiers of the
  100. workers that have the type indicated in the first argument. The
  101. argument \p maxsize indicates the size of the array \p workerids. The returned
  102. value gives the number of identifiers that were put in the array.
  103. -ERANGE is returned is \p maxsize is lower than the number of workers
  104. with the appropriate type: in that case, the array is filled with the
  105. \p maxsize first elements. To avoid such overflows, the value of maxsize
  106. can be chosen by the means of the function
  107. starpu_worker_get_count_by_type(), or by passing a value greater or
  108. equal to \ref STARPU_NMAXWORKERS.
  109. \fn int starpu_worker_get_by_type(enum starpu_worker_archtype type, int num)
  110. \ingroup API_Workers_Properties
  111. This returns the identifier of the num-th worker that has the
  112. specified type type. If there are no such worker, -1 is returned.
  113. \fn int starpu_worker_get_by_devid(enum starpu_worker_archtype type, int devid)
  114. \ingroup API_Workers_Properties
  115. This returns the identifier of the worker that has the specified type
  116. \p type and device id \p devid (which may not be the n-th, if some
  117. devices are skipped for instance). If there are no such worker, -1 is returned.
  118. \fn int starpu_worker_get_devid(int id)
  119. \ingroup API_Workers_Properties
  120. This function returns the device id of the given worker. The
  121. worker should be identified with the value returned by the
  122. starpu_worker_get_id() function. In the case of a CUDA worker, this
  123. device identifier is the logical device identifier exposed by CUDA
  124. (used by the function cudaGetDevice() for instance). The device
  125. identifier of a CPU worker is the logical identifier of the core on
  126. which the worker was bound; this identifier is either provided by the
  127. OS or by the library <c>hwloc</c> in case it is available.
  128. \fn enum starpu_worker_archtype starpu_worker_get_type(int id)
  129. \ingroup API_Workers_Properties
  130. This function returns the type of processing unit associated to
  131. a worker. The worker identifier is a value returned by the function
  132. starpu_worker_get_id()). The returned value indicates the
  133. architecture of the worker: ::STARPU_CPU_WORKER for a CPU core,
  134. ::STARPU_CUDA_WORKER for a CUDA device, and ::STARPU_OPENCL_WORKER for a
  135. OpenCL device. The value returned for an invalid identifier is
  136. unspecified.
  137. \fn void starpu_worker_get_name(int id, char *dst, size_t maxlen)
  138. \ingroup API_Workers_Properties
  139. This function allows to get the name of a given worker. StarPU
  140. associates a unique human readable string to each processing unit.
  141. This function copies at most the maxlen first bytes of the unique
  142. string associated to a worker identified by its identifier id into the
  143. dst buffer. The caller is responsible for ensuring that \p dst is a
  144. valid pointer to a buffer of \p maxlen bytes at least. Calling this
  145. function on an invalid identifier results in an unspecified behaviour.
  146. \fn unsigned starpu_worker_get_memory_node(unsigned workerid)
  147. \ingroup API_Workers_Properties
  148. This function returns the identifier of the memory node
  149. associated to the worker identified by \p workerid.
  150. \fn enum starpu_node_kind starpu_node_get_kind(unsigned node)
  151. \ingroup API_Workers_Properties
  152. Returns the type of the given node as defined by
  153. ::starpu_node_kind. For example, when defining a new data interface,
  154. this function should be used in the allocation function to determine
  155. on which device the memory needs to be allocated.
  156. */