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-2022 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 #pragma GCC visibility push(hidden)
29 
30 #ifndef O_BINARY
31 #define O_BINARY 0
32 #endif
33 
34 #define STARPU_UNISTD_USE_COPY 1
35 #if !defined(HAVE_COPY_FILE_RANGE) && !defined(__NR_copy_file_range)
36 #undef STARPU_UNISTD_USE_COPY
37 #endif
38 
39 #ifdef __linux__
40 typedef loff_t starpu_loff_t;
41 #else
42 typedef off_t starpu_loff_t;
43 #endif
44 
46 {
47  int descriptor;
48  char * path;
49  size_t size;
50  int flags;
51  starpu_pthread_mutex_t mutex;
52 };
53 
54 void * starpu_unistd_global_alloc (struct starpu_unistd_global_obj * obj, void *base, size_t size);
55 void starpu_unistd_global_free (void *base, void *obj, size_t size);
56 void * starpu_unistd_global_open (struct starpu_unistd_global_obj * obj, void *base, void *pos, size_t size);
57 void starpu_unistd_global_close (void *base, void *obj, size_t size);
58 int starpu_unistd_global_read (void *base, void *obj, void *buf, off_t offset, size_t size);
59 int starpu_unistd_global_write (void *base, void *obj, const void *buf, off_t offset, size_t size);
60 void * starpu_unistd_global_plug (void *parameter, starpu_ssize_t size);
61 void starpu_unistd_global_unplug (void *base);
62 int _starpu_get_unistd_global_bandwidth_between_disk_and_main_ram(unsigned node, void *base);
63 void* starpu_unistd_global_async_read (void *base, void *obj, void *buf, off_t offset, size_t size);
64 void* starpu_unistd_global_async_write (void *base, void *obj, void *buf, off_t offset, size_t size);
65 void * starpu_unistd_global_async_full_write (void * base, void * obj, void * ptr, size_t size);
66 void * starpu_unistd_global_async_full_read (void * base, void * obj, void ** ptr, size_t * size, unsigned dst_node);
67 void starpu_unistd_global_wait_request(void * async_channel);
68 int starpu_unistd_global_test_request(void * async_channel);
69 void starpu_unistd_global_free_request(void * async_channel);
70 int starpu_unistd_global_full_read(void *base, void * obj, void ** ptr, size_t * size, unsigned dst_node);
71 int starpu_unistd_global_full_write (void * base, void * obj, void * ptr, size_t size);
72 #ifdef STARPU_UNISTD_USE_COPY
73 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);
74 #endif
75 
76 #pragma GCC visibility pop
77 
78 #endif
Definition: disk_unistd_global.h:46