Interfaces for the creation and modification of the data-flow-graph and and general description of the application running within DeDOS. More...
#include <stdio.h>
#include <pthread.h>
#include <arpa/inet.h>
Go to the source code of this file.
Classes | |
struct | msu_init_data |
Data with which an MSU is initialized, and the payload for messages of type CTRL_CREATE_MSU. More... | |
struct | dfg_runtime |
Representation of a runtime in the DFG. More... | |
struct | dfg_thread |
Representation of a thread on a runtime in the DFG. More... | |
struct | dfg_scheduling |
Structure representing the scheduling of an MSU on a runtime. More... | |
struct | dfg_meta_routing |
Describes which MSU types a given MSU type should route to if it is cloned. More... | |
struct | dfg_route_endpoint |
A single endpoint for an MSU route. More... | |
struct | dfg_route |
A route through which MSU messages can be passed. More... | |
struct | dfg_msu_type |
A type of MSU. More... | |
struct | dfg_dependency |
MSUs which must be present for another MSU to be cloned. More... | |
struct | dfg_msu |
Representation of a single MSU in the dfg. More... | |
struct | db_info |
Info to connect and use database. More... | |
struct | dedos_dfg |
Top-level structure holding the data-flow graph. More... | |
Macros | |
#define | MAX_MSU 512 |
The maximum number of MSUs which can be present in the system at a time. More... | |
#define | MAIN_THREAD_ID 0 |
The ID to which messages should be addressed when delivered to the main runtime thread. More... | |
#define | MAX_RUNTIMES 16 |
The maximum number of runtimes that may be present in the DFG. More... | |
#define | MAX_THREADS 32 |
The maximum number of threads that may be present on a runtime. More... | |
#define | MAX_ROUTES 64 |
The total maximum number of routes that may be present in the DFG. More... | |
#define | MAX_ROUTE_ENDPOINTS 256 |
The maximum number of endpoints that a single route may have as destinations. More... | |
#define | MAX_INIT_DATA_LEN 64 |
The maximum length of the initial data that may be passed to an MSU. More... | |
#define | MAX_MSU_NAME_LEN 32 |
The maximum length of the name for an MSU type. More... | |
#define | MAX_MSU_TYPES 32 |
The maximum number of different MSU types that may be present in the DFG. More... | |
#define | MAX_APP_NAME_LENGTH 64 |
The maximum length for the name of the application. More... | |
#define | MAX_MSU_PER_THREAD 8 |
The maximum number of MSUs which can be placed on a single thread. More... | |
#define | ENTRY_VERTEX_TYPE 0x01 |
Bitmask representing an MSU through which messages enter DeDOS. More... | |
#define | EXIT_VERTEX_TYPE 0x02 |
Bitmask representing an MSU through which messages exit DeDOS. More... | |
Enumerations | |
enum | thread_mode { UNSPECIFIED_THREAD_MODE = 0, PINNED_THREAD = 1, UNPINNED_THREAD = 2 } |
Identifies if a thread is pinned to a core or able to be scheduled on any core. More... | |
enum | blocking_mode { UNKNOWN_BLOCKING_MODE = 0, BLOCKING_MSU = 1, NONBLOCK_MSU = 2 } |
Whether an MSU is blocking or non-blocking. More... | |
enum | msu_locality { UNDEFINED_LOCALITY = 0, MSU_IS_LOCAL = 1, MSU_IS_REMOTE = 2 } |
Whether an MSU is located on the same runtime or a remote runtime. More... | |
Functions | |
enum thread_mode | str_to_thread_mode (char *mode) |
Converts a string of pinned/unpinned to the corresponding enumerator. More... | |
enum blocking_mode | str_to_blocking_mode (char *mode_str) |
Converts a string of blocking/non-blocking to the correct enumerator. More... | |
uint8_t | str_to_vertex_type (char *type_str) |
Converts a string containing exit and/or entry to the correct bitmask. More... | |
void | set_dfg (struct dedos_dfg *dfg) |
Sets the local copy of the DFG, so it doesn't have to be passed in for each call. More... | |
struct db_info * | get_db_info () |
Returns DB info. More... | |
int | get_dfg_n_runtimes () |
Returns the number of registered runtime. More... | |
struct dfg_runtime * | get_dfg_runtime (unsigned int id) |
Returns the runtime with the given ID. More... | |
struct dfg_msu_type * | get_dfg_msu_type (unsigned int id) |
Returns the MSU type with the given ID. More... | |
struct dfg_route * | get_dfg_route (unsigned int id) |
Returns the route with the given ID. More... | |
struct dfg_route * | get_dfg_rt_route_by_type (struct dfg_runtime *rt, struct dfg_msu_type *route_type) |
Returns the route on the given runtime with the specified MSU type. More... | |
struct dfg_route * | get_dfg_msu_route_by_type (struct dfg_msu *msu, struct dfg_msu_type *route_type) |
Returns the route which the given MSU sends to of the specified MSU type. More... | |
struct dfg_msu * | get_dfg_msu (unsigned int id) |
Returns the MSU with the given ID. More... | |
struct dfg_thread * | get_dfg_thread (struct dfg_runtime *rt, unsigned int id) |
Returns the thread on the given runtime with the specified ID. More... | |
struct dfg_route_endpoint * | get_dfg_route_endpoint (struct dfg_route *route, unsigned int msu_id) |
Returns the endpoint within the given route which has the specified MSU ID. More... | |
int | msu_has_route (struct dfg_msu *msu, struct dfg_route *route) |
Returns 1 if the given MSU has the route as an endpoint. More... | |
struct dfg_msu * | msu_type_on_runtime (struct dfg_runtime *rt, struct dfg_msu_type *type) |
Returns 1 if the given MSU type is present on the provided runtime. More... | |
struct dfg_msu * | copy_dfg_msu (struct dfg_msu *input) |
Allocates a new MSU with the same fields as the input MSU (though unscheduled) More... | |
struct dfg_msu * | init_dfg_msu (unsigned int id, struct dfg_msu_type *type, uint8_t vertex_type, enum blocking_mode mode, struct msu_init_data *init_data) |
Allocates a new MSU with the given parameters. More... | |
int | free_dfg_msu (struct dfg_msu *input) |
Frees an MSU structure. More... | |
int | schedule_dfg_msu (struct dfg_msu *msu, unsigned int runtime_id, unsigned int thread_id) |
Places the given MSU on the correct runtime and thread. More... | |
int | unschedule_dfg_msu (struct dfg_msu *msu) |
Removes the given MSU from its runtime and thread. More... | |
struct dfg_route * | create_dfg_route (unsigned int id, struct dfg_msu_type *type, unsigned int runtime_id) |
Creates a route with the specified parameters. More... | |
int | delete_dfg_route (struct dfg_route *route) |
Deletes the provided route from the DFG. More... | |
int | add_dfg_route_to_msu (struct dfg_route *route, struct dfg_msu *msu) |
Subscribes an MSU to a route, so it can send to the route's endpoints. More... | |
struct dfg_route_endpoint * | add_dfg_route_endpoint (struct dfg_msu *msu, uint32_t key, struct dfg_route *route) |
Adds an MSU as an endpoint to a route. More... | |
int | del_dfg_route_endpoint (struct dfg_route *route, struct dfg_route_endpoint *ep) |
Removes an MSU as a route endpoint. More... | |
int | mod_dfg_route_endpoint (struct dfg_route *route, struct dfg_route_endpoint *ep, uint32_t new_key) |
Modifies the key associated with an MSU endpoint. More... | |
struct dfg_thread * | create_dfg_thread (struct dfg_runtime *rt, int thread_id, enum thread_mode mode) |
Creates a new thread on the given runtime. More... | |
void | free_dfg (struct dedos_dfg *dfg) |
Frees the entirety of the DFG structure. More... | |
Interfaces for the creation and modification of the data-flow-graph and and general description of the application running within DeDOS.
Definition in file dfg.h.
#define ENTRY_VERTEX_TYPE 0x01 |
#define EXIT_VERTEX_TYPE 0x02 |
#define MAIN_THREAD_ID 0 |
#define MAX_APP_NAME_LENGTH 64 |
#define MAX_INIT_DATA_LEN 64 |
#define MAX_MSU 512 |
#define MAX_MSU_NAME_LEN 32 |
#define MAX_MSU_PER_THREAD 8 |
#define MAX_MSU_TYPES 32 |
#define MAX_ROUTE_ENDPOINTS 256 |
#define MAX_ROUTES 64 |
#define MAX_RUNTIMES 16 |
#define MAX_THREADS 32 |
enum blocking_mode |
enum msu_locality |
enum thread_mode |
struct dfg_route_endpoint* add_dfg_route_endpoint | ( | struct dfg_msu * | msu, |
uint32_t | key, | ||
struct dfg_route * | route | ||
) |
struct dfg_route* create_dfg_route | ( | unsigned int | id, |
struct dfg_msu_type * | type, | ||
unsigned int | runtime_id | ||
) |
struct dfg_thread* create_dfg_thread | ( | struct dfg_runtime * | rt, |
int | thread_id, | ||
enum thread_mode | mode | ||
) |
int del_dfg_route_endpoint | ( | struct dfg_route * | route, |
struct dfg_route_endpoint * | ep | ||
) |
int delete_dfg_route | ( | struct dfg_route * | route | ) |
void free_dfg | ( | struct dedos_dfg * | dfg | ) |
int free_dfg_msu | ( | struct dfg_msu * | input | ) |
struct dfg_msu* get_dfg_msu | ( | unsigned int | id | ) |
struct dfg_route* get_dfg_msu_route_by_type | ( | struct dfg_msu * | msu, |
struct dfg_msu_type * | route_type | ||
) |
struct dfg_msu_type* get_dfg_msu_type | ( | unsigned int | id | ) |
int get_dfg_n_runtimes | ( | ) |
struct dfg_route* get_dfg_route | ( | unsigned int | id | ) |
struct dfg_route_endpoint* get_dfg_route_endpoint | ( | struct dfg_route * | route, |
unsigned int | msu_id | ||
) |
struct dfg_route* get_dfg_rt_route_by_type | ( | struct dfg_runtime * | rt, |
struct dfg_msu_type * | route_type | ||
) |
struct dfg_runtime* get_dfg_runtime | ( | unsigned int | id | ) |
struct dfg_thread* get_dfg_thread | ( | struct dfg_runtime * | rt, |
unsigned int | id | ||
) |
struct dfg_msu* init_dfg_msu | ( | unsigned int | id, |
struct dfg_msu_type * | type, | ||
uint8_t | vertex_type, | ||
enum blocking_mode | mode, | ||
struct msu_init_data * | init_data | ||
) |
int mod_dfg_route_endpoint | ( | struct dfg_route * | route, |
struct dfg_route_endpoint * | ep, | ||
uint32_t | new_key | ||
) |
struct dfg_msu* msu_type_on_runtime | ( | struct dfg_runtime * | rt, |
struct dfg_msu_type * | type | ||
) |
int schedule_dfg_msu | ( | struct dfg_msu * | msu, |
unsigned int | runtime_id, | ||
unsigned int | thread_id | ||
) |
void set_dfg | ( | struct dedos_dfg * | dfg | ) |
enum blocking_mode str_to_blocking_mode | ( | char * | mode_str | ) |
enum thread_mode str_to_thread_mode | ( | char * | mode | ) |
uint8_t str_to_vertex_type | ( | char * | type_str | ) |