/* * This file is part of the StarPU Handbook. * Copyright (C) 2009--2011 Universit@'e de Bordeaux 1 * Copyright (C) 2010, 2011, 2012, 2013 Centre National de la Recherche Scientifique * Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique * See the file version.doxy for copying conditions. */ /*! \defgroup Parallel_Tasks Parallel Tasks \fn int starpu_combined_worker_get_size(void) \ingroup Parallel_Tasks Return the size of the current combined worker, i.e. the total number of cpus running the same task in the case of ::STARPU_SPMD parallel tasks, or the total number of threads that the task is allowed to start in the case of ::STARPU_FORKJOIN parallel tasks. \fn int starpu_combined_worker_get_rank(void) \ingroup Parallel_Tasks Return the rank of the current thread within the combined worker. Can only be used in ::STARPU_FORKJOIN parallel tasks, to know which part of the task to work on. \fn unsigned starpu_combined_worker_get_count(void) \ingroup Parallel_Tasks Return the number of different combined workers. \fn int starpu_combined_worker_get_id(void) \ingroup Parallel_Tasks Return the identifier of the current combined worker. \fn int starpu_combined_worker_assign_workerid(int nworkers, int workerid_array[]) \ingroup Parallel_Tasks Register a new combined worker and get its identifier \fn int starpu_combined_worker_get_description(int workerid, int *worker_size, int **combined_workerid) \ingroup Parallel_Tasks Get the description of a combined worker \fn int starpu_combined_worker_can_execute_task(unsigned workerid, struct starpu_task *task, unsigned nimpl) \ingroup Parallel_Tasks Variant of starpu_worker_can_execute_task() compatible with combined workers \fn void starpu_parallel_task_barrier_init(struct starpu_task*task, int workerid) \ingroup Parallel_Tasks Initialise the barrier for the parallel task, and dispatch the task between the different combined workers. \struct starpu_machine_topology \ingroup Parallel_Tasks \var starpu_machine_topology::nworkers Total number of workers. \var starpu_machine_topology::ncombinedworkers Total number of combined workers. \var starpu_machine_topology::hwtopology Topology as detected by hwloc. To maintain ABI compatibility when hwloc is not available, the field is replaced with <c>void *dummy</c> \var starpu_machine_topology::nhwcpus Total number of CPUs, as detected by the topology code. May be different from the actual number of CPU workers. \var starpu_machine_topology::nhwcudagpus Total number of CUDA devices, as detected. May be different from the actual number of CUDA workers. \var starpu_machine_topology::nhwopenclgpus Total number of OpenCL devices, as detected. May be different from the actual number of OpenCL workers. \var starpu_machine_topology::ncpus Actual number of CPU workers used by StarPU. \var starpu_machine_topology::ncudagpus Actual number of CUDA workers used by StarPU. \var starpu_machine_topology::nopenclgpus Actual number of OpenCL workers used by StarPU. \var starpu_machine_topology::workers_bindid Indicates the successive cpu identifier that should be used to bind the workers. It is either filled according to the user’s explicit parameters (from starpu_conf()) or according to the STARPU_WORKERS_CPUID environment variable. Otherwise, a round-robin policy is used to distributed the workers over the cpus. \var starpu_machine_topology::workers_cuda_gpuid Indicates the successive cuda identifier that should be used by the CUDA driver. It is either filled according to the user’s explicit parameters (from starpu_conf()) or according to the STARPU_WORKERS_CUDAID environment variable. Otherwise, they are taken in ID order. \var starpu_machine_topology::workers_opencl_gpuid Indicates the successive OpenCL identifier that should be used by the OpenCL driver. It is either filled according to the user’s explicit parameters (from starpu_conf()) or according to the STARPU_WORKERS_OPENCLID environment variable. Otherwise, they are taken in ID order. */