StarPU Handbook
starpu_data.h File Reference
#include <starpu.h>

Go to the source code of this file.

Data Structures

struct  starpu_data_descr
 

Macros

#define starpu_data_malloc_pinned_if_possible
 
#define starpu_data_free_pinned_if_possible
 
#define STARPU_MAIN_RAM
 

Typedefs

typedef struct _starpu_data_state * starpu_data_handle_t
 
typedef struct starpu_arbiter * starpu_arbiter_t
 

Enumerations

enum  starpu_data_access_mode {
  STARPU_NONE, STARPU_R, STARPU_W, STARPU_RW,
  STARPU_SCRATCH, STARPU_REDUX, STARPU_COMMUTE, STARPU_SSEND,
  STARPU_LOCALITY, STARPU_ACCESS_MODE_MAX
}
 
enum  starpu_node_kind {
  STARPU_UNUSED, STARPU_CPU_RAM, STARPU_CUDA_RAM, STARPU_OPENCL_RAM,
  STARPU_DISK_RAM, STARPU_MIC_RAM, STARPU_SCC_RAM, STARPU_SCC_SHM
}
 

Functions

void starpu_data_display_memory_stats ()
 
unsigned starpu_worker_get_memory_node (unsigned workerid)
 
unsigned starpu_memory_nodes_get_count (void)
 
enum starpu_node_kind starpu_node_get_kind (unsigned node)
 
void starpu_data_set_sequential_consistency_flag (starpu_data_handle_t handle, unsigned flag)
 
unsigned starpu_data_get_sequential_consistency_flag (starpu_data_handle_t handle)
 
unsigned starpu_data_get_default_sequential_consistency_flag (void)
 
void starpu_data_set_default_sequential_consistency_flag (unsigned flag)
 
unsigned starpu_data_test_if_allocated_on_node (starpu_data_handle_t handle, unsigned memory_node)
 
void starpu_memchunk_tidy (unsigned memory_node)
 
Basic Data Management API

Data management is done at a high-level in StarPU: rather than accessing a mere list of contiguous buffers, the tasks may manipulate data that are described by a high-level construct which we call data interface.

An example of data interface is the "vector" interface which describes a contiguous data array on a spefic memory node. This interface is a simple structure containing the number of elements in the array, the size of the elements, and the address of the array in the appropriate address space (this address may be invalid if there is no valid copy of the array in the memory node). More informations on the data interfaces provided by StarPU are given in Data Interfaces.

When a piece of data managed by StarPU is used by a task, the task implementation is given a pointer to an interface describing a valid copy of the data that is accessible from the current processing unit.

Every worker is associated to a memory node which is a logical abstraction of the address space from which the processing unit gets its data. For instance, the memory node associated to the different CPU workers represents main memory (RAM), the memory node associated to a GPU is DRAM embedded on the device. Every memory node is identified by a logical index which is accessible from the function starpu_worker_get_memory_node(). When registering a piece of data to StarPU, the specified memory node indicates where the piece of data initially resides (we also call this memory node the home node of a piece of data).

void starpu_data_set_name (starpu_data_handle_t handle, const char *name)
 
void starpu_data_set_coordinates_array (starpu_data_handle_t handle, int dimensions, int dims[])
 
void starpu_data_set_coordinates (starpu_data_handle_t handle, unsigned dimensions,...)
 
void starpu_data_unregister (starpu_data_handle_t handle)
 
void starpu_data_unregister_no_coherency (starpu_data_handle_t handle)
 
void starpu_data_unregister_submit (starpu_data_handle_t handle)
 
void starpu_data_invalidate (starpu_data_handle_t handle)
 
void starpu_data_invalidate_submit (starpu_data_handle_t handle)
 
void starpu_data_advise_as_important (starpu_data_handle_t handle, unsigned is_important)
 
int starpu_data_request_allocation (starpu_data_handle_t handle, unsigned node)
 
int starpu_data_fetch_on_node (starpu_data_handle_t handle, unsigned node, unsigned async)
 
int starpu_data_prefetch_on_node (starpu_data_handle_t handle, unsigned node, unsigned async)
 
int starpu_data_idle_prefetch_on_node (starpu_data_handle_t handle, unsigned node, unsigned async)
 
void starpu_data_wont_use (starpu_data_handle_t handle)
 
void starpu_data_set_wt_mask (starpu_data_handle_t handle, uint32_t wt_mask)
 
void starpu_data_query_status (starpu_data_handle_t handle, int memory_node, int *is_allocated, int *is_valid, int *is_requested)
 
void starpu_data_set_reduction_methods (starpu_data_handle_t handle, struct starpu_codelet *redux_cl, struct starpu_codelet *init_cl)
 
struct starpu_data_interface_opsstarpu_data_get_interface_ops (starpu_data_handle_t handle)
 
void starpu_data_set_user_data (starpu_data_handle_t handle, void *user_data)
 
void * starpu_data_get_user_data (starpu_data_handle_t handle)
 

Access registered data from the application

#define STARPU_ACQUIRE_NO_NODE
 
#define STARPU_ACQUIRE_ALL_NODES
 
#define STARPU_DATA_ACQUIRE_CB(handle, mode, code)
 
int starpu_data_acquire (starpu_data_handle_t handle, enum starpu_data_access_mode mode)
 
int starpu_data_acquire_on_node (starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode)
 
int starpu_data_acquire_cb (starpu_data_handle_t handle, enum starpu_data_access_mode mode, void(*callback)(void *), void *arg)
 
int starpu_data_acquire_on_node_cb (starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void(*callback)(void *), void *arg)
 
int starpu_data_acquire_cb_sequential_consistency (starpu_data_handle_t handle, enum starpu_data_access_mode mode, void(*callback)(void *), void *arg, int sequential_consistency)
 
int starpu_data_acquire_on_node_cb_sequential_consistency (starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void(*callback)(void *), void *arg, int sequential_consistency)
 
int starpu_data_acquire_on_node_cb_sequential_consistency_sync_jobids (starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void(*callback)(void *), void *arg, int sequential_consistency, long *pre_sync_jobid, long *post_sync_jobid)
 
int starpu_data_acquire_try (starpu_data_handle_t handle, enum starpu_data_access_mode mode)
 
int starpu_data_acquire_on_node_try (starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode)
 
void starpu_data_release (starpu_data_handle_t handle)
 
void starpu_data_release_on_node (starpu_data_handle_t handle, int node)
 
starpu_arbiter_t starpu_arbiter_create (void) STARPU_ATTRIBUTE_MALLOC
 
void starpu_data_assign_arbiter (starpu_data_handle_t handle, starpu_arbiter_t arbiter)
 
void starpu_arbiter_destroy (starpu_arbiter_t arbiter)