initialization.doxy 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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 Initialization_and_Termination Initialization and Termination
  9. \struct starpu_driver
  10. \brief structure for a driver
  11. \ingroup Initialization_and_Termination
  12. \var starpu_driver::type
  13. The type of the driver. Only STARPU_CPU_DRIVER,
  14. STARPU_CUDA_DRIVER and STARPU_OPENCL_DRIVER are currently supported.
  15. \var starpu_driver::id
  16. The identifier of the driver.
  17. \struct starpu_vector_interface
  18. \brief vector interface for contiguous (non-strided) buffers
  19. \ingroup Initialization_and_Termination
  20. \struct starpu_conf
  21. \ingroup Initialization_and_Termination
  22. \brief structure for configuring StarPU.
  23. This structure is passed to the starpu_init() function in order to
  24. configure StarPU. It has to be initialized with starpu_conf_init().
  25. When the default value is used, StarPU automatically selects the
  26. number of processing units and takes the default scheduling policy.
  27. The environment variables overwrite the equivalent parameters.
  28. \var starpu_conf::magic
  29. \private
  30. Will be initialized by starpu_conf_init(). Should not be set by hand.
  31. \var starpu_conf::sched_policy_name
  32. This is the name of the scheduling policy. This can also be specified
  33. with the STARPU_SCHED environment variable. (default = NULL).
  34. \var starpu_conf::sched_policy
  35. This is the definition of the scheduling policy. This field is ignored
  36. if starpu_conf::sched_policy_name is set. (default = NULL)
  37. \var starpu_conf::ncpus
  38. This is the number of CPU cores that StarPU can use. This can also be
  39. specified with the STARPU_NCPU environment variable. (default = -1)
  40. \var starpu_conf::ncuda
  41. This is the number of CUDA devices that StarPU can use. This can also
  42. be specified with the STARPU_NCUDA environment variable. (default =
  43. -1)
  44. \var starpu_conf::nopencl
  45. This is the number of OpenCL devices that StarPU can use. This can
  46. also be specified with the STARPU_NOPENCL environment variable.
  47. (default = -1)
  48. \var starpu_conf::nmic
  49. This is the number of MIC devices that StarPU can use. (default = -1)
  50. \var starpu_conf::nscc
  51. This is the number of SCC devices that StarPU can use. (default = -1)
  52. \var starpu_conf::use_explicit_workers_bindid
  53. If this flag is set, the starpu_conf::workers_bindid array indicates
  54. where the different workers are bound, otherwise StarPU automatically
  55. selects where to bind the different workers. This can also be
  56. specified with the STARPU_WORKERS_CPUID environment variable. (default = 0)
  57. \var starpu_conf::workers_bindid
  58. If the starpu_conf::use_explicit_workers_bindid flag is set, this
  59. array indicates where to bind the different workers. The i-th entry of
  60. the starpu_conf::workers_bindid indicates the logical identifier of
  61. the processor which should execute the i-th worker. Note that the
  62. logical ordering of the CPUs is either determined by the OS, or
  63. provided by the hwloc library in case it is available.
  64. \var starpu_conf::use_explicit_workers_cuda_gpuid
  65. If this flag is set, the CUDA workers will be attached to the CUDA
  66. devices specified in the starpu_conf::workers_cuda_gpuid array.
  67. Otherwise, StarPU affects the CUDA devices in a round-robin fashion.
  68. This can also be specified with the STARPU_WORKERS_CUDAID environment
  69. variable. (default = 0)
  70. \var starpu_conf::workers_cuda_gpuid
  71. If the starpu_conf::use_explicit_workers_cuda_gpuid flag is set, this
  72. array contains the logical identifiers of the CUDA devices (as used by
  73. cudaGetDevice()).
  74. \var starpu_conf::use_explicit_workers_opencl_gpuid
  75. If this flag is set, the OpenCL workers will be attached to the OpenCL
  76. devices specified in the starpu_conf::workers_opencl_gpuid array.
  77. Otherwise, StarPU affects the OpenCL devices in a round-robin fashion.
  78. This can also be specified with the STARPU_WORKERS_OPENCLID
  79. environment variable. (default = 0)
  80. \var starpu_conf::workers_opencl_gpuid
  81. If the starpu_conf::use_explicit_workers_opencl_gpuid flag is set,
  82. this array contains the logical identifiers of the OpenCL devices to
  83. be used.
  84. \var starpu_conf::use_explicit_workers_mic_deviceid
  85. If this flag is set, the MIC workers will be attached to the MIC
  86. devices specified in the array starpu_conf::workers_mic_deviceid.
  87. (default = 0)
  88. \var starpu_conf::workers_mic_deviceid
  89. If the flag starpu_conf::use_explicit_workers_mic_deviceid is set, the
  90. array contains the logical identifiers of the MIC devices to be used.
  91. \var starpu_conf::use_explicit_workers_scc_deviceid
  92. If this flag is set, the SCC workers will be attached to the SCC
  93. devices specified in the array starpu_conf::workers_scc_deviceid.
  94. (default = 0)
  95. \var starpu_conf::workers_scc_deviceid
  96. If the flag starpu_conf::use_explicit_workers_scc_deviceid is set, the
  97. array contains the logical identifiers of the SCC devices to be used.
  98. \var starpu_conf::bus_calibrate
  99. If this flag is set, StarPU will recalibrate the bus. If this value
  100. is equal to <c>-1</c>, the default value is used. This can also be
  101. specified with the STARPU_BUS_CALIBRATE environment variable. (default
  102. = 0)
  103. \var starpu_conf::calibrate
  104. If this flag is set, StarPU will calibrate the performance models when
  105. executing tasks. If this value is equal to <c>-1</c>, the default
  106. value is used. If the value is equal to <c>1</c>, it will force
  107. continuing calibration. If the value is equal to <c>2</c>, the
  108. existing performance models will be overwritten. This can also be
  109. specified with the STARPU_CALIBRATE environment variable. (default =
  110. 0)
  111. \var starpu_conf::single_combined_worker
  112. By default, StarPU executes parallel tasks
  113. concurrently. Some parallel libraries (e.g. most OpenMP
  114. implementations) however do not support concurrent calls to
  115. parallel code. In such case, setting this flag makes StarPU
  116. only start one parallel task at a time (but other CPU and
  117. GPU tasks are not affected and can be run concurrently).
  118. The parallel task scheduler will however still however
  119. still try varying combined worker sizes to look for the
  120. most efficient ones. This can also be specified with the
  121. STARPU_SINGLE_COMBINED_WORKER environment variable.
  122. (default = 0)
  123. \var starpu_conf::mic_sink_program_path
  124. Path to the kernel to execute on the MIC device, compiled for MIC
  125. architecture.
  126. \var starpu_conf::disable_asynchronous_copy
  127. This flag should be set to 1 to disable
  128. asynchronous copies between CPUs and all accelerators. This
  129. can also be specified with the
  130. STARPU_DISABLE_ASYNCHRONOUS_COPY environment variable. The
  131. AMD implementation of OpenCL is known to fail when copying
  132. data asynchronously. When using this implementation, it is
  133. therefore necessary to disable asynchronous data transfers.
  134. This can also be specified at compilation time by giving to
  135. the configure script the option
  136. <c>--disable-asynchronous-copy</c>. (default = 0)
  137. \var starpu_conf::disable_asynchronous_cuda_copy
  138. This flag should be set to 1 to disable
  139. asynchronous copies between CPUs and CUDA accelerators.
  140. This can also be specified with the
  141. STARPU_DISABLE_ASYNCHRONOUS_CUDA_COPY environment variable.
  142. This can also be specified at compilation time by giving to
  143. the configure script the option
  144. <c>--disable-asynchronous-cuda-copy</c>. (default = 0)
  145. \var starpu_conf::disable_asynchronous_opencl_copy
  146. This flag should be set to 1 to disable
  147. asynchronous copies between CPUs and OpenCL accelerators.
  148. This can also be specified with the
  149. STARPU_DISABLE_ASYNCHRONOUS_OPENCL_COPY environment
  150. variable. The AMD implementation of OpenCL is known to fail
  151. when copying data asynchronously. When using this
  152. implementation, it is therefore necessary to disable
  153. asynchronous data transfers. This can also be specified at
  154. compilation time by giving to the configure script the
  155. option <c>--disable-asynchronous-opencl-copy</c>. (default
  156. = 0)
  157. \var starpu_conf::disable_asynchronous_mic_copy
  158. indicate if asynchronous copies to MIC devices should be disabled
  159. \var starpu_conf::cuda_opengl_interoperability
  160. Enable CUDA/OpenGL interoperation on these CUDA
  161. devices. This can be set to an array of CUDA device
  162. identifiers for which cudaGLSetGLDevice() should be called
  163. instead of cudaSetDevice(). Its size is specified by the
  164. starpu_conf::n_cuda_opengl_interoperability field below
  165. (default = NULL)
  166. \var starpu_conf::n_cuda_opengl_interoperability
  167. \var starpu_conf::not_launched_drivers
  168. Array of drivers that should not be launched by
  169. StarPU. The application will run in one of its own
  170. threads. (default = NULL)
  171. \var starpu_conf::n_not_launched_drivers
  172. The number of StarPU drivers that should not be
  173. launched by StarPU. (default = 0)
  174. \var starpu_conf::trace_buffer_size
  175. Specifies the buffer size used for FxT tracing.
  176. Starting from FxT version 0.2.12, the buffer will
  177. automatically be flushed when it fills in, but it may still
  178. be interesting to specify a bigger value to avoid any
  179. flushing (which would disturb the trace).
  180. \fn int starpu_init(struct starpu_conf *conf)
  181. \ingroup Initialization_and_Termination
  182. This is StarPU initialization method, which must be called prior to
  183. any other StarPU call. It is possible to specify StarPU’s
  184. configuration (e.g. scheduling policy, number of cores, ...) by
  185. passing a non-null argument. Default configuration is used if the
  186. passed argument is NULL. Upon successful completion, this function
  187. returns 0. Otherwise, -ENODEV indicates that no worker was available
  188. (so that StarPU was not initialized).
  189. \fn int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
  190. \ingroup Initialization_and_Termination
  191. Alternative initialization method with argc and argv. This is used by
  192. MIC, MPI, and SCC implementation. Do not call starpu_init() and
  193. starpu_initialize() in the same program.
  194. \fn int starpu_conf_init(struct starpu_conf *conf)
  195. \ingroup Initialization_and_Termination
  196. This function initializes the conf structure passed as argument with
  197. the default values. In case some configuration parameters are already
  198. specified through environment variables, starpu_conf_init initializes
  199. the fields of the structure according to the environment variables.
  200. For instance if STARPU_CALIBRATE is set, its value is put in the
  201. .calibrate field of the structure passed as argument. Upon successful
  202. completion, this function returns 0. Otherwise, -EINVAL indicates that
  203. the argument was NULL.
  204. \fn void starpu_shutdown(void)
  205. \ingroup Initialization_and_Termination
  206. This is StarPU termination method. It must be called at the end of the
  207. application: statistics and other post-mortem debugging information
  208. are not guaranteed to be available until this method has been called.
  209. \fn int starpu_asynchronous_copy_disabled(void)
  210. \ingroup Initialization_and_Termination
  211. Return 1 if asynchronous data transfers between CPU and accelerators
  212. are disabled.
  213. \fn int starpu_asynchronous_cuda_copy_disabled(void)
  214. \ingroup Initialization_and_Termination
  215. Return 1 if asynchronous data transfers between CPU and CUDA
  216. accelerators are disabled.
  217. \fn int starpu_asynchronous_opencl_copy_disabled(void)
  218. \ingroup Initialization_and_Termination
  219. Return 1 if asynchronous data transfers between CPU and OpenCL
  220. accelerators are disabled.
  221. \fn void starpu_topology_print(FILE *f)
  222. \ingroup Initialization_and_Termination
  223. Prints a description of the topology on f.
  224. */