StarPU Internal Handbook

disk_unistd_global.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 __DISK_UNISTD_GLOBAL_H__
19#define __DISK_UNISTD_GLOBAL_H__
20
23#include <fcntl.h>
24#ifdef __linux__
25#include <sys/syscall.h>
26#endif
27
28#ifndef O_BINARY
29#define O_BINARY 0
30#endif
31
32#define STARPU_UNISTD_USE_COPY 1
33#if !defined(HAVE_COPY_FILE_RANGE) && !defined(__NR_copy_file_range)
34#undef STARPU_UNISTD_USE_COPY
35#endif
36
37 struct starpu_unistd_global_obj
38{
39 int descriptor;
40 char * path;
41 size_t size;
42 int flags;
43 starpu_pthread_mutex_t mutex;
44};
45
46 void * starpu_unistd_global_alloc (struct starpu_unistd_global_obj * obj, void *base, size_t size);
47 void starpu_unistd_global_free (void *base, void *obj, size_t size);
48 void * starpu_unistd_global_open (struct starpu_unistd_global_obj * obj, void *base, void *pos, size_t size);
49 void starpu_unistd_global_close (void *base, void *obj, size_t size);
50 int starpu_unistd_global_read (void *base, void *obj, void *buf, off_t offset, size_t size);
51 int starpu_unistd_global_write (void *base, void *obj, const void *buf, off_t offset, size_t size);
52 void * starpu_unistd_global_plug (void *parameter, starpu_ssize_t size);
53 void starpu_unistd_global_unplug (void *base);
54 int _starpu_get_unistd_global_bandwidth_between_disk_and_main_ram(unsigned node, void *base);
55 void* starpu_unistd_global_async_read (void *base, void *obj, void *buf, off_t offset, size_t size);
56 void* starpu_unistd_global_async_write (void *base, void *obj, void *buf, off_t offset, size_t size);
57 void * starpu_unistd_global_async_full_write (void * base, void * obj, void * ptr, size_t size);
58 void * starpu_unistd_global_async_full_read (void * base, void * obj, void ** ptr, size_t * size, unsigned dst_node);
59 void starpu_unistd_global_wait_request(void * async_channel);
60 int starpu_unistd_global_test_request(void * async_channel);
61 void starpu_unistd_global_free_request(void * async_channel);
62 int starpu_unistd_global_full_read(void *base, void * obj, void ** ptr, size_t * size, unsigned dst_node);
63 int starpu_unistd_global_full_write (void * base, void * obj, void * ptr, size_t size);
64#ifdef STARPU_UNISTD_USE_COPY
65 void * starpu_unistd_global_copy(void *base_src, void* obj_src, off_t offset_src, void *base_dst, void* obj_dst, off_t offset_dst, size_t size);
66#endif
67#endif
starpu_unistd_global_obj
Definition: disk_unistd_global.h:38