StarPU Handbook

starpu_disk.h
Go to the documentation of this file.
1/* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2013-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4 * Copyright (C) 2013 Corentin Salingue
5 *
6 * StarPU is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or (at
9 * your option) any later version.
10 *
11 * StarPU is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 *
15 * See the GNU Lesser General Public License in COPYING.LGPL for more details.
16 */
17
18#ifndef __STARPU_DISK_H__
19#define __STARPU_DISK_H__
20
21#include <sys/types.h>
22#include <starpu_config.h>
23
32 struct starpu_disk_ops
33{
38 void * (*plug) (void *parameter, starpu_ssize_t size);
42 void (*unplug) (void *base);
43
48 int (*bandwidth) (unsigned node, void *base);
49
53 void * (*alloc) (void *base, size_t size);
54
58 void (*free) (void *base, void *obj, size_t size);
59
63 void * (*open) (void *base, void *pos, size_t size);
67 void (*close) (void *base, void *obj, size_t size);
68
73 int (*read) (void *base, void *obj, void *buf, off_t offset, size_t size);
77 int (*write) (void *base, void *obj, const void *buf, off_t offset, size_t size);
78
82 int (*full_read) (void * base, void * obj, void ** ptr, size_t * size, unsigned dst_node);
87 int (*full_write) (void * base, void * obj, void * ptr, size_t size);
88
94 void * (*async_write) (void *base, void *obj, void *buf, off_t offset, size_t size);
100 void * (*async_read) (void *base, void *obj, void *buf, off_t offset, size_t size);
101
105 void * (*async_full_read) (void * base, void * obj, void ** ptr, size_t * size, unsigned dst_node);
110 void * (*async_full_write) (void * base, void * obj, void * ptr, size_t size);
111
118 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);
119
124 void (*wait_request) (void * async_channel);
129 int (*test_request) (void * async_channel);
130
134 void (*free_request)(void * async_channel);
135
136 /* TODO: readv, writev, read2d, write2d, etc. */
137};
138
146 extern struct starpu_disk_ops starpu_disk_stdio_ops;
147
157 extern struct starpu_disk_ops starpu_disk_hdf5_ops;
158
164 extern struct starpu_disk_ops starpu_disk_unistd_ops;
165
173 extern struct starpu_disk_ops starpu_disk_unistd_o_direct_ops;
174
179 extern struct starpu_disk_ops starpu_disk_leveldb_ops;
180
184 void starpu_disk_close(unsigned node, void *obj, size_t size);
185
192 void *starpu_disk_open(unsigned node, void *pos, size_t size);
193
204 int starpu_disk_register(struct starpu_disk_ops *func, void *parameter, starpu_ssize_t size);
205
210#define STARPU_DISK_SIZE_MIN (16*1024*1024)
211
216 extern int starpu_disk_swap_node;
217
220#endif /* __STARPU_DISK_H__ */
starpu_disk_ops::close
void(* close)(void *base, void *obj, size_t size)
Definition: starpu_disk.h:67
starpu_disk_ops::read
int(* read)(void *base, void *obj, void *buf, off_t offset, size_t size)
Definition: starpu_disk.h:73
starpu_disk_ops::free
void(* free)(void *base, void *obj, size_t size)
Definition: starpu_disk.h:58
starpu_disk_ops::full_write
int(* full_write)(void *base, void *obj, void *ptr, size_t size)
Definition: starpu_disk.h:87
starpu_disk_ops::test_request
int(* test_request)(void *async_channel)
Definition: starpu_disk.h:129
starpu_disk_ops::bandwidth
int(* bandwidth)(unsigned node, void *base)
Definition: starpu_disk.h:48
starpu_disk_ops::full_read
int(* full_read)(void *base, void *obj, void **ptr, size_t *size, unsigned dst_node)
Definition: starpu_disk.h:82
starpu_disk_ops::unplug
void(* unplug)(void *base)
Definition: starpu_disk.h:42
starpu_disk_ops::free_request
void(* free_request)(void *async_channel)
Definition: starpu_disk.h:134
starpu_disk_ops::wait_request
void(* wait_request)(void *async_channel)
Definition: starpu_disk.h:124
starpu_disk_ops::write
int(* write)(void *base, void *obj, const void *buf, off_t offset, size_t size)
Definition: starpu_disk.h:77
starpu_disk_stdio_ops
struct starpu_disk_ops starpu_disk_stdio_ops
starpu_disk_unistd_o_direct_ops
struct starpu_disk_ops starpu_disk_unistd_o_direct_ops
starpu_disk_close
void starpu_disk_close(unsigned node, void *obj, size_t size)
starpu_disk_unistd_ops
struct starpu_disk_ops starpu_disk_unistd_ops
starpu_disk_swap_node
int starpu_disk_swap_node
starpu_disk_register
int starpu_disk_register(struct starpu_disk_ops *func, void *parameter, starpu_ssize_t size)
starpu_disk_leveldb_ops
struct starpu_disk_ops starpu_disk_leveldb_ops
starpu_disk_hdf5_ops
struct starpu_disk_ops starpu_disk_hdf5_ops
starpu_disk_open
void * starpu_disk_open(unsigned node, void *pos, size_t size)
starpu_disk_ops
Definition: starpu_disk.h:33
starpu_config.h