SimGrid  3.16
Versatile Simulation of Distributed Systems

Detailed Description

Functions to specify the dependencies between tasks.

This section describes the functions for managing the dependencies between the tasks.

See also
Tasks

Functions

void SD_task_dependency_add (const char *name, void *data, SD_task_t src, SD_task_t dst)
 Adds a dependency between two tasks. More...
 
void SD_task_dependency_remove (SD_task_t src, SD_task_t dst)
 Remove a dependency between two tasks. More...
 
int SD_task_dependency_exists (SD_task_t src, SD_task_t dst)
 Indicates whether there is a dependency between two tasks. More...
 

Function Documentation

◆ SD_task_dependency_add()

void SD_task_dependency_add ( const char *  name,
void data,
SD_task_t  src,
SD_task_t  dst 
)

Adds a dependency between two tasks.

dst will depend on src, ie dst will not start before src is finished. Their state must be SD_NOT_SCHEDULED, SD_SCHEDULED or SD_RUNNABLE.

Parameters
namethe name of the new dependency (can be nullptr)
datathe user data you want to associate with this dependency (can be nullptr)
srcthe task which must be executed first
dstthe task you want to make depend on src
See also
SD_task_dependency_remove()

◆ SD_task_dependency_remove()

void SD_task_dependency_remove ( SD_task_t  src,
SD_task_t  dst 
)

Remove a dependency between two tasks.

Parameters
srca task
dsta task depending on src
See also
SD_task_dependency_add()

◆ SD_task_dependency_exists()

int SD_task_dependency_exists ( SD_task_t  src,
SD_task_t  dst 
)

Indicates whether there is a dependency between two tasks.

Parameters
srca task
dsta task depending on src

If src is nullptr, checks whether dst has any pre-dependency. If dst is nullptr, checks whether src has any post-dependency.