workers.doxy 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. 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 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 STARPU_MAXCUDADEVS.
  74. \fn unsigned starpu_opencl_worker_get_count(void)
  75. \ingroup API_Workers_Properties
  76. This function returns the number of OpenCL devices controlled by
  77. StarPU. The returned value should be at most STARPU_MAXOPENCLDEVS.
  78. \fn int starpu_worker_get_id (void)
  79. \ingroup API_Workers_Properties
  80. This function returns the identifier of the current worker, i.e
  81. the one associated to the calling thread. The returned value is either
  82. -1 if the current context is not a StarPU worker (i.e. when called
  83. from the application outside a task or a callback), or an integer
  84. between 0 and starpu_worker_get_count() - 1.
  85. \fn int starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize)
  86. \ingroup API_Workers_Properties
  87. This function gets the list of identifiers of workers with the
  88. given type. It fills the workerids array with the identifiers of the
  89. workers that have the type indicated in the first argument. The
  90. maxsize argument indicates the size of the workids array. The returned
  91. value gives the number of identifiers that were put in the array.
  92. -ERANGE is returned is maxsize is lower than the number of workers
  93. with the appropriate type: in that case, the array is filled with the
  94. maxsize first elements. To avoid such overflows, the value of maxsize
  95. can be chosen by the means of the starpu_worker_get_count_by_type
  96. function, or by passing a value greater or equal to
  97. STARPU_NMAXWORKERS.
  98. \fn int starpu_worker_get_by_type(enum starpu_worker_archtype type, int num)
  99. \ingroup API_Workers_Properties
  100. This returns the identifier of the num-th worker that has the
  101. specified type type. If there are no such worker, -1 is returned.
  102. \fn int starpu_worker_get_by_devid(enum starpu_worker_archtype type, int devid)
  103. \ingroup API_Workers_Properties
  104. This returns the identifier of the worker that has the specified type
  105. type and devid devid (which may not be the n-th, if some devices are
  106. skipped for instance). If there are no such worker, -1 is returned.
  107. \fn int starpu_worker_get_devid(int id)
  108. \ingroup API_Workers_Properties
  109. This function returns the device id of the given worker. The
  110. worker should be identified with the value returned by the
  111. starpu_worker_get_id() function. In the case of a CUDA worker, this
  112. device identifier is the logical device identifier exposed by CUDA
  113. (used by the cudaGetDevice function for instance). The device
  114. identifier of a CPU worker is the logical identifier of the core on
  115. which the worker was bound; this identifier is either provided by the
  116. OS or by the hwloc library in case it is available.
  117. \fn enum starpu_worker_archtype starpu_worker_get_type(int id)
  118. \ingroup API_Workers_Properties
  119. This function returns the type of processing unit associated to
  120. a worker. The worker identifier is a value returned by the
  121. starpu_worker_get_id() function). The returned value indicates the
  122. architecture of the worker: STARPU_CPU_WORKER for a CPU core,
  123. STARPU_CUDA_WORKER for a CUDA device, and STARPU_OPENCL_WORKER for a
  124. OpenCL device. The value returned for an invalid identifier is
  125. unspecified.
  126. \fn void starpu_worker_get_name(int id, char *dst, size_t maxlen)
  127. \ingroup API_Workers_Properties
  128. This function allows to get the name of a given worker. StarPU
  129. associates a unique human readable string to each processing unit.
  130. This function copies at most the maxlen first bytes of the unique
  131. string associated to a worker identified by its identifier id into the
  132. dst buffer. The caller is responsible for ensuring that the dst is a
  133. valid pointer to a buffer of maxlen bytes at least. Calling this
  134. function on an invalid identifier results in an unspecified behaviour.
  135. \fn unsigned starpu_worker_get_memory_node(unsigned workerid)
  136. \ingroup API_Workers_Properties
  137. This function returns the identifier of the memory node
  138. associated to the worker identified by workerid.
  139. \fn enum starpu_node_kind starpu_node_get_kind(unsigned node)
  140. \ingroup API_Workers_Properties
  141. Returns the type of the given node as defined by
  142. ::starpu_node_kind. For example, when defining a new data interface,
  143. this function should be used in the allocation function to determine
  144. on which device the memory needs to be allocated.
  145. */