StarPU Handbook
Miscellaneous Helpers


#define STARPU_MIN(a, b)
#define STARPU_MAX(a, b)


char * starpu_getenv (const char *str)
static __starpu_inline int starpu_get_env_number (const char *str)
static __starpu_inline int starpu_get_env_number_default (const char *str, int defval)
static __starpu_inline float starpu_get_env_float_default (const char *str, float defval)
void starpu_execute_on_each_worker (void(*func)(void *), void *arg, uint32_t where)
void starpu_execute_on_each_worker_ex (void(*func)(void *), void *arg, uint32_t where, const char *name)
void starpu_execute_on_specific_workers (void(*func)(void *), void *arg, unsigned num_workers, unsigned *workers, const char *name)
double starpu_timing_now (void)
int starpu_data_cpy (starpu_data_handle_t dst_handle, starpu_data_handle_t src_handle, int asynchronous, void(*callback_func)(void *), void *callback_arg)


int _starpu_silent

Detailed Description

Macro Definition Documentation


#define STARPU_MIN (   a,

Return the min of the two parameters.


#define STARPU_MAX (   a,

Return the max of the two parameters.



Define a value which can be used to mark pointers as invalid values.

Function Documentation

◆ starpu_get_env_number()

static __starpu_inline int starpu_get_env_number ( const char *  str)

Return the integer value of the environment variable named str. Return 0 otherwise (the variable does not exist or has a non-integer value).

◆ starpu_execute_on_each_worker()

void starpu_execute_on_each_worker ( void(*)(void *)  func,
void *  arg,
uint32_t  where 

Execute the given function func on a subset of workers. When calling this method, the offloaded function func is executed by every StarPU worker that are eligible to execute the function. The argument arg is passed to the offloaded function. The argument where specifies on which types of processing units the function should be executed. Similarly to the field starpu_codelet::where, it is possible to specify that the function should be executed on every CUDA device and every CPU by passing STARPU_CPU|STARPU_CUDA. This function blocks until func has been executed on every appropriate processing units, and thus may not be called from a callback function for instance.

◆ starpu_execute_on_each_worker_ex()

void starpu_execute_on_each_worker_ex ( void(*)(void *)  func,
void *  arg,
uint32_t  where,
const char *  name 

Same as starpu_execute_on_each_worker(), except that the task name is specified in the argument name.

◆ starpu_execute_on_specific_workers()

void starpu_execute_on_specific_workers ( void(*)(void *)  func,
void *  arg,
unsigned  num_workers,
unsigned *  workers,
const char *  name 

Call func(arg) on every worker in the workers array. num_workers indicates the number of workers in this array. This function is synchronous, but the different workers may execute the function in parallel.

◆ starpu_timing_now()

double starpu_timing_now ( void  )

Return the current date in micro-seconds.

◆ starpu_data_cpy()

int starpu_data_cpy ( starpu_data_handle_t  dst_handle,
starpu_data_handle_t  src_handle,
int  asynchronous,
void(*)(void *)  callback_func,
void *  callback_arg 

Copy the content of src_handle into dst_handle. The parameter asynchronous indicates whether the function should block or not. In the case of an asynchronous call, it is possible to synchronize with the termination of this operation either by the means of implicit dependencies (if enabled) or by calling starpu_task_wait_for_all(). If callback_func is not NULL, this callback function is executed after the handle has been copied, and it is given the pointer callback_arg as argument.