initialization.doxy 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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_WORKER,
  14. ::STARPU_CUDA_WORKER and ::STARPU_OPENCL_WORKER 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 environment variable \ref STARPU_SCHED. (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 environment variable \ref STARPU_NCPU . (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 environment variable \ref STARPU_NCUDA. (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 environment variable \ref STARPU_NOPENCL.
  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 environment variable \ref STARPU_WORKERS_CPUID. (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 environment variable \ref
  68. STARPU_WORKERS_CUDAID. (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 environment variable \ref
  78. STARPU_WORKERS_OPENCLID. (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 environment variable \ref STARPU_BUS_CALIBRATE. (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 environment variable \ref STARPU_CALIBRATE. (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 environment
  120. variable \ref STARPU_SINGLE_COMBINED_WORKER.
  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 environment variable \ref
  129. STARPU_DISABLE_ASYNCHRONOUS_COPY. 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 \ref disable-asynchronous-copy. (default = 0)
  135. \var starpu_conf::disable_asynchronous_cuda_copy
  136. This flag should be set to 1 to disable
  137. asynchronous copies between CPUs and CUDA accelerators.
  138. This can also be specified with the environment variable
  139. \ref STARPU_DISABLE_ASYNCHRONOUS_CUDA_COPY.
  140. This can also be specified at compilation time by giving to
  141. the configure script the option \ref disable-asynchronous-cuda-copy. (default = 0)
  142. \var starpu_conf::disable_asynchronous_opencl_copy
  143. This flag should be set to 1 to disable
  144. asynchronous copies between CPUs and OpenCL accelerators.
  145. This can also be specified with the environment
  146. variable \ref STARPU_DISABLE_ASYNCHRONOUS_OPENCL_COPY. The AMD
  147. implementation of OpenCL is known to fail
  148. when copying data asynchronously. When using this
  149. implementation, it is therefore necessary to disable
  150. asynchronous data transfers. This can also be specified at
  151. compilation time by giving to the configure script the
  152. option \ref disable-asynchronous-opencl-copy. (default
  153. = 0)
  154. \var starpu_conf::disable_asynchronous_mic_copy
  155. indicate if asynchronous copies to MIC devices should be disabled
  156. \var starpu_conf::cuda_opengl_interoperability
  157. Enable CUDA/OpenGL interoperation on these CUDA
  158. devices. This can be set to an array of CUDA device
  159. identifiers for which cudaGLSetGLDevice() should be called
  160. instead of cudaSetDevice(). Its size is specified by the
  161. starpu_conf::n_cuda_opengl_interoperability field below
  162. (default = NULL)
  163. \var starpu_conf::n_cuda_opengl_interoperability
  164. \var starpu_conf::not_launched_drivers
  165. Array of drivers that should not be launched by
  166. StarPU. The application will run in one of its own
  167. threads. (default = NULL)
  168. \var starpu_conf::n_not_launched_drivers
  169. The number of StarPU drivers that should not be
  170. launched by StarPU. (default = 0)
  171. \var starpu_conf::trace_buffer_size
  172. Specifies the buffer size used for FxT tracing.
  173. Starting from FxT version 0.2.12, the buffer will
  174. automatically be flushed when it fills in, but it may still
  175. be interesting to specify a bigger value to avoid any
  176. flushing (which would disturb the trace).
  177. \fn int starpu_init(struct starpu_conf *conf)
  178. \ingroup API_Initialization_and_Termination
  179. This is StarPU initialization method, which must be called prior to
  180. any other StarPU call. It is possible to specify StarPU’s
  181. configuration (e.g. scheduling policy, number of cores, ...) by
  182. passing a non-null argument. Default configuration is used if the
  183. passed argument is NULL. Upon successful completion, this function
  184. returns 0. Otherwise, -ENODEV indicates that no worker was available
  185. (so that StarPU was not initialized).
  186. \fn int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
  187. \ingroup API_Initialization_and_Termination
  188. Alternative initialization method with argc and argv. This is used by
  189. MIC, MPI, and SCC implementation. Do not call starpu_init() and
  190. starpu_initialize() in the same program.
  191. \fn int starpu_conf_init(struct starpu_conf *conf)
  192. \ingroup API_Initialization_and_Termination
  193. This function initializes the conf structure passed as argument with
  194. the default values. In case some configuration parameters are already
  195. specified through environment variables, starpu_conf_init() initializes
  196. the fields of the structure according to the environment variables.
  197. For instance if \ref STARPU_CALIBRATE is set, its value is put in the
  198. field starpu_conf::calibrate of the structure passed as argument. Upon successful
  199. completion, this function returns 0. Otherwise, -EINVAL indicates that
  200. the argument was NULL.
  201. \fn void starpu_shutdown(void)
  202. \ingroup API_Initialization_and_Termination
  203. This is StarPU termination method. It must be called at the end of the
  204. application: statistics and other post-mortem debugging information
  205. are not guaranteed to be available until this method has been called.
  206. \fn int starpu_asynchronous_copy_disabled(void)
  207. \ingroup API_Initialization_and_Termination
  208. Return 1 if asynchronous data transfers between CPU and accelerators
  209. are disabled.
  210. \fn int starpu_asynchronous_cuda_copy_disabled(void)
  211. \ingroup API_Initialization_and_Termination
  212. Return 1 if asynchronous data transfers between CPU and CUDA
  213. accelerators are disabled.
  214. \fn int starpu_asynchronous_opencl_copy_disabled(void)
  215. \ingroup API_Initialization_and_Termination
  216. Return 1 if asynchronous data transfers between CPU and OpenCL
  217. accelerators are disabled.
  218. \fn void starpu_topology_print(FILE *f)
  219. \ingroup API_Initialization_and_Termination
  220. Prints a description of the topology on f.
  221. */