StarPU Internal Handbook
Loading...
Searching...
No Matches
graph.h
Go to the documentation of this file.
1/* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2016-2022 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 __GRAPH_H__
18#define __GRAPH_H__
19
20#include <core/task.h>
21#include <common/list.h>
22
23#pragma GCC visibility push(hidden)
24
27MULTILIST_CREATE_TYPE(_starpu_graph_node, all)
28MULTILIST_CREATE_TYPE(_starpu_graph_node, top)
29MULTILIST_CREATE_TYPE(_starpu_graph_node, bottom)
30MULTILIST_CREATE_TYPE(_starpu_graph_node, dropped)
31
33{
35 starpu_pthread_mutex_t mutex;
38
43 struct _starpu_graph_node_multilist_top top;
45 struct _starpu_graph_node_multilist_bottom bottom;
47 struct _starpu_graph_node_multilist_all all;
49 struct _starpu_graph_node_multilist_dropped dropped;
50
55 unsigned *incoming_slot;
57 unsigned n_incoming;
62
65
67 unsigned *outgoing_slot;
69 unsigned n_outgoing;
72
76 unsigned depth;
80 unsigned descendants;
81
84};
85
86MULTILIST_CREATE_INLINES(struct _starpu_graph_node, _starpu_graph_node, all)
87MULTILIST_CREATE_INLINES(struct _starpu_graph_node, _starpu_graph_node, top)
88MULTILIST_CREATE_INLINES(struct _starpu_graph_node, _starpu_graph_node, bottom)
89MULTILIST_CREATE_INLINES(struct _starpu_graph_node, _starpu_graph_node, dropped)
90
91extern int _starpu_graph_record;
92void _starpu_graph_init(void);
93void _starpu_graph_wrlock(void);
94void _starpu_graph_rdlock(void);
95void _starpu_graph_wrunlock(void);
96void _starpu_graph_rdunlock(void);
97
100
102void _starpu_graph_add_job_dep(struct _starpu_job *job, struct _starpu_job *prev_job);
103
106
109
116
119
125void _starpu_graph_foreach(void (*func)(void *data, struct _starpu_graph_node *node), void *data);
126
127struct _starpu_graph_node *_starpu_graph_task_node(struct starpu_task *task);
128struct starpu_task *_starpu_graph_node_task(struct _starpu_graph_node *node);
129void _starpu_graph_node_outgoing(struct _starpu_graph_node *node, unsigned *n_outgoing, struct _starpu_graph_node ***outgoing);
130
131#pragma GCC visibility pop
132
133#endif /* __GRAPH_H__ */
unsigned total_incoming
Definition graph.h:64
void _starpu_graph_add_job(struct _starpu_job *job)
unsigned depth
Definition graph.h:76
void _starpu_graph_compute_descendants(void)
unsigned * outgoing_slot
Definition graph.h:67
unsigned alloc_incoming
Definition graph.h:59
void _starpu_graph_drop_dropped_nodes(void)
void _starpu_graph_add_job_dep(struct _starpu_job *job, struct _starpu_job *prev_job)
struct _starpu_job * job
Definition graph.h:37
struct _starpu_graph_node ** incoming
Definition graph.h:53
unsigned descendants
Definition graph.h:80
void _starpu_graph_compute_depths(void)
starpu_pthread_mutex_t mutex
Definition graph.h:35
void _starpu_graph_foreach(void(*func)(void *data, struct _starpu_graph_node *node), void *data)
struct _starpu_graph_node_multilist_bottom bottom
Definition graph.h:45
struct _starpu_graph_node_multilist_top top
Definition graph.h:43
struct _starpu_graph_node ** outgoing
Definition graph.h:61
struct _starpu_graph_node_multilist_all all
Definition graph.h:47
unsigned alloc_outgoing
Definition graph.h:71
int graph_n
Definition graph.h:83
unsigned * incoming_slot
Definition graph.h:55
unsigned n_outgoing
Definition graph.h:69
struct _starpu_graph_node_multilist_dropped dropped
Definition graph.h:49
void _starpu_graph_drop_job(struct _starpu_job *job)
unsigned n_incoming
Definition graph.h:57
Definition graph.h:33
#define struct
Definition list.h:175
Definition jobs.h:74