initialization.doxy 11 KB

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