StarPU Handbook
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenMP Runtime Support

This section describes the interface provided for implementing OpenMP runtimes on top of StarPU. More...

Data Structures

struct  starpu_omp_lock_t
struct  starpu_omp_nest_lock_t
struct  starpu_omp_parallel_region_attr
struct  starpu_omp_task_region_attr

Enumerations

enum  starpu_omp_sched_value {
  starpu_omp_sched_undefined, starpu_omp_sched_static, starpu_omp_sched_dynamic, starpu_omp_sched_guided,
  starpu_omp_sched_auto, starpu_omp_sched_runtime
}
enum  starpu_omp_proc_bind_value {
  starpu_omp_proc_bind_undefined, starpu_omp_proc_bind_false, starpu_omp_proc_bind_true, starpu_omp_proc_bind_master,
  starpu_omp_proc_bind_close, starpu_omp_proc_bind_spread
}

Initialisation

#define STARPU_OPENMP
int starpu_omp_init (void) __STARPU_OMP_NOTHROW
void starpu_omp_shutdown (void) __STARPU_OMP_NOTHROW

Parallel

void starpu_omp_parallel_region (const struct starpu_omp_parallel_region_attr *attr) __STARPU_OMP_NOTHROW
void starpu_omp_master (void(*f)(void *arg), void *arg) __STARPU_OMP_NOTHROW
int starpu_omp_master_inline (void) __STARPU_OMP_NOTHROW

Synchronization

void starpu_omp_barrier (void) __STARPU_OMP_NOTHROW
void starpu_omp_critical (void(*f)(void *arg), void *arg, const char *name) __STARPU_OMP_NOTHROW
void starpu_omp_critical_inline_begin (const char *name) __STARPU_OMP_NOTHROW
void starpu_omp_critical_inline_end (const char *name) __STARPU_OMP_NOTHROW

Worksharing

void starpu_omp_single (void(*f)(void *arg), void *arg, int nowait) __STARPU_OMP_NOTHROW
int starpu_omp_single_inline (void) __STARPU_OMP_NOTHROW
void starpu_omp_single_copyprivate (void(*f)(void *arg, void *data, unsigned long long data_size), void *arg, void *data, unsigned long long data_size) __STARPU_OMP_NOTHROW
void * starpu_omp_single_copyprivate_inline_begin (void *data) __STARPU_OMP_NOTHROW
void starpu_omp_single_copyprivate_inline_end (void) __STARPU_OMP_NOTHROW
void starpu_omp_for (void(*f)(unsigned long long _first_i, unsigned long long _nb_i, void *arg), void *arg, unsigned long long nb_iterations, unsigned long long chunk, int schedule, int ordered, int nowait) __STARPU_OMP_NOTHROW
int starpu_omp_for_inline_first (unsigned long long nb_iterations, unsigned long long chunk, int schedule, int ordered, unsigned long long *_first_i, unsigned long long *_nb_i) __STARPU_OMP_NOTHROW
int starpu_omp_for_inline_next (unsigned long long nb_iterations, unsigned long long chunk, int schedule, int ordered, unsigned long long *_first_i, unsigned long long *_nb_i) __STARPU_OMP_NOTHROW
void starpu_omp_for_alt (void(*f)(unsigned long long _begin_i, unsigned long long _end_i, void *arg), void *arg, unsigned long long nb_iterations, unsigned long long chunk, int schedule, int ordered, int nowait) __STARPU_OMP_NOTHROW
int starpu_omp_for_inline_first_alt (unsigned long long nb_iterations, unsigned long long chunk, int schedule, int ordered, unsigned long long *_begin_i, unsigned long long *_end_i) __STARPU_OMP_NOTHROW
int starpu_omp_for_inline_next_alt (unsigned long long nb_iterations, unsigned long long chunk, int schedule, int ordered, unsigned long long *_begin_i, unsigned long long *_end_i) __STARPU_OMP_NOTHROW
void starpu_omp_ordered (void(*f)(void *arg), void *arg) __STARPU_OMP_NOTHROW
void starpu_omp_ordered_inline_begin (void) __STARPU_OMP_NOTHROW
void starpu_omp_ordered_inline_end (void) __STARPU_OMP_NOTHROW
void starpu_omp_sections (unsigned long long nb_sections, void(**section_f)(void *arg), void **section_arg, int nowait) __STARPU_OMP_NOTHROW
void starpu_omp_sections_combined (unsigned long long nb_sections, void(*section_f)(unsigned long long section_num, void *arg), void *section_arg, int nowait) __STARPU_OMP_NOTHROW

Task

void starpu_omp_task_region (const struct starpu_omp_task_region_attr *attr) __STARPU_OMP_NOTHROW
void starpu_omp_taskwait (void) __STARPU_OMP_NOTHROW
void starpu_omp_taskgroup (void(*f)(void *arg), void *arg) __STARPU_OMP_NOTHROW
void starpu_omp_taskgroup_inline_begin (void) __STARPU_OMP_NOTHROW
void starpu_omp_taskgroup_inline_end (void) __STARPU_OMP_NOTHROW

API

void starpu_omp_set_num_threads (int threads) __STARPU_OMP_NOTHROW
int starpu_omp_get_num_threads () __STARPU_OMP_NOTHROW
int starpu_omp_get_thread_num () __STARPU_OMP_NOTHROW
int starpu_omp_get_max_threads () __STARPU_OMP_NOTHROW
int starpu_omp_get_num_procs (void) __STARPU_OMP_NOTHROW
int starpu_omp_in_parallel (void) __STARPU_OMP_NOTHROW
void starpu_omp_set_dynamic (int dynamic_threads) __STARPU_OMP_NOTHROW
int starpu_omp_get_dynamic (void) __STARPU_OMP_NOTHROW
void starpu_omp_set_nested (int nested) __STARPU_OMP_NOTHROW
int starpu_omp_get_nested (void) __STARPU_OMP_NOTHROW
int starpu_omp_get_cancellation (void) __STARPU_OMP_NOTHROW
void starpu_omp_set_schedule (enum starpu_omp_sched_value kind, int modifier) __STARPU_OMP_NOTHROW
void starpu_omp_get_schedule (enum starpu_omp_sched_value *kind, int *modifier) __STARPU_OMP_NOTHROW
int starpu_omp_get_thread_limit (void) __STARPU_OMP_NOTHROW
void starpu_omp_set_max_active_levels (int max_levels) __STARPU_OMP_NOTHROW
int starpu_omp_get_max_active_levels (void) __STARPU_OMP_NOTHROW
int starpu_omp_get_level (void) __STARPU_OMP_NOTHROW
int starpu_omp_get_ancestor_thread_num (int level) __STARPU_OMP_NOTHROW
int starpu_omp_get_team_size (int level) __STARPU_OMP_NOTHROW
int starpu_omp_get_active_level (void) __STARPU_OMP_NOTHROW
int starpu_omp_in_final (void) __STARPU_OMP_NOTHROW
enum starpu_omp_proc_bind_value starpu_omp_get_proc_bind (void) __STARPU_OMP_NOTHROW
void starpu_omp_set_default_device (int device_num) __STARPU_OMP_NOTHROW
int starpu_omp_get_default_device (void) __STARPU_OMP_NOTHROW
int starpu_omp_get_num_devices (void) __STARPU_OMP_NOTHROW
int starpu_omp_get_num_teams (void) __STARPU_OMP_NOTHROW
int starpu_omp_get_team_num (void) __STARPU_OMP_NOTHROW
int starpu_omp_is_initial_device (void) __STARPU_OMP_NOTHROW
void starpu_omp_init_lock (starpu_omp_lock_t *lock) __STARPU_OMP_NOTHROW
void starpu_omp_destroy_lock (starpu_omp_lock_t *lock) __STARPU_OMP_NOTHROW
void starpu_omp_set_lock (starpu_omp_lock_t *lock) __STARPU_OMP_NOTHROW
void starpu_omp_unset_lock (starpu_omp_lock_t *lock) __STARPU_OMP_NOTHROW
int starpu_omp_test_lock (starpu_omp_lock_t *lock) __STARPU_OMP_NOTHROW
void starpu_omp_init_nest_lock (starpu_omp_nest_lock_t *lock) __STARPU_OMP_NOTHROW
void starpu_omp_destroy_nest_lock (starpu_omp_nest_lock_t *lock) __STARPU_OMP_NOTHROW
void starpu_omp_set_nest_lock (starpu_omp_nest_lock_t *lock) __STARPU_OMP_NOTHROW
void starpu_omp_unset_nest_lock (starpu_omp_nest_lock_t *lock) __STARPU_OMP_NOTHROW
int starpu_omp_test_nest_lock (starpu_omp_nest_lock_t *lock) __STARPU_OMP_NOTHROW
void starpu_omp_atomic_fallback_inline_begin (void) __STARPU_OMP_NOTHROW
void starpu_omp_atomic_fallback_inline_end (void) __STARPU_OMP_NOTHROW
double starpu_omp_get_wtime (void) __STARPU_OMP_NOTHROW
double starpu_omp_get_wtick (void) __STARPU_OMP_NOTHROW
void starpu_omp_vector_annotate (starpu_data_handle_t handle, uint32_t slice_base) __STARPU_OMP_NOTHROW

Detailed Description

This section describes the interface provided for implementing OpenMP runtimes on top of StarPU.


Data Structure Documentation

struct starpu_omp_lock_t

Opaque Simple Lock object (Simple Locks) for inter-task synchronization operations.

See Also
starpu_omp_init_lock()
starpu_omp_destroy_lock()
starpu_omp_set_lock()
starpu_omp_unset_lock()
starpu_omp_test_lock()
Data Fields
void * internal Is an opaque pointer for internal use.
struct starpu_omp_nest_lock_t
Data Fields
void * internal Is an opaque pointer for internal use.
struct starpu_omp_parallel_region_attr

Set of attributes used for creating a new parallel region.

See Also
starpu_omp_parallel_region()
Data Fields
struct starpu_codelet cl Is a starpu_codelet (Codelet And Tasks) to use for the parallel region implicit tasks. The codelet must provide a CPU implementation function.
starpu_data_handle_t * handles Is an array of zero or more starpu_data_handle_t data handle to be passed to the parallel region implicit tasks.
void * cl_arg Is an optional pointer to an inline argument to be passed to the region implicit tasks.
size_t cl_arg_size Is the size of the optional inline argument to be passed to the region implicit tasks, or 0 if unused.
unsigned cl_arg_free Is a boolean indicating whether the optional inline argument should be automatically freed (true), or not (false).
int if_clause Is a boolean indicating whether the if clause of the corresponding pragma omp parallel is true or false.
int num_threads Is an integer indicating the requested number of threads in the team of the newly created parallel region, or 0 to let the runtime choose the number of threads alone. This attribute may be ignored by the runtime system if the requested number of threads is higher than the number of threads that the runtime can create.
struct starpu_omp_task_region_attr

Set of attributes used for creating a new task region.

See Also
starpu_omp_task_region()
Data Fields
struct starpu_codelet cl Is a starpu_codelet (Codelet And Tasks) to use for the task region explicit task. The codelet must provide a CPU implementation function or an accelerator implementation for offloaded target regions.
starpu_data_handle_t * handles Is an array of zero or more starpu_data_handle_t data handle to be passed to the task region explicit tasks.
void * cl_arg Is an optional pointer to an inline argument to be passed to the region implicit tasks.
size_t cl_arg_size Is the size of the optional inline argument to be passed to the region implicit tasks, or 0 if unused.
unsigned cl_arg_free Is a boolean indicating whether the optional inline argument should be automatically freed (true), or not (false).
int priority
int if_clause Is a boolean indicating whether the if clause of the corresponding pragma omp task is true or false.
int final_clause Is a boolean indicating whether the final clause of the corresponding pragma omp task is true or false.
int untied_clause Is a boolean indicating whether the untied clause of the corresponding pragma omp task is true or false.
int mergeable_clause Is a boolean indicating whether the mergeable clause of the corresponding pragma omp task is true or false.

Macro Definition Documentation

#define STARPU_OPENMP

This macro is defined when StarPU has been installed with OpenMP Runtime support. It should be used in your code to detect the availability of the runtime support for OpenMP.

Enumeration Type Documentation

Set of constants for selecting the for loop iteration scheduling algorithm (Parallel For) as defined by the OpenMP specification.

Enumerator:
starpu_omp_sched_undefined 

Undefined iteration scheduling algorithm.

starpu_omp_sched_static 

Static iteration scheduling algorithm.

starpu_omp_sched_dynamic 

Dynamic iteration scheduling algorithm.

starpu_omp_sched_guided 

Guided iteration scheduling algorithm.

starpu_omp_sched_auto 

Automatically choosen iteration scheduling algorithm.

starpu_omp_sched_runtime 

Choice of iteration scheduling algorithm deferred at runtime.

See Also
starpu_omp_for()
starpu_omp_for_inline_first()
starpu_omp_for_inline_next()
starpu_omp_for_alt()
starpu_omp_for_inline_first_alt()
starpu_omp_for_inline_next_alt()

Set of constants for selecting the processor binding method, as defined in the OpenMP specification.

Enumerator:
starpu_omp_proc_bind_undefined 

Undefined processor binding method.

starpu_omp_proc_bind_false 

Team threads may be moved between places at any time.

starpu_omp_proc_bind_true 

Team threads may not be moved between places.

starpu_omp_proc_bind_master 

Assign every thread in the team to the same place as the master thread.

starpu_omp_proc_bind_close 

Assign every thread in the team to a place close to the parent thread.

starpu_omp_proc_bind_spread 

Assign team threads as a sparse distribution over the selected places.

See Also
starpu_omp_get_proc_bind()

Function Documentation

int starpu_omp_init ( void  )

Initializes StarPU and its OpenMP Runtime support.

void starpu_omp_shutdown ( void  )

Shutdown StarPU and its OpenMP Runtime support.

void starpu_omp_parallel_region ( const struct starpu_omp_parallel_region_attr attr)

Generates and launch an OpenMP parallel region and return after its completion. attr specifies the attributes for the generated parallel region. If this function is called from inside another, generating, parallel region, the generated parallel region is nested within the generating parallel region.

This function can be used to implement #pragma omp parallel.

void starpu_omp_master ( void(*)(void *arg)  f,
void *  arg 
)

Executes a function only on the master thread of the OpenMP parallel region it is called from. When called from a thread that is not the master of the parallel region it is called from, this function does nothing. f is the function to be called. arg is an argument passed to function f.

This function can be used to implement #pragma omp master.

int starpu_omp_master_inline ( void  )

Determines whether the calling thread is the master of the OpenMP parallel region it is called from or not.

This function can be used to implement #pragma omp master without code outlining.

Returns
!0 if called by the region's master thread.
0 if not called by the region's master thread.
void starpu_omp_barrier ( void  )

Waits until each participating thread of the innermost OpenMP parallel region has reached the barrier and each explicit OpenMP task bound to this region has completed its execution.

This function can be used to implement #pragma omp barrier.

void starpu_omp_critical ( void(*)(void *arg)  f,
void *  arg,
const char *  name 
)

Waits until no other thread is executing within the context of the selected critical section, then proceeds to the exclusive execution of a function within the critical section. f is the function to be executed in the critical section. arg is an argument passed to function f. name is the name of the selected critical section. If name == NULL, the selected critical section is the unique anonymous critical section.

This function can be used to implement #pragma omp critical.

void starpu_omp_critical_inline_begin ( const char *  name)

Waits until execution can proceed exclusively within the context of the selected critical section. name is the name of the selected critical section. If name == NULL, the selected critical section is the unique anonymous critical section.

This function together with starpu_omp_critical_inline_end can be used to implement #pragma omp critical without code outlining.

void starpu_omp_critical_inline_end ( const char *  name)

Ends the exclusive execution within the context of the selected critical section. name is the name of the selected critical section. If name==NULL, the selected critical section is the unique anonymous critical section.

This function together with starpu_omp_critical_inline_begin can be used to implement #pragma omp critical without code outlining.

void starpu_omp_single ( void(*)(void *arg)  f,
void *  arg,
int  nowait 
)

Ensures that a single participating thread of the innermost OpenMP parallel region executes a function. f is the function to be executed by a single thread. arg is an argument passed to function f. nowait is a flag indicating whether an implicit barrier is requested after the single section (nowait==0) or not (nowait==!0).

This function can be used to implement #pragma omp single.

int starpu_omp_single_inline ( void  )

Decides whether the current thread is elected to run the following single section among the participating threads of the innermost OpenMP parallel region.

This function can be used to implement #pragma omp single without code outlining.

Returns
!0 if the calling thread has won the election.
0 if the calling thread has lost the election.
void starpu_omp_single_copyprivate ( void(*)(void *arg, void *data, unsigned long long data_size)  f,
void *  arg,
void *  data,
unsigned long long  data_size 
)

This function executes f on a single task of the current parallel region task, and then broadcast the contents of the memory block pointed by the copyprivate pointer data and of size data_size to the corresponding data pointed memory blocks of all the other participating region tasks. This function can be used to implement #pragma omp single with a copyprivate clause.

See Also
starpu_omp_single_copyprivate_inline
starpu_omp_single_copyprivate_inline_begin
starpu_omp_single_copyprivate_inline_end
void * starpu_omp_single_copyprivate_inline_begin ( void *  data)

This function elects one task among the tasks of the current parallel region task to execute the following single section, and then broadcast the copyprivate pointer data to all the other participating region tasks. This function can be used to implement #pragma omp single with a copyprivate clause without code outlining.

See Also
starpu_omp_single_copyprivate_inline
starpu_omp_single_copyprivate_inline_end
void starpu_omp_single_copyprivate_inline_end ( void  )

This function completes the execution of a single section and returns the broadcasted copyprivate pointer for tasks that lost the election and NULL for the task that won the election. This function can be used to implement #pragma omp single with a copyprivate clause without code outlining.

Returns
the copyprivate pointer for tasks that lost the election and therefore did not execute the code of the single section.
NULL for the task that won the election and executed the code of the single section.
See Also
starpu_omp_single_copyprivate_inline
starpu_omp_single_copyprivate_inline_begin
void starpu_omp_for ( void(*)(unsigned long long _first_i, unsigned long long _nb_i, void *arg)  f,
void *  arg,
unsigned long long  nb_iterations,
unsigned long long  chunk,
int  schedule,
int  ordered,
int  nowait 
)

Executes a parallel loop together with the other threads participating to the innermost parallel region. f is the function to be executed iteratively. arg is an argument passed to function f. nb_iterations is the number of iterations to be performed by the parallel loop. chunk is the number of consecutive iterations that should be affected to the same thread when scheduling the loop workshares, it follows the semantics of the modifier argument in OpenMP #pragma omp for specification. schedule is the scheduling mode according to the OpenMP specification. ordered is a flag indicating whether the loop region may contain an ordered section (ordered==!0) or not (ordered==0). nowait is a flag indicating whether an implicit barrier is requested after the for section (nowait==0) or not (nowait==!0).

The function f will be called with arguments _first_i, the first iteration to perform, _nb_i, the number of consecutive iterations to perform before returning, arg, the free arg argument.

This function can be used to implement #pragma omp for.

int starpu_omp_for_inline_first ( unsigned long long  nb_iterations,
unsigned long long  chunk,
int  schedule,
int  ordered,
unsigned long long *  _first_i,
unsigned long long *  _nb_i 
)

Decides whether the current thread should start to execute a parallel loop section. See starpu_omp_for for the argument description.

This function together with starpu_omp_for_inline_next can be used to implement #pragma omp for without code outlining.

Returns
!0 if the calling thread participates to the loop region and should execute a first chunk of iterations. In that case, *_first_i will be set to the first iteration of the chunk to perform and *_nb_i will be set to the number of iterations of the chunk to perform.
0 if the calling thread does not participate to the loop region because all the available iterations have been affected to the other threads of the parallel region.
See Also
starpu_omp_for
int starpu_omp_for_inline_next ( unsigned long long  nb_iterations,
unsigned long long  chunk,
int  schedule,
int  ordered,
unsigned long long *  _first_i,
unsigned long long *  _nb_i 
)

Decides whether the current thread should continue to execute a parallel loop section. See starpu_omp_for for the argument description.

This function together with starpu_omp_for_inline_first can be used to implement #pragma omp for without code outlining.

Returns
!0 if the calling thread should execute a next chunk of iterations. In that case, *_first_i will be set to the first iteration of the chunk to perform and *_nb_i will be set to the number of iterations of the chunk to perform.
0 if the calling thread does not participate anymore to the loop region because all the available iterations have been affected to the other threads of the parallel region.
See Also
starpu_omp_for
void starpu_omp_for_alt ( void(*)(unsigned long long _begin_i, unsigned long long _end_i, void *arg)  f,
void *  arg,
unsigned long long  nb_iterations,
unsigned long long  chunk,
int  schedule,
int  ordered,
int  nowait 
)

Alternative implementation of a parallel loop. This function differs from starpu_omp_for in the expected arguments of the loop function f.

The function f will be called with arguments _begin_i, the first iteration to perform, _end_i, the first iteration not to perform before returning, arg, the free arg argument.

This function can be used to implement #pragma omp for.

See Also
starpu_omp_for
int starpu_omp_for_inline_first_alt ( unsigned long long  nb_iterations,
unsigned long long  chunk,
int  schedule,
int  ordered,
unsigned long long *  _begin_i,
unsigned long long *  _end_i 
)

Inline version of the alternative implementation of a parallel loop.

This function together with starpu_omp_for_inline_next_alt can be used to implement #pragma omp for without code outlining.

See Also
starpu_omp_for
starpu_omp_for_alt
starpu_omp_for_inline_first
int starpu_omp_for_inline_next_alt ( unsigned long long  nb_iterations,
unsigned long long  chunk,
int  schedule,
int  ordered,
unsigned long long *  _begin_i,
unsigned long long *  _end_i 
)

Inline version of the alternative implementation of a parallel loop.

This function together with starpu_omp_for_inline_first_alt can be used to implement #pragma omp for without code outlining.

See Also
starpu_omp_for
starpu_omp_for_alt
starpu_omp_for_inline_next
void starpu_omp_ordered ( void(*)(void *arg)  f,
void *  arg 
)

Ensures that a function is sequentially executed once for each iteration in order within a parallel loop, by the thread that own the iteration. f is the function to be executed by the thread that own the current iteration. arg is an argument passed to function f.

This function can be used to implement #pragma omp ordered.

void starpu_omp_ordered_inline_begin ( void  )

Waits until all the iterations of a parallel loop below the iteration owned by the current thread have been executed.

This function together with starpu_omp_ordered_inline_end can be used to implement #pragma omp ordered without code code outlining.

void starpu_omp_ordered_inline_end ( void  )

Notifies that the ordered section for the current iteration has been completed.

This function together with starpu_omp_ordered_inline_begin can be used to implement #pragma omp ordered without code code outlining.

void starpu_omp_sections ( unsigned long long  nb_sections,
void(**)(void *arg)  section_f,
void **  section_arg,
int  nowait 
)

Ensures that each function of a given array of functions is executed by one and only one thread. nb_sections is the number of functions in the array section_f. section_f is the array of functions to be executed as sections. section_arg is an array of arguments to be passed to the corresponding function. nowait is a flag indicating whether an implicit barrier is requested after the execution of all the sections (nowait==0) or not (nowait==!0).

This function can be used to implement #pragma omp sections and #pragma omp section.

void starpu_omp_sections_combined ( unsigned long long  nb_sections,
void(*)(unsigned long long section_num, void *arg)  section_f,
void *  section_arg,
int  nowait 
)

Alternative implementation of sections. This function differs from starpu_omp_sections in that all the sections are combined within a single function in this version. section_f is the function implementing the combined sections.

The function section_f will be called with arguments section_num, the section number to be executed, arg, the entry of section_arg corresponding to this section.

This function can be used to implement #pragma omp sections and #pragma omp section.

See Also
starpu_omp_sections
void starpu_omp_task_region ( const struct starpu_omp_task_region_attr attr)

Generates an explicit child task. The execution of the generated task is asynchronous with respect to the calling code unless specified otherwise. attr specifies the attributes for the generated task region.

This function can be used to implement #pragma omp task.

void starpu_omp_taskwait ( void  )

Waits for the completion of the tasks generated by the current task. This function does not wait for the descendants of the tasks generated by the current task.

This function can be used to implement #pragma omp taskwait.

void starpu_omp_taskgroup ( void(*)(void *arg)  f,
void *  arg 
)

Launches a function and wait for the completion of every descendant task generated during the execution of the function.

This function can be used to implement #pragma omp taskgroup.

See Also
starpu_omp_taskgroup_inline_begin
starpu_omp_taskgroup_inline_end
void starpu_omp_taskgroup_inline_begin ( void  )

Launches a function and gets ready to wait for the completion of every descendant task generated during the dynamic scope of the taskgroup.

This function can be used to implement #pragma omp taskgroup without code outlining.

See Also
starpu_omp_taskgroup
starpu_omp_taskgroup_inline_end
void starpu_omp_taskgroup_inline_end ( void  )

Waits for the completion of every descendant task generated during the dynamic scope of the taskgroup.

This function can be used to implement #pragma omp taskgroup without code outlining.

See Also
starpu_omp_taskgroup
starpu_omp_taskgroup_inline_begin
void starpu_omp_set_num_threads ( int  threads)

This function sets ICVS nthreads_var for the parallel regions to be created with the current region.

Note: The StarPU OpenMP runtime support currently ignores this setting for nested parallel regions.

See Also
starpu_omp_get_num_threads
starpu_omp_get_thread_num
starpu_omp_get_max_threads
starpu_omp_get_num_procs
int starpu_omp_get_num_threads ( )

This function returns the number of threads of the current region.

Returns
the number of threads of the current region.
See Also
starpu_omp_set_num_threads
starpu_omp_get_thread_num
starpu_omp_get_max_threads
starpu_omp_get_num_procs
int starpu_omp_get_thread_num ( )

This function returns the rank of the current thread among the threads of the current region.

Returns
the rank of the current thread in the current region.
See Also
starpu_omp_set_num_threads
starpu_omp_get_num_threads
starpu_omp_get_max_threads
starpu_omp_get_num_procs
int starpu_omp_get_max_threads ( )

This function returns the maximum number of threads that can be used to create a region from the current region.

Returns
the maximum number of threads that can be used to create a region from the current region.
See Also
starpu_omp_set_num_threads
starpu_omp_get_num_threads
starpu_omp_get_thread_num
starpu_omp_get_num_procs
int starpu_omp_get_num_procs ( void  )

This function returns the number of StarPU CPU workers.

Returns
the number of StarPU CPU workers.
See Also
starpu_omp_set_num_threads
starpu_omp_get_num_threads
starpu_omp_get_thread_num
starpu_omp_get_max_threads
int starpu_omp_in_parallel ( void  )

This function returns whether it is called from the scope of a parallel region or not.

Returns
!0 if called from a parallel region scope.
0 otherwise.
void starpu_omp_set_dynamic ( int  dynamic_threads)

This function enables (1) or disables (0) dynamically adjusting the number of parallel threads.

Note: The StarPU OpenMP runtime support currently ignores the argument of this function.

See Also
starpu_omp_get_dynamic
int starpu_omp_get_dynamic ( void  )

This function returns the state of dynamic thread number adjustment.

Returns
!0 if dynamic thread number adjustment is enabled.
0 otherwise.
See Also
starpu_omp_set_dynamic
void starpu_omp_set_nested ( int  nested)

This function enables (1) or disables (0) nested parallel regions.

Note: The StarPU OpenMP runtime support currently ignores the argument of this function.

See Also
starpu_omp_get_nested
starpu_omp_get_max_active_levels
starpu_omp_set_max_active_levels
starpu_omp_get_level
starpu_omp_get_active_level
int starpu_omp_get_nested ( void  )

This function returns whether nested parallel sections are enabled or not.

Returns
!0 if nested parallel sections are enabled.
0 otherwise.
See Also
starpu_omp_set_nested
starpu_omp_get_max_active_levels
starpu_omp_set_max_active_levels
starpu_omp_get_level
starpu_omp_get_active_level
int starpu_omp_get_cancellation ( void  )

This function returns the state of the cancel ICVS var.

void starpu_omp_set_schedule ( enum starpu_omp_sched_value  kind,
int  modifier 
)

This function sets the default scheduling kind for upcoming loops within the current parallel section. kind is the scheduler kind, modifier complements the scheduler kind with informations such as the chunk size, in accordance with the OpenMP specification.

See Also
starpu_omp_get_schedule
void starpu_omp_get_schedule ( enum starpu_omp_sched_value kind,
int *  modifier 
)

This function returns the current selected default loop scheduler.

Returns
the kind and the modifier of the current default loop scheduler.
See Also
starpu_omp_set_schedule
int starpu_omp_get_thread_limit ( void  )

This function returns the number of StarPU CPU workers.

Returns
the number of StarPU CPU workers.
void starpu_omp_set_max_active_levels ( int  max_levels)

This function sets the maximum number of allowed active parallel section levels.

Note: The StarPU OpenMP runtime support currently ignores the argument of this function and assume max_levels equals 1 instead.

See Also
starpu_omp_set_nested
starpu_omp_get_nested
starpu_omp_get_max_active_levels
starpu_omp_get_level
starpu_omp_get_active_level
int starpu_omp_get_max_active_levels ( void  )

This function returns the current maximum number of allowed active parallel section levels

Returns
the current maximum number of allowed active parallel section levels.
See Also
starpu_omp_set_nested
starpu_omp_get_nested
starpu_omp_set_max_active_levels
starpu_omp_get_level
starpu_omp_get_active_level
int starpu_omp_get_level ( void  )

This function returns the nesting level of the current parallel section.

Returns
the nesting level of the current parallel section.
See Also
starpu_omp_set_nested
starpu_omp_get_nested
starpu_omp_get_max_active_levels
starpu_omp_set_max_active_levels
starpu_omp_get_active_level
int starpu_omp_get_ancestor_thread_num ( int  level)

This function returns the number of the ancestor of the current parallel section.

Returns
the number of the ancestor of the current parallel section.
int starpu_omp_get_team_size ( int  level)

This function returns the size of the team of the current parallel section.

Returns
the size of the team of the current parallel section.
int starpu_omp_get_active_level ( void  )

This function returns the nestinglevel of the current innermost active parallel section.

Returns
the nestinglevel of the current innermost active parallel section.
See Also
starpu_omp_set_nested
starpu_omp_get_nested
starpu_omp_get_max_active_levels
starpu_omp_set_max_active_levels
starpu_omp_get_level
int starpu_omp_in_final ( void  )

This function checks whether the current task is final or not.

Returns
!0 if called from a final task.
0 otherwise.
enum starpu_omp_proc_bind_value starpu_omp_get_proc_bind ( void  )

This function returns the proc_bind setting of the current parallel region.

Returns
the proc_bind setting of the current parallel region.
void starpu_omp_set_default_device ( int  device_num)

This function sets the number of the device to use as default.

Note: The StarPU OpenMP runtime support currently ignores the argument of this function.

See Also
starpu_omp_get_default_device
starpu_omp_is_initial_device
int starpu_omp_get_default_device ( void  )

This function returns the number of the device used as default.

Returns
the number of the device used as default.
See Also
starpu_omp_set_default_device
starpu_omp_is_initial_device
int starpu_omp_get_num_devices ( void  )

This function returns the number of the devices.

Returns
the number of the devices.
int starpu_omp_get_num_teams ( void  )

This function returns the number of teams in the current teams region.

Returns
the number of teams in the current teams region.
See Also
starpu_omp_get_num_teams
int starpu_omp_get_team_num ( void  )

This function returns the team number of the calling thread.

Returns
the team number of the calling thread.
See Also
starpu_omp_get_num_teams
int starpu_omp_is_initial_device ( void  )

This function checks whether the current device is the initial device or not.

Returns
!0 if called from the host device.
0 otherwise.
See Also
starpu_omp_set_default_device
starpu_omp_get_default_device
void starpu_omp_init_lock ( starpu_omp_lock_t lock)

This function initializes an opaque lock object.

See Also
starpu_omp_destroy_lock
starpu_omp_set_lock
starpu_omp_unset_lock
starpu_omp_test_lock
void starpu_omp_destroy_lock ( starpu_omp_lock_t lock)

This function destroys an opaque lock object.

See Also
starpu_omp_init_lock
starpu_omp_set_lock
starpu_omp_unset_lock
starpu_omp_test_lock
void starpu_omp_set_lock ( starpu_omp_lock_t lock)

This function locks an opaque lock object. If the lock is already locked, the function will block until it succeeds in exclusively acquiring the lock.

See Also
starpu_omp_init_lock
starpu_omp_destroy_lock
starpu_omp_unset_lock
starpu_omp_test_lock
void starpu_omp_unset_lock ( starpu_omp_lock_t lock)

This function unlocks a previously locked lock object. The behaviour of this function is unspecified if it is called on an unlocked lock object.

See Also
starpu_omp_init_lock
starpu_omp_destroy_lock
starpu_omp_set_lock
starpu_omp_test_lock
int starpu_omp_test_lock ( starpu_omp_lock_t lock)

This function unblockingly attempts to lock a lock object and returns whether it succeeded or not.

Returns
!0 if the function succeeded in acquiring the lock.
0 if the lock was already locked.
See Also
starpu_omp_init_lock
starpu_omp_destroy_lock
starpu_omp_set_lock
starpu_omp_unset_lock
void starpu_omp_init_nest_lock ( starpu_omp_nest_lock_t lock)

This function initializes an opaque lock object supporting nested locking operations.

See Also
starpu_omp_destroy_nest_lock
starpu_omp_set_nest_lock
starpu_omp_unset_nest_lock
starpu_omp_test_nest_lock
void starpu_omp_destroy_nest_lock ( starpu_omp_nest_lock_t lock)

This function destroys an opaque lock object supporting nested locking operations.

See Also
starpu_omp_init_nest_lock
starpu_omp_set_nest_lock
starpu_omp_unset_nest_lock
starpu_omp_test_nest_lock
void starpu_omp_set_nest_lock ( starpu_omp_nest_lock_t lock)

This function locks an opaque lock object supporting nested locking operations. If the lock is already locked by another task, the function will block until it succeeds in exclusively acquiring the lock. If the lock is already taken by the current task, the function will increase the nested locking level of the lock object.

See Also
starpu_omp_init_nest_lock
starpu_omp_destroy_nest_lock
starpu_omp_unset_nest_lock
starpu_omp_test_nest_lock
void starpu_omp_unset_nest_lock ( starpu_omp_nest_lock_t lock)

This function unlocks a previously locked lock object supporting nested locking operations. If the lock has been locked multiple times in nested fashion, the nested locking level is decreased and the lock remains locked. Otherwise, if the lock has only been locked once, it becomes unlocked. The behaviour of this function is unspecified if it is called on an unlocked lock object. The behaviour of this function is unspecified if it is called from a different task than the one that locked the lock object.

See Also
starpu_omp_init_nest_lock
starpu_omp_destroy_nest_lock
starpu_omp_set_nest_lock
starpu_omp_test_nest_lock
int starpu_omp_test_nest_lock ( starpu_omp_nest_lock_t lock)

This function unblocking attempts to lock an opaque lock object supporting nested locking operations and returns whether it succeeded or not. If the lock is already locked by another task, the function will return without having acquired the lock. If the lock is already taken by the current task, the function will increase the nested locking level of the lock object.

Returns
!0 if the function succeeded in acquiring the lock.
0 if the lock was already locked.
See Also
starpu_omp_init_nest_lock
starpu_omp_destroy_nest_lock
starpu_omp_set_nest_lock
starpu_omp_unset_nest_lock
void starpu_omp_atomic_fallback_inline_begin ( void  )

This function implements the entry point of a fallback global atomic region. It blocks until it succeeds in acquiring exclusive access to the global atomic region.

See Also
starpu_omp_atomic_fallback_inline_end
void starpu_omp_atomic_fallback_inline_end ( void  )

This function implements the exit point of a fallback global atomic region. It release the exclusive access to the global atomic region.

See Also
starpu_omp_atomic_fallback_inline_begin
double starpu_omp_get_wtime ( void  )

This function returns the elapsed wallclock time in seconds.

Returns
the elapsed wallclock time in seconds.
See Also
starpu_omp_get_wtick
double starpu_omp_get_wtick ( void  )

This function returns the precision of the time used by starpu_omp_get_wtime.

Returns
the precision of the time used by starpu_omp_get_wtime.
See Also
starpu_omp_get_wtime
void starpu_omp_vector_annotate ( starpu_data_handle_t  handle,
uint32_t  slice_base 
)

This function enables setting additional vector metadata needed by the OpenMP Runtime Support.

handle is vector data handle. slice_base is the base of an array slice, expressed in number of vector elements from the array base.

See Also
STARPU_VECTOR_GET_SLICE_BASE