StarPU Handbook - StarPU Language Bindings
Loading...
Searching...
No Matches
Interoperability Support

This section describes the interface supplied by StarPU to interoperate with other runtime systems. More...

Typedefs

typedef int starpurm_drs_ret_t
 
typedef void * starpurm_drs_desc_t
 
typedef void * starpurm_drs_cbs_t
 
typedef void(* starpurm_drs_cb_t) (void *)
 
typedef void * starpurm_block_cond_t
 
typedef int(* starpurm_polling_t) (void *)
 

Enumerations

enum  e_starpurm_drs_ret { starpurm_DRS_SUCCESS , starpurm_DRS_DISABLD , starpurm_DRS_PERM , starpurm_DRS_EINVAL }
 

Initialisation

void starpurm_initialize_with_cpuset (hwloc_cpuset_t initially_owned_cpuset)
 
void starpurm_initialize (void)
 
void starpurm_shutdown (void)
 

Spawn

void starpurm_spawn_kernel_on_cpus (void *data, void(*f)(void *), void *args, hwloc_cpuset_t cpuset)
 
void starpurm_spawn_kernel_on_cpus_callback (void *data, void(*f)(void *), void *args, hwloc_cpuset_t cpuset, void(*cb_f)(void *), void *cb_args)
 
void starpurm_spawn_kernel_callback (void *data, void(*f)(void *), void *args, void(*cb_f)(void *), void *cb_args)
 

DynamicResourceSharing

starpurm_drs_ret_t starpurm_set_drs_enable (starpurm_drs_desc_t *spd)
 
starpurm_drs_ret_t starpurm_set_drs_disable (starpurm_drs_desc_t *spd)
 
int starpurm_drs_enabled_p (void)
 
starpurm_drs_ret_t starpurm_set_max_parallelism (starpurm_drs_desc_t *spd, int max)
 
starpurm_drs_ret_t starpurm_assign_cpu_to_starpu (starpurm_drs_desc_t *spd, int cpuid)
 
starpurm_drs_ret_t starpurm_assign_cpus_to_starpu (starpurm_drs_desc_t *spd, int ncpus)
 
starpurm_drs_ret_t starpurm_assign_cpu_mask_to_starpu (starpurm_drs_desc_t *spd, const hwloc_cpuset_t mask)
 
starpurm_drs_ret_t starpurm_assign_all_cpus_to_starpu (starpurm_drs_desc_t *spd)
 
starpurm_drs_ret_t starpurm_withdraw_cpu_from_starpu (starpurm_drs_desc_t *spd, int cpuid)
 
starpurm_drs_ret_t starpurm_withdraw_cpus_from_starpu (starpurm_drs_desc_t *spd, int ncpus)
 
starpurm_drs_ret_t starpurm_withdraw_cpu_mask_from_starpu (starpurm_drs_desc_t *spd, const hwloc_cpuset_t mask)
 
starpurm_drs_ret_t starpurm_withdraw_all_cpus_from_starpu (starpurm_drs_desc_t *spd)
 
starpurm_drs_ret_t starpurm_lend (starpurm_drs_desc_t *spd)
 
starpurm_drs_ret_t starpurm_lend_cpu (starpurm_drs_desc_t *spd, int cpuid)
 
starpurm_drs_ret_t starpurm_lend_cpus (starpurm_drs_desc_t *spd, int ncpus)
 
starpurm_drs_ret_t starpurm_lend_cpu_mask (starpurm_drs_desc_t *spd, const hwloc_cpuset_t mask)
 
starpurm_drs_ret_t starpurm_reclaim (starpurm_drs_desc_t *spd)
 
starpurm_drs_ret_t starpurm_reclaim_cpu (starpurm_drs_desc_t *spd, int cpuid)
 
starpurm_drs_ret_t starpurm_reclaim_cpus (starpurm_drs_desc_t *spd, int ncpus)
 
starpurm_drs_ret_t starpurm_reclaim_cpu_mask (starpurm_drs_desc_t *spd, const hwloc_cpuset_t mask)
 
starpurm_drs_ret_t starpurm_acquire (starpurm_drs_desc_t *spd)
 
starpurm_drs_ret_t starpurm_acquire_cpu (starpurm_drs_desc_t *spd, int cpuid)
 
starpurm_drs_ret_t starpurm_acquire_cpus (starpurm_drs_desc_t *spd, int ncpus)
 
starpurm_drs_ret_t starpurm_acquire_cpu_mask (starpurm_drs_desc_t *spd, const hwloc_cpuset_t mask)
 
starpurm_drs_ret_t starpurm_return_all (starpurm_drs_desc_t *spd)
 
starpurm_drs_ret_t starpurm_return_cpu (starpurm_drs_desc_t *spd, int cpuid)
 

Devices

int starpurm_get_device_type_id (const char *type_str)
 
const char * starpurm_get_device_type_name (int type_id)
 
int starpurm_get_nb_devices_by_type (int type_id)
 
int starpurm_get_device_id (int type_id, int device_rank)
 
starpurm_drs_ret_t starpurm_assign_device_to_starpu (starpurm_drs_desc_t *spd, int type_id, int unit_rank)
 
starpurm_drs_ret_t starpurm_assign_devices_to_starpu (starpurm_drs_desc_t *spd, int type_id, int ndevices)
 
starpurm_drs_ret_t starpurm_assign_device_mask_to_starpu (starpurm_drs_desc_t *spd, const hwloc_cpuset_t mask)
 
starpurm_drs_ret_t starpurm_assign_all_devices_to_starpu (starpurm_drs_desc_t *spd, int type_id)
 
starpurm_drs_ret_t starpurm_withdraw_device_from_starpu (starpurm_drs_desc_t *spd, int type_id, int unit_rank)
 
starpurm_drs_ret_t starpurm_withdraw_devices_from_starpu (starpurm_drs_desc_t *spd, int type_id, int ndevices)
 
starpurm_drs_ret_t starpurm_withdraw_device_mask_from_starpu (starpurm_drs_desc_t *spd, const hwloc_cpuset_t mask)
 
starpurm_drs_ret_t starpurm_withdraw_all_devices_from_starpu (starpurm_drs_desc_t *spd, int type_id)
 
starpurm_drs_ret_t starpurm_lend_device (starpurm_drs_desc_t *spd, int type_id, int unit_rank)
 
starpurm_drs_ret_t starpurm_lend_devices (starpurm_drs_desc_t *spd, int type_id, int ndevices)
 
starpurm_drs_ret_t starpurm_lend_device_mask (starpurm_drs_desc_t *spd, const hwloc_cpuset_t mask)
 
starpurm_drs_ret_t starpurm_lend_all_devices (starpurm_drs_desc_t *spd, int type_id)
 
starpurm_drs_ret_t starpurm_reclaim_device (starpurm_drs_desc_t *spd, int type_id, int unit_rank)
 
starpurm_drs_ret_t starpurm_reclaim_devices (starpurm_drs_desc_t *spd, int type_id, int ndevices)
 
starpurm_drs_ret_t starpurm_reclaim_device_mask (starpurm_drs_desc_t *spd, const hwloc_cpuset_t mask)
 
starpurm_drs_ret_t starpurm_reclaim_all_devices (starpurm_drs_desc_t *spd, int type_id)
 
starpurm_drs_ret_t starpurm_acquire_device (starpurm_drs_desc_t *spd, int type_id, int unit_rank)
 
starpurm_drs_ret_t starpurm_acquire_devices (starpurm_drs_desc_t *spd, int type_id, int ndevices)
 
starpurm_drs_ret_t starpurm_acquire_device_mask (starpurm_drs_desc_t *spd, const hwloc_cpuset_t mask)
 
starpurm_drs_ret_t starpurm_acquire_all_devices (starpurm_drs_desc_t *spd, int type_id)
 
starpurm_drs_ret_t starpurm_return_all_devices (starpurm_drs_desc_t *spd, int type_id)
 
starpurm_drs_ret_t starpurm_return_device (starpurm_drs_desc_t *spd, int type_id, int unit_rank)
 

CpusetsQueries

hwloc_cpuset_t starpurm_get_device_worker_cpuset (int type_id, int unit_rank)
 
hwloc_cpuset_t starpurm_get_global_cpuset (void)
 
hwloc_cpuset_t starpurm_get_selected_cpuset (void)
 
hwloc_cpuset_t starpurm_get_all_cpu_workers_cpuset (void)
 
hwloc_cpuset_t starpurm_get_all_device_workers_cpuset (void)
 
hwloc_cpuset_t starpurm_get_all_device_workers_cpuset_by_type (int typeid)
 

Detailed Description

This section describes the interface supplied by StarPU to interoperate with other runtime systems.

Enumeration Type Documentation

◆ e_starpurm_drs_ret

StarPU Resource Manager return type.

Enumerator
starpurm_DRS_SUCCESS 

Dynamic resource sharing operation succeeded.

starpurm_DRS_DISABLD 

Dynamic resource sharing is disabled.

starpurm_DRS_PERM 

Dynamic resource sharing operation is not authorized or implemented.

starpurm_DRS_EINVAL 

Dynamic resource sharing operation has been called with one or more invalid parameters.

Function Documentation

◆ starpurm_initialize_with_cpuset()

void starpurm_initialize_with_cpuset ( hwloc_cpuset_t  initially_owned_cpuset)

Resource enforcement

◆ starpurm_initialize()

void starpurm_initialize ( void  )

Initialize StarPU and the StarPU-RM resource management module. The starpu_init() function should not have been called before the call to starpurm_initialize(). The starpurm_initialize() function will take care of this

◆ starpurm_shutdown()

void starpurm_shutdown ( void  )

Shutdown StarPU-RM and StarPU. The starpu_shutdown() function should not be called before. The starpurm_shutdown() function will take care of this.

◆ starpurm_spawn_kernel_on_cpus()

void starpurm_spawn_kernel_on_cpus ( void *  data,
void(*)(void *)  f,
void *  args,
hwloc_cpuset_t  cpuset 
)

Allocate a temporary context spanning the units selected in the cpuset bitmap, set it as the default context for the current thread, and call user function f. Upon the return of user function f, the temporary context is freed and the previous default context for the current thread is restored.

◆ starpurm_spawn_kernel_on_cpus_callback()

void starpurm_spawn_kernel_on_cpus_callback ( void *  data,
void(*)(void *)  f,
void *  args,
hwloc_cpuset_t  cpuset,
void(*)(void *)  cb_f,
void *  cb_args 
)

Spawn a POSIX thread and returns immediately. The thread spawned will allocate a temporary context spanning the units selected in the cpuset bitmap, set it as the default context for the current thread, and call user function f. Upon the return of user function f, the temporary context will be freed and the previous default context for the current thread restored. A user specified callback cb_f will be called just before the termination of the thread.

◆ starpurm_set_drs_enable()

starpurm_drs_ret_t starpurm_set_drs_enable ( starpurm_drs_desc_t *  spd)

Turn-on dynamic resource sharing support.

◆ starpurm_set_drs_disable()

starpurm_drs_ret_t starpurm_set_drs_disable ( starpurm_drs_desc_t *  spd)

Turn-off dynamic resource sharing support.

◆ starpurm_drs_enabled_p()

int starpurm_drs_enabled_p ( void  )

Return the state of the dynamic resource sharing support (=!0 enabled, =0 disabled).

◆ starpurm_set_max_parallelism()

starpurm_drs_ret_t starpurm_set_max_parallelism ( starpurm_drs_desc_t *  spd,
int  max 
)

Set the maximum number of CPU computing units available for StarPU computations to max. This number cannot exceed the maximum number of StarPU's CPU worker allocated at start-up time.

◆ starpurm_assign_cpu_to_starpu()

starpurm_drs_ret_t starpurm_assign_cpu_to_starpu ( starpurm_drs_desc_t *  spd,
int  cpuid 
)

Extend StarPU's default scheduling context to execute tasks on worker corresponding to logical unit cpuid. If StarPU does not have a worker thread initialized for logical unit cpuid, do nothing.

◆ starpurm_assign_cpus_to_starpu()

starpurm_drs_ret_t starpurm_assign_cpus_to_starpu ( starpurm_drs_desc_t *  spd,
int  ncpus 
)

Extend StarPU's default scheduling context to execute tasks on ncpus more workers, up to the number of StarPU worker threads initialized.

◆ starpurm_assign_cpu_mask_to_starpu()

starpurm_drs_ret_t starpurm_assign_cpu_mask_to_starpu ( starpurm_drs_desc_t *  spd,
const hwloc_cpuset_t  mask 
)

Extend StarPU's default scheduling context to execute tasks on the additional logical units selected in mask. Logical units of mask for which no StarPU worker is initialized are silently ignored.

◆ starpurm_assign_all_cpus_to_starpu()

starpurm_drs_ret_t starpurm_assign_all_cpus_to_starpu ( starpurm_drs_desc_t *  spd)

Set StarPU's default scheduling context to execute tasks on all available logical units for which a StarPU worker has been initialized.

◆ starpurm_withdraw_cpu_from_starpu()

starpurm_drs_ret_t starpurm_withdraw_cpu_from_starpu ( starpurm_drs_desc_t *  spd,
int  cpuid 
)

Shrink StarPU's default scheduling context so as to not execute tasks on worker corresponding to logical unit cpuid. If StarPU does not have a worker thread initialized for logical unit cpuid, do nothing.

◆ starpurm_withdraw_cpus_from_starpu()

starpurm_drs_ret_t starpurm_withdraw_cpus_from_starpu ( starpurm_drs_desc_t *  spd,
int  ncpus 
)

Shrink StarPU's default scheduling context to execute tasks on ncpus less workers.

◆ starpurm_withdraw_cpu_mask_from_starpu()

starpurm_drs_ret_t starpurm_withdraw_cpu_mask_from_starpu ( starpurm_drs_desc_t *  spd,
const hwloc_cpuset_t  mask 
)

Shrink StarPU's default scheduling context so as to not execute tasks on the logical units selected in mask. Logical units of mask for which no StarPU worker is initialized are silently ignored.

◆ starpurm_withdraw_all_cpus_from_starpu()

starpurm_drs_ret_t starpurm_withdraw_all_cpus_from_starpu ( starpurm_drs_desc_t *  spd)

Shrink StarPU's default scheduling context so as to remove all logical units.

◆ starpurm_lend()

starpurm_drs_ret_t starpurm_lend ( starpurm_drs_desc_t *  spd)

◆ starpurm_lend_cpu()

starpurm_drs_ret_t starpurm_lend_cpu ( starpurm_drs_desc_t *  spd,
int  cpuid 
)

◆ starpurm_lend_cpus()

starpurm_drs_ret_t starpurm_lend_cpus ( starpurm_drs_desc_t *  spd,
int  ncpus 
)

◆ starpurm_lend_cpu_mask()

starpurm_drs_ret_t starpurm_lend_cpu_mask ( starpurm_drs_desc_t *  spd,
const hwloc_cpuset_t  mask 
)

◆ starpurm_reclaim()

starpurm_drs_ret_t starpurm_reclaim ( starpurm_drs_desc_t *  spd)

◆ starpurm_reclaim_cpu()

starpurm_drs_ret_t starpurm_reclaim_cpu ( starpurm_drs_desc_t *  spd,
int  cpuid 
)

◆ starpurm_reclaim_cpus()

starpurm_drs_ret_t starpurm_reclaim_cpus ( starpurm_drs_desc_t *  spd,
int  ncpus 
)

◆ starpurm_reclaim_cpu_mask()

starpurm_drs_ret_t starpurm_reclaim_cpu_mask ( starpurm_drs_desc_t *  spd,
const hwloc_cpuset_t  mask 
)

◆ starpurm_acquire()

starpurm_drs_ret_t starpurm_acquire ( starpurm_drs_desc_t *  spd)

◆ starpurm_acquire_cpu()

starpurm_drs_ret_t starpurm_acquire_cpu ( starpurm_drs_desc_t *  spd,
int  cpuid 
)

◆ starpurm_acquire_cpus()

starpurm_drs_ret_t starpurm_acquire_cpus ( starpurm_drs_desc_t *  spd,
int  ncpus 
)

◆ starpurm_acquire_cpu_mask()

starpurm_drs_ret_t starpurm_acquire_cpu_mask ( starpurm_drs_desc_t *  spd,
const hwloc_cpuset_t  mask 
)

◆ starpurm_return_all()

starpurm_drs_ret_t starpurm_return_all ( starpurm_drs_desc_t *  spd)

◆ starpurm_return_cpu()

starpurm_drs_ret_t starpurm_return_cpu ( starpurm_drs_desc_t *  spd,
int  cpuid 
)

◆ starpurm_get_device_type_id()

int starpurm_get_device_type_id ( const char *  type_str)

Return the device type ID constant associated to the device type name. Valid names for type_str are:

  • "cpu": regular CPU unit;
  • "opencl": OpenCL device unit;
  • "cuda": nVidia CUDA device unit;

◆ starpurm_get_device_type_name()

const char * starpurm_get_device_type_name ( int  type_id)

Return the device type name associated to the device type ID constant.

◆ starpurm_get_nb_devices_by_type()

int starpurm_get_nb_devices_by_type ( int  type_id)

Return the number of initialized StarPU worker for the device type type_id.

◆ starpurm_get_device_id()

int starpurm_get_device_id ( int  type_id,
int  device_rank 
)

Return the unique ID assigned to the device_rank nth device of type type_id.

◆ starpurm_assign_device_to_starpu()

starpurm_drs_ret_t starpurm_assign_device_to_starpu ( starpurm_drs_desc_t *  spd,
int  type_id,
int  unit_rank 
)

Extend StarPU's default scheduling context to use unit_rank nth device of type type_id.

◆ starpurm_assign_devices_to_starpu()

starpurm_drs_ret_t starpurm_assign_devices_to_starpu ( starpurm_drs_desc_t *  spd,
int  type_id,
int  ndevices 
)

Extend StarPU's default scheduling context to use ndevices more devices of type type_id, up to the number of StarPU workers initialized for such device type.

◆ starpurm_assign_device_mask_to_starpu()

starpurm_drs_ret_t starpurm_assign_device_mask_to_starpu ( starpurm_drs_desc_t *  spd,
const hwloc_cpuset_t  mask 
)

Extend StarPU's default scheduling context to use additional devices as designated by their corresponding StarPU worker thread(s) CPU-set mask.

◆ starpurm_assign_all_devices_to_starpu()

starpurm_drs_ret_t starpurm_assign_all_devices_to_starpu ( starpurm_drs_desc_t *  spd,
int  type_id 
)

Extend StarPU's default scheduling context to use all devices of type type_id for which it has a worker thread initialized.

◆ starpurm_withdraw_device_from_starpu()

starpurm_drs_ret_t starpurm_withdraw_device_from_starpu ( starpurm_drs_desc_t *  spd,
int  type_id,
int  unit_rank 
)

Shrink StarPU's default scheduling context to not use unit_rank nth device of type type_id.

◆ starpurm_withdraw_devices_from_starpu()

starpurm_drs_ret_t starpurm_withdraw_devices_from_starpu ( starpurm_drs_desc_t *  spd,
int  type_id,
int  ndevices 
)

Shrink StarPU's default scheduling context to use ndevices less devices of type type_id.

◆ starpurm_withdraw_device_mask_from_starpu()

starpurm_drs_ret_t starpurm_withdraw_device_mask_from_starpu ( starpurm_drs_desc_t *  spd,
const hwloc_cpuset_t  mask 
)

Shrink StarPU's default scheduling context to not use devices designated by their corresponding StarPU worker thread(s) CPU-set mask.

◆ starpurm_withdraw_all_devices_from_starpu()

starpurm_drs_ret_t starpurm_withdraw_all_devices_from_starpu ( starpurm_drs_desc_t *  spd,
int  type_id 
)

Shrink StarPU's default scheduling context to use no devices of type type_id.

◆ starpurm_lend_device()

starpurm_drs_ret_t starpurm_lend_device ( starpurm_drs_desc_t *  spd,
int  type_id,
int  unit_rank 
)

◆ starpurm_lend_devices()

starpurm_drs_ret_t starpurm_lend_devices ( starpurm_drs_desc_t *  spd,
int  type_id,
int  ndevices 
)

◆ starpurm_lend_device_mask()

starpurm_drs_ret_t starpurm_lend_device_mask ( starpurm_drs_desc_t *  spd,
const hwloc_cpuset_t  mask 
)

◆ starpurm_lend_all_devices()

starpurm_drs_ret_t starpurm_lend_all_devices ( starpurm_drs_desc_t *  spd,
int  type_id 
)

◆ starpurm_reclaim_device()

starpurm_drs_ret_t starpurm_reclaim_device ( starpurm_drs_desc_t *  spd,
int  type_id,
int  unit_rank 
)

◆ starpurm_reclaim_devices()

starpurm_drs_ret_t starpurm_reclaim_devices ( starpurm_drs_desc_t *  spd,
int  type_id,
int  ndevices 
)

◆ starpurm_reclaim_device_mask()

starpurm_drs_ret_t starpurm_reclaim_device_mask ( starpurm_drs_desc_t *  spd,
const hwloc_cpuset_t  mask 
)

◆ starpurm_reclaim_all_devices()

starpurm_drs_ret_t starpurm_reclaim_all_devices ( starpurm_drs_desc_t *  spd,
int  type_id 
)

◆ starpurm_acquire_device()

starpurm_drs_ret_t starpurm_acquire_device ( starpurm_drs_desc_t *  spd,
int  type_id,
int  unit_rank 
)

◆ starpurm_acquire_devices()

starpurm_drs_ret_t starpurm_acquire_devices ( starpurm_drs_desc_t *  spd,
int  type_id,
int  ndevices 
)

◆ starpurm_acquire_device_mask()

starpurm_drs_ret_t starpurm_acquire_device_mask ( starpurm_drs_desc_t *  spd,
const hwloc_cpuset_t  mask 
)

◆ starpurm_acquire_all_devices()

starpurm_drs_ret_t starpurm_acquire_all_devices ( starpurm_drs_desc_t *  spd,
int  type_id 
)

◆ starpurm_return_all_devices()

starpurm_drs_ret_t starpurm_return_all_devices ( starpurm_drs_desc_t *  spd,
int  type_id 
)

◆ starpurm_return_device()

starpurm_drs_ret_t starpurm_return_device ( starpurm_drs_desc_t *  spd,
int  type_id,
int  unit_rank 
)

◆ starpurm_get_device_worker_cpuset()

hwloc_cpuset_t starpurm_get_device_worker_cpuset ( int  type_id,
int  unit_rank 
)

Return the CPU-set of the StarPU worker associated to the unit_rank nth unit of type type_id.

◆ starpurm_get_global_cpuset()

hwloc_cpuset_t starpurm_get_global_cpuset ( void  )

Return the cumulated CPU-set of all StarPU worker threads.

◆ starpurm_get_selected_cpuset()

hwloc_cpuset_t starpurm_get_selected_cpuset ( void  )

Return the CPU-set of the StarPU worker threads currently selected in the default StarPU's scheduling context.

◆ starpurm_get_all_cpu_workers_cpuset()

hwloc_cpuset_t starpurm_get_all_cpu_workers_cpuset ( void  )

Return the cumulated CPU-set of all CPU StarPU worker threads.

◆ starpurm_get_all_device_workers_cpuset()

hwloc_cpuset_t starpurm_get_all_device_workers_cpuset ( void  )

Return the cumulated CPU-set of all "non-CPU" StarPU worker threads.

◆ starpurm_get_all_device_workers_cpuset_by_type()

hwloc_cpuset_t starpurm_get_all_device_workers_cpuset_by_type ( int  typeid)

Return the cumulated CPU-set of all StarPU worker threads for devices of type typeid.