40 #define FILENAME_LEN 32
46 printf(
"Usage: global_controller -j /path/to/json [-o json_file] [-p dfg_out_port] [-c control_port]\n");
49 int main(
int argc,
char *argv[]) {
55 char *output_filename = NULL;
57 int control_port = -1;
61 struct option longopts[] = {
62 {
"db", no_argument, 0, 0 },
63 {
"init-db", no_argument, 0, 0},
68 while ((option = getopt_long(argc, argv,
"j:o:p:c:", longopts, &opt_index)) != -1) {
71 if (strcmp(longopts[opt_index].
name,
"db") == 0) {
73 }
else if (strcmp(longopts[opt_index].name,
"init-db") == 0) {
81 case 'j' : strcpy(filename, optarg);
83 case 'o' : output_filename = optarg;
85 case 'p' : output_port = atoi(optarg);
87 case 'd' : init_db =
true;
89 case 'c' : control_port = atoi(optarg);
96 if (strlen(filename) == 0) {
105 log_error(
"Error initializing DFG lock");
126 log_error(
"Error initializing statistics");
int main(int argc, char **argv)
Entry point to start the runtime.
int runtime_communication_loop(int listen_port, char *output_file, int output_port)
Logging of status messages to the terminal.
Access local files within the repo.
#define log_error(fmt,...)
Declares function for converting JSON to dedos_dfg.
int set_local_directory(char *dir)
Sets the directory of the executable so we can get relaitve paths.
int init_statistics()
Initializes the entire stats module.
int db_init(int clear)
Initialize the MySQL client library, and connect to the server Also init tables for running system...
int start_cli_thread(pthread_t *cli_thread)
void init_db(char *ip, int port, int n_files)
static void print_usage()
int init_controller_dfg(char *filename)
Interfaces for the creation and modification of the data-flow-graph and and general description of th...
int start_socket_interface_thread(pthread_t *thread, int port)