44 log_error(
"Runtime DFG already instantiated!");
56 if (LOCAL_RUNTIME == NULL) {
57 log_error(
"Error finding runtime %d in DFG %s",
58 runtime_id, filename);
63 log_error(
"Error instantiating MSU types found in %s",
69 log_error(
"Error instantiating runtime %d from %s",
70 runtime_id, filename);
79 log_error(
"Runtime DFG not instantiated");
83 bzero(addr,
sizeof(*addr));
84 addr->sin_family = AF_INET;
92 if (LOCAL_RUNTIME == NULL) {
93 log_error(
"Runtime DFG not instantiated");
96 return LOCAL_RUNTIME->
id;
100 if (LOCAL_RUNTIME == NULL) {
101 log_error(
"Runtime DFG not instantiated");
104 return LOCAL_RUNTIME->
port;
108 if (LOCAL_RUNTIME == NULL) {
109 log_error(
"Runtime DFG not implemented");
112 return LOCAL_RUNTIME->
ip;
void set_local_runtime(struct dfg_runtime *rt)
Sets the local runtime to be equal to the provided rt.
int init_runtime_dfg(char *filename, int runtime_id)
Initializes the DFG as loaded from a JSON file, and sets the global variables such that the DFG and r...
uint32_t ip
IP of the node on which the runtime is running.
int controller_address(struct sockaddr_in *addr)
Gets the sockaddr associated with the global controller.
uint32_t local_runtime_ip()
int global_ctl_port
Port of the global controller.
#define log_info(fmt,...)
void destroy_msu_types()
Calls the type-sepecific constructor for each instantiated MSU type.
uint32_t global_ctl_ip
IP address of the global controller.
static struct dedos_dfg * DFG
Static (global) variable for accessing a lodaed Dfg.
Defines a type of MSU, including callback and accessor functions.
void free_dfg(struct dedos_dfg *dfg)
Frees the entirety of the DFG structure.
Instantiation of a dfg on a runtime.
int n_msu_types
The number of elements in dedos_dfg::msu_types.
struct dfg_runtime * get_dfg_runtime(unsigned int runtime_id)
Returns the runtime with the given ID.
int id
Unique identifier for the runtime.
Logging of status messages to the terminal.
Interactions with global dfg from individual runtime.
Representation of a runtime in the DFG.
#define log_error(fmt,...)
void set_dfg(struct dedos_dfg *dfg_in)
Sets the local copy of the DFG, so it doesn't have to be passed in for each call. ...
Declares function for converting JSON to dedos_dfg.
struct dfg_msu_type * msu_types[32]
MSU types which may be present in the application.
Top-level structure holding the data-flow graph.
struct dedos_dfg * parse_dfg_json_file(const char *filename)
Converts a json file to a dfg structure.
int instantiate_dfg_runtime(struct dfg_runtime *rt)
Instantiates the MSUs, routes, and threads on the specified runtime.
int init_dfg_msu_types(struct dfg_msu_type **msu_types, int n_msu_types)
Runs the runtime initilization function for the given MSU types.
static int runtime_id(int runtime_fd)
struct dedos_dfg * get_dfg()
static struct dfg_runtime * LOCAL_RUNTIME
Static (global) variable holding this runtime's dfg.
int port
Port on which the runtime is listening for controller/inter-runtime.
void free_runtime_dfg()
Frees the runtime's static instance of the DFG.