44 " -j dfg.json -i runtime_id [-l statlog] [-p profiling_prob]"
49 int main(
int argc,
char **argv) {
51 char *dfg_json = NULL;
56 struct option long_options[] = {
62 int c = getopt_long(argc, argv,
"j:i:l:p:", long_options, &option_index);
72 runtime_id = atoi(optarg);
78 prof_prob = atof(optarg);
81 printf(
"Unknown option provided: %c. Exiting\n", c);
86 if (dfg_json == NULL || runtime_id == -1) {
93 log_warn(
"Error initializing runtime statistics");
98 log_critical(
"Error initializing runtime %d from json file %s. Exiting",
99 runtime_id, dfg_json);
103 struct sockaddr_in ctrl_addr;
106 log_critical(
"Could not get controller address from DFG");
111 if (output_thread == NULL) {
119 log_critical(
"Error running socket monitor. Runtime will exit");
int main(int argc, char **argv)
Entry point to start the runtime.
void finalize_statistics(char *statlog)
Writes the statistics to statlog if provided, and frees assocated structure.
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...
Collecting statistics within the runtime.
int controller_address(struct sockaddr_in *addr)
Gets the sockaddr associated with the global controller.
#define log_info(fmt,...)
#define log_critical(fmt,...)
Monitors an incoming port for messages from runtime or controller.
void join_output_thread()
Joins the underlying pthread.
Logging of status messages to the terminal.
Access local files within the repo.
Interactions with global dfg from individual runtime.
struct dedos_thread * start_output_monitor_thread(void)
Starts the thread monitoring the queue for messages to be sent to other endpoints.
For profiling the path of MSU messages through DeDOS.
#define USAGE_ARGS
The command-line arguments.
int set_local_directory(char *dir)
Sets the directory of the executable so we can get relaitve paths.
A dedos_thread which monitors a queue for output to be sent to other runtimes or the global controlle...
int init_statistics()
Initializes the entire stats module.
void stop_all_worker_threads()
Signals all worker threads to stop.
void stop_output_monitor()
Triggers the output thread to stop execution.
static int runtime_id(int runtime_fd)
#define INIT_PROFILER(tprof)
Initializes the profiler with the provided probability of profiling.
int run_socket_monitor(int local_port, struct sockaddr_in *ctrl_addr)
Starts (blocking) the socket monitor, listening on the provided port.
#define log_warn(fmt,...)
void free_runtime_dfg()
Frees the runtime's static instance of the DFG.
Structure representing any thread within DeDOS.
Communication with global controller from runtime.