graph.h
Go to the documentation of this file.
/* StarPU --- Runtime system for heterogeneous multicore architectures.
*
* Copyright (C) 2016-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
*
* StarPU is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* StarPU is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU Lesser General Public License in COPYING.LGPL for more details.
*/
#ifndef __GRAPH_H__
#define __GRAPH_H__
#include <common/list.h>
MULTILIST_CREATE_TYPE(_starpu_graph_node, all)
MULTILIST_CREATE_TYPE(_starpu_graph_node, top)
MULTILIST_CREATE_TYPE(_starpu_graph_node, bottom)
MULTILIST_CREATE_TYPE(_starpu_graph_node, dropped)
struct _starpu_graph_node
{
starpu_pthread_mutex_t mutex;
struct _starpu_job *job;
struct _starpu_graph_node_multilist_top top;
struct _starpu_graph_node_multilist_bottom bottom;
struct _starpu_graph_node_multilist_all all;
struct _starpu_graph_node_multilist_dropped dropped;
struct _starpu_graph_node **incoming;
unsigned *incoming_slot;
unsigned n_incoming;
unsigned alloc_incoming;
struct _starpu_graph_node **outgoing;
unsigned *outgoing_slot;
unsigned n_outgoing;
unsigned alloc_outgoing;
unsigned depth;
unsigned descendants;
int graph_n;
};
MULTILIST_CREATE_INLINES(struct _starpu_graph_node, _starpu_graph_node, all)
MULTILIST_CREATE_INLINES(struct _starpu_graph_node, _starpu_graph_node, top)
MULTILIST_CREATE_INLINES(struct _starpu_graph_node, _starpu_graph_node, bottom)
MULTILIST_CREATE_INLINES(struct _starpu_graph_node, _starpu_graph_node, dropped)
extern int _starpu_graph_record;
void _starpu_graph_init(void);
void _starpu_graph_wrlock(void);
void _starpu_graph_rdlock(void);
void _starpu_graph_wrunlock(void);
void _starpu_graph_rdunlock(void);
void _starpu_graph_add_job(struct _starpu_job *job);
void _starpu_graph_add_job_dep(struct _starpu_job *job, struct _starpu_job *prev_job);
void _starpu_graph_drop_job(struct _starpu_job *job);
void _starpu_graph_drop_dropped_nodes(void);
void _starpu_graph_compute_depths(void);
void _starpu_graph_compute_descendants(void);
void _starpu_graph_foreach(void (*func)(void *data, struct _starpu_graph_node *node), void *data);
#endif /* __GRAPH_H__ */
_starpu_graph_add_job
void _starpu_graph_add_job(struct _starpu_job *job)
_starpu_graph_node::depth
unsigned depth
Definition: graph.h:70
_starpu_graph_compute_descendants
void _starpu_graph_compute_descendants(void)
_starpu_graph_node::outgoing_slot
unsigned * outgoing_slot
Definition: graph.h:61
_starpu_graph_node::alloc_incoming
unsigned alloc_incoming
Definition: graph.h:56
_starpu_graph_drop_dropped_nodes
void _starpu_graph_drop_dropped_nodes(void)
_starpu_graph_add_job_dep
void _starpu_graph_add_job_dep(struct _starpu_job *job, struct _starpu_job *prev_job)
_starpu_graph_node::job
struct _starpu_job * job
Definition: graph.h:34
_starpu_graph_node::incoming
struct _starpu_graph_node ** incoming
Definition: graph.h:50
_starpu_graph_node::descendants
unsigned descendants
Definition: graph.h:74
_starpu_graph_compute_depths
void _starpu_graph_compute_depths(void)
_starpu_graph_node::mutex
starpu_pthread_mutex_t mutex
Definition: graph.h:32
_starpu_graph_foreach
void _starpu_graph_foreach(void(*func)(void *data, struct _starpu_graph_node *node), void *data)
_starpu_graph_node::bottom
struct _starpu_graph_node_multilist_bottom bottom
Definition: graph.h:42
_starpu_graph_node::top
struct _starpu_graph_node_multilist_top top
Definition: graph.h:40
_starpu_graph_node::outgoing
struct _starpu_graph_node ** outgoing
Definition: graph.h:58
_starpu_graph_node::all
struct _starpu_graph_node_multilist_all all
Definition: graph.h:44
_starpu_graph_node::alloc_outgoing
unsigned alloc_outgoing
Definition: graph.h:65
_starpu_graph_node::graph_n
int graph_n
Definition: graph.h:77
_starpu_graph_node::incoming_slot
unsigned * incoming_slot
Definition: graph.h:52
_starpu_graph_node::n_outgoing
unsigned n_outgoing
Definition: graph.h:63
_starpu_graph_node::dropped
struct _starpu_graph_node_multilist_dropped dropped
Definition: graph.h:46
_starpu_graph_drop_job
void _starpu_graph_drop_job(struct _starpu_job *job)
_starpu_graph_node::n_incoming
unsigned n_incoming
Definition: graph.h:54
_starpu_graph_node
Definition: graph.h:30
list.h
struct
#define struct
Definition: list.h:172
_starpu_job
Definition: jobs.h:79