StarPU Internal Handbook

Data Structures | Functions | Variables
graph.h File Reference
`#include <common/list.h>`

Go to the source code of this file.

## Data Structures
struct | _starpu_graph_node

## Functions
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)

## Variables
int | _starpu_graph_record

## Data Structure Documentation

## ◆ _starpu_graph_node

struct _starpu_graph_node

Data Fields
starpu_pthread_mutex_t | mutex | protects access to the job
struct _starpu_job * | job | pointer to the job, if it is still alive, NULL otherwise
struct _starpu_graph_node_multilist_top | top | Fields for graph analysis for scheduling heuristics Member of list of all jobs without incoming dependency
struct _starpu_graph_node_multilist_bottom | bottom | Member of list of all jobs without outgoing dependency
struct _starpu_graph_node_multilist_all | all | Member of list of all jobs
struct _starpu_graph_node_multilist_dropped | dropped | Member of list of dropped jobs
struct _starpu_graph_node ** | incoming | set of incoming dependencies May contain NULLs for terminated jobs
unsigned * | incoming_slot | Index within corresponding outgoing array
unsigned | n_incoming | Number of slots used
unsigned | alloc_incoming | Size of incoming
struct _starpu_graph_node ** | outgoing | set of outgoing dependencies
unsigned * | outgoing_slot | Index within corresponding incoming array
unsigned | n_outgoing | Number of slots used
unsigned | alloc_outgoing | Size of outgoing
unsigned | depth | Rank from bottom, in number of jobs Only available if _starpu_graph_compute_depths was called
unsigned | descendants | Number of children, grand-children, etc. Only available if _starpu_graph_compute_descendants was called
int | graph_n | Variable available for graph flow

## Function Documentation

## ◆ _starpu_graph_add_job()

void _starpu_graph_add_job | ( | struct _starpu_job * | job | ) |

Add a job to the graph, called before any _starpu_graph_add_job_dep call

## ◆ _starpu_graph_add_job_dep()

void _starpu_graph_add_job_dep | ( | struct _starpu_job * | job,
|  | struct _starpu_job * | prev_job
| ) |  |

Add a dependency between jobs

## ◆ _starpu_graph_drop_job()

void _starpu_graph_drop_job | ( | struct _starpu_job * | job | ) |

Remove a job from the graph

## ◆ _starpu_graph_drop_dropped_nodes()

void _starpu_graph_drop_dropped_nodes | ( | void |  | ) |

Really drop the nodes from the graph now

## ◆ _starpu_graph_compute_depths()

void _starpu_graph_compute_depths | ( | void |  | ) |

This make StarPU compute for each task the depth, i.e. the length of the longest path to a task without outgoing dependencies. This does not take job duration into account, just the number

## ◆ _starpu_graph_compute_descendants()

void _starpu_graph_compute_descendants | ( | void |  | ) |

Compute the descendants of jobs in the graph

## ◆ _starpu_graph_foreach()

void _starpu_graph_foreach | ( | void(*)(void *data, struct _starpu_graph_node *node) | func,
|  | void * | data
| ) |  |

This calls func for each node of the task graph, passing also data as it Apply func on each job of the graph