StarPU Internal Handbook
copy_driver.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2008-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4  *
5  * StarPU is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation; either version 2.1 of the License, or (at
8  * your option) any later version.
9  *
10  * StarPU is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
15  */
16 
17 #ifndef __COPY_DRIVER_H__
18 #define __COPY_DRIVER_H__
19 
22 #ifdef HAVE_AIO_H
23 #include <aio.h>
24 #endif
25 
26 #include <common/config.h>
27 #include <common/list.h>
28 
29 #ifdef STARPU_USE_CUDA
30 #include <cuda.h>
31 #include <cuda_runtime.h>
32 #endif
33 
34 #ifdef STARPU_USE_OPENCL
35 #include <starpu_opencl.h>
36 #endif
37 
38 #ifdef STARPU_USE_MPI_MASTER_SLAVE
39 #include <mpi.h>
40 #endif
41 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
47 struct _starpu_data_request;
49 
50 enum _starpu_is_prefetch
51 {
52  STARPU_FETCH = 0, /* A task really needs it now! */
53  STARPU_PREFETCH = 1, /* It is a good idea to have it asap */
54  STARPU_IDLEFETCH = 2, /* Get this here when you have time to */
55  STARPU_NFETCH
56 };
57 
58 #ifdef STARPU_USE_MIC
59 
63 {
64  unsigned memory_node;
65  int mark;
66  uint64_t *signal;
67 };
68 #endif
69 
70 #ifdef STARPU_USE_MPI_MASTER_SLAVE
71 LIST_TYPE(_starpu_mpi_ms_event_request,
72  MPI_Request request;
73 );
74 
75 struct _starpu_mpi_ms_async_event
76 {
77  int is_sender;
78  struct _starpu_mpi_ms_event_request_list * requests;
79 };
80 #endif
81 
83  void *backend_event;
84 );
85 
87 {
88  unsigned memory_node;
89  struct _starpu_disk_backend_event_list * requests;
90 
91  void * ptr;
92  unsigned node;
93  size_t size;
94  starpu_data_handle_t handle;
95 };
96 
100 {
101 #ifdef STARPU_SIMGRID
102  struct
103  {
104  unsigned finished;
105  starpu_pthread_queue_t *queue;
106  };
107 #endif
108 #ifdef STARPU_USE_CUDA
109  cudaEvent_t cuda_event;
110 #endif
111 #ifdef STARPU_USE_OPENCL
112  cl_event opencl_event;
113 #endif
114 #ifdef STARPU_USE_MPI_MASTER_SLAVE
115  struct _starpu_mpi_ms_async_event mpi_ms_event;
116 #endif
117 #ifdef STARPU_USE_MIC
118  struct _starpu_mic_async_event mic_event;
119 #endif
120  struct _starpu_disk_async_event disk_event;
121 };
122 
124 {
125  union _starpu_async_channel_event event;
126  struct _starpu_node_ops *node_ops;
128  struct _starpu_mp_node *polling_node_sender;
129  struct _starpu_mp_node *polling_node_receiver;
132  volatile int starpu_mp_common_finished_receiver;
133 };
134 
135 void _starpu_wake_all_blocked_workers_on_node(unsigned nodeid);
136 
137 int _starpu_driver_copy_data_1_to_1(starpu_data_handle_t handle,
138  struct _starpu_data_replicate *src_replicate,
139  struct _starpu_data_replicate *dst_replicate,
140  unsigned donotread,
141  struct _starpu_data_request *req,
142  unsigned may_alloc,
143  enum _starpu_is_prefetch prefetch);
144 
145 unsigned _starpu_driver_test_request_completion(struct _starpu_async_channel *async_channel);
146 void _starpu_driver_wait_request_completion(struct _starpu_async_channel *async_channel);
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 
152 #endif // __COPY_DRIVER_H__
_starpu_async_channel_event
Definition: copy_driver.h:100
_starpu_data_replicate
Definition: coherency.h:45
_starpu_disk_async_event
Definition: copy_driver.h:87
_starpu_mic_async_event
Definition: copy_driver.h:63
_starpu_async_channel::starpu_mp_common_finished_sender
volatile int starpu_mp_common_finished_sender
Definition: copy_driver.h:131
_starpu_disk_backend_event
Definition: copy_driver.h:82
_starpu_async_channel::polling_node_sender
struct _starpu_mp_node * polling_node_sender
Definition: copy_driver.h:128
_starpu_async_channel
Definition: copy_driver.h:124
_starpu_node_ops
Definition: node_ops.h:48