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 #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 #ifdef __linux__
38 typedef loff_t starpu_loff_t;
39 #else
40 typedef off_t starpu_loff_t;
41 #endif
42 
44 {
45  int descriptor;
46  char * path;
47  size_t size;
48  int flags;
49  starpu_pthread_mutex_t mutex;
50 };
51 
52 void * starpu_unistd_global_alloc (struct starpu_unistd_global_obj * obj, void *base, size_t size);
53 void starpu_unistd_global_free (void *base, void *obj, size_t size);
54 void * starpu_unistd_global_open (struct starpu_unistd_global_obj * obj, void *base, void *pos, size_t size);
55 void starpu_unistd_global_close (void *base, void *obj, size_t size);
56 int starpu_unistd_global_read (void *base, void *obj, void *buf, off_t offset, size_t size);
57 int starpu_unistd_global_write (void *base, void *obj, const void *buf, off_t offset, size_t size);
58 void * starpu_unistd_global_plug (void *parameter, starpu_ssize_t size);
59 void starpu_unistd_global_unplug (void *base);
60 int _starpu_get_unistd_global_bandwidth_between_disk_and_main_ram(unsigned node, void *base);
61 void* starpu_unistd_global_async_read (void *base, void *obj, void *buf, off_t offset, size_t size);
62 void* starpu_unistd_global_async_write (void *base, void *obj, void *buf, off_t offset, size_t size);
63 void * starpu_unistd_global_async_full_write (void * base, void * obj, void * ptr, size_t size);
64 void * starpu_unistd_global_async_full_read (void * base, void * obj, void ** ptr, size_t * size, unsigned dst_node);
65 void starpu_unistd_global_wait_request(void * async_channel);
66 int starpu_unistd_global_test_request(void * async_channel);
67 void starpu_unistd_global_free_request(void * async_channel);
68 int starpu_unistd_global_full_read(void *base, void * obj, void ** ptr, size_t * size, unsigned dst_node);
69 int starpu_unistd_global_full_write (void * base, void * obj, void * ptr, size_t size);
70 #ifdef STARPU_UNISTD_USE_COPY
71 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);
72 #endif
73 #endif
Definition: disk_unistd_global.h:44