FXT Support
===========

 -- Function: void starpu_fxt_start_profiling (void)
     Start recording the trace. The trace is by default started from starpu_init() call, but can be paused by using starpu_fxt_stop_profiling, in which case starpu_fxt_start_profiling should be called to specify when to resume recording events.

 -- Function: void starpu_fxt_stop_profiling (void)
     Stop recording the trace. The trace is by default stopped at starpu_shutdown() call. starpu_fxt_stop_profiling can however be used to stop it earlier. starpu_fxt_start_profiling can then be called to start recording it again, etc.

MPI
===

Initialisation
--------------

 -- Function: int starpu_mpi_init (int *ARGC, char ***ARGV, int initialize_mpi)
     Initializes the starpumpi library. initialize_mpi indicates if MPI should be initialized or not by StarPU. If the value is not 0, MPI will be initialized by calling MPI_Init_Thread(argc, argv, MPI_THREAD_SERIALIZED, ...).

 -- Function: int starpu_mpi_initialize (void)
     This function has been made deprecated. One should use instead the function starpu_mpi_init() defined above. This function does not call MPI_Init, it should be called beforehand.

 -- Function: int starpu_mpi_initialize_extended (int *RANK, int *WORLD_SIZE)
     This function has been made deprecated. One should use instead the function starpu_mpi_init() defined above. MPI will be initialized by starpumpi by calling MPI_Init_Thread(argc, argv, MPI_THREAD_SERIALIZED, ...).

 -- Function: int starpu_mpi_shutdown (void)
     Cleans the starpumpi library. This must be called between calling starpu_mpi functions and starpu_shutdown(). MPI_Finalize() will be called if StarPU-MPI has been initialized by starpu_mpi_init().

 -- Function: void starpu_mpi_comm_amounts_retrieve (size_t *COMM_AMOUNTS)
     Retrieve the current amount of communications from the current node in the array comm_amounts which must have a size greater or equal to the world size. Communications statistics must be enabled (see STARPU_COMM_STATS).

Communication
-------------

 -- Function: int starpu_mpi_send (starpu_data_handle_t DATA_HANDLE, int DEST, int MPI_TAG, MPI_Comm COMM)
     Performs a standard-mode, blocking send of DATA_HANDLE to the node DEST using the message tag mpi_tag within the communicator COMM.

 -- Function: int starpu_mpi_recv (starpu_data_handle_t DATA_HANDLE, int SOURCE, int MPI_TAG, MPI_Comm COMM, MPI_Status *STATUS)
     Performs a standard-mode, blocking receive in DATA_HANDLE from the node SOURCE using the message tag mpi_tag within the communicator COMM.

 -- Function: int starpu_mpi_isend (starpu_data_handle_t DATA_HANDLE, starpu_mpi_req *REQ, int DEST, int MPI_TAG, MPI_Comm COMM)
     Posts a standard-mode, non blocking send of DATA_HANDLE to the node DEST using the message tag mpi_tag within the communicator COMM. After the call, the pointer to the request REQ can be used to test or to wait for the completion of the communication.

 -- Function: int starpu_mpi_irecv (starpu_data_handle_t DATA_HANDLE, starpu_mpi_req *REQ, int SOURCE, int MPI_TAG, MPI_Comm COMM)
     Posts a nonblocking receive in DATA_HANDLE from the node SOURCE using the message tag mpi_tag within the communicator COMM. After the call, the pointer to the request REQ can be used to test or to wait for the completion of the communication.

 -- Function: int starpu_mpi_isend_detached (starpu_data_handle_t DATA_HANDLE, int DEST, int MPI_TAG, MPI_Comm COMM, void (*CALLBACK)(void *), void *ARG)
     Posts a standard-mode, non blocking send of DATA_HANDLE to the node DEST using the message tag mpi_tag within the communicator COMM. On completion, the CALLBACK function is called with the argument ARG. Similarly to the pthread detached functionality, when a detached communication completes, its resources are automatically released back to the system, there is no need to test or to wait for the completion of the request.

 -- Function: int starpu_mpi_irecv_detached (starpu_data_handle_t DATA_HANDLE, int SOURCE, int MPI_TAG, MPI_Comm COMM, void (*CALLBACK)(void *), void *ARG)
     Posts a nonblocking receive in DATA_HANDLE from the node SOURCE using the message tag mpi_tag within the communicator COMM. On completion, the CALLBACK function is called with the argument ARG. Similarly to the pthread detached functionality, when a detached communication completes, its resources are automatically released back to the system, there is no need to test or to wait for the completion of the request.

 -- Function: int starpu_mpi_wait (starpu_mpi_req *REQ, MPI_Status *STATUS)
     Returns when the operation identified by request REQ is complete.

 -- Function: int starpu_mpi_test (starpu_mpi_req *REQ, int *FLAG, MPI_Status *STATUS)
     If the operation identified by REQ is complete, set FLAG to 1. The STATUS object is set to contain information on the completed operation.

 -- Function: int starpu_mpi_barrier (MPI_Comm COMM)
     Blocks the caller until all group members of the communicator COMM have called it.

 -- Function: int starpu_mpi_isend_detached_unlock_tag (starpu_data_handle_t DATA_HANDLE, int DEST, int MPI_TAG, MPI_Comm COMM, starpu_tag_t TAG)
     Posts a standard-mode, non blocking send of DATA_HANDLE to the node DEST using the message tag mpi_tag within the communicator COMM. On completion, TAG is unlocked.

 -- Function: int starpu_mpi_irecv_detached_unlock_tag (starpu_data_handle_t DATA_HANDLE, int SOURCE, int MPI_TAG, MPI_Comm COMM, starpu_tag_t TAG)
     Posts a nonblocking receive in DATA_HANDLE from the node SOURCE using the message tag mpi_tag within the communicator COMM. On completion, TAG is unlocked.

 -- Function: int starpu_mpi_isend_array_detached_unlock_tag (unsigned ARRAY_SIZE, starpu_data_handle_t *DATA_HANDLE, int *DEST, int *MPI_TAG, MPI_Comm *COMM, starpu_tag_t TAG)
     Posts ARRAY_SIZE standard-mode, non blocking send. Each post sends the n-th data of the array DATA_HANDLE to the n-th node of the array DEST using the n-th message tag of the array mpi_tag within the n-th communicator of the array COMM. On completion of the all the requests, TAG is unlocked.

 -- Function: int starpu_mpi_irecv_array_detached_unlock_tag (unsigned ARRAY_SIZE, starpu_data_handle_t *DATA_HANDLE, int *SOURCE, int *MPI_TAG, MPI_Comm *COMM, starpu_tag_t TAG)
     Posts ARRAY_SIZE nonblocking receive. Each post receives in the n-th data of the array DATA_HANDLE from the n-th node of the array SOURCE using the n-th message tag of the array mpi_tag within the n-th communicator of the array COMM. On completion of the all the requests, TAG is unlocked.

Communication cache
-------------------

 -- Function: void starpu_mpi_cache_flush (MPI_Comm COMM, starpu_data_handle_t DATA_HANDLE)
     Clear the send and receive communication cache for the data DATA_HANDLE. The function has to be called synchronously by all the MPI nodes. The function does nothing if the cache mechanism is disabled (see STARPU_MPI_CACHE).

 -- Function: void starpu_mpi_cache_flush_all_data (MPI_Comm COMM)
     Clear the send and receive communication cache for all data. The function has to be called synchronously by all the MPI nodes. The function does nothing if the cache mechanism is disabled (see STARPU_MPI_CACHE).

Task Bundles
============

 -- Data Type: starpu_task_bundle_t
     Opaque structure describing a list of tasks that should be scheduled on the same worker whenever it's possible. It must be considered as a hint given to the scheduler as there is no guarantee that they will be executed on the same worker.

 -- Function: void starpu_task_bundle_create (starpu_task_bundle_t *BUNDLE)
     Factory function creating and initializing BUNDLE, when the call returns, memory needed is allocated and BUNDLE is ready to use.

 -- Function: int starpu_task_bundle_insert (starpu_task_bundle_t BUNDLE, struct starpu_task *TASK)
     Insert TASK in BUNDLE. Until TASK is removed from BUNDLE its expected length and data transfer time will be considered along those of the other tasks of BUNDLE. This function mustn't be called if BUNDLE is already closed and/or TASK is already submitted.

 -- Function: int starpu_task_bundle_remove (starpu_task_bundle_t BUNDLE, struct starpu_task *TASK)
     Remove TASK from BUNDLE. Of course TASK must have been previously inserted BUNDLE. This function mustn't be called if BUNDLE is already closed and/or TASK is already submitted. Doing so would result in undefined behaviour.

 -- Function: void starpu_task_bundle_close (starpu_task_bundle_t BUNDLE)
     Inform the runtime that the user won't modify BUNDLE anymore, it means no more inserting or removing task. Thus the runtime can destroy it when possible.

 -- Function: double starpu_task_bundle_expected_length (starpu_task_bundle_t BUNDLE, enum starpu_perf_archtype ARCH, unsigned NIMPL)
     Return the expected duration of the entire task bundle in µs.

 -- Function: double starpu_task_bundle_expected_power (starpu_task_bundle_t BUNDLE, enum starpu_perf_archtype ARCH, unsigned NIMPL)
     Return the expected power consumption of the entire task bundle in J.

 -- Function: double starpu_task_bundle_expected_data_transfer_time (starpu_task_bundle_t BUNDLE, unsigned MEMORY_NODE)
     Return the time (in µs) expected to transfer all data used within the bundle.

Task Lists
==========

 -- Data Type: struct starpu_task_list
     Stores a double-chained list of tasks

 -- Function: void starpu_task_list_init (struct starpu_task_list *LIST)
     Initialize a list structure

 -- Function: void starpu_task_list_push_front (struct starpu_task_list *LIST, struct starpu_task *TASK)
     Push a task at the front of a list

 -- Function: void starpu_task_list_push_back (struct starpu_task_list *LIST, struct starpu_task *TASK)
     Push a task at the back of a list

 -- Function: struct starpu_task * starpu_task_list_front (struct starpu_task_list *LIST)
     Get the front of the list (without removing it)

 -- Function: struct starpu_task * starpu_task_list_back (struct starpu_task_list *LIST)
     Get the back of the list (without removing it)

 -- Function: int starpu_task_list_empty (struct starpu_task_list *LIST)
     Test if a list is empty

 -- Function: void starpu_task_list_erase (struct starpu_task_list *LIST, struct starpu_task *TASK)
     Remove an element from the list

 -- Function: struct starpu_task * starpu_task_list_pop_front (struct starpu_task_list *LIST)
     Remove the element at the front of the list

 -- Function: struct starpu_task * starpu_task_list_pop_back (struct starpu_task_list *LIST)
     Remove the element at the back of the list

 -- Function: struct starpu_task * starpu_task_list_begin (struct starpu_task_list *LIST)
     Get the first task of the list.

 -- Function: struct starpu_task * starpu_task_list_end (struct starpu_task_list *LIST)
     Get the end of the list.

 -- Function: struct starpu_task * starpu_task_list_next (struct starpu_task *TASK)
     Get the next task of the list. This is not erase-safe.

Using Parallel Tasks
====================

These are used by parallel tasks:

 -- Function: int starpu_combined_worker_get_size (void)
     Return the size of the current combined worker, i.e. the total number of cpus running the same task in the case of SPMD parallel tasks, or the total number of threads that the task is allowed to start in the case of FORKJOIN parallel tasks.

 -- Function: int starpu_combined_worker_get_rank (void)
     Return the rank of the current thread within the combined worker. Can only be used in FORKJOIN parallel tasks, to know which part of the task to work on.

Most of these are used for schedulers which support parallel tasks.

 -- Function: unsigned starpu_combined_worker_get_count (void)
     Return the number of different combined workers.

 -- Function: int starpu_combined_worker_get_id (void)
     Return the identifier of the current combined worker.

 -- Function: int starpu_combined_worker_assign_workerid (int NWORKERS, int WORKERID_ARRAY[])
     Register a new combined worker and get its identifier

 -- Function: int starpu_combined_worker_get_description (int WORKERID, int *WORKER_SIZE, int **COMBINED_WORKERID)
     Get the description of a combined worker

 -- Function: int starpu_combined_worker_can_execute_task (unsigned WORKERID, struct starpu_task *TASK, unsigned NIMPL)
     Variant of starpu_worker_can_execute_task compatible with combined workers

 -- Data Type: struct starpu_machine_topology

     unsigned nworkers
          Total number of workers.

     unsigned ncombinedworkers
          Total number of combined workers.

     hwloc_topology_t hwtopology
          Topology as detected by hwloc.

          To maintain ABI compatibility when hwloc is not available, the field is replaced with void *dummy

     unsigned nhwcpus
          Total number of CPUs, as detected by the topology code. May be different from the actual number of CPU workers.

     unsigned nhwcudagpus
          Total number of CUDA devices, as detected. May be different from the actual number of CUDA workers.

     unsigned nhwopenclgpus
          Total number of OpenCL devices, as detected. May be different from the actual number of CUDA workers.

     unsigned ncpus
          Actual number of CPU workers used by StarPU.

     unsigned ncudagpus
          Actual number of CUDA workers used by StarPU.

     unsigned nopenclgpus
          Actual number of OpenCL workers used by StarPU.

     unsigned workers_bindid[STARPU_NMAXWORKERS]
          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 env. variable. Otherwise, a round-robin policy is used to distributed the workers over the cpus.

     unsigned workers_cuda_gpuid[STARPU_NMAXWORKERS]
          Indicates the successive cpu 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 env. variable. Otherwise, they are taken in ID order.

     unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS]
          Indicates the successive cpu 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 env. variable. Otherwise, they are taken in ID order.

Scheduling Contexts
===================

StarPU permits on one hand grouping workers in combined workers in order to execute a parallel task and on the other hand grouping tasks in bundles that will be executed by a single specified worker. In contrast when we group workers in scheduling contexts we submit starpu tasks to them and we schedule them with the policy assigned to the context. Scheduling contexts can be created, deleted and modified dynamically.

 -- Function: unsigned starpu_sched_ctx_create (const char *POLICY_NAME, int *WORKERIDS_CTX, int NWORKERS_CTX, const char *SCHED_CTX_NAME)
     This function creates a scheduling context which uses the scheduling policy indicated in the first argument and assigns the workers indicated in the second argument to execute the tasks submitted to it. The return value represents the identifier of the context that has just been created. It will be further used to indicate the context the tasks will be submitted to. The return value should be at most STARPU_NMAX_SCHED_CTXS.

 -- Function: void starpu_sched_ctx_delete (unsigned SCHED_CTX_ID)
     Delete scheduling context SCHED_CTX_ID and transfer remaining workers to the inheritor scheduling context.

 -- Function: void starpu_sched_ctx_add_workers (int *WORKERIDS_CTX, int NWORKERS_CTX, unsigned SCHED_CTX_ID)
     This function adds dynamically the workers indicated in the first argument to the context indicated in the last argument. The last argument cannot be greater than  STARPU_NMAX_SCHED_CTXS.

 -- Function: void starpu_sched_ctx_remove_workers (int *WORKERIDS_CTX, int NWORKERS_CTX, unsigned SCHED_CTX_ID)
     This function removes the workers indicated in the first argument from the context indicated in the last argument. The last argument cannot be greater than  STARPU_NMAX_SCHED_CTXS.

A scheduling context manages a collection of workers that can be memorized using different data structures. Thus, a generic structure is available in order to simplify the choice of its type. Only the list data structure is available but further data structures(like tree) implementations are foreseen.

 -- Data Type: struct starpu_worker_collection

     void *workerids
          The workerids managed by the collection

     unsigned nworkers
          The number of workerids

     pthread_key_t cursor_key (optional)
          The cursor needed to iterate the collection (depending on the data structure)

     int type
          The type of structure (currently STARPU_WORKER_LIST is the only one available)

     unsigned (*has_next)(struct starpu_worker_collection *workers)
          Checks if there is a next worker

     int (*get_next)(struct starpu_worker_collection *workers)
          Gets the next worker

     int (*add)(struct starpu_worker_collection *workers, int worker)
          Adds a worker to the collection

     int (*remove)(struct starpu_worker_collection *workers, int worker)
          Removes a worker from the collection

     void* (*init)(struct starpu_worker_collection *workers)
          Initialize the collection

     void (*deinit)(struct starpu_worker_collection *workers)
          Deinitialize the colection

     void (*init_cursor)(struct starpu_worker_collection *workers) (optional)
          Initialize the cursor if there is one

     void (*deinit_cursor)(struct starpu_worker_collection *workers) (optional)
          Deinitialize the cursor if there is one

 -- Function: struct starpu_worker_collection* starpu_sched_ctx_create_worker_collection (unsigned SCHED_CTX_ID, int TYPE)
     Create a worker collection of the type indicated by the last parameter for the context specified through the first parameter.

 -- Function: void starpu_sched_ctx_delete_worker_collection (unsigned SCHED_CTX_ID)
     Delete the worker collection of the specified scheduling context

 -- Function: struct starpu_worker_collection* starpu_sched_ctx_get_worker_collection (unsigned SCHED_CTX_ID)
     Return the worker collection managed by the indicated context

 -- Function: pthread_mutex_t* starpu_sched_ctx_get_changing_ctx_mutex (unsigned SCHED_CTX_ID)
     TODO

 -- Function: void starpu_sched_ctx_set_context (unsigned *SCHED_CTX_ID)
     Set the scheduling context the subsequent tasks will be submitted to

 -- Function: unsigned starpu_sched_ctx_get_context (void)
     Return the scheduling context the tasks are currently submitted to

 -- Function: unsigned starpu_sched_ctx_get_nworkers (unsigned SCHED_CTX_ID)
     Return the number of workers managed by the specified contexts (Usually needed to verify if it manages any workers or if it should be blocked)

 -- Function: unsigned starpu_sched_ctx_get_nshared_workers (unsigned SCHED_CTX_ID, unsigned SCHED_CTX_ID2)
     Return the number of workers shared by two contexts

Scheduling Policy
=================

TODO

While StarPU comes with a variety of scheduling policies (see Task scheduling policy), it may sometimes be desirable to implement custom policies to address specific problems.  The API described below allows users to write their own scheduling policy.

 -- Data Type: struct starpu_sched_policy
     This structure contains all the methods that implement a scheduling policy.  An application may specify which scheduling strategy in the sched_policy field of the starpu_conf structure passed to the starpu_init function. The different fields are:

     void (*init_sched)(unsigned sched_ctx_id)
          Initialize the scheduling policy.

     void (*deinit_sched)(unsigned sched_ctx_id)
          Cleanup the scheduling policy.

     int (*push_task)(struct starpu_task *)
          Insert a task into the scheduler.

     void (*push_task_notify)(struct starpu_task *, int workerid)
          Notify the scheduler that a task was pushed on a given worker. This method is called when a task that was explicitely assigned to a worker becomes ready and is about to be executed by the worker. This method therefore permits to keep the state of of the scheduler coherent even when StarPU bypasses the scheduling strategy.

     struct starpu_task *(*pop_task)(unsigned sched_ctx_id) (optional)
          Get a task from the scheduler. The mutex associated to the worker is already taken when this method is called. If this method is defined as NULL, the worker will only execute tasks from its local queue. In this case, the push_task method should use the starpu_push_local_task method to assign tasks to the different workers.

     struct starpu_task *(*pop_every_task)(unsigned sched_ctx_id)
          Remove all available tasks from the scheduler (tasks are chained by the means of the prev and next fields of the starpu_task structure). The mutex associated to the worker is already taken when this method is called. This is currently not used.

     void (*pre_exec_hook)(struct starpu_task *) (optional)
          This method is called every time a task is starting.

     void (*post_exec_hook)(struct starpu_task *) (optional)
          This method is called every time a task has been executed.

     void (*add_workers)(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
          Initialize scheduling structures corresponding to each worker used by the policy.

     void (*remove_workers)(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
          Deinitialize scheduling structures corresponding to each worker used by the policy.

     const char *policy_name (optional)
          Name of the policy.

     const char *policy_description (optional)
          Description of the policy.

 -- Function: struct starpu_sched_policy ** starpu_sched_get_predefined_policies ()
     Return an NULL-terminated array of all the predefined scheduling policies.

 -- Function: void starpu_sched_ctx_set_policy_data (unsigned SCHED_CTX_ID, void * POLICY_DATA)
     Each scheduling policy uses some specific data (queues, variables, additional condition variables). It is memorize through a local structure. This function assigns it to a scheduling context.

 -- Function: void* starpu_sched_ctx_get_policy_data (unsigned SCHED_CTX_ID)
     Returns the policy data previously assigned to a context

 -- Function: void starpu_task_set_min_priority (int MIN_PRIO)
     Defines the minimum task priority level supported by the scheduling policy. The default minimum priority level is the same as the default priority level which is 0 by convention.  The application may access that value by calling the starpu_task_get_min_priority function. This function should only be called from the initialization method of the scheduling policy, and should not be used directly from the application.

 -- Function: void starpu_task_set_max_priority (int MAX_PRIO)
     Defines the maximum priority level supported by the scheduling policy. The default maximum priority level is 1.  The application may access that value by calling the starpu_task_get_max_priority function. This function should only be called from the initialization method of the scheduling policy, and should not be used directly from the application.

 -- Function: int starpu_task_get_min_priority (void)
     Returns the current minimum priority level supported by the scheduling policy

 -- Function: int starpu_task_get_max_priority (void)
     Returns the current maximum priority level supported by the scheduling policy

 -- Function: int starpu_push_local_task (int WORKERID, struct starpu_task *TASK, int BACK)
     The scheduling policy may put tasks directly into a worker's local queue so that it is not always necessary to create its own queue when the local queue is sufficient. If BACK not null, TASK is put at the back of the queue where the worker will pop tasks first. Setting BACK to 0 therefore ensures a FIFO ordering.

 -- Function: int starpu_push_task_end (struct starpu_task *TASK)
     This function must be called by a scheduler to notify that the given task has just been pushed.

 -- Function: int starpu_worker_can_execute_task (unsigned WORKERID, struct starpu_task *TASK, unsigned nimpl)
     Check if the worker specified by workerid can execute the codelet. Schedulers need to call it before assigning a task to a worker, otherwise the task may fail to execute.

 -- Function: double starpu_timing_now (void)
     Return the current date in µs

 -- Function: uint32_t starpu_task_footprint (struct starpu_perfmodel *MODEL, struct starpu_task * TASK, enum starpu_perf_archtype ARCH, unsigned NIMPL)
     Returns the footprint for a given task

 -- Function: double starpu_task_expected_length (struct starpu_task *TASK, enum starpu_perf_archtype ARCH, unsigned NIMPL)
     Returns expected task duration in µs

 -- Function: double starpu_worker_get_relative_speedup (enum starpu_perf_archtype PERF_ARCHTYPE)
     Returns an estimated speedup factor relative to CPU speed

 -- Function: double starpu_task_expected_data_transfer_time (unsigned MEMORY_NODE, struct starpu_task *TASK)
     Returns expected data transfer time in µs

 -- Function: double starpu_data_expected_transfer_time (starpu_data_handle_t HANDLE, unsigned MEMORY_NODE, enum starpu_access_mode MODE)
     Predict the transfer time (in µs) to move a handle to a memory node

 -- Function: double starpu_task_expected_power (struct starpu_task *TASK, enum starpu_perf_archtype ARCH, unsigned NIMPL)
     Returns expected power consumption in J

 -- Function: double starpu_task_expected_conversion_time (struct starpu_task *TASK, enum starpu_perf_archtype ARCH, unsigned nimpl)
     Returns expected conversion time in ms (multiformat interface only)

Running drivers
===============

 -- Function: int starpu_driver_run (struct starpu_driver *D)
     Initialize the given driver, run it until it receives a request to terminate, deinitialize it and return 0 on success. It returns -EINVAL if d->type is not a valid StarPU device type (STARPU_CPU_WORKER, STARPU_CUDA_WORKER or STARPU_OPENCL_WORKER). This is the same as using the following functions: calling starpu_driver_init(), then calling starpu_driver_run_once() in a loop, and eventually starpu_driver_deinit().

 -- Function: int starpu_driver_init (struct starpu_driver *D)
     Initialize the given driver. Returns 0 on success, -EINVAL if d->type is not a valid StarPU device type (STARPU_CPU_WORKER, STARPU_CUDA_WORKER or STARPU_OPENCL_WORKER).

 -- Function: int starpu_driver_run_once (struct starpu_driver *D)
     Run the driver once, then returns 0 on success, -EINVAL if d->type is not a valid StarPU device type (STARPU_CPU_WORKER, STARPU_CUDA_WORKER or STARPU_OPENCL_WORKER).

 -- Function: int starpu_driver_deinit (struct starpu_driver *D)
     Deinitialize the given driver. Returns 0 on success, -EINVAL if d->type is not a valid StarPU device type (STARPU_CPU_WORKER, STARPU_CUDA_WORKER or STARPU_OPENCL_WORKER).

 -- Function: void starpu_drivers_request_termination (void)
     Notify all running drivers they should terminate.

Expert mode
===========

 -- Function: void starpu_wake_all_blocked_workers (void)
     Wake all the workers, so they can inspect data requests and task submissions again.

 -- Function: int starpu_progression_hook_register (unsigned (*FUNC)(void *arg), void *ARG)
     Register a progression hook, to be called when workers are idle.

 -- Function: void starpu_progression_hook_deregister (int HOOK_ID)
     Unregister a given progression hook.