StarPU Internal Handbook
source_common.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2012-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4  * Copyright (C) 2013 Thibaut Lambert
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 __SOURCE_COMMON_H__
19 #define __SOURCE_COMMON_H__
20 
23 #ifdef STARPU_USE_MP
24 
25 #include <core/sched_policy.h>
26 #include <core/task.h>
28 
29 enum _starpu_mp_command _starpu_src_common_wait_command_sync(struct _starpu_mp_node *node, void ** arg, int* arg_size);
30 int _starpu_src_common_store_message(struct _starpu_mp_node *node, void * arg, int arg_size, enum _starpu_mp_command answer);
31 
32 enum _starpu_mp_command _starpu_src_common_wait_completed_execution(struct _starpu_mp_node *node, int devid, void **arg, int * arg_size);
33 
34 int _starpu_src_common_sink_nbcores(struct _starpu_mp_node *node, int *buf);
35 
36 int _starpu_src_common_lookup(const struct _starpu_mp_node *node, void (**func_ptr)(void), const char *func_name);
37 
38 int _starpu_src_common_allocate(const struct _starpu_mp_node *mp_node, void **addr, size_t size);
39 
40 void _starpu_src_common_free(struct _starpu_mp_node *mp_node, void *addr);
41 
42 int _starpu_src_common_execute_kernel(const struct _starpu_mp_node *node,
43  void (*kernel)(void), unsigned coreid,
44  enum starpu_codelet_type type,
45  int is_parallel_task, int cb_workerid,
46  starpu_data_handle_t *handles,
47  void **interfaces,
48  unsigned nb_interfaces,
49  void *cl_arg, size_t cl_arg_size, int detached);
50 
51 int _starpu_src_common_copy_host_to_sink_sync(struct _starpu_mp_node *mp_node, void *src, void *dst, size_t size);
52 
53 int _starpu_src_common_copy_sink_to_host_sync(struct _starpu_mp_node *mp_node, void *src, void *dst, size_t size);
54 
55 int _starpu_src_common_copy_sink_to_sink_sync(struct _starpu_mp_node *src_node, struct _starpu_mp_node *dst_node, void *src, void *dst, size_t size);
56 
57 int _starpu_src_common_copy_host_to_sink_async(struct _starpu_mp_node *mp_node, void *src, void *dst, size_t size, void *event);
58 
59 int _starpu_src_common_copy_sink_to_host_async(struct _starpu_mp_node *mp_node, void *src, void *dst, size_t size, void *event);
60 
61 int _starpu_src_common_copy_sink_to_sink_async(struct _starpu_mp_node *src_node, struct _starpu_mp_node *dst_node, void *src, void *dst, size_t size, void *event);
62 
63 int _starpu_src_common_locate_file(char *located_file_name, size_t len,
64  const char *env_file_name, const char *env_mic_path,
65  const char *config_file_name, const char *actual_file_name,
66  const char **suffixes);
67 
68 void _starpu_src_common_worker(struct _starpu_worker_set * worker_set, unsigned baseworkerid, struct _starpu_mp_node * node_set);
69 
70 #if defined(STARPU_USE_MPI_MASTER_SLAVE) && !defined(STARPU_MPI_MASTER_SLAVE_MULTIPLE_THREAD)
71 void _starpu_src_common_init_switch_env(unsigned this);
72 void _starpu_src_common_workers_set(struct _starpu_worker_set * worker_set, int ndevices, struct _starpu_mp_node ** mp_node);
73 #endif
74 
75 #endif /* STARPU_USE_MP */
76 
77 #endif /* __SOURCE_COMMON_H__ */
Definition: workers.h:232