StarPU Handbook
Out Of Core

Data Structures

struct  starpu_disk_ops
 

Macros

#define STARPU_DISK_SIZE_MIN
 

Functions

int starpu_disk_register (struct starpu_disk_ops *func, void *parameter, starpu_ssize_t size)
 
void * starpu_disk_open (unsigned node, void *pos, size_t size)
 
void starpu_disk_close (unsigned node, void *obj, size_t size)
 

Variables

int starpu_disk_swap_node
 
struct starpu_disk_ops starpu_disk_stdio_ops
 
struct starpu_disk_ops starpu_disk_unistd_ops
 
struct starpu_disk_ops starpu_disk_unistd_o_direct_ops
 
struct starpu_disk_ops starpu_disk_leveldb_ops
 

Detailed Description


Data Structure Documentation

◆ starpu_disk_ops

struct starpu_disk_ops

This is a set of functions to manipulate datas on disk.

Data Fields

void *(* plug )(void *parameter, starpu_ssize_t size)
 
void(* unplug )(void *base)
 
int(* bandwidth )(unsigned node, void *base)
 
void *(* alloc )(void *base, size_t size)
 
void(* free )(void *base, void *obj, size_t size)
 
void *(* open )(void *base, void *pos, size_t size)
 
void(* close )(void *base, void *obj, size_t size)
 
int(* read )(void *base, void *obj, void *buf, off_t offset, size_t size)
 
int(* write )(void *base, void *obj, const void *buf, off_t offset, size_t size)
 
int(* full_read )(void *base, void *obj, void **ptr, size_t *size)
 
int(* full_write )(void *base, void *obj, void *ptr, size_t size)
 
void *(* async_write )(void *base, void *obj, void *buf, off_t offset, size_t size)
 
void *(* async_read )(void *base, void *obj, void *buf, off_t offset, size_t size)
 
void *(* async_full_read )(void *base, void *obj, void **ptr, size_t *size)
 
void *(* async_full_write )(void *base, void *obj, void *ptr, size_t size)
 
void *(* copy )(void *base_src, void *obj_src, off_t offset_src, void *base_dst, void *obj_dst, off_t offset_dst, size_t size)
 
void(* wait_request )(void *async_channel)
 
int(* test_request )(void *async_channel)
 
void(* free_request )(void *async_channel)
 

Field Documentation

◆ plug

void *(* starpu_disk_ops::plug)(void *parameters, size_t size)

Connect a disk memory at location parameter with size size, and return a base as void*, which will be passed by StarPU to all other methods.

◆ unplug

void(* starpu_disk_ops::unplug)(void *base)

Disconnect a disk memory base.

◆ bandwidth

int(* starpu_disk_ops::bandwidth)(unsigned node)

Measure the bandwidth and the latency for the disk node and save it. Returns 1 if it could measure it.

◆ alloc

void *(* starpu_disk_ops::alloc)(void *base, size_t size)

Create a new location for datas of size size. This returns an opaque object pointer.

◆ free

void(* starpu_disk_ops::free)(void *base, void *obj, size_t size)

Free a data obj previously allocated with alloc.

◆ open

void *(* starpu_disk_ops::open)(void *base, void *pos, size_t size)

Open an existing location of datas, at a specific position pos dependent on the backend.

◆ close

void(* starpu_disk_ops::close)(void *base, void *obj, size_t size)

Close, without deleting it, a location of datas obj.

◆ read

int(* starpu_disk_ops::read)(void *base, void *obj, void *buf, off_t offset, size_t size)

Read size bytes of data from obj in base, at offset offset, and put into buf. Returns the actual number of read bytes.

◆ write

int(* starpu_disk_ops::write)(void *base, void *obj, const void *buf, off_t offset, size_t size)

Write size bytes of data to obj in base, at offset offset, from buf. Returns 0 on success.

◆ full_read

int(* starpu_disk_ops::full_read)(void *base, void *obj, void **ptr, size_t *size)

Read all data from obj of base, from offset 0. Returns it in an allocated buffer ptr, of size size

◆ full_write

int(* starpu_disk_ops::full_write)(void *base, void *obj, void *ptr, size_t size)

Write data in ptr to obj of base, from offset 0, and truncate obj to size, so that a full_read will get it.

◆ async_write

void *(* starpu_disk_ops::async_write)(void *base, void *obj, const void *buf, off_t offset, size_t size)

Asynchronously write size bytes of data to obj in base, at offset offset, from buf. Returns a void* pointer that StarPU will pass to _request methods for testing for the completion.

◆ async_read

void *(* starpu_disk_ops::async_read)(void *base, void *obj, void *buf, off_t offset, size_t size)

Asynchronously read size bytes of data from obj in base, at offset offset, and put into buf. Returns a void* pointer that StarPU will pass to _request methods for testing for the completion.

◆ async_full_read

void *(* starpu_disk_ops::async_full_read)(void *base, void *obj, void **ptr, size_t *size)

Read all data from obj of base, from offset 0. Returns it in an allocated buffer ptr, of size size

◆ async_full_write

void *(* starpu_disk_ops::async_full_write)(void *base, void *obj, void *ptr, size_t size)

Write data in ptr to obj of base, from offset 0, and truncate obj to size, so that a full_read will get it.

◆ copy

void *(* starpu_disk_ops::copy)(void *base_src, void *obj_src, off_t offset_src, void *base_dst, void *obj_dst, off_t offset_dst, size_t size)

Copy from offset offset_src of disk object obj_src in base_src to offset offset_dst of disk object obj_dst in base_dst. Returns a void* pointer that StarPU will pass to *_request methods for testing for the completion.

◆ wait_request

void(* starpu_disk_ops::wait_request)(void *async_channel)

Wait for completion of request async_channel returned by a previous asynchronous read, write or copy.

◆ test_request

void(* starpu_disk_ops::test_request)(void *async_channel)

Test for completion of request async_channel returned by a previous asynchronous read, write or copy. Returns 1 on completion, 0 otherwise.

◆ free_request

void(* starpu_disk_ops::free_request)(void *async_channel)

Free the request allocated by a previous asynchronous read, write or copy.

Macro Definition Documentation

◆ STARPU_DISK_SIZE_MIN

#define STARPU_DISK_SIZE_MIN

Minimum size of a registered disk. The size of a disk is the last parameter of the function starpu_disk_register().

Function Documentation

◆ starpu_disk_register()

int starpu_disk_register ( struct starpu_disk_ops func,
void *  parameter,
starpu_ssize_t  size 
)

Register a disk memory node with a set of functions to manipulate datas. The plug member of func will be passed parameter, and return a base which will be passed to all func methods.
SUCCESS: return the disk node.
FAIL: return an error code.
size must be at least STARPU_DISK_SIZE_MIN bytes ! size being negative means infinite size.

◆ starpu_disk_open()

void * starpu_disk_open ( unsigned  node,
void *  pos,
size_t  size 
)

Open an existing file memory in a disk node. size: this is a size of your file. pos is specific position dependent on the backend, given to the open method of the disk operations. This returns an opaque object pointer.

◆ starpu_disk_close()

void starpu_disk_close ( unsigned  node,
void *  obj,
size_t  size 
)

Close an existing data opened with starpu_disk_open.

Variable Documentation

◆ starpu_disk_swap_node

starpu_disk_swap_node

This contains the node number of the disk swap, if set up through the STARPU_DISK_SWAP variable.

◆ starpu_disk_stdio_ops

starpu_disk_stdio_ops

This set uses the stdio library (fwrite, fread...) to read/write on disk.
Warning: It creates one file per allocation !
It doesn't support asynchronous transfers.

◆ starpu_disk_unistd_ops

starpu_disk_unistd_ops

This set uses the unistd library (write, read...) to read/write on disk.
Warning: It creates one file per allocation !

◆ starpu_disk_unistd_o_direct_ops

starpu_disk_unistd_o_direct_ops

This set uses the unistd library (write, read...) to read/write on disk with the O_DIRECT flag.
Warning: It creates one file per allocation !
Only available on Linux systems.

◆ starpu_disk_leveldb_ops

starpu_disk_leveldb_ops

This set uses the leveldb created by Google
Show here: https://code.google.com/p/leveldb/
It doesn't support asynchronous transfers.