From 9a0c7f292b96bfb7e93df8721017d7018d8dd644 Mon Sep 17 00:00:00 2001 From: Timo Schneider Date: Sat, 21 Oct 2023 15:29:21 +0200 Subject: [PATCH] make fortran wrappers print args --- .gitignore | 1 + src/CMakeLists.txt | 5 +- src/LogGOPSim/loggopsim_cmdline.c | 962 ++++++ src/LogGOPSim/loggopsim_cmdline.h | 235 ++ src/LogGOPSim/txt2bin.cpp | 2970 +++++++++++++++++ src/LogGOPSim/txt2bin_cmdline.c | 600 ++++ src/LogGOPSim/txt2bin_cmdline.h | 184 + src/Schedgen/schedgen_cmdline.c | 1060 ++++++ src/Schedgen/schedgen_cmdline.h | 260 ++ ...additional_microbenchmarks.cpython-311.pyc | Bin 0 -> 1274 bytes .../__pycache__/goal.cpython-311.pyc | Bin 0 -> 21275 bytes .../__pycache__/mpi_colls.cpython-311.pyc | Bin 0 -> 7689 bytes .../__pycache__/patterns.cpython-311.pyc | Bin 0 -> 13689 bytes src/Schedgen2/schedule.goal | 44 + src/liballprof2/gencode.py | 111 +- src/liballprof2/gensem.py | 4 +- 16 files changed, 6415 insertions(+), 21 deletions(-) create mode 100644 src/LogGOPSim/loggopsim_cmdline.c create mode 100644 src/LogGOPSim/loggopsim_cmdline.h create mode 100644 src/LogGOPSim/txt2bin.cpp create mode 100644 src/LogGOPSim/txt2bin_cmdline.c create mode 100644 src/LogGOPSim/txt2bin_cmdline.h create mode 100644 src/Schedgen/schedgen_cmdline.c create mode 100644 src/Schedgen/schedgen_cmdline.h create mode 100644 src/Schedgen2/__pycache__/additional_microbenchmarks.cpython-311.pyc create mode 100644 src/Schedgen2/__pycache__/goal.cpython-311.pyc create mode 100644 src/Schedgen2/__pycache__/mpi_colls.cpython-311.pyc create mode 100644 src/Schedgen2/__pycache__/patterns.cpython-311.pyc create mode 100644 src/Schedgen2/schedule.goal diff --git a/.gitignore b/.gitignore index 378eac2..7d75298 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build +__pycache__ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8656ff5..c63ccb1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -77,15 +77,16 @@ add_test(NAME loggopsim_schedgen2_bcast COMMAND LogGOPSim -f schedule.bin) # test liballprof # test liballprof2 +set(ENV{OMPI_MCA_rmaps_base_oversubscribe} "1") #Open MPI might need oversubscription enabled, MPICH doesn't, their cmdline args are not compatible, so this should work for both #c wrapper test add_executable(test_lap2_c ${PROJECT_SOURCE_DIR}/../tests/mpi_helloworld.c) target_link_libraries(test_lap2_c mpipclog) -add_test(NAME trace_lap2_c COMMAND ${MPIEXEC_EXECUTABLE} --oversubscribe ${MPIEXEC_NUMPROC_FLAG} 4 $) +add_test(NAME trace_lap2_c COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 4 $) add_test(NAME lap2_c_trace_exists COMMAND ${CMAKE_COMMAND} -E cat lap2-trace-rank-1-of-4.txt) # fortran wrapper test add_executable(test_lap2_f ${PROJECT_SOURCE_DIR}/../tests/mpi_helloworld.f90) target_link_libraries(test_lap2_f mpipflog) -add_test(NAME trace_lap2_f COMMAND ${MPIEXEC_EXECUTABLE} --oversubscribe ${MPIEXEC_NUMPROC_FLAG} 4 $) +add_test(NAME trace_lap2_f COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 4 $) add_test(NAME lap2_f_trace_exists COMMAND ${CMAKE_COMMAND} -E cat lap2-trace-rank-1-of-4.txt ) diff --git a/src/LogGOPSim/loggopsim_cmdline.c b/src/LogGOPSim/loggopsim_cmdline.c new file mode 100644 index 0000000..85907a2 --- /dev/null +++ b/src/LogGOPSim/loggopsim_cmdline.c @@ -0,0 +1,962 @@ +/* + File autogenerated by gengetopt version 2.23 + generated with the following command: + gengetopt -F loggopsim_cmdline -i /Users/tim0s/Work/LogGOPSim/src/LogGOPSim/loggopsim_cmdline.ggo --output-dir /Users/tim0s/Work/LogGOPSim/src/LogGOPSim + + The developers of gengetopt consider the fixed text that goes in all + gengetopt output files to be in the public domain: + we make no copyright claims on it. +*/ + +/* If we use autoconf. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#ifndef FIX_UNUSED +#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ +#endif + +#include + +#include "loggopsim_cmdline.h" + +const char *gengetopt_args_info_purpose = ""; + +const char *gengetopt_args_info_usage = "Usage: goalsim [OPTION]..."; + +const char *gengetopt_args_info_versiontext = ""; + +const char *gengetopt_args_info_description = ""; + +const char *gengetopt_args_info_help[] = { + " -h, --help Print help and exit", + " --version Print version and exit", + " -f, --filename=STRING Prefix for the filenames which contain the\n schedules", + " --save-mem Map the schedules as MAP_SHARED to enable\n processing of large schedule (larger than main\n memory). This will invalidate the schedules\n during simulation. (default=off)", + " -L, --LogGOPS_L=INT The latency parameter L in the LogGP model\n (default=`2500')", + " -o, --LogGOPS_o=INT The overhead parameter o in the LogGP model\n (default=`1500')", + " -g, --LogGOPS_g=INT The gap per message parameter g in the LogGP model\n (default=`1000')", + " -G, --LogGOPS_G=INT The gap per byte parameter G in the LogGP model\n (default=`6')", + " -S, --LogGOPS_S=INT Datasize at which we change from eager to\n rendezvous protocol (default=`65535')", + " -O, --LogGOPS_O=INT The overhead per byte in LogGOP (default=`0')", + " -V, --vizfile=STRING Name of the output file for visualization data", + " -v, --verbose Enable more verbose output", + " --progress print progress", + " -b, --batchmode enable batchmode (never print detailed host info)", + " --noise-trace=STRING Read Noise from trace ", + " --noise-cosched Co-schedule noise (use same starttime on all\n processes) (default=off)", + " -n, --network-type=STRING Network type (LogGP=no network congestion;\n simple=simple linear model) (possible\n values=\"LogGP\", \"simple\" default=`LogGP')", + " --network-file=STRING Input file for network (annotated dot format)", + " --qstat=STRING Enable PQ and UQ statistics. Argument is output\n filename prefix (default=`Unknown')", + 0 +}; + +typedef enum {ARG_NO + , ARG_FLAG + , ARG_STRING + , ARG_INT +} cmdline_parser_arg_type; + +static +void clear_given (struct gengetopt_args_info *args_info); +static +void clear_args (struct gengetopt_args_info *args_info); + +static int +cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error); + +static int +cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error); + +const char *cmdline_parser_network_type_values[] = {"LogGP", "simple", 0}; /*< Possible values for network-type. */ + +static char * +gengetopt_strdup (const char *s); + +static +void clear_given (struct gengetopt_args_info *args_info) +{ + args_info->help_given = 0 ; + args_info->version_given = 0 ; + args_info->filename_given = 0 ; + args_info->save_mem_given = 0 ; + args_info->LogGOPS_L_given = 0 ; + args_info->LogGOPS_o_given = 0 ; + args_info->LogGOPS_g_given = 0 ; + args_info->LogGOPS_G_given = 0 ; + args_info->LogGOPS_S_given = 0 ; + args_info->LogGOPS_O_given = 0 ; + args_info->vizfile_given = 0 ; + args_info->verbose_given = 0 ; + args_info->progress_given = 0 ; + args_info->batchmode_given = 0 ; + args_info->noise_trace_given = 0 ; + args_info->noise_cosched_given = 0 ; + args_info->network_type_given = 0 ; + args_info->network_file_given = 0 ; + args_info->qstat_given = 0 ; +} + +static +void clear_args (struct gengetopt_args_info *args_info) +{ + FIX_UNUSED (args_info); + args_info->filename_arg = NULL; + args_info->filename_orig = NULL; + args_info->save_mem_flag = 0; + args_info->LogGOPS_L_arg = 2500; + args_info->LogGOPS_L_orig = NULL; + args_info->LogGOPS_o_arg = 1500; + args_info->LogGOPS_o_orig = NULL; + args_info->LogGOPS_g_arg = 1000; + args_info->LogGOPS_g_orig = NULL; + args_info->LogGOPS_G_arg = 6; + args_info->LogGOPS_G_orig = NULL; + args_info->LogGOPS_S_arg = 65535; + args_info->LogGOPS_S_orig = NULL; + args_info->LogGOPS_O_arg = 0; + args_info->LogGOPS_O_orig = NULL; + args_info->vizfile_arg = NULL; + args_info->vizfile_orig = NULL; + args_info->noise_trace_arg = NULL; + args_info->noise_trace_orig = NULL; + args_info->noise_cosched_flag = 0; + args_info->network_type_arg = gengetopt_strdup ("LogGP"); + args_info->network_type_orig = NULL; + args_info->network_file_arg = NULL; + args_info->network_file_orig = NULL; + args_info->qstat_arg = gengetopt_strdup ("Unknown"); + args_info->qstat_orig = NULL; + +} + +static +void init_args_info(struct gengetopt_args_info *args_info) +{ + + + args_info->help_help = gengetopt_args_info_help[0] ; + args_info->version_help = gengetopt_args_info_help[1] ; + args_info->filename_help = gengetopt_args_info_help[2] ; + args_info->save_mem_help = gengetopt_args_info_help[3] ; + args_info->LogGOPS_L_help = gengetopt_args_info_help[4] ; + args_info->LogGOPS_o_help = gengetopt_args_info_help[5] ; + args_info->LogGOPS_g_help = gengetopt_args_info_help[6] ; + args_info->LogGOPS_G_help = gengetopt_args_info_help[7] ; + args_info->LogGOPS_S_help = gengetopt_args_info_help[8] ; + args_info->LogGOPS_O_help = gengetopt_args_info_help[9] ; + args_info->vizfile_help = gengetopt_args_info_help[10] ; + args_info->verbose_help = gengetopt_args_info_help[11] ; + args_info->progress_help = gengetopt_args_info_help[12] ; + args_info->batchmode_help = gengetopt_args_info_help[13] ; + args_info->noise_trace_help = gengetopt_args_info_help[14] ; + args_info->noise_cosched_help = gengetopt_args_info_help[15] ; + args_info->network_type_help = gengetopt_args_info_help[16] ; + args_info->network_file_help = gengetopt_args_info_help[17] ; + args_info->qstat_help = gengetopt_args_info_help[18] ; + +} + +void +cmdline_parser_print_version (void) +{ + printf ("%s %s\n", + (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), + CMDLINE_PARSER_VERSION); + + if (strlen(gengetopt_args_info_versiontext) > 0) + printf("\n%s\n", gengetopt_args_info_versiontext); +} + +static void print_help_common(void) +{ + size_t len_purpose = strlen(gengetopt_args_info_purpose); + size_t len_usage = strlen(gengetopt_args_info_usage); + + if (len_usage > 0) { + printf("%s\n", gengetopt_args_info_usage); + } + if (len_purpose > 0) { + printf("%s\n", gengetopt_args_info_purpose); + } + + if (len_usage || len_purpose) { + printf("\n"); + } + + if (strlen(gengetopt_args_info_description) > 0) { + printf("%s\n\n", gengetopt_args_info_description); + } +} + +void +cmdline_parser_print_help (void) +{ + int i = 0; + print_help_common(); + while (gengetopt_args_info_help[i]) + printf("%s\n", gengetopt_args_info_help[i++]); +} + +void +cmdline_parser_init (struct gengetopt_args_info *args_info) +{ + clear_given (args_info); + clear_args (args_info); + init_args_info (args_info); +} + +void +cmdline_parser_params_init(struct cmdline_parser_params *params) +{ + if (params) + { + params->override = 0; + params->initialize = 1; + params->check_required = 1; + params->check_ambiguity = 0; + params->print_errors = 1; + } +} + +struct cmdline_parser_params * +cmdline_parser_params_create(void) +{ + struct cmdline_parser_params *params = + (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); + cmdline_parser_params_init(params); + return params; +} + +static void +free_string_field (char **s) +{ + if (*s) + { + free (*s); + *s = 0; + } +} + + +static void +cmdline_parser_release (struct gengetopt_args_info *args_info) +{ + + free_string_field (&(args_info->filename_arg)); + free_string_field (&(args_info->filename_orig)); + free_string_field (&(args_info->LogGOPS_L_orig)); + free_string_field (&(args_info->LogGOPS_o_orig)); + free_string_field (&(args_info->LogGOPS_g_orig)); + free_string_field (&(args_info->LogGOPS_G_orig)); + free_string_field (&(args_info->LogGOPS_S_orig)); + free_string_field (&(args_info->LogGOPS_O_orig)); + free_string_field (&(args_info->vizfile_arg)); + free_string_field (&(args_info->vizfile_orig)); + free_string_field (&(args_info->noise_trace_arg)); + free_string_field (&(args_info->noise_trace_orig)); + free_string_field (&(args_info->network_type_arg)); + free_string_field (&(args_info->network_type_orig)); + free_string_field (&(args_info->network_file_arg)); + free_string_field (&(args_info->network_file_orig)); + free_string_field (&(args_info->qstat_arg)); + free_string_field (&(args_info->qstat_orig)); + + + + clear_given (args_info); +} + +/** + * @param val the value to check + * @param values the possible values + * @return the index of the matched value: + * -1 if no value matched, + * -2 if more than one value has matched + */ +static int +check_possible_values(const char *val, const char *values[]) +{ + int i, found, last; + size_t len; + + if (!val) /* otherwise strlen() crashes below */ + return -1; /* -1 means no argument for the option */ + + found = last = 0; + + for (i = 0, len = strlen(val); values[i]; ++i) + { + if (strncmp(val, values[i], len) == 0) + { + ++found; + last = i; + if (strlen(values[i]) == len) + return i; /* exact macth no need to check more */ + } + } + + if (found == 1) /* one match: OK */ + return last; + + return (found ? -2 : -1); /* return many values or none matched */ +} + + +static void +write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) +{ + int found = -1; + if (arg) { + if (values) { + found = check_possible_values(arg, values); + } + if (found >= 0) + fprintf(outfile, "%s=\"%s\" # %s\n", opt, arg, values[found]); + else + fprintf(outfile, "%s=\"%s\"\n", opt, arg); + } else { + fprintf(outfile, "%s\n", opt); + } +} + + +int +cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) +{ + int i = 0; + + if (!outfile) + { + fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); + return EXIT_FAILURE; + } + + if (args_info->help_given) + write_into_file(outfile, "help", 0, 0 ); + if (args_info->version_given) + write_into_file(outfile, "version", 0, 0 ); + if (args_info->filename_given) + write_into_file(outfile, "filename", args_info->filename_orig, 0); + if (args_info->save_mem_given) + write_into_file(outfile, "save-mem", 0, 0 ); + if (args_info->LogGOPS_L_given) + write_into_file(outfile, "LogGOPS_L", args_info->LogGOPS_L_orig, 0); + if (args_info->LogGOPS_o_given) + write_into_file(outfile, "LogGOPS_o", args_info->LogGOPS_o_orig, 0); + if (args_info->LogGOPS_g_given) + write_into_file(outfile, "LogGOPS_g", args_info->LogGOPS_g_orig, 0); + if (args_info->LogGOPS_G_given) + write_into_file(outfile, "LogGOPS_G", args_info->LogGOPS_G_orig, 0); + if (args_info->LogGOPS_S_given) + write_into_file(outfile, "LogGOPS_S", args_info->LogGOPS_S_orig, 0); + if (args_info->LogGOPS_O_given) + write_into_file(outfile, "LogGOPS_O", args_info->LogGOPS_O_orig, 0); + if (args_info->vizfile_given) + write_into_file(outfile, "vizfile", args_info->vizfile_orig, 0); + if (args_info->verbose_given) + write_into_file(outfile, "verbose", 0, 0 ); + if (args_info->progress_given) + write_into_file(outfile, "progress", 0, 0 ); + if (args_info->batchmode_given) + write_into_file(outfile, "batchmode", 0, 0 ); + if (args_info->noise_trace_given) + write_into_file(outfile, "noise-trace", args_info->noise_trace_orig, 0); + if (args_info->noise_cosched_given) + write_into_file(outfile, "noise-cosched", 0, 0 ); + if (args_info->network_type_given) + write_into_file(outfile, "network-type", args_info->network_type_orig, cmdline_parser_network_type_values); + if (args_info->network_file_given) + write_into_file(outfile, "network-file", args_info->network_file_orig, 0); + if (args_info->qstat_given) + write_into_file(outfile, "qstat", args_info->qstat_orig, 0); + + + i = EXIT_SUCCESS; + return i; +} + +int +cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) +{ + FILE *outfile; + int i = 0; + + outfile = fopen(filename, "w"); + + if (!outfile) + { + fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); + return EXIT_FAILURE; + } + + i = cmdline_parser_dump(outfile, args_info); + fclose (outfile); + + return i; +} + +void +cmdline_parser_free (struct gengetopt_args_info *args_info) +{ + cmdline_parser_release (args_info); +} + +/** @brief replacement of strdup, which is not standard */ +char * +gengetopt_strdup (const char *s) +{ + char *result = 0; + if (!s) + return result; + + result = (char*)malloc(strlen(s) + 1); + if (result == (char*)0) + return (char*)0; + strcpy(result, s); + return result; +} + +int +cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) +{ + return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); +} + +int +cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) +{ + int result; + result = cmdline_parser_internal (argc, argv, args_info, params, 0); + + if (result == EXIT_FAILURE) + { + cmdline_parser_free (args_info); + exit (EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) +{ + int result; + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); + + if (result == EXIT_FAILURE) + { + cmdline_parser_free (args_info); + exit (EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) +{ + int result = EXIT_SUCCESS; + + if (cmdline_parser_required2(args_info, prog_name, 0) > 0) + result = EXIT_FAILURE; + + if (result == EXIT_FAILURE) + { + cmdline_parser_free (args_info); + exit (EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) +{ + int error_occurred = 0; + FIX_UNUSED (additional_error); + + /* checks for required options */ + if (! args_info->filename_given) + { + fprintf (stderr, "%s: '--filename' ('-f') option required%s\n", prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + + + /* checks for dependences among options */ + + return error_occurred; +} + + +static char *package_name = 0; + +/** + * @brief updates an option + * @param field the generic pointer to the field to update + * @param orig_field the pointer to the orig field + * @param field_given the pointer to the number of occurrence of this option + * @param prev_given the pointer to the number of occurrence already seen + * @param value the argument for this option (if null no arg was specified) + * @param possible_values the possible values for this option (if specified) + * @param default_value the default value (in case the option only accepts fixed values) + * @param arg_type the type of this option + * @param check_ambiguity @see cmdline_parser_params.check_ambiguity + * @param override @see cmdline_parser_params.override + * @param no_free whether to free a possible previous value + * @param multiple_option whether this is a multiple option + * @param long_opt the corresponding long option + * @param short_opt the corresponding short option (or '-' if none) + * @param additional_error possible further error specification + */ +static +int update_arg(void *field, char **orig_field, + unsigned int *field_given, unsigned int *prev_given, + char *value, const char *possible_values[], + const char *default_value, + cmdline_parser_arg_type arg_type, + int check_ambiguity, int override, + int no_free, int multiple_option, + const char *long_opt, char short_opt, + const char *additional_error) +{ + char *stop_char = 0; + const char *val = value; + int found; + char **string_field; + FIX_UNUSED (field); + + stop_char = 0; + found = 0; + + if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) + { + if (short_opt != '-') + fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", + package_name, long_opt, short_opt, + (additional_error ? additional_error : "")); + else + fprintf (stderr, "%s: `--%s' option given more than once%s\n", + package_name, long_opt, + (additional_error ? additional_error : "")); + return 1; /* failure */ + } + + if (possible_values && (found = check_possible_values((value ? value : default_value), possible_values)) < 0) + { + if (short_opt != '-') + fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s' (`-%c')%s\n", + package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt, short_opt, + (additional_error ? additional_error : "")); + else + fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s'%s\n", + package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt, + (additional_error ? additional_error : "")); + return 1; /* failure */ + } + + if (field_given && *field_given && ! override) + return 0; + if (prev_given) + (*prev_given)++; + if (field_given) + (*field_given)++; + if (possible_values) + val = possible_values[found]; + + switch(arg_type) { + case ARG_FLAG: + *((int *)field) = !*((int *)field); + break; + case ARG_INT: + if (val) *((int *)field) = strtol (val, &stop_char, 0); + break; + case ARG_STRING: + if (val) { + string_field = (char **)field; + if (!no_free && *string_field) + free (*string_field); /* free previous string */ + *string_field = gengetopt_strdup (val); + } + break; + default: + break; + }; + + /* check numeric conversion */ + switch(arg_type) { + case ARG_INT: + if (val && !(stop_char && *stop_char == '\0')) { + fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); + return 1; /* failure */ + } + break; + default: + ; + }; + + /* store the original value */ + switch(arg_type) { + case ARG_NO: + case ARG_FLAG: + break; + default: + if (value && orig_field) { + if (no_free) { + *orig_field = value; + } else { + if (*orig_field) + free (*orig_field); /* free previous string */ + *orig_field = gengetopt_strdup (value); + } + } + }; + + return 0; /* OK */ +} + + +int +cmdline_parser_internal ( + int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error) +{ + int c; /* Character of the parsed option. */ + + int error_occurred = 0; + struct gengetopt_args_info local_args_info; + + int override; + int initialize; + int check_required; + int check_ambiguity; + + package_name = argv[0]; + + /* TODO: Why is this here? It is not used anywhere. */ + override = params->override; + FIX_UNUSED(override); + + initialize = params->initialize; + check_required = params->check_required; + + /* TODO: Why is this here? It is not used anywhere. */ + check_ambiguity = params->check_ambiguity; + FIX_UNUSED(check_ambiguity); + + if (initialize) + cmdline_parser_init (args_info); + + cmdline_parser_init (&local_args_info); + + optarg = 0; + optind = 0; + opterr = params->print_errors; + optopt = '?'; + + while (1) + { + int option_index = 0; + + static struct option long_options[] = { + { "help", 0, NULL, 'h' }, + { "version", 0, NULL, 0 }, + { "filename", 1, NULL, 'f' }, + { "save-mem", 0, NULL, 0 }, + { "LogGOPS_L", 1, NULL, 'L' }, + { "LogGOPS_o", 1, NULL, 'o' }, + { "LogGOPS_g", 1, NULL, 'g' }, + { "LogGOPS_G", 1, NULL, 'G' }, + { "LogGOPS_S", 1, NULL, 'S' }, + { "LogGOPS_O", 1, NULL, 'O' }, + { "vizfile", 1, NULL, 'V' }, + { "verbose", 0, NULL, 'v' }, + { "progress", 0, NULL, 0 }, + { "batchmode", 0, NULL, 'b' }, + { "noise-trace", 1, NULL, 0 }, + { "noise-cosched", 0, NULL, 0 }, + { "network-type", 1, NULL, 'n' }, + { "network-file", 1, NULL, 0 }, + { "qstat", 1, NULL, 0 }, + { 0, 0, 0, 0 } + }; + + c = getopt_long (argc, argv, "hf:L:o:g:G:S:O:V:vbn:", long_options, &option_index); + + if (c == -1) break; /* Exit from `while (1)' loop. */ + + switch (c) + { + case 'h': /* Print help and exit. */ + cmdline_parser_print_help (); + cmdline_parser_free (&local_args_info); + exit (EXIT_SUCCESS); + + case 'f': /* Prefix for the filenames which contain the schedules. */ + + + if (update_arg( (void *)&(args_info->filename_arg), + &(args_info->filename_orig), &(args_info->filename_given), + &(local_args_info.filename_given), optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "filename", 'f', + additional_error)) + goto failure; + + break; + case 'L': /* The latency parameter L in the LogGP model. */ + + + if (update_arg( (void *)&(args_info->LogGOPS_L_arg), + &(args_info->LogGOPS_L_orig), &(args_info->LogGOPS_L_given), + &(local_args_info.LogGOPS_L_given), optarg, 0, "2500", ARG_INT, + check_ambiguity, override, 0, 0, + "LogGOPS_L", 'L', + additional_error)) + goto failure; + + break; + case 'o': /* The overhead parameter o in the LogGP model. */ + + + if (update_arg( (void *)&(args_info->LogGOPS_o_arg), + &(args_info->LogGOPS_o_orig), &(args_info->LogGOPS_o_given), + &(local_args_info.LogGOPS_o_given), optarg, 0, "1500", ARG_INT, + check_ambiguity, override, 0, 0, + "LogGOPS_o", 'o', + additional_error)) + goto failure; + + break; + case 'g': /* The gap per message parameter g in the LogGP model. */ + + + if (update_arg( (void *)&(args_info->LogGOPS_g_arg), + &(args_info->LogGOPS_g_orig), &(args_info->LogGOPS_g_given), + &(local_args_info.LogGOPS_g_given), optarg, 0, "1000", ARG_INT, + check_ambiguity, override, 0, 0, + "LogGOPS_g", 'g', + additional_error)) + goto failure; + + break; + case 'G': /* The gap per byte parameter G in the LogGP model. */ + + + if (update_arg( (void *)&(args_info->LogGOPS_G_arg), + &(args_info->LogGOPS_G_orig), &(args_info->LogGOPS_G_given), + &(local_args_info.LogGOPS_G_given), optarg, 0, "6", ARG_INT, + check_ambiguity, override, 0, 0, + "LogGOPS_G", 'G', + additional_error)) + goto failure; + + break; + case 'S': /* Datasize at which we change from eager to rendezvous protocol. */ + + + if (update_arg( (void *)&(args_info->LogGOPS_S_arg), + &(args_info->LogGOPS_S_orig), &(args_info->LogGOPS_S_given), + &(local_args_info.LogGOPS_S_given), optarg, 0, "65535", ARG_INT, + check_ambiguity, override, 0, 0, + "LogGOPS_S", 'S', + additional_error)) + goto failure; + + break; + case 'O': /* The overhead per byte in LogGOP. */ + + + if (update_arg( (void *)&(args_info->LogGOPS_O_arg), + &(args_info->LogGOPS_O_orig), &(args_info->LogGOPS_O_given), + &(local_args_info.LogGOPS_O_given), optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "LogGOPS_O", 'O', + additional_error)) + goto failure; + + break; + case 'V': /* Name of the output file for visualization data. */ + + + if (update_arg( (void *)&(args_info->vizfile_arg), + &(args_info->vizfile_orig), &(args_info->vizfile_given), + &(local_args_info.vizfile_given), optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "vizfile", 'V', + additional_error)) + goto failure; + + break; + case 'v': /* Enable more verbose output. */ + + + if (update_arg( 0 , + 0 , &(args_info->verbose_given), + &(local_args_info.verbose_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "verbose", 'v', + additional_error)) + goto failure; + + break; + case 'b': /* enable batchmode (never print detailed host info). */ + + + if (update_arg( 0 , + 0 , &(args_info->batchmode_given), + &(local_args_info.batchmode_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "batchmode", 'b', + additional_error)) + goto failure; + + break; + case 'n': /* Network type (LogGP=no network congestion; simple=simple linear model). */ + + + if (update_arg( (void *)&(args_info->network_type_arg), + &(args_info->network_type_orig), &(args_info->network_type_given), + &(local_args_info.network_type_given), optarg, cmdline_parser_network_type_values, "LogGP", ARG_STRING, + check_ambiguity, override, 0, 0, + "network-type", 'n', + additional_error)) + goto failure; + + break; + + case 0: /* Long option with no short option */ + if (strcmp (long_options[option_index].name, "version") == 0) { + cmdline_parser_print_version (); + cmdline_parser_free (&local_args_info); + exit (EXIT_SUCCESS); + } + + /* Map the schedules as MAP_SHARED to enable processing of large schedule (larger than main memory). This will invalidate the schedules during simulation.. */ + if (strcmp (long_options[option_index].name, "save-mem") == 0) + { + + + if (update_arg((void *)&(args_info->save_mem_flag), 0, &(args_info->save_mem_given), + &(local_args_info.save_mem_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "save-mem", '-', + additional_error)) + goto failure; + + } + /* print progress. */ + else if (strcmp (long_options[option_index].name, "progress") == 0) + { + + + if (update_arg( 0 , + 0 , &(args_info->progress_given), + &(local_args_info.progress_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "progress", '-', + additional_error)) + goto failure; + + } + /* Read Noise from trace . */ + else if (strcmp (long_options[option_index].name, "noise-trace") == 0) + { + + + if (update_arg( (void *)&(args_info->noise_trace_arg), + &(args_info->noise_trace_orig), &(args_info->noise_trace_given), + &(local_args_info.noise_trace_given), optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "noise-trace", '-', + additional_error)) + goto failure; + + } + /* Co-schedule noise (use same starttime on all processes). */ + else if (strcmp (long_options[option_index].name, "noise-cosched") == 0) + { + + + if (update_arg((void *)&(args_info->noise_cosched_flag), 0, &(args_info->noise_cosched_given), + &(local_args_info.noise_cosched_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "noise-cosched", '-', + additional_error)) + goto failure; + + } + /* Input file for network (annotated dot format). */ + else if (strcmp (long_options[option_index].name, "network-file") == 0) + { + + + if (update_arg( (void *)&(args_info->network_file_arg), + &(args_info->network_file_orig), &(args_info->network_file_given), + &(local_args_info.network_file_given), optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "network-file", '-', + additional_error)) + goto failure; + + } + /* Enable PQ and UQ statistics. Argument is output filename prefix. */ + else if (strcmp (long_options[option_index].name, "qstat") == 0) + { + + + if (update_arg( (void *)&(args_info->qstat_arg), + &(args_info->qstat_orig), &(args_info->qstat_given), + &(local_args_info.qstat_given), optarg, 0, "Unknown", ARG_STRING, + check_ambiguity, override, 0, 0, + "qstat", '-', + additional_error)) + goto failure; + + } + + break; + case '?': /* Invalid option. */ + /* `getopt_long' already printed an error message. */ + goto failure; + + default: /* bug: option not considered. */ + fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); + abort (); + } /* switch */ + } /* while */ + + + + if (check_required) + { + error_occurred += cmdline_parser_required2 (args_info, argv[0], additional_error); + } + + cmdline_parser_release (&local_args_info); + + if ( error_occurred ) + return (EXIT_FAILURE); + + return 0; + +failure: + + cmdline_parser_release (&local_args_info); + return (EXIT_FAILURE); +} +/* vim: set ft=c noet ts=8 sts=8 sw=8 tw=80 nojs spell : */ diff --git a/src/LogGOPSim/loggopsim_cmdline.h b/src/LogGOPSim/loggopsim_cmdline.h new file mode 100644 index 0000000..24a6725 --- /dev/null +++ b/src/LogGOPSim/loggopsim_cmdline.h @@ -0,0 +1,235 @@ +/** @file loggopsim_cmdline.h + * @brief The header file for the command line option parser + * generated by GNU Gengetopt version 2.23 + * http://www.gnu.org/software/gengetopt. + * DO NOT modify this file, since it can be overwritten + * @author GNU Gengetopt */ + +#ifndef LOGGOPSIM_CMDLINE_H +#define LOGGOPSIM_CMDLINE_H + +/* If we use autoconf. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include /* for FILE */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifndef CMDLINE_PARSER_PACKAGE +/** @brief the program name (used for printing errors) */ +#define CMDLINE_PARSER_PACKAGE "goalsim" +#endif + +#ifndef CMDLINE_PARSER_PACKAGE_NAME +/** @brief the complete program name (used for help and version) */ +#define CMDLINE_PARSER_PACKAGE_NAME "goalsim" +#endif + +#ifndef CMDLINE_PARSER_VERSION +/** @brief the program version */ +#define CMDLINE_PARSER_VERSION "0.1" +#endif + +/** @brief Where the command line options are stored */ +struct gengetopt_args_info +{ + const char *help_help; /**< @brief Print help and exit help description. */ + const char *version_help; /**< @brief Print version and exit help description. */ + char * filename_arg; /**< @brief Prefix for the filenames which contain the schedules. */ + char * filename_orig; /**< @brief Prefix for the filenames which contain the schedules original value given at command line. */ + const char *filename_help; /**< @brief Prefix for the filenames which contain the schedules help description. */ + int save_mem_flag; /**< @brief Map the schedules as MAP_SHARED to enable processing of large schedule (larger than main memory). This will invalidate the schedules during simulation. (default=off). */ + const char *save_mem_help; /**< @brief Map the schedules as MAP_SHARED to enable processing of large schedule (larger than main memory). This will invalidate the schedules during simulation. help description. */ + int LogGOPS_L_arg; /**< @brief The latency parameter L in the LogGP model (default='2500'). */ + char * LogGOPS_L_orig; /**< @brief The latency parameter L in the LogGP model original value given at command line. */ + const char *LogGOPS_L_help; /**< @brief The latency parameter L in the LogGP model help description. */ + int LogGOPS_o_arg; /**< @brief The overhead parameter o in the LogGP model (default='1500'). */ + char * LogGOPS_o_orig; /**< @brief The overhead parameter o in the LogGP model original value given at command line. */ + const char *LogGOPS_o_help; /**< @brief The overhead parameter o in the LogGP model help description. */ + int LogGOPS_g_arg; /**< @brief The gap per message parameter g in the LogGP model (default='1000'). */ + char * LogGOPS_g_orig; /**< @brief The gap per message parameter g in the LogGP model original value given at command line. */ + const char *LogGOPS_g_help; /**< @brief The gap per message parameter g in the LogGP model help description. */ + int LogGOPS_G_arg; /**< @brief The gap per byte parameter G in the LogGP model (default='6'). */ + char * LogGOPS_G_orig; /**< @brief The gap per byte parameter G in the LogGP model original value given at command line. */ + const char *LogGOPS_G_help; /**< @brief The gap per byte parameter G in the LogGP model help description. */ + int LogGOPS_S_arg; /**< @brief Datasize at which we change from eager to rendezvous protocol (default='65535'). */ + char * LogGOPS_S_orig; /**< @brief Datasize at which we change from eager to rendezvous protocol original value given at command line. */ + const char *LogGOPS_S_help; /**< @brief Datasize at which we change from eager to rendezvous protocol help description. */ + int LogGOPS_O_arg; /**< @brief The overhead per byte in LogGOP (default='0'). */ + char * LogGOPS_O_orig; /**< @brief The overhead per byte in LogGOP original value given at command line. */ + const char *LogGOPS_O_help; /**< @brief The overhead per byte in LogGOP help description. */ + char * vizfile_arg; /**< @brief Name of the output file for visualization data. */ + char * vizfile_orig; /**< @brief Name of the output file for visualization data original value given at command line. */ + const char *vizfile_help; /**< @brief Name of the output file for visualization data help description. */ + const char *verbose_help; /**< @brief Enable more verbose output help description. */ + const char *progress_help; /**< @brief print progress help description. */ + const char *batchmode_help; /**< @brief enable batchmode (never print detailed host info) help description. */ + char * noise_trace_arg; /**< @brief Read Noise from trace . */ + char * noise_trace_orig; /**< @brief Read Noise from trace original value given at command line. */ + const char *noise_trace_help; /**< @brief Read Noise from trace help description. */ + int noise_cosched_flag; /**< @brief Co-schedule noise (use same starttime on all processes) (default=off). */ + const char *noise_cosched_help; /**< @brief Co-schedule noise (use same starttime on all processes) help description. */ + char * network_type_arg; /**< @brief Network type (LogGP=no network congestion; simple=simple linear model) (default='LogGP'). */ + char * network_type_orig; /**< @brief Network type (LogGP=no network congestion; simple=simple linear model) original value given at command line. */ + const char *network_type_help; /**< @brief Network type (LogGP=no network congestion; simple=simple linear model) help description. */ + char * network_file_arg; /**< @brief Input file for network (annotated dot format). */ + char * network_file_orig; /**< @brief Input file for network (annotated dot format) original value given at command line. */ + const char *network_file_help; /**< @brief Input file for network (annotated dot format) help description. */ + char * qstat_arg; /**< @brief Enable PQ and UQ statistics. Argument is output filename prefix (default='Unknown'). */ + char * qstat_orig; /**< @brief Enable PQ and UQ statistics. Argument is output filename prefix original value given at command line. */ + const char *qstat_help; /**< @brief Enable PQ and UQ statistics. Argument is output filename prefix help description. */ + + unsigned int help_given ; /**< @brief Whether help was given. */ + unsigned int version_given ; /**< @brief Whether version was given. */ + unsigned int filename_given ; /**< @brief Whether filename was given. */ + unsigned int save_mem_given ; /**< @brief Whether save-mem was given. */ + unsigned int LogGOPS_L_given ; /**< @brief Whether LogGOPS_L was given. */ + unsigned int LogGOPS_o_given ; /**< @brief Whether LogGOPS_o was given. */ + unsigned int LogGOPS_g_given ; /**< @brief Whether LogGOPS_g was given. */ + unsigned int LogGOPS_G_given ; /**< @brief Whether LogGOPS_G was given. */ + unsigned int LogGOPS_S_given ; /**< @brief Whether LogGOPS_S was given. */ + unsigned int LogGOPS_O_given ; /**< @brief Whether LogGOPS_O was given. */ + unsigned int vizfile_given ; /**< @brief Whether vizfile was given. */ + unsigned int verbose_given ; /**< @brief Whether verbose was given. */ + unsigned int progress_given ; /**< @brief Whether progress was given. */ + unsigned int batchmode_given ; /**< @brief Whether batchmode was given. */ + unsigned int noise_trace_given ; /**< @brief Whether noise-trace was given. */ + unsigned int noise_cosched_given ; /**< @brief Whether noise-cosched was given. */ + unsigned int network_type_given ; /**< @brief Whether network-type was given. */ + unsigned int network_file_given ; /**< @brief Whether network-file was given. */ + unsigned int qstat_given ; /**< @brief Whether qstat was given. */ + +} ; + +/** @brief The additional parameters to pass to parser functions */ +struct cmdline_parser_params +{ + int override; /**< @brief whether to override possibly already present options (default 0) */ + int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ + int check_required; /**< @brief whether to check that all required options were provided (default 1) */ + int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ + int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ +} ; + +/** @brief the purpose string of the program */ +extern const char *gengetopt_args_info_purpose; +/** @brief the usage string of the program */ +extern const char *gengetopt_args_info_usage; +/** @brief the description string of the program */ +extern const char *gengetopt_args_info_description; +/** @brief all the lines making the help output */ +extern const char *gengetopt_args_info_help[]; + +/** + * The command line parser + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser (int argc, char **argv, + struct gengetopt_args_info *args_info); + +/** + * The command line parser (version with additional parameters - deprecated) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_ext() instead + */ +int cmdline_parser2 (int argc, char **argv, + struct gengetopt_args_info *args_info, + int override, int initialize, int check_required); + +/** + * The command line parser (version with additional parameters) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser_ext (int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Save the contents of the option struct into an already open FILE stream. + * @param outfile the stream where to dump options + * @param args_info the option struct to dump + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser_dump(FILE *outfile, + struct gengetopt_args_info *args_info); + +/** + * Save the contents of the option struct into a (text) file. + * This file can be read by the config file parser (if generated by gengetopt) + * @param filename the file where to save + * @param args_info the option struct to save + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser_file_save(const char *filename, + struct gengetopt_args_info *args_info); + +/** + * Print the help + */ +void cmdline_parser_print_help(void); +/** + * Print the version + */ +void cmdline_parser_print_version(void); + +/** + * Initializes all the fields a cmdline_parser_params structure + * to their default values + * @param params the structure to initialize + */ +void cmdline_parser_params_init(struct cmdline_parser_params *params); + +/** + * Allocates dynamically a cmdline_parser_params structure and initializes + * all its fields to their default values + * @return the created and initialized cmdline_parser_params structure + */ +struct cmdline_parser_params *cmdline_parser_params_create(void); + +/** + * Initializes the passed gengetopt_args_info structure's fields + * (also set default values for options that have a default) + * @param args_info the structure to initialize + */ +void cmdline_parser_init (struct gengetopt_args_info *args_info); +/** + * Deallocates the string fields of the gengetopt_args_info structure + * (but does not deallocate the structure itself) + * @param args_info the structure to deallocate + */ +void cmdline_parser_free (struct gengetopt_args_info *args_info); + +/** + * Checks that all the required options were specified + * @param args_info the structure to check + * @param prog_name the name of the program that will be used to print + * possible errors + * @return + */ +int cmdline_parser_required (struct gengetopt_args_info *args_info, + const char *prog_name); + +extern const char *cmdline_parser_network_type_values[]; /**< @brief Possible values for network-type. */ + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* LOGGOPSIM_CMDLINE_H */ diff --git a/src/LogGOPSim/txt2bin.cpp b/src/LogGOPSim/txt2bin.cpp new file mode 100644 index 0000000..620df98 --- /dev/null +++ b/src/LogGOPSim/txt2bin.cpp @@ -0,0 +1,2970 @@ +/* Generated by re2c 3.1 on Sun Oct 15 14:07:10 2023 */ +#line 1 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Goal.hpp" +#include "txt2bin_cmdline.h" + +typedef unsigned int uint; +typedef unsigned char uchar; + +#define BSIZE 10240 + +#define YYCTYPE uchar +#define YYCURSOR cursor +#define YYLIMIT s->lim +#define YYMARKER s->ptr +#define YYFILL(n) {cursor = fill(s, cursor, n);} + +#define RET(i) {s->cur = cursor; return i;} + +gengetopt_args_info args_info; + +typedef struct Scanner { + FILE* fd; + uchar *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof; + uint line; + int rank; + uint32_t curr_rank, num_ranks; + Goal* schedule; + std::map* idtbl; +} Scanner; + +typedef struct Item { + char type; + char *label1; + char *label2; + uint64_t size; + uint32_t target; + uint32_t tag; + uint8_t cpu; + uint8_t nic; +} Item; + +enum OpTypes { + Undefined, + SendOp, + RecvOp, + LoclOp, + StartDependency, + Dependency +}; + +inline uint64_t add_number(unsigned char *s, unsigned char *e) { + + uint64_t num = 0; + --s; + while(++s < e) num = num * 10 + (*s - '0'); + + return num; +} + +inline void insert_id(Scanner *s, char *id, goalop_t op) { + + s->idtbl->insert(std::make_pair(std::string(id), op)); + free(id); +} + +inline goalop_t retrieve_id(Scanner *s, char *id) { + + std::map::iterator it; + it = s->idtbl->find(std::string(id)); + if (it == s->idtbl->end()) { + fprintf(stderr, "A dependency references label %s, which is undefined!\n", id); + exit(EXIT_FAILURE); + } + free(id); + return it->second; +} + +void process_item(Scanner *s, Item *item) { + +/* + printf("Parsed Item:\n"); + printf(" Type: "); + if (item->type == Undefined) printf("Undefined\n"); + if (item->type == SendOp) printf("Send\n"); + if (item->type == RecvOp) printf("Recv\n"); + if (item->type == LoclOp) printf("LoclOp\n"); + if (item->type == StartDependency) printf("IRequires\n"); + if (item->type == Dependency) printf("Requires\n"); + printf(" Label1: %s\n", item->label1); + printf(" Label2: %s\n", item->label2); + printf(" Size: %i\n", item->size); + printf(" Target: %i\n", item->target); + printf(" Tag: %i\n", item->tag); + printf(" CPU: %i\n", item->cpu); + printf(" NIC: %i\n", item->nic); +*/ + + goalop_t op, op2; + + switch (item->type) { + case Undefined: + fprintf(stderr, "Error while parsing, attempt to add a undefined operation\n"); + exit(EXIT_FAILURE); + break; + case SendOp: + op = s->schedule->Send(s->rank, item->target, item->size, item->tag, item->cpu, item->nic); + if (item->label1 != NULL) insert_id(s, item->label1, op); + break; + case RecvOp: + op = s->schedule->Recv(item->target, s->rank, item->size, item->tag, item->cpu, item->nic); + if (item->label1 != NULL) insert_id(s, item->label1, op); + break; + case LoclOp: + op = s->schedule->Calc(s->rank, item->size, item->cpu, item->nic); + if (item->label1 != NULL) insert_id(s, item->label1, op); + break; + case StartDependency: + op = retrieve_id(s, item->label1); + op2 = retrieve_id(s, item->label2); + assert(op != NULL); + assert(op2 != NULL); + s->schedule->StartDependency(op, op2); + break; + case Dependency: + op = retrieve_id(s, item->label1); + op2 = retrieve_id(s, item->label2); + assert(op != NULL); + assert(op2 != NULL); + s->schedule->Dependency(op, op2); + break; + default: + break; + } +} + +inline char* add_label(unsigned char *s, unsigned char *e) { + + char *buf = NULL; + + buf = (char *) malloc((e-s)+1); + memcpy((void *) buf, (void *) s, (size_t) (e-s)); + buf[e-s] = '\0'; + + return buf; + +} + + +uchar *fill(Scanner *s, uchar *cursor, int numtoread) { + + if(!s->eof) { + uint cnt = s->tok - s->bot; + if(cnt){ + if ((s->lim - s->tok) < abs(s->bot - s->tok)) memcpy(s->bot, s->tok, s->lim - s->tok); + else memmove(s->bot, s->tok, s->lim - s->tok); + s->tok = s->bot; + s->ptr -= cnt; + cursor -= cnt; + s->pos -= cnt; + s->lim -= cnt; + } + if((s->top - s->lim) < BSIZE){ + uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar)); + if ((s->lim - s->tok) > abs(s->tok - buf)) memmove(buf, s->tok, s->lim - s->tok); + else memcpy(buf, s->tok, s->lim - s->tok); + s->tok = buf; + s->ptr = &buf[s->ptr - s->bot]; + cursor = &buf[cursor - s->bot]; + s->pos = &buf[s->pos - s->bot]; + s->lim = &buf[s->lim - s->bot]; + s->top = &s->lim[BSIZE]; + free(s->bot); + s->bot = buf; + } + cnt = fread((char*) s->lim, 1, BSIZE, s->fd); + if(cnt != BSIZE) { + s->eof = &s->lim[cnt]; + *(s->eof)++ = '\n'; + } + s->lim += cnt; + //assert(cnt >= numtoread); + } + return cursor; +} + +/* +uchar *fill(Scanner *s, uchar *cursor, int numtoread) { + + static bool firstcall = true; + + if (firstcall) { + + void *buf; + struct stat statbuf; + + int ret = fstat(fileno(s->fd), &statbuf); + buf = mmap(NULL, statbuf.st_size, PROT_READ, MAP_PRIVATE, fileno(s->fd), 0); + assert(buf != NULL); + s->lim = (uchar*) buf; + s->lim += statbuf.st_size; + s->eof = s->lim; + return (uchar*) buf; + } + else { + assert(0==1); + } +} +*/ + +int scan(Scanner *s) { + + //uchar *cursor = s->cur; + + static uchar *cursor = NULL; + Item item; + int state; + + for (;;) { + +s_0: + + if ((cursor == s->eof) and (cursor != NULL)) { + fprintf(stderr, "Reached the end of the inputfile - did you forget a closing bracket?\n"); + return s->rank; + } + + s->tok = cursor; + state = 0; + + // printf("Entered s_0\n"); + // if (((s->line % 100) == 0) or (s->line < 100)) printf("Line: %i\n", s->line); + + item.type = Undefined; + item.label1 = NULL; + item.label2 = NULL; + item.cpu = 0; + item.nic = 0; + item.tag = 0; + + +#line 256 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy3; + case '\n': goto yy5; + case '\r': goto yy6; + case '/': goto yy7; + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case 'a': + case 'b': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'o': + case 'p': + case 'q': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy8; + case 'c': goto yy11; + case 'n': goto yy12; + case 'r': goto yy13; + case 's': goto yy14; + case '}': goto yy15; + default: goto yy1; + } +yy1: + ++YYCURSOR; +yy2: +#line 294 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 327 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy3: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy3; + default: goto yy4; + } +yy4: +#line 282 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->tok = cursor; } +#line 340 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy5: + ++YYCURSOR; +#line 292 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->line++; continue; } +#line 345 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy6: + yych = *++YYCURSOR; + switch (yych) { + case '\n': goto yy5; + default: goto yy2; + } +yy7: + yych = *++YYCURSOR; + switch (yych) { + case '*': goto yy16; + case '/': goto yy17; + default: goto yy2; + } +yy8: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy9: + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy8; + default: goto yy10; + } +yy10: +#line 288 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.label1 = add_label(s->tok, cursor); goto s_1; } +#line 433 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy11: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy18; + default: goto yy9; + } +yy12: + yych = *++YYCURSOR; + switch (yych) { + case 'u': goto yy19; + default: goto yy9; + } +yy13: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy20; + case 'e': goto yy21; + default: goto yy9; + } +yy14: + yych = *++YYCURSOR; + switch (yych) { + case 'e': goto yy22; + default: goto yy9; + } +yy15: + ++YYCURSOR; +#line 293 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { if (s->rank == -1) goto s_err; int oldrank = s->rank; s->rank = -1; return oldrank; } +#line 463 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy16: + ++YYCURSOR; +#line 290 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_24; } +#line 468 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy17: + ++YYCURSOR; +#line 289 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_23; } +#line 473 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy18: + yych = *++YYCURSOR; + switch (yych) { + case 'l': goto yy23; + default: goto yy9; + } +yy19: + yych = *++YYCURSOR; + switch (yych) { + case 'm': goto yy24; + default: goto yy9; + } +yy20: + yych = *++YYCURSOR; + switch (yych) { + case 'n': goto yy25; + default: goto yy9; + } +yy21: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy26; + default: goto yy9; + } +yy22: + yych = *++YYCURSOR; + switch (yych) { + case 'n': goto yy27; + default: goto yy9; + } +yy23: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy28; + default: goto yy9; + } +yy24: + yych = *++YYCURSOR; + switch (yych) { + case '_': goto yy30; + default: goto yy9; + } +yy25: + yych = *++YYCURSOR; + switch (yych) { + case 'k': goto yy31; + default: goto yy9; + } +yy26: + yych = *++YYCURSOR; + switch (yych) { + case 'v': goto yy33; + default: goto yy9; + } +yy27: + yych = *++YYCURSOR; + switch (yych) { + case 'd': goto yy35; + default: goto yy9; + } +yy28: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy8; + default: goto yy29; + } +yy29: +#line 285 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.type = LoclOp; goto s_3; } +#line 605 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy30: + yych = *++YYCURSOR; + switch (yych) { + case 'r': goto yy37; + default: goto yy9; + } +yy31: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy8; + default: goto yy32; + } +yy32: +#line 286 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_20; } +#line 683 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy33: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy8; + default: goto yy34; + } +yy34: +#line 284 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.type = RecvOp; goto s_2; } +#line 755 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy35: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy8; + default: goto yy36; + } +yy36: +#line 283 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.type = SendOp; goto s_2; } +#line 827 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy37: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy38; + default: goto yy9; + } +yy38: + yych = *++YYCURSOR; + switch (yych) { + case 'n': goto yy39; + default: goto yy9; + } +yy39: + yych = *++YYCURSOR; + switch (yych) { + case 'k': goto yy40; + default: goto yy9; + } +yy40: + yych = *++YYCURSOR; + switch (yych) { + case 's': goto yy41; + default: goto yy9; + } +yy41: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy8; + default: goto yy42; + } +yy42: +#line 287 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_22; } +#line 923 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 295 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_1: + state =1; + + // printf("Entered s_1\n"); + + +#line 936 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy46; + case ':': goto yy48; + case 'i': goto yy49; + case 'r': goto yy50; + default: goto yy44; + } +yy44: + ++YYCURSOR; +yy45: +#line 309 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 954 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy46: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy46; + default: goto yy47; + } +yy47: +#line 305 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_1; } +#line 967 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy48: + ++YYCURSOR; +#line 306 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_4; } +#line 972 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy49: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'r': goto yy51; + default: goto yy45; + } +yy50: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'e': goto yy53; + default: goto yy45; + } +yy51: + yych = *++YYCURSOR; + switch (yych) { + case 'e': goto yy54; + default: goto yy52; + } +yy52: + YYCURSOR = YYMARKER; + goto yy45; +yy53: + yych = *++YYCURSOR; + switch (yych) { + case 'q': goto yy55; + default: goto yy52; + } +yy54: + yych = *++YYCURSOR; + switch (yych) { + case 'q': goto yy56; + default: goto yy52; + } +yy55: + yych = *++YYCURSOR; + switch (yych) { + case 'u': goto yy57; + default: goto yy52; + } +yy56: + yych = *++YYCURSOR; + switch (yych) { + case 'u': goto yy58; + default: goto yy52; + } +yy57: + yych = *++YYCURSOR; + switch (yych) { + case 'i': goto yy59; + default: goto yy52; + } +yy58: + yych = *++YYCURSOR; + switch (yych) { + case 'i': goto yy60; + default: goto yy52; + } +yy59: + yych = *++YYCURSOR; + switch (yych) { + case 'r': goto yy61; + default: goto yy52; + } +yy60: + yych = *++YYCURSOR; + switch (yych) { + case 'r': goto yy62; + default: goto yy52; + } +yy61: + yych = *++YYCURSOR; + switch (yych) { + case 'e': goto yy63; + default: goto yy52; + } +yy62: + yych = *++YYCURSOR; + switch (yych) { + case 'e': goto yy64; + default: goto yy52; + } +yy63: + yych = *++YYCURSOR; + switch (yych) { + case 's': goto yy65; + default: goto yy52; + } +yy64: + yych = *++YYCURSOR; + switch (yych) { + case 's': goto yy66; + default: goto yy52; + } +yy65: + ++YYCURSOR; +#line 307 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.type = Dependency; goto s_5; } +#line 1070 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy66: + ++YYCURSOR; +#line 308 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.type = StartDependency; goto s_5; } +#line 1075 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 310 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + assert(0==1); //We should never reach this line + +s_2: + state=2; + + // printf("Entered s_2\n"); + + s->tok = cursor; + +#line 1088 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy69; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy71; + default: goto yy68; + } +yy68: + ++YYCURSOR; +#line 322 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1112 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy69: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy69; + default: goto yy70; + } +yy70: +#line 320 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_2; } +#line 1125 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy71: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy71; + default: goto yy72; + } +yy72: +#line 321 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.size = add_number(s->tok, cursor); goto s_10; } +#line 1146 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 323 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_3: + state = 3; + // printf("Entered s_3\n"); + + s->tok = cursor; + +#line 1159 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy75; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy77; + default: goto yy74; + } +yy74: + ++YYCURSOR; +#line 335 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1183 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy75: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy75; + default: goto yy76; + } +yy76: +#line 333 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_3; } +#line 1196 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy77: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy77; + default: goto yy78; + } +yy78: +#line 334 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.size = add_number(s->tok, cursor); goto s_7; } +#line 1217 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 336 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_4: + state = 4; + // printf("Entered s_4\n"); + + +#line 1229 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy82; + case 'c': goto yy84; + case 'r': goto yy85; + case 's': goto yy86; + default: goto yy80; + } +yy80: + ++YYCURSOR; +yy81: +#line 349 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1247 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy82: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy82; + default: goto yy83; + } +yy83: +#line 345 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_4; } +#line 1260 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy84: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'a': goto yy87; + default: goto yy81; + } +yy85: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'e': goto yy89; + default: goto yy81; + } +yy86: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'e': goto yy90; + default: goto yy81; + } +yy87: + yych = *++YYCURSOR; + switch (yych) { + case 'l': goto yy91; + default: goto yy88; + } +yy88: + YYCURSOR = YYMARKER; + goto yy81; +yy89: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy92; + default: goto yy88; + } +yy90: + yych = *++YYCURSOR; + switch (yych) { + case 'n': goto yy93; + default: goto yy88; + } +yy91: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy94; + default: goto yy88; + } +yy92: + yych = *++YYCURSOR; + switch (yych) { + case 'v': goto yy95; + default: goto yy88; + } +yy93: + yych = *++YYCURSOR; + switch (yych) { + case 'd': goto yy96; + default: goto yy88; + } +yy94: + ++YYCURSOR; +#line 346 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.type = LoclOp; goto s_3; } +#line 1322 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy95: + ++YYCURSOR; +#line 348 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.type = RecvOp; goto s_2; } +#line 1327 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy96: + ++YYCURSOR; +#line 347 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.type = SendOp; goto s_2; } +#line 1332 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 350 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + assert(0==1); //We should never reach this line + +s_5: + state =5; + // printf("Entered s_5\n"); + + s->tok = cursor; + +#line 1344 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy99; + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy101; + default: goto yy98; + } +yy98: + ++YYCURSOR; +#line 361 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1410 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy99: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy99; + default: goto yy100; + } +yy100: +#line 359 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_5; } +#line 1423 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy101: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy101; + default: goto yy102; + } +yy102: +#line 360 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.label2 = add_label(s->tok, cursor); goto s_6; } +#line 1497 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 362 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_6: + state = 6; + // printf("Entered s_6\n"); + + +#line 1509 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy106; + case '\n': goto yy108; + case '\r': goto yy109; + default: goto yy104; + } +yy104: + ++YYCURSOR; +yy105: +#line 373 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1526 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy106: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy106; + default: goto yy107; + } +yy107: +#line 371 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_6; } +#line 1539 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy108: + ++YYCURSOR; +#line 372 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->line++; process_item(s, &item); continue; } +#line 1544 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy109: + yych = *++YYCURSOR; + switch (yych) { + case '\n': goto yy108; + default: goto yy105; + } + } +#line 374 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_7: + state = 7; + // printf("Entered s_7\n"); + + +#line 1562 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy113; + case '\n': goto yy115; + case '\r': goto yy116; + case 'c': goto yy117; + default: goto yy111; + } +yy111: + ++YYCURSOR; +yy112: +#line 386 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1580 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy113: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy113; + default: goto yy114; + } +yy114: +#line 383 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_7; } +#line 1593 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy115: + ++YYCURSOR; +#line 385 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->line++; process_item(s, &item); continue; } +#line 1598 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy116: + yych = *++YYCURSOR; + switch (yych) { + case '\n': goto yy115; + default: goto yy112; + } +yy117: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'p': goto yy118; + default: goto yy112; + } +yy118: + yych = *++YYCURSOR; + switch (yych) { + case 'u': goto yy120; + default: goto yy119; + } +yy119: + YYCURSOR = YYMARKER; + goto yy112; +yy120: + ++YYCURSOR; +#line 384 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_8; } +#line 1624 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 387 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_8: + state =8; + // printf("Entered s_8\n"); + + s->tok = cursor; + + +#line 1638 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy123; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy125; + default: goto yy122; + } +yy122: + ++YYCURSOR; +#line 400 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1662 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy123: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy123; + default: goto yy124; + } +yy124: +#line 398 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_8; } +#line 1675 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy125: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy125; + default: goto yy126; + } +yy126: +#line 399 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.cpu = add_number(s->tok, cursor); goto s_9; } +#line 1696 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 401 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_9: + state=9; + // printf("Entered s_9\n"); + + +#line 1708 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy130; + case '\n': goto yy132; + case '\r': goto yy133; + default: goto yy128; + } +yy128: + ++YYCURSOR; +yy129: +#line 412 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1725 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy130: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy130; + default: goto yy131; + } +yy131: +#line 410 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_9; } +#line 1738 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy132: + ++YYCURSOR; +#line 411 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->line++; process_item(s, &item); continue; } +#line 1743 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy133: + yych = *++YYCURSOR; + switch (yych) { + case '\n': goto yy132; + default: goto yy129; + } + } +#line 413 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_10: + state=10; + // printf("Entered s_10\n"); + + +#line 1761 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy136; + case 'b': goto yy138; + default: goto yy135; + } +yy135: + ++YYCURSOR; +#line 424 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1776 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy136: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy136; + default: goto yy137; + } +yy137: +#line 422 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_10; } +#line 1789 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy138: + ++YYCURSOR; +#line 423 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_11; } +#line 1794 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 425 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_11: + state = 11; + // printf("Entered s_11\n"); + + +#line 1806 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy142; + case 'f': goto yy144; + case 't': goto yy145; + default: goto yy140; + } +yy140: + ++YYCURSOR; +yy141: +#line 437 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1823 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy142: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy142; + default: goto yy143; + } +yy143: +#line 434 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_11; } +#line 1836 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy144: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'r': goto yy146; + default: goto yy141; + } +yy145: + yych = *++YYCURSOR; + switch (yych) { + case 'o': goto yy148; + default: goto yy141; + } +yy146: + yych = *++YYCURSOR; + switch (yych) { + case 'o': goto yy149; + default: goto yy147; + } +yy147: + YYCURSOR = YYMARKER; + goto yy141; +yy148: + ++YYCURSOR; +#line 435 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { if (item.type == SendOp) {goto s_12;} else {goto s_err;}; } +#line 1862 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy149: + yych = *++YYCURSOR; + switch (yych) { + case 'm': goto yy150; + default: goto yy147; + } +yy150: + ++YYCURSOR; +#line 436 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { if (item.type == RecvOp) {goto s_12;} else {goto s_err;}; } +#line 1873 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 438 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_12: + state = 12; + // printf("Entered s_12\n"); + + s->tok = cursor; + + +#line 1887 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy154; + case '-': goto yy156; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy157; + default: goto yy152; + } +yy152: + ++YYCURSOR; +yy153: +#line 452 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1913 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy154: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy154; + default: goto yy155; + } +yy155: +#line 449 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_12; } +#line 1926 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy156: + yych = *++YYCURSOR; + switch (yych) { + case '1': goto yy159; + default: goto yy153; + } +yy157: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy157; + default: goto yy158; + } +yy158: +#line 451 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.target = add_number(s->tok, cursor); goto s_13; } +#line 1953 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy159: + ++YYCURSOR; +#line 450 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + {if (item.type == RecvOp) {item.target = std::numeric_limits::max(); goto s_13;} else {goto s_err;}; } +#line 1958 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 453 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_13: + state = 13; + // printf("Entered s_13\n"); + + +#line 1970 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy163; + case '\n': goto yy165; + case '\r': goto yy166; + case 'c': goto yy167; + case 'n': goto yy168; + case 't': goto yy169; + default: goto yy161; + } +yy161: + ++YYCURSOR; +yy162: +#line 467 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 1990 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy163: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy163; + default: goto yy164; + } +yy164: +#line 462 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_13; } +#line 2003 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy165: + ++YYCURSOR; +#line 466 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->line++; process_item(s, &item); continue; } +#line 2008 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy166: + yych = *++YYCURSOR; + switch (yych) { + case '\n': goto yy165; + default: goto yy162; + } +yy167: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'p': goto yy170; + default: goto yy162; + } +yy168: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'i': goto yy172; + default: goto yy162; + } +yy169: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'a': goto yy173; + default: goto yy162; + } +yy170: + yych = *++YYCURSOR; + switch (yych) { + case 'u': goto yy174; + default: goto yy171; + } +yy171: + YYCURSOR = YYMARKER; + goto yy162; +yy172: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy175; + default: goto yy171; + } +yy173: + yych = *++YYCURSOR; + switch (yych) { + case 'g': goto yy176; + default: goto yy171; + } +yy174: + ++YYCURSOR; +#line 464 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_16; } +#line 2058 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy175: + ++YYCURSOR; +#line 465 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_18; } +#line 2063 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy176: + ++YYCURSOR; +#line 463 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_14; } +#line 2068 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 468 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_14: + state = 14; + // printf("Entered s_14\n"); + + s->tok = cursor; + + +#line 2082 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy180; + case '-': goto yy182; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy183; + default: goto yy178; + } +yy178: + ++YYCURSOR; +yy179: +#line 482 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 2108 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy180: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy180; + default: goto yy181; + } +yy181: +#line 479 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_14; } +#line 2121 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy182: + yych = *++YYCURSOR; + switch (yych) { + case '1': goto yy185; + default: goto yy179; + } +yy183: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy183; + default: goto yy184; + } +yy184: +#line 481 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.tag = add_number(s->tok, cursor); goto s_15; } +#line 2148 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy185: + ++YYCURSOR; +#line 480 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.tag = std::numeric_limits::max(); goto s_15; } +#line 2153 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 483 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_15: + state =15; + // printf("Entered s_15\n"); + + +#line 2165 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy189; + case '\n': goto yy191; + case '\r': goto yy192; + case 'c': goto yy193; + case 'n': goto yy194; + default: goto yy187; + } +yy187: + ++YYCURSOR; +yy188: +#line 496 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 2184 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy189: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy189; + default: goto yy190; + } +yy190: +#line 492 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_15; } +#line 2197 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy191: + ++YYCURSOR; +#line 495 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->line++; process_item(s, &item); continue; } +#line 2202 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy192: + yych = *++YYCURSOR; + switch (yych) { + case '\n': goto yy191; + default: goto yy188; + } +yy193: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'p': goto yy195; + default: goto yy188; + } +yy194: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'i': goto yy197; + default: goto yy188; + } +yy195: + yych = *++YYCURSOR; + switch (yych) { + case 'u': goto yy198; + default: goto yy196; + } +yy196: + YYCURSOR = YYMARKER; + goto yy188; +yy197: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy199; + default: goto yy196; + } +yy198: + ++YYCURSOR; +#line 493 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_16; } +#line 2240 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy199: + ++YYCURSOR; +#line 494 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_18; } +#line 2245 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 497 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_16: + state = 16; + // printf("Entered s_16\n"); + + s->tok = cursor; + + +#line 2259 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy202; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy204; + default: goto yy201; + } +yy201: + ++YYCURSOR; +#line 510 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 2283 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy202: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy202; + default: goto yy203; + } +yy203: +#line 508 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_16; } +#line 2296 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy204: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy204; + default: goto yy205; + } +yy205: +#line 509 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.cpu = add_number(s->tok, cursor); goto s_17; } +#line 2317 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 511 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_17: + state = 17; + // printf("Entered s_17\n"); + + +#line 2329 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy209; + case '\n': goto yy211; + case '\r': goto yy212; + case 'n': goto yy213; + default: goto yy207; + } +yy207: + ++YYCURSOR; +yy208: +#line 523 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 2347 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy209: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy209; + default: goto yy210; + } +yy210: +#line 520 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_17; } +#line 2360 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy211: + ++YYCURSOR; +#line 522 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->line++; process_item(s, &item); continue; } +#line 2365 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy212: + yych = *++YYCURSOR; + switch (yych) { + case '\n': goto yy211; + default: goto yy208; + } +yy213: + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'i': goto yy214; + default: goto yy208; + } +yy214: + yych = *++YYCURSOR; + switch (yych) { + case 'c': goto yy216; + default: goto yy215; + } +yy215: + YYCURSOR = YYMARKER; + goto yy208; +yy216: + ++YYCURSOR; +#line 521 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_18; } +#line 2391 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 524 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_18: + state = 18; + // printf("Entered s_18\n"); + + s->tok = cursor; + + +#line 2405 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy219; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy221; + default: goto yy218; + } +yy218: + ++YYCURSOR; +#line 537 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 2429 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy219: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy219; + default: goto yy220; + } +yy220: +#line 535 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_18; } +#line 2442 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy221: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy221; + default: goto yy222; + } +yy222: +#line 536 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { item.nic = add_number(s->tok, cursor); goto s_19; } +#line 2463 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 538 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_19: + state = 19; + // printf("Entered s_19\n"); + + +#line 2475 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy226; + case '\n': goto yy228; + case '\r': goto yy229; + default: goto yy224; + } +yy224: + ++YYCURSOR; +yy225: +#line 549 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 2492 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy226: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy226; + default: goto yy227; + } +yy227: +#line 547 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_19; } +#line 2505 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy228: + ++YYCURSOR; +#line 548 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->line++; process_item(s, &item); continue; } +#line 2510 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy229: + yych = *++YYCURSOR; + switch (yych) { + case '\n': goto yy228; + default: goto yy225; + } + } +#line 550 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_20: + state = 20; + // printf("Entered s_20\n"); + + s->tok = cursor; + + +#line 2530 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy232; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy234; + default: goto yy231; + } +yy231: + ++YYCURSOR; +#line 563 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 2554 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy232: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy232; + default: goto yy233; + } +yy233: +#line 561 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_20; } +#line 2567 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy234: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy234; + default: goto yy235; + } +yy235: +#line 562 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->rank = add_number(s->tok, cursor); s->curr_rank = s->rank; goto s_21; } +#line 2588 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 564 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_21: + state = 21; + // printf("Entered s_21\n"); + + +#line 2600 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy238; + case '{': goto yy240; + default: goto yy237; + } +yy237: + ++YYCURSOR; +#line 575 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 2615 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy238: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy238; + default: goto yy239; + } +yy239: +#line 573 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_21; } +#line 2628 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy240: + ++YYCURSOR; +#line 574 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_0; } +#line 2633 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 576 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_22: + state = 22; + // printf("Entered s_22\n"); + + s->tok = cursor; + + +#line 2647 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy243; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy245; + default: goto yy242; + } +yy242: + ++YYCURSOR; +#line 589 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_err; } +#line 2671 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy243: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '\t': + case ' ': goto yy243; + default: goto yy244; + } +yy244: +#line 587 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_22; } +#line 2684 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy245: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy245; + default: goto yy246; + } +yy246: +#line 588 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->num_ranks = add_number(s->tok, cursor); goto s_0; } +#line 2705 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 590 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_23: + state = 23; + // printf("Entered s_23\n"); + + +#line 2717 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '\n': goto yy250; + case '\r': goto yy251; + default: goto yy248; + } +yy248: + ++YYCURSOR; +yy249: +#line 600 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_23; } +#line 2732 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy250: + ++YYCURSOR; +#line 599 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->line++; continue; } +#line 2737 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy251: + yych = *++YYCURSOR; + switch (yych) { + case '\n': goto yy250; + default: goto yy249; + } + } +#line 601 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_24: + state = 24; + // printf("Entered s_24\n"); + + +#line 2755 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + { + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case '\n': goto yy255; + case '\r': goto yy256; + case '*': goto yy257; + default: goto yy253; + } +yy253: + ++YYCURSOR; +yy254: +#line 612 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { goto s_24; } +#line 2771 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy255: + ++YYCURSOR; +#line 611 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { s->line++; goto s_24; } +#line 2776 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" +yy256: + yych = *++YYCURSOR; + switch (yych) { + case '\n': goto yy255; + default: goto yy254; + } +yy257: + yych = *++YYCURSOR; + switch (yych) { + case '/': goto yy258; + default: goto yy254; + } +yy258: + ++YYCURSOR; +#line 610 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + { continue; } +#line 2793 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.cpp" + } +#line 613 "/Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin.re" + + + assert(0==1); //We should never reach this line + +s_err: + + fprintf(stderr, "Error in line %i:\n", s->line); + + uchar* nlbef = s->bot; + uchar* nlaft = s->lim; + // find the last newline before the error + uchar* c = cursor-2; + while (c>s->bot) { + c--; + if (*c == '\n') { + nlbef = c; + break; + } + } + // find the next newline after the error + c = cursor-2; + while (clim) { + c++; + if (*c == '\n') { + nlaft = c; + break; + } + } + + for (uchar* c = nlbef+1; c; + + uint32_t numranks = -1; + + while (true) { + + in.schedule = new Goal; + + scan(&in); + + if (in.num_ranks < 1) { + fprintf(stderr, "Parse error: Number of Ranks undefined\n"); + exit(EXIT_FAILURE); + } + + in.idtbl->clear(); + + in.schedule->SetRank(in.curr_rank); + in.schedule->SetNumRanks(in.num_ranks); + in.schedule->SerializeSchedule(args_info.output_arg); + delete in.schedule; + int newprogress = round((((double) in.curr_rank) / in.num_ranks)*100); + if (args_info.progress_given && (newprogress > lastprogress) ) { + lastprogress = newprogress; + printf("Progress %i%% - parsed schedule %i/%i\n", lastprogress, in.curr_rank, in.num_ranks); + } + if (in.curr_rank+1 == in.num_ranks) break; + } + + free(in.bot); + exit(EXIT_SUCCESS); +} diff --git a/src/LogGOPSim/txt2bin_cmdline.c b/src/LogGOPSim/txt2bin_cmdline.c new file mode 100644 index 0000000..a3a3709 --- /dev/null +++ b/src/LogGOPSim/txt2bin_cmdline.c @@ -0,0 +1,600 @@ +/* + File autogenerated by gengetopt version 2.23 + generated with the following command: + gengetopt -F txt2bin_cmdline -i /Users/tim0s/Work/LogGOPSim/src/LogGOPSim/txt2bin_cmdline.ggo --output-dir /Users/tim0s/Work/LogGOPSim/src/LogGOPSim + + The developers of gengetopt consider the fixed text that goes in all + gengetopt output files to be in the public domain: + we make no copyright claims on it. +*/ + +/* If we use autoconf. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#ifndef FIX_UNUSED +#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ +#endif + +#include + +#include "txt2bin_cmdline.h" + +const char *gengetopt_args_info_purpose = ""; + +const char *gengetopt_args_info_usage = "Usage: goalsim [OPTION]..."; + +const char *gengetopt_args_info_versiontext = ""; + +const char *gengetopt_args_info_description = ""; + +const char *gengetopt_args_info_help[] = { + " -h, --help Print help and exit", + " -V, --version Print version and exit", + " -i, --input=filename Input file, textfile containing GOAL schedules", + " -o, --output=filename Output file, will contain the binary representation of\n the GOAL schedules", + " -p, --progress Print progress information while parsing the schedule\n (default=off)", + 0 +}; + +typedef enum {ARG_NO + , ARG_FLAG + , ARG_STRING +} cmdline_parser_arg_type; + +static +void clear_given (struct gengetopt_args_info *args_info); +static +void clear_args (struct gengetopt_args_info *args_info); + +static int +cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error); + +static int +cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error); + +static char * +gengetopt_strdup (const char *s); + +static +void clear_given (struct gengetopt_args_info *args_info) +{ + args_info->help_given = 0 ; + args_info->version_given = 0 ; + args_info->input_given = 0 ; + args_info->output_given = 0 ; + args_info->progress_given = 0 ; +} + +static +void clear_args (struct gengetopt_args_info *args_info) +{ + FIX_UNUSED (args_info); + args_info->input_arg = NULL; + args_info->input_orig = NULL; + args_info->output_arg = NULL; + args_info->output_orig = NULL; + args_info->progress_flag = 0; + +} + +static +void init_args_info(struct gengetopt_args_info *args_info) +{ + + + args_info->help_help = gengetopt_args_info_help[0] ; + args_info->version_help = gengetopt_args_info_help[1] ; + args_info->input_help = gengetopt_args_info_help[2] ; + args_info->output_help = gengetopt_args_info_help[3] ; + args_info->progress_help = gengetopt_args_info_help[4] ; + +} + +void +cmdline_parser_print_version (void) +{ + printf ("%s %s\n", + (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), + CMDLINE_PARSER_VERSION); + + if (strlen(gengetopt_args_info_versiontext) > 0) + printf("\n%s\n", gengetopt_args_info_versiontext); +} + +static void print_help_common(void) +{ + size_t len_purpose = strlen(gengetopt_args_info_purpose); + size_t len_usage = strlen(gengetopt_args_info_usage); + + if (len_usage > 0) { + printf("%s\n", gengetopt_args_info_usage); + } + if (len_purpose > 0) { + printf("%s\n", gengetopt_args_info_purpose); + } + + if (len_usage || len_purpose) { + printf("\n"); + } + + if (strlen(gengetopt_args_info_description) > 0) { + printf("%s\n\n", gengetopt_args_info_description); + } +} + +void +cmdline_parser_print_help (void) +{ + int i = 0; + print_help_common(); + while (gengetopt_args_info_help[i]) + printf("%s\n", gengetopt_args_info_help[i++]); +} + +void +cmdline_parser_init (struct gengetopt_args_info *args_info) +{ + clear_given (args_info); + clear_args (args_info); + init_args_info (args_info); +} + +void +cmdline_parser_params_init(struct cmdline_parser_params *params) +{ + if (params) + { + params->override = 0; + params->initialize = 1; + params->check_required = 1; + params->check_ambiguity = 0; + params->print_errors = 1; + } +} + +struct cmdline_parser_params * +cmdline_parser_params_create(void) +{ + struct cmdline_parser_params *params = + (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); + cmdline_parser_params_init(params); + return params; +} + +static void +free_string_field (char **s) +{ + if (*s) + { + free (*s); + *s = 0; + } +} + + +static void +cmdline_parser_release (struct gengetopt_args_info *args_info) +{ + + free_string_field (&(args_info->input_arg)); + free_string_field (&(args_info->input_orig)); + free_string_field (&(args_info->output_arg)); + free_string_field (&(args_info->output_orig)); + + + + clear_given (args_info); +} + + +static void +write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) +{ + FIX_UNUSED (values); + if (arg) { + fprintf(outfile, "%s=\"%s\"\n", opt, arg); + } else { + fprintf(outfile, "%s\n", opt); + } +} + + +int +cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) +{ + int i = 0; + + if (!outfile) + { + fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); + return EXIT_FAILURE; + } + + if (args_info->help_given) + write_into_file(outfile, "help", 0, 0 ); + if (args_info->version_given) + write_into_file(outfile, "version", 0, 0 ); + if (args_info->input_given) + write_into_file(outfile, "input", args_info->input_orig, 0); + if (args_info->output_given) + write_into_file(outfile, "output", args_info->output_orig, 0); + if (args_info->progress_given) + write_into_file(outfile, "progress", 0, 0 ); + + + i = EXIT_SUCCESS; + return i; +} + +int +cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) +{ + FILE *outfile; + int i = 0; + + outfile = fopen(filename, "w"); + + if (!outfile) + { + fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); + return EXIT_FAILURE; + } + + i = cmdline_parser_dump(outfile, args_info); + fclose (outfile); + + return i; +} + +void +cmdline_parser_free (struct gengetopt_args_info *args_info) +{ + cmdline_parser_release (args_info); +} + +/** @brief replacement of strdup, which is not standard */ +char * +gengetopt_strdup (const char *s) +{ + char *result = 0; + if (!s) + return result; + + result = (char*)malloc(strlen(s) + 1); + if (result == (char*)0) + return (char*)0; + strcpy(result, s); + return result; +} + +int +cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) +{ + return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); +} + +int +cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) +{ + int result; + result = cmdline_parser_internal (argc, argv, args_info, params, 0); + + if (result == EXIT_FAILURE) + { + cmdline_parser_free (args_info); + exit (EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) +{ + int result; + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); + + if (result == EXIT_FAILURE) + { + cmdline_parser_free (args_info); + exit (EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) +{ + int result = EXIT_SUCCESS; + + if (cmdline_parser_required2(args_info, prog_name, 0) > 0) + result = EXIT_FAILURE; + + if (result == EXIT_FAILURE) + { + cmdline_parser_free (args_info); + exit (EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) +{ + int error_occurred = 0; + FIX_UNUSED (additional_error); + + /* checks for required options */ + if (! args_info->input_given) + { + fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + + if (! args_info->output_given) + { + fprintf (stderr, "%s: '--output' ('-o') option required%s\n", prog_name, (additional_error ? additional_error : "")); + error_occurred = 1; + } + + + /* checks for dependences among options */ + + return error_occurred; +} + + +static char *package_name = 0; + +/** + * @brief updates an option + * @param field the generic pointer to the field to update + * @param orig_field the pointer to the orig field + * @param field_given the pointer to the number of occurrence of this option + * @param prev_given the pointer to the number of occurrence already seen + * @param value the argument for this option (if null no arg was specified) + * @param possible_values the possible values for this option (if specified) + * @param default_value the default value (in case the option only accepts fixed values) + * @param arg_type the type of this option + * @param check_ambiguity @see cmdline_parser_params.check_ambiguity + * @param override @see cmdline_parser_params.override + * @param no_free whether to free a possible previous value + * @param multiple_option whether this is a multiple option + * @param long_opt the corresponding long option + * @param short_opt the corresponding short option (or '-' if none) + * @param additional_error possible further error specification + */ +static +int update_arg(void *field, char **orig_field, + unsigned int *field_given, unsigned int *prev_given, + char *value, const char *possible_values[], + const char *default_value, + cmdline_parser_arg_type arg_type, + int check_ambiguity, int override, + int no_free, int multiple_option, + const char *long_opt, char short_opt, + const char *additional_error) +{ + char *stop_char = 0; + const char *val = value; + int found; + char **string_field; + FIX_UNUSED (field); + + stop_char = 0; + found = 0; + + if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) + { + if (short_opt != '-') + fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", + package_name, long_opt, short_opt, + (additional_error ? additional_error : "")); + else + fprintf (stderr, "%s: `--%s' option given more than once%s\n", + package_name, long_opt, + (additional_error ? additional_error : "")); + return 1; /* failure */ + } + + FIX_UNUSED (default_value); + + if (field_given && *field_given && ! override) + return 0; + if (prev_given) + (*prev_given)++; + if (field_given) + (*field_given)++; + if (possible_values) + val = possible_values[found]; + + switch(arg_type) { + case ARG_FLAG: + *((int *)field) = !*((int *)field); + break; + case ARG_STRING: + if (val) { + string_field = (char **)field; + if (!no_free && *string_field) + free (*string_field); /* free previous string */ + *string_field = gengetopt_strdup (val); + } + break; + default: + break; + }; + + FIX_UNUSED(stop_char); + + /* store the original value */ + switch(arg_type) { + case ARG_NO: + case ARG_FLAG: + break; + default: + if (value && orig_field) { + if (no_free) { + *orig_field = value; + } else { + if (*orig_field) + free (*orig_field); /* free previous string */ + *orig_field = gengetopt_strdup (value); + } + } + }; + + return 0; /* OK */ +} + + +int +cmdline_parser_internal ( + int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error) +{ + int c; /* Character of the parsed option. */ + + int error_occurred = 0; + struct gengetopt_args_info local_args_info; + + int override; + int initialize; + int check_required; + int check_ambiguity; + + package_name = argv[0]; + + /* TODO: Why is this here? It is not used anywhere. */ + override = params->override; + FIX_UNUSED(override); + + initialize = params->initialize; + check_required = params->check_required; + + /* TODO: Why is this here? It is not used anywhere. */ + check_ambiguity = params->check_ambiguity; + FIX_UNUSED(check_ambiguity); + + if (initialize) + cmdline_parser_init (args_info); + + cmdline_parser_init (&local_args_info); + + optarg = 0; + optind = 0; + opterr = params->print_errors; + optopt = '?'; + + while (1) + { + int option_index = 0; + + static struct option long_options[] = { + { "help", 0, NULL, 'h' }, + { "version", 0, NULL, 'V' }, + { "input", 1, NULL, 'i' }, + { "output", 1, NULL, 'o' }, + { "progress", 0, NULL, 'p' }, + { 0, 0, 0, 0 } + }; + + c = getopt_long (argc, argv, "hVi:o:p", long_options, &option_index); + + if (c == -1) break; /* Exit from `while (1)' loop. */ + + switch (c) + { + case 'h': /* Print help and exit. */ + cmdline_parser_print_help (); + cmdline_parser_free (&local_args_info); + exit (EXIT_SUCCESS); + + case 'V': /* Print version and exit. */ + cmdline_parser_print_version (); + cmdline_parser_free (&local_args_info); + exit (EXIT_SUCCESS); + + case 'i': /* Input file, textfile containing GOAL schedules. */ + + + if (update_arg( (void *)&(args_info->input_arg), + &(args_info->input_orig), &(args_info->input_given), + &(local_args_info.input_given), optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "input", 'i', + additional_error)) + goto failure; + + break; + case 'o': /* Output file, will contain the binary representation of the GOAL schedules. */ + + + if (update_arg( (void *)&(args_info->output_arg), + &(args_info->output_orig), &(args_info->output_given), + &(local_args_info.output_given), optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "output", 'o', + additional_error)) + goto failure; + + break; + case 'p': /* Print progress information while parsing the schedule. */ + + + if (update_arg((void *)&(args_info->progress_flag), 0, &(args_info->progress_given), + &(local_args_info.progress_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "progress", 'p', + additional_error)) + goto failure; + + break; + + case 0: /* Long option with no short option */ + case '?': /* Invalid option. */ + /* `getopt_long' already printed an error message. */ + goto failure; + + default: /* bug: option not considered. */ + fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); + abort (); + } /* switch */ + } /* while */ + + + + if (check_required) + { + error_occurred += cmdline_parser_required2 (args_info, argv[0], additional_error); + } + + cmdline_parser_release (&local_args_info); + + if ( error_occurred ) + return (EXIT_FAILURE); + + return 0; + +failure: + + cmdline_parser_release (&local_args_info); + return (EXIT_FAILURE); +} +/* vim: set ft=c noet ts=8 sts=8 sw=8 tw=80 nojs spell : */ diff --git a/src/LogGOPSim/txt2bin_cmdline.h b/src/LogGOPSim/txt2bin_cmdline.h new file mode 100644 index 0000000..065e24e --- /dev/null +++ b/src/LogGOPSim/txt2bin_cmdline.h @@ -0,0 +1,184 @@ +/** @file txt2bin_cmdline.h + * @brief The header file for the command line option parser + * generated by GNU Gengetopt version 2.23 + * http://www.gnu.org/software/gengetopt. + * DO NOT modify this file, since it can be overwritten + * @author GNU Gengetopt */ + +#ifndef TXT2BIN_CMDLINE_H +#define TXT2BIN_CMDLINE_H + +/* If we use autoconf. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include /* for FILE */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifndef CMDLINE_PARSER_PACKAGE +/** @brief the program name (used for printing errors) */ +#define CMDLINE_PARSER_PACKAGE "goalsim" +#endif + +#ifndef CMDLINE_PARSER_PACKAGE_NAME +/** @brief the complete program name (used for help and version) */ +#define CMDLINE_PARSER_PACKAGE_NAME "goalsim" +#endif + +#ifndef CMDLINE_PARSER_VERSION +/** @brief the program version */ +#define CMDLINE_PARSER_VERSION "0.1" +#endif + +/** @brief Where the command line options are stored */ +struct gengetopt_args_info +{ + const char *help_help; /**< @brief Print help and exit help description. */ + const char *version_help; /**< @brief Print version and exit help description. */ + char * input_arg; /**< @brief Input file, textfile containing GOAL schedules. */ + char * input_orig; /**< @brief Input file, textfile containing GOAL schedules original value given at command line. */ + const char *input_help; /**< @brief Input file, textfile containing GOAL schedules help description. */ + char * output_arg; /**< @brief Output file, will contain the binary representation of the GOAL schedules. */ + char * output_orig; /**< @brief Output file, will contain the binary representation of the GOAL schedules original value given at command line. */ + const char *output_help; /**< @brief Output file, will contain the binary representation of the GOAL schedules help description. */ + int progress_flag; /**< @brief Print progress information while parsing the schedule (default=off). */ + const char *progress_help; /**< @brief Print progress information while parsing the schedule help description. */ + + unsigned int help_given ; /**< @brief Whether help was given. */ + unsigned int version_given ; /**< @brief Whether version was given. */ + unsigned int input_given ; /**< @brief Whether input was given. */ + unsigned int output_given ; /**< @brief Whether output was given. */ + unsigned int progress_given ; /**< @brief Whether progress was given. */ + +} ; + +/** @brief The additional parameters to pass to parser functions */ +struct cmdline_parser_params +{ + int override; /**< @brief whether to override possibly already present options (default 0) */ + int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ + int check_required; /**< @brief whether to check that all required options were provided (default 1) */ + int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ + int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ +} ; + +/** @brief the purpose string of the program */ +extern const char *gengetopt_args_info_purpose; +/** @brief the usage string of the program */ +extern const char *gengetopt_args_info_usage; +/** @brief the description string of the program */ +extern const char *gengetopt_args_info_description; +/** @brief all the lines making the help output */ +extern const char *gengetopt_args_info_help[]; + +/** + * The command line parser + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser (int argc, char **argv, + struct gengetopt_args_info *args_info); + +/** + * The command line parser (version with additional parameters - deprecated) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_ext() instead + */ +int cmdline_parser2 (int argc, char **argv, + struct gengetopt_args_info *args_info, + int override, int initialize, int check_required); + +/** + * The command line parser (version with additional parameters) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser_ext (int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Save the contents of the option struct into an already open FILE stream. + * @param outfile the stream where to dump options + * @param args_info the option struct to dump + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser_dump(FILE *outfile, + struct gengetopt_args_info *args_info); + +/** + * Save the contents of the option struct into a (text) file. + * This file can be read by the config file parser (if generated by gengetopt) + * @param filename the file where to save + * @param args_info the option struct to save + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser_file_save(const char *filename, + struct gengetopt_args_info *args_info); + +/** + * Print the help + */ +void cmdline_parser_print_help(void); +/** + * Print the version + */ +void cmdline_parser_print_version(void); + +/** + * Initializes all the fields a cmdline_parser_params structure + * to their default values + * @param params the structure to initialize + */ +void cmdline_parser_params_init(struct cmdline_parser_params *params); + +/** + * Allocates dynamically a cmdline_parser_params structure and initializes + * all its fields to their default values + * @return the created and initialized cmdline_parser_params structure + */ +struct cmdline_parser_params *cmdline_parser_params_create(void); + +/** + * Initializes the passed gengetopt_args_info structure's fields + * (also set default values for options that have a default) + * @param args_info the structure to initialize + */ +void cmdline_parser_init (struct gengetopt_args_info *args_info); +/** + * Deallocates the string fields of the gengetopt_args_info structure + * (but does not deallocate the structure itself) + * @param args_info the structure to deallocate + */ +void cmdline_parser_free (struct gengetopt_args_info *args_info); + +/** + * Checks that all the required options were specified + * @param args_info the structure to check + * @param prog_name the name of the program that will be used to print + * possible errors + * @return + */ +int cmdline_parser_required (struct gengetopt_args_info *args_info, + const char *prog_name); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* TXT2BIN_CMDLINE_H */ diff --git a/src/Schedgen/schedgen_cmdline.c b/src/Schedgen/schedgen_cmdline.c new file mode 100644 index 0000000..7b00db4 --- /dev/null +++ b/src/Schedgen/schedgen_cmdline.c @@ -0,0 +1,1060 @@ +/* + File autogenerated by gengetopt version 2.23 + generated with the following command: + gengetopt -F schedgen_cmdline -i /Users/tim0s/Work/LogGOPSim/src/Schedgen/schedgen_cmdline.ggo --output-dir /Users/tim0s/Work/LogGOPSim/src/Schedgen + + The developers of gengetopt consider the fixed text that goes in all + gengetopt output files to be in the public domain: + we make no copyright claims on it. +*/ + +/* If we use autoconf. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#ifndef FIX_UNUSED +#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ +#endif + +#include + +#include "schedgen_cmdline.h" + +const char *gengetopt_args_info_purpose = ""; + +const char *gengetopt_args_info_usage = "Usage: schedgen [OPTION]..."; + +const char *gengetopt_args_info_versiontext = ""; + +const char *gengetopt_args_info_description = ""; + +const char *gengetopt_args_info_help[] = { + " -h, --help Print help and exit", + " -V, --version Print version and exit", + " -p, --ptrn=STRING Name of the communication pattern that should be\n used to generate a schedule (possible\n values=\"binomialtreereduce\",\n \"binarytreebcast\", \"binomialtreebcast\",\n \"nwaydissemination\", \"pipelinedring\",\n \"pipelinedringdep\", \"doublering\",\n \"gather\", \"scatter\", \"linbarrier\",\n \"trace\", \"dissemination\", \"random_bisect\",\n \"random_bisect_fd_sym\", \"linear_alltoall\",\n \"linear_alltoallv\", \"allreduce_recdoub\",\n \"allreduce_ring\", \"resnet\",\n \"chained_dissem\" default=`binomialtreebcast')", + " -s, --commsize=INT Number of nodes that should be used in the\n communication pattern (default=`8')", + " --timemult=INT Time multiplier, relative to microsecond (e.g.,\n nanoseconds -> 1000) (default=`1000')", + " -d, --datasize=INT Number of bytes that are transmitted in the\n communication patttern in a basic step\n (default=`1')", + " -o, --filename=STRING Filename for the name of the generated schedule\n (default=`schedule.goal')", + " --nway=INT Fanout for the n-way dissemination pattern\n (default=`1')", + " --root=INT Root node for certain patterns (default=`0')", + " --segmentsize=INT Segment size for pipelined pattern (default=`1')", + " --nb=INT nonblocking execution of collectives (provide\n length of local operation) (default=`0')", + " --nb-poll=INT polling interval for nonblocking execution\n (default=`0')", + " --cpu=INT select CPU to execute computation (default=`0')", + " --rpl-dep-cmp=INT replaces dependencies with fixed computation\n (parameter represents computation time. If -1,\n does not replace dependencies.) (default=`-1')", + " --a2av-skew-ratio=INT In the alltoallv pattern, each chunk of data sent\n by each rank is of a random size. The size of\n the chunk with id 'root' is of size 'datasize'.\n All the other chunks are of random size, and\n a2av-skew-ratio times smaller. (default=`1')", + " --outcast Generates outcast in the alltoallv pattern.\n (default=off)", + " --traces=STRING Tracefile for rank 0 (others are autodetected)", + " --traces-start=STRING file with start lines in trace files (is updated\n after run if trace-nops is given)", + " --traces-nops=INT number of operations to write to file (0=all)\n (default=`0')", + " --traces-extr=INT extrapolation factor for traces (default=`1')", + " --traces-print=INT print each operation (default=`0')", + " --traces-nop2p do not consider point-to-point communication\n (default=off)", + " --traces-nocolls do not consider collective communication\n (default=off)", + " --traces-nbcify=INT turn blocking collectives into non-blocking colls,\n time to pre-post NBCs (default=`0')", + 0 +}; + +typedef enum {ARG_NO + , ARG_FLAG + , ARG_STRING + , ARG_INT +} cmdline_parser_arg_type; + +static +void clear_given (struct gengetopt_args_info *args_info); +static +void clear_args (struct gengetopt_args_info *args_info); + +static int +cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error); + + +const char *cmdline_parser_ptrn_values[] = {"binomialtreereduce", "binarytreebcast", "binomialtreebcast", "nwaydissemination", "pipelinedring", "pipelinedringdep", "doublering", "gather", "scatter", "linbarrier", "trace", "dissemination", "random_bisect", "random_bisect_fd_sym", "linear_alltoall", "linear_alltoallv", "allreduce_recdoub", "allreduce_ring", "resnet", "chained_dissem", 0}; /*< Possible values for ptrn. */ + +static char * +gengetopt_strdup (const char *s); + +static +void clear_given (struct gengetopt_args_info *args_info) +{ + args_info->help_given = 0 ; + args_info->version_given = 0 ; + args_info->ptrn_given = 0 ; + args_info->commsize_given = 0 ; + args_info->timemult_given = 0 ; + args_info->datasize_given = 0 ; + args_info->filename_given = 0 ; + args_info->nway_given = 0 ; + args_info->root_given = 0 ; + args_info->segmentsize_given = 0 ; + args_info->nb_given = 0 ; + args_info->nb_poll_given = 0 ; + args_info->cpu_given = 0 ; + args_info->rpl_dep_cmp_given = 0 ; + args_info->a2av_skew_ratio_given = 0 ; + args_info->outcast_given = 0 ; + args_info->traces_given = 0 ; + args_info->traces_start_given = 0 ; + args_info->traces_nops_given = 0 ; + args_info->traces_extr_given = 0 ; + args_info->traces_print_given = 0 ; + args_info->traces_nop2p_given = 0 ; + args_info->traces_nocolls_given = 0 ; + args_info->traces_nbcify_given = 0 ; +} + +static +void clear_args (struct gengetopt_args_info *args_info) +{ + FIX_UNUSED (args_info); + args_info->ptrn_arg = gengetopt_strdup ("binomialtreebcast"); + args_info->ptrn_orig = NULL; + args_info->commsize_arg = 8; + args_info->commsize_orig = NULL; + args_info->timemult_arg = 1000; + args_info->timemult_orig = NULL; + args_info->datasize_arg = 1; + args_info->datasize_orig = NULL; + args_info->filename_arg = gengetopt_strdup ("schedule.goal"); + args_info->filename_orig = NULL; + args_info->nway_arg = 1; + args_info->nway_orig = NULL; + args_info->root_arg = 0; + args_info->root_orig = NULL; + args_info->segmentsize_arg = 1; + args_info->segmentsize_orig = NULL; + args_info->nb_arg = 0; + args_info->nb_orig = NULL; + args_info->nb_poll_arg = 0; + args_info->nb_poll_orig = NULL; + args_info->cpu_arg = 0; + args_info->cpu_orig = NULL; + args_info->rpl_dep_cmp_arg = -1; + args_info->rpl_dep_cmp_orig = NULL; + args_info->a2av_skew_ratio_arg = 1; + args_info->a2av_skew_ratio_orig = NULL; + args_info->outcast_flag = 0; + args_info->traces_arg = NULL; + args_info->traces_orig = NULL; + args_info->traces_start_arg = NULL; + args_info->traces_start_orig = NULL; + args_info->traces_nops_arg = 0; + args_info->traces_nops_orig = NULL; + args_info->traces_extr_arg = 1; + args_info->traces_extr_orig = NULL; + args_info->traces_print_arg = 0; + args_info->traces_print_orig = NULL; + args_info->traces_nop2p_flag = 0; + args_info->traces_nocolls_flag = 0; + args_info->traces_nbcify_arg = 0; + args_info->traces_nbcify_orig = NULL; + +} + +static +void init_args_info(struct gengetopt_args_info *args_info) +{ + + + args_info->help_help = gengetopt_args_info_help[0] ; + args_info->version_help = gengetopt_args_info_help[1] ; + args_info->ptrn_help = gengetopt_args_info_help[2] ; + args_info->commsize_help = gengetopt_args_info_help[3] ; + args_info->timemult_help = gengetopt_args_info_help[4] ; + args_info->datasize_help = gengetopt_args_info_help[5] ; + args_info->filename_help = gengetopt_args_info_help[6] ; + args_info->nway_help = gengetopt_args_info_help[7] ; + args_info->root_help = gengetopt_args_info_help[8] ; + args_info->segmentsize_help = gengetopt_args_info_help[9] ; + args_info->nb_help = gengetopt_args_info_help[10] ; + args_info->nb_poll_help = gengetopt_args_info_help[11] ; + args_info->cpu_help = gengetopt_args_info_help[12] ; + args_info->rpl_dep_cmp_help = gengetopt_args_info_help[13] ; + args_info->a2av_skew_ratio_help = gengetopt_args_info_help[14] ; + args_info->outcast_help = gengetopt_args_info_help[15] ; + args_info->traces_help = gengetopt_args_info_help[16] ; + args_info->traces_start_help = gengetopt_args_info_help[17] ; + args_info->traces_nops_help = gengetopt_args_info_help[18] ; + args_info->traces_extr_help = gengetopt_args_info_help[19] ; + args_info->traces_print_help = gengetopt_args_info_help[20] ; + args_info->traces_nop2p_help = gengetopt_args_info_help[21] ; + args_info->traces_nocolls_help = gengetopt_args_info_help[22] ; + args_info->traces_nbcify_help = gengetopt_args_info_help[23] ; + +} + +void +cmdline_parser_print_version (void) +{ + printf ("%s %s\n", + (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), + CMDLINE_PARSER_VERSION); + + if (strlen(gengetopt_args_info_versiontext) > 0) + printf("\n%s\n", gengetopt_args_info_versiontext); +} + +static void print_help_common(void) +{ + size_t len_purpose = strlen(gengetopt_args_info_purpose); + size_t len_usage = strlen(gengetopt_args_info_usage); + + if (len_usage > 0) { + printf("%s\n", gengetopt_args_info_usage); + } + if (len_purpose > 0) { + printf("%s\n", gengetopt_args_info_purpose); + } + + if (len_usage || len_purpose) { + printf("\n"); + } + + if (strlen(gengetopt_args_info_description) > 0) { + printf("%s\n\n", gengetopt_args_info_description); + } +} + +void +cmdline_parser_print_help (void) +{ + int i = 0; + print_help_common(); + while (gengetopt_args_info_help[i]) + printf("%s\n", gengetopt_args_info_help[i++]); +} + +void +cmdline_parser_init (struct gengetopt_args_info *args_info) +{ + clear_given (args_info); + clear_args (args_info); + init_args_info (args_info); +} + +void +cmdline_parser_params_init(struct cmdline_parser_params *params) +{ + if (params) + { + params->override = 0; + params->initialize = 1; + params->check_required = 1; + params->check_ambiguity = 0; + params->print_errors = 1; + } +} + +struct cmdline_parser_params * +cmdline_parser_params_create(void) +{ + struct cmdline_parser_params *params = + (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); + cmdline_parser_params_init(params); + return params; +} + +static void +free_string_field (char **s) +{ + if (*s) + { + free (*s); + *s = 0; + } +} + + +static void +cmdline_parser_release (struct gengetopt_args_info *args_info) +{ + + free_string_field (&(args_info->ptrn_arg)); + free_string_field (&(args_info->ptrn_orig)); + free_string_field (&(args_info->commsize_orig)); + free_string_field (&(args_info->timemult_orig)); + free_string_field (&(args_info->datasize_orig)); + free_string_field (&(args_info->filename_arg)); + free_string_field (&(args_info->filename_orig)); + free_string_field (&(args_info->nway_orig)); + free_string_field (&(args_info->root_orig)); + free_string_field (&(args_info->segmentsize_orig)); + free_string_field (&(args_info->nb_orig)); + free_string_field (&(args_info->nb_poll_orig)); + free_string_field (&(args_info->cpu_orig)); + free_string_field (&(args_info->rpl_dep_cmp_orig)); + free_string_field (&(args_info->a2av_skew_ratio_orig)); + free_string_field (&(args_info->traces_arg)); + free_string_field (&(args_info->traces_orig)); + free_string_field (&(args_info->traces_start_arg)); + free_string_field (&(args_info->traces_start_orig)); + free_string_field (&(args_info->traces_nops_orig)); + free_string_field (&(args_info->traces_extr_orig)); + free_string_field (&(args_info->traces_print_orig)); + free_string_field (&(args_info->traces_nbcify_orig)); + + + + clear_given (args_info); +} + +/** + * @param val the value to check + * @param values the possible values + * @return the index of the matched value: + * -1 if no value matched, + * -2 if more than one value has matched + */ +static int +check_possible_values(const char *val, const char *values[]) +{ + int i, found, last; + size_t len; + + if (!val) /* otherwise strlen() crashes below */ + return -1; /* -1 means no argument for the option */ + + found = last = 0; + + for (i = 0, len = strlen(val); values[i]; ++i) + { + if (strncmp(val, values[i], len) == 0) + { + ++found; + last = i; + if (strlen(values[i]) == len) + return i; /* exact macth no need to check more */ + } + } + + if (found == 1) /* one match: OK */ + return last; + + return (found ? -2 : -1); /* return many values or none matched */ +} + + +static void +write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) +{ + int found = -1; + if (arg) { + if (values) { + found = check_possible_values(arg, values); + } + if (found >= 0) + fprintf(outfile, "%s=\"%s\" # %s\n", opt, arg, values[found]); + else + fprintf(outfile, "%s=\"%s\"\n", opt, arg); + } else { + fprintf(outfile, "%s\n", opt); + } +} + + +int +cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) +{ + int i = 0; + + if (!outfile) + { + fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); + return EXIT_FAILURE; + } + + if (args_info->help_given) + write_into_file(outfile, "help", 0, 0 ); + if (args_info->version_given) + write_into_file(outfile, "version", 0, 0 ); + if (args_info->ptrn_given) + write_into_file(outfile, "ptrn", args_info->ptrn_orig, cmdline_parser_ptrn_values); + if (args_info->commsize_given) + write_into_file(outfile, "commsize", args_info->commsize_orig, 0); + if (args_info->timemult_given) + write_into_file(outfile, "timemult", args_info->timemult_orig, 0); + if (args_info->datasize_given) + write_into_file(outfile, "datasize", args_info->datasize_orig, 0); + if (args_info->filename_given) + write_into_file(outfile, "filename", args_info->filename_orig, 0); + if (args_info->nway_given) + write_into_file(outfile, "nway", args_info->nway_orig, 0); + if (args_info->root_given) + write_into_file(outfile, "root", args_info->root_orig, 0); + if (args_info->segmentsize_given) + write_into_file(outfile, "segmentsize", args_info->segmentsize_orig, 0); + if (args_info->nb_given) + write_into_file(outfile, "nb", args_info->nb_orig, 0); + if (args_info->nb_poll_given) + write_into_file(outfile, "nb-poll", args_info->nb_poll_orig, 0); + if (args_info->cpu_given) + write_into_file(outfile, "cpu", args_info->cpu_orig, 0); + if (args_info->rpl_dep_cmp_given) + write_into_file(outfile, "rpl-dep-cmp", args_info->rpl_dep_cmp_orig, 0); + if (args_info->a2av_skew_ratio_given) + write_into_file(outfile, "a2av-skew-ratio", args_info->a2av_skew_ratio_orig, 0); + if (args_info->outcast_given) + write_into_file(outfile, "outcast", 0, 0 ); + if (args_info->traces_given) + write_into_file(outfile, "traces", args_info->traces_orig, 0); + if (args_info->traces_start_given) + write_into_file(outfile, "traces-start", args_info->traces_start_orig, 0); + if (args_info->traces_nops_given) + write_into_file(outfile, "traces-nops", args_info->traces_nops_orig, 0); + if (args_info->traces_extr_given) + write_into_file(outfile, "traces-extr", args_info->traces_extr_orig, 0); + if (args_info->traces_print_given) + write_into_file(outfile, "traces-print", args_info->traces_print_orig, 0); + if (args_info->traces_nop2p_given) + write_into_file(outfile, "traces-nop2p", 0, 0 ); + if (args_info->traces_nocolls_given) + write_into_file(outfile, "traces-nocolls", 0, 0 ); + if (args_info->traces_nbcify_given) + write_into_file(outfile, "traces-nbcify", args_info->traces_nbcify_orig, 0); + + + i = EXIT_SUCCESS; + return i; +} + +int +cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) +{ + FILE *outfile; + int i = 0; + + outfile = fopen(filename, "w"); + + if (!outfile) + { + fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); + return EXIT_FAILURE; + } + + i = cmdline_parser_dump(outfile, args_info); + fclose (outfile); + + return i; +} + +void +cmdline_parser_free (struct gengetopt_args_info *args_info) +{ + cmdline_parser_release (args_info); +} + +/** @brief replacement of strdup, which is not standard */ +char * +gengetopt_strdup (const char *s) +{ + char *result = 0; + if (!s) + return result; + + result = (char*)malloc(strlen(s) + 1); + if (result == (char*)0) + return (char*)0; + strcpy(result, s); + return result; +} + +int +cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) +{ + return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); +} + +int +cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params) +{ + int result; + result = cmdline_parser_internal (argc, argv, args_info, params, 0); + + if (result == EXIT_FAILURE) + { + cmdline_parser_free (args_info); + exit (EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) +{ + int result; + struct cmdline_parser_params params; + + params.override = override; + params.initialize = initialize; + params.check_required = check_required; + params.check_ambiguity = 0; + params.print_errors = 1; + + result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); + + if (result == EXIT_FAILURE) + { + cmdline_parser_free (args_info); + exit (EXIT_FAILURE); + } + + return result; +} + +int +cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) +{ + FIX_UNUSED (args_info); + FIX_UNUSED (prog_name); + return EXIT_SUCCESS; +} + + +static char *package_name = 0; + +/** + * @brief updates an option + * @param field the generic pointer to the field to update + * @param orig_field the pointer to the orig field + * @param field_given the pointer to the number of occurrence of this option + * @param prev_given the pointer to the number of occurrence already seen + * @param value the argument for this option (if null no arg was specified) + * @param possible_values the possible values for this option (if specified) + * @param default_value the default value (in case the option only accepts fixed values) + * @param arg_type the type of this option + * @param check_ambiguity @see cmdline_parser_params.check_ambiguity + * @param override @see cmdline_parser_params.override + * @param no_free whether to free a possible previous value + * @param multiple_option whether this is a multiple option + * @param long_opt the corresponding long option + * @param short_opt the corresponding short option (or '-' if none) + * @param additional_error possible further error specification + */ +static +int update_arg(void *field, char **orig_field, + unsigned int *field_given, unsigned int *prev_given, + char *value, const char *possible_values[], + const char *default_value, + cmdline_parser_arg_type arg_type, + int check_ambiguity, int override, + int no_free, int multiple_option, + const char *long_opt, char short_opt, + const char *additional_error) +{ + char *stop_char = 0; + const char *val = value; + int found; + char **string_field; + FIX_UNUSED (field); + + stop_char = 0; + found = 0; + + if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) + { + if (short_opt != '-') + fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", + package_name, long_opt, short_opt, + (additional_error ? additional_error : "")); + else + fprintf (stderr, "%s: `--%s' option given more than once%s\n", + package_name, long_opt, + (additional_error ? additional_error : "")); + return 1; /* failure */ + } + + if (possible_values && (found = check_possible_values((value ? value : default_value), possible_values)) < 0) + { + if (short_opt != '-') + fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s' (`-%c')%s\n", + package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt, short_opt, + (additional_error ? additional_error : "")); + else + fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s'%s\n", + package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt, + (additional_error ? additional_error : "")); + return 1; /* failure */ + } + + if (field_given && *field_given && ! override) + return 0; + if (prev_given) + (*prev_given)++; + if (field_given) + (*field_given)++; + if (possible_values) + val = possible_values[found]; + + switch(arg_type) { + case ARG_FLAG: + *((int *)field) = !*((int *)field); + break; + case ARG_INT: + if (val) *((int *)field) = strtol (val, &stop_char, 0); + break; + case ARG_STRING: + if (val) { + string_field = (char **)field; + if (!no_free && *string_field) + free (*string_field); /* free previous string */ + *string_field = gengetopt_strdup (val); + } + break; + default: + break; + }; + + /* check numeric conversion */ + switch(arg_type) { + case ARG_INT: + if (val && !(stop_char && *stop_char == '\0')) { + fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); + return 1; /* failure */ + } + break; + default: + ; + }; + + /* store the original value */ + switch(arg_type) { + case ARG_NO: + case ARG_FLAG: + break; + default: + if (value && orig_field) { + if (no_free) { + *orig_field = value; + } else { + if (*orig_field) + free (*orig_field); /* free previous string */ + *orig_field = gengetopt_strdup (value); + } + } + }; + + return 0; /* OK */ +} + + +int +cmdline_parser_internal ( + int argc, char **argv, struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params, const char *additional_error) +{ + int c; /* Character of the parsed option. */ + + int error_occurred = 0; + struct gengetopt_args_info local_args_info; + + int override; + int initialize; + int check_required; + int check_ambiguity; + + package_name = argv[0]; + + /* TODO: Why is this here? It is not used anywhere. */ + override = params->override; + FIX_UNUSED(override); + + initialize = params->initialize; + check_required = params->check_required; + + /* TODO: Why is this here? It is not used anywhere. */ + check_ambiguity = params->check_ambiguity; + FIX_UNUSED(check_ambiguity); + + if (initialize) + cmdline_parser_init (args_info); + + cmdline_parser_init (&local_args_info); + + optarg = 0; + optind = 0; + opterr = params->print_errors; + optopt = '?'; + + while (1) + { + int option_index = 0; + + static struct option long_options[] = { + { "help", 0, NULL, 'h' }, + { "version", 0, NULL, 'V' }, + { "ptrn", 1, NULL, 'p' }, + { "commsize", 1, NULL, 's' }, + { "timemult", 1, NULL, 0 }, + { "datasize", 1, NULL, 'd' }, + { "filename", 1, NULL, 'o' }, + { "nway", 1, NULL, 0 }, + { "root", 1, NULL, 0 }, + { "segmentsize", 1, NULL, 0 }, + { "nb", 1, NULL, 0 }, + { "nb-poll", 1, NULL, 0 }, + { "cpu", 1, NULL, 0 }, + { "rpl-dep-cmp", 1, NULL, 0 }, + { "a2av-skew-ratio", 1, NULL, 0 }, + { "outcast", 0, NULL, 0 }, + { "traces", 1, NULL, 0 }, + { "traces-start", 1, NULL, 0 }, + { "traces-nops", 1, NULL, 0 }, + { "traces-extr", 1, NULL, 0 }, + { "traces-print", 1, NULL, 0 }, + { "traces-nop2p", 0, NULL, 0 }, + { "traces-nocolls", 0, NULL, 0 }, + { "traces-nbcify", 1, NULL, 0 }, + { 0, 0, 0, 0 } + }; + + c = getopt_long (argc, argv, "hVp:s:d:o:", long_options, &option_index); + + if (c == -1) break; /* Exit from `while (1)' loop. */ + + switch (c) + { + case 'h': /* Print help and exit. */ + cmdline_parser_print_help (); + cmdline_parser_free (&local_args_info); + exit (EXIT_SUCCESS); + + case 'V': /* Print version and exit. */ + cmdline_parser_print_version (); + cmdline_parser_free (&local_args_info); + exit (EXIT_SUCCESS); + + case 'p': /* Name of the communication pattern that should be used to generate a schedule. */ + + + if (update_arg( (void *)&(args_info->ptrn_arg), + &(args_info->ptrn_orig), &(args_info->ptrn_given), + &(local_args_info.ptrn_given), optarg, cmdline_parser_ptrn_values, "binomialtreebcast", ARG_STRING, + check_ambiguity, override, 0, 0, + "ptrn", 'p', + additional_error)) + goto failure; + + break; + case 's': /* Number of nodes that should be used in the communication pattern. */ + + + if (update_arg( (void *)&(args_info->commsize_arg), + &(args_info->commsize_orig), &(args_info->commsize_given), + &(local_args_info.commsize_given), optarg, 0, "8", ARG_INT, + check_ambiguity, override, 0, 0, + "commsize", 's', + additional_error)) + goto failure; + + break; + case 'd': /* Number of bytes that are transmitted in the communication patttern in a basic step. */ + + + if (update_arg( (void *)&(args_info->datasize_arg), + &(args_info->datasize_orig), &(args_info->datasize_given), + &(local_args_info.datasize_given), optarg, 0, "1", ARG_INT, + check_ambiguity, override, 0, 0, + "datasize", 'd', + additional_error)) + goto failure; + + break; + case 'o': /* Filename for the name of the generated schedule. */ + + + if (update_arg( (void *)&(args_info->filename_arg), + &(args_info->filename_orig), &(args_info->filename_given), + &(local_args_info.filename_given), optarg, 0, "schedule.goal", ARG_STRING, + check_ambiguity, override, 0, 0, + "filename", 'o', + additional_error)) + goto failure; + + break; + + case 0: /* Long option with no short option */ + /* Time multiplier, relative to microsecond (e.g., nanoseconds -> 1000). */ + if (strcmp (long_options[option_index].name, "timemult") == 0) + { + + + if (update_arg( (void *)&(args_info->timemult_arg), + &(args_info->timemult_orig), &(args_info->timemult_given), + &(local_args_info.timemult_given), optarg, 0, "1000", ARG_INT, + check_ambiguity, override, 0, 0, + "timemult", '-', + additional_error)) + goto failure; + + } + /* Fanout for the n-way dissemination pattern. */ + else if (strcmp (long_options[option_index].name, "nway") == 0) + { + + + if (update_arg( (void *)&(args_info->nway_arg), + &(args_info->nway_orig), &(args_info->nway_given), + &(local_args_info.nway_given), optarg, 0, "1", ARG_INT, + check_ambiguity, override, 0, 0, + "nway", '-', + additional_error)) + goto failure; + + } + /* Root node for certain patterns. */ + else if (strcmp (long_options[option_index].name, "root") == 0) + { + + + if (update_arg( (void *)&(args_info->root_arg), + &(args_info->root_orig), &(args_info->root_given), + &(local_args_info.root_given), optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "root", '-', + additional_error)) + goto failure; + + } + /* Segment size for pipelined pattern. */ + else if (strcmp (long_options[option_index].name, "segmentsize") == 0) + { + + + if (update_arg( (void *)&(args_info->segmentsize_arg), + &(args_info->segmentsize_orig), &(args_info->segmentsize_given), + &(local_args_info.segmentsize_given), optarg, 0, "1", ARG_INT, + check_ambiguity, override, 0, 0, + "segmentsize", '-', + additional_error)) + goto failure; + + } + /* nonblocking execution of collectives (provide length of local operation). */ + else if (strcmp (long_options[option_index].name, "nb") == 0) + { + + + if (update_arg( (void *)&(args_info->nb_arg), + &(args_info->nb_orig), &(args_info->nb_given), + &(local_args_info.nb_given), optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "nb", '-', + additional_error)) + goto failure; + + } + /* polling interval for nonblocking execution. */ + else if (strcmp (long_options[option_index].name, "nb-poll") == 0) + { + + + if (update_arg( (void *)&(args_info->nb_poll_arg), + &(args_info->nb_poll_orig), &(args_info->nb_poll_given), + &(local_args_info.nb_poll_given), optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "nb-poll", '-', + additional_error)) + goto failure; + + } + /* select CPU to execute computation. */ + else if (strcmp (long_options[option_index].name, "cpu") == 0) + { + + + if (update_arg( (void *)&(args_info->cpu_arg), + &(args_info->cpu_orig), &(args_info->cpu_given), + &(local_args_info.cpu_given), optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "cpu", '-', + additional_error)) + goto failure; + + } + /* replaces dependencies with fixed computation (parameter represents computation time. If -1, does not replace dependencies.). */ + else if (strcmp (long_options[option_index].name, "rpl-dep-cmp") == 0) + { + + + if (update_arg( (void *)&(args_info->rpl_dep_cmp_arg), + &(args_info->rpl_dep_cmp_orig), &(args_info->rpl_dep_cmp_given), + &(local_args_info.rpl_dep_cmp_given), optarg, 0, "-1", ARG_INT, + check_ambiguity, override, 0, 0, + "rpl-dep-cmp", '-', + additional_error)) + goto failure; + + } + /* In the alltoallv pattern, each chunk of data sent by each rank is of a random size. The size of the chunk with id 'root' is of size 'datasize'. All the other chunks are of random size, and a2av-skew-ratio times smaller.. */ + else if (strcmp (long_options[option_index].name, "a2av-skew-ratio") == 0) + { + + + if (update_arg( (void *)&(args_info->a2av_skew_ratio_arg), + &(args_info->a2av_skew_ratio_orig), &(args_info->a2av_skew_ratio_given), + &(local_args_info.a2av_skew_ratio_given), optarg, 0, "1", ARG_INT, + check_ambiguity, override, 0, 0, + "a2av-skew-ratio", '-', + additional_error)) + goto failure; + + } + /* Generates outcast in the alltoallv pattern.. */ + else if (strcmp (long_options[option_index].name, "outcast") == 0) + { + + + if (update_arg((void *)&(args_info->outcast_flag), 0, &(args_info->outcast_given), + &(local_args_info.outcast_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "outcast", '-', + additional_error)) + goto failure; + + } + /* Tracefile for rank 0 (others are autodetected). */ + else if (strcmp (long_options[option_index].name, "traces") == 0) + { + + + if (update_arg( (void *)&(args_info->traces_arg), + &(args_info->traces_orig), &(args_info->traces_given), + &(local_args_info.traces_given), optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "traces", '-', + additional_error)) + goto failure; + + } + /* file with start lines in trace files (is updated after run if trace-nops is given). */ + else if (strcmp (long_options[option_index].name, "traces-start") == 0) + { + + + if (update_arg( (void *)&(args_info->traces_start_arg), + &(args_info->traces_start_orig), &(args_info->traces_start_given), + &(local_args_info.traces_start_given), optarg, 0, 0, ARG_STRING, + check_ambiguity, override, 0, 0, + "traces-start", '-', + additional_error)) + goto failure; + + } + /* number of operations to write to file (0=all). */ + else if (strcmp (long_options[option_index].name, "traces-nops") == 0) + { + + + if (update_arg( (void *)&(args_info->traces_nops_arg), + &(args_info->traces_nops_orig), &(args_info->traces_nops_given), + &(local_args_info.traces_nops_given), optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "traces-nops", '-', + additional_error)) + goto failure; + + } + /* extrapolation factor for traces. */ + else if (strcmp (long_options[option_index].name, "traces-extr") == 0) + { + + + if (update_arg( (void *)&(args_info->traces_extr_arg), + &(args_info->traces_extr_orig), &(args_info->traces_extr_given), + &(local_args_info.traces_extr_given), optarg, 0, "1", ARG_INT, + check_ambiguity, override, 0, 0, + "traces-extr", '-', + additional_error)) + goto failure; + + } + /* print each operation. */ + else if (strcmp (long_options[option_index].name, "traces-print") == 0) + { + + + if (update_arg( (void *)&(args_info->traces_print_arg), + &(args_info->traces_print_orig), &(args_info->traces_print_given), + &(local_args_info.traces_print_given), optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "traces-print", '-', + additional_error)) + goto failure; + + } + /* do not consider point-to-point communication. */ + else if (strcmp (long_options[option_index].name, "traces-nop2p") == 0) + { + + + if (update_arg((void *)&(args_info->traces_nop2p_flag), 0, &(args_info->traces_nop2p_given), + &(local_args_info.traces_nop2p_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "traces-nop2p", '-', + additional_error)) + goto failure; + + } + /* do not consider collective communication. */ + else if (strcmp (long_options[option_index].name, "traces-nocolls") == 0) + { + + + if (update_arg((void *)&(args_info->traces_nocolls_flag), 0, &(args_info->traces_nocolls_given), + &(local_args_info.traces_nocolls_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "traces-nocolls", '-', + additional_error)) + goto failure; + + } + /* turn blocking collectives into non-blocking colls, time to pre-post NBCs. */ + else if (strcmp (long_options[option_index].name, "traces-nbcify") == 0) + { + + + if (update_arg( (void *)&(args_info->traces_nbcify_arg), + &(args_info->traces_nbcify_orig), &(args_info->traces_nbcify_given), + &(local_args_info.traces_nbcify_given), optarg, 0, "0", ARG_INT, + check_ambiguity, override, 0, 0, + "traces-nbcify", '-', + additional_error)) + goto failure; + + } + + break; + case '?': /* Invalid option. */ + /* `getopt_long' already printed an error message. */ + goto failure; + + default: /* bug: option not considered. */ + fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); + abort (); + } /* switch */ + } /* while */ + + + + FIX_UNUSED(check_required); + + cmdline_parser_release (&local_args_info); + + if ( error_occurred ) + return (EXIT_FAILURE); + + return 0; + +failure: + + cmdline_parser_release (&local_args_info); + return (EXIT_FAILURE); +} +/* vim: set ft=c noet ts=8 sts=8 sw=8 tw=80 nojs spell : */ diff --git a/src/Schedgen/schedgen_cmdline.h b/src/Schedgen/schedgen_cmdline.h new file mode 100644 index 0000000..0e46fac --- /dev/null +++ b/src/Schedgen/schedgen_cmdline.h @@ -0,0 +1,260 @@ +/** @file schedgen_cmdline.h + * @brief The header file for the command line option parser + * generated by GNU Gengetopt version 2.23 + * http://www.gnu.org/software/gengetopt. + * DO NOT modify this file, since it can be overwritten + * @author GNU Gengetopt */ + +#ifndef SCHEDGEN_CMDLINE_H +#define SCHEDGEN_CMDLINE_H + +/* If we use autoconf. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include /* for FILE */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifndef CMDLINE_PARSER_PACKAGE +/** @brief the program name (used for printing errors) */ +#define CMDLINE_PARSER_PACKAGE "schedgen" +#endif + +#ifndef CMDLINE_PARSER_PACKAGE_NAME +/** @brief the complete program name (used for help and version) */ +#define CMDLINE_PARSER_PACKAGE_NAME "schedgen" +#endif + +#ifndef CMDLINE_PARSER_VERSION +/** @brief the program version */ +#define CMDLINE_PARSER_VERSION "0.1" +#endif + +/** @brief Where the command line options are stored */ +struct gengetopt_args_info +{ + const char *help_help; /**< @brief Print help and exit help description. */ + const char *version_help; /**< @brief Print version and exit help description. */ + char * ptrn_arg; /**< @brief Name of the communication pattern that should be used to generate a schedule (default='binomialtreebcast'). */ + char * ptrn_orig; /**< @brief Name of the communication pattern that should be used to generate a schedule original value given at command line. */ + const char *ptrn_help; /**< @brief Name of the communication pattern that should be used to generate a schedule help description. */ + int commsize_arg; /**< @brief Number of nodes that should be used in the communication pattern (default='8'). */ + char * commsize_orig; /**< @brief Number of nodes that should be used in the communication pattern original value given at command line. */ + const char *commsize_help; /**< @brief Number of nodes that should be used in the communication pattern help description. */ + int timemult_arg; /**< @brief Time multiplier, relative to microsecond (e.g., nanoseconds -> 1000) (default='1000'). */ + char * timemult_orig; /**< @brief Time multiplier, relative to microsecond (e.g., nanoseconds -> 1000) original value given at command line. */ + const char *timemult_help; /**< @brief Time multiplier, relative to microsecond (e.g., nanoseconds -> 1000) help description. */ + int datasize_arg; /**< @brief Number of bytes that are transmitted in the communication patttern in a basic step (default='1'). */ + char * datasize_orig; /**< @brief Number of bytes that are transmitted in the communication patttern in a basic step original value given at command line. */ + const char *datasize_help; /**< @brief Number of bytes that are transmitted in the communication patttern in a basic step help description. */ + char * filename_arg; /**< @brief Filename for the name of the generated schedule (default='schedule.goal'). */ + char * filename_orig; /**< @brief Filename for the name of the generated schedule original value given at command line. */ + const char *filename_help; /**< @brief Filename for the name of the generated schedule help description. */ + int nway_arg; /**< @brief Fanout for the n-way dissemination pattern (default='1'). */ + char * nway_orig; /**< @brief Fanout for the n-way dissemination pattern original value given at command line. */ + const char *nway_help; /**< @brief Fanout for the n-way dissemination pattern help description. */ + int root_arg; /**< @brief Root node for certain patterns (default='0'). */ + char * root_orig; /**< @brief Root node for certain patterns original value given at command line. */ + const char *root_help; /**< @brief Root node for certain patterns help description. */ + int segmentsize_arg; /**< @brief Segment size for pipelined pattern (default='1'). */ + char * segmentsize_orig; /**< @brief Segment size for pipelined pattern original value given at command line. */ + const char *segmentsize_help; /**< @brief Segment size for pipelined pattern help description. */ + int nb_arg; /**< @brief nonblocking execution of collectives (provide length of local operation) (default='0'). */ + char * nb_orig; /**< @brief nonblocking execution of collectives (provide length of local operation) original value given at command line. */ + const char *nb_help; /**< @brief nonblocking execution of collectives (provide length of local operation) help description. */ + int nb_poll_arg; /**< @brief polling interval for nonblocking execution (default='0'). */ + char * nb_poll_orig; /**< @brief polling interval for nonblocking execution original value given at command line. */ + const char *nb_poll_help; /**< @brief polling interval for nonblocking execution help description. */ + int cpu_arg; /**< @brief select CPU to execute computation (default='0'). */ + char * cpu_orig; /**< @brief select CPU to execute computation original value given at command line. */ + const char *cpu_help; /**< @brief select CPU to execute computation help description. */ + int rpl_dep_cmp_arg; /**< @brief replaces dependencies with fixed computation (parameter represents computation time. If -1, does not replace dependencies.) (default='-1'). */ + char * rpl_dep_cmp_orig; /**< @brief replaces dependencies with fixed computation (parameter represents computation time. If -1, does not replace dependencies.) original value given at command line. */ + const char *rpl_dep_cmp_help; /**< @brief replaces dependencies with fixed computation (parameter represents computation time. If -1, does not replace dependencies.) help description. */ + int a2av_skew_ratio_arg; /**< @brief In the alltoallv pattern, each chunk of data sent by each rank is of a random size. The size of the chunk with id 'root' is of size 'datasize'. All the other chunks are of random size, and a2av-skew-ratio times smaller. (default='1'). */ + char * a2av_skew_ratio_orig; /**< @brief In the alltoallv pattern, each chunk of data sent by each rank is of a random size. The size of the chunk with id 'root' is of size 'datasize'. All the other chunks are of random size, and a2av-skew-ratio times smaller. original value given at command line. */ + const char *a2av_skew_ratio_help; /**< @brief In the alltoallv pattern, each chunk of data sent by each rank is of a random size. The size of the chunk with id 'root' is of size 'datasize'. All the other chunks are of random size, and a2av-skew-ratio times smaller. help description. */ + int outcast_flag; /**< @brief Generates outcast in the alltoallv pattern. (default=off). */ + const char *outcast_help; /**< @brief Generates outcast in the alltoallv pattern. help description. */ + char * traces_arg; /**< @brief Tracefile for rank 0 (others are autodetected). */ + char * traces_orig; /**< @brief Tracefile for rank 0 (others are autodetected) original value given at command line. */ + const char *traces_help; /**< @brief Tracefile for rank 0 (others are autodetected) help description. */ + char * traces_start_arg; /**< @brief file with start lines in trace files (is updated after run if trace-nops is given). */ + char * traces_start_orig; /**< @brief file with start lines in trace files (is updated after run if trace-nops is given) original value given at command line. */ + const char *traces_start_help; /**< @brief file with start lines in trace files (is updated after run if trace-nops is given) help description. */ + int traces_nops_arg; /**< @brief number of operations to write to file (0=all) (default='0'). */ + char * traces_nops_orig; /**< @brief number of operations to write to file (0=all) original value given at command line. */ + const char *traces_nops_help; /**< @brief number of operations to write to file (0=all) help description. */ + int traces_extr_arg; /**< @brief extrapolation factor for traces (default='1'). */ + char * traces_extr_orig; /**< @brief extrapolation factor for traces original value given at command line. */ + const char *traces_extr_help; /**< @brief extrapolation factor for traces help description. */ + int traces_print_arg; /**< @brief print each operation (default='0'). */ + char * traces_print_orig; /**< @brief print each operation original value given at command line. */ + const char *traces_print_help; /**< @brief print each operation help description. */ + int traces_nop2p_flag; /**< @brief do not consider point-to-point communication (default=off). */ + const char *traces_nop2p_help; /**< @brief do not consider point-to-point communication help description. */ + int traces_nocolls_flag; /**< @brief do not consider collective communication (default=off). */ + const char *traces_nocolls_help; /**< @brief do not consider collective communication help description. */ + int traces_nbcify_arg; /**< @brief turn blocking collectives into non-blocking colls, time to pre-post NBCs (default='0'). */ + char * traces_nbcify_orig; /**< @brief turn blocking collectives into non-blocking colls, time to pre-post NBCs original value given at command line. */ + const char *traces_nbcify_help; /**< @brief turn blocking collectives into non-blocking colls, time to pre-post NBCs help description. */ + + unsigned int help_given ; /**< @brief Whether help was given. */ + unsigned int version_given ; /**< @brief Whether version was given. */ + unsigned int ptrn_given ; /**< @brief Whether ptrn was given. */ + unsigned int commsize_given ; /**< @brief Whether commsize was given. */ + unsigned int timemult_given ; /**< @brief Whether timemult was given. */ + unsigned int datasize_given ; /**< @brief Whether datasize was given. */ + unsigned int filename_given ; /**< @brief Whether filename was given. */ + unsigned int nway_given ; /**< @brief Whether nway was given. */ + unsigned int root_given ; /**< @brief Whether root was given. */ + unsigned int segmentsize_given ; /**< @brief Whether segmentsize was given. */ + unsigned int nb_given ; /**< @brief Whether nb was given. */ + unsigned int nb_poll_given ; /**< @brief Whether nb-poll was given. */ + unsigned int cpu_given ; /**< @brief Whether cpu was given. */ + unsigned int rpl_dep_cmp_given ; /**< @brief Whether rpl-dep-cmp was given. */ + unsigned int a2av_skew_ratio_given ; /**< @brief Whether a2av-skew-ratio was given. */ + unsigned int outcast_given ; /**< @brief Whether outcast was given. */ + unsigned int traces_given ; /**< @brief Whether traces was given. */ + unsigned int traces_start_given ; /**< @brief Whether traces-start was given. */ + unsigned int traces_nops_given ; /**< @brief Whether traces-nops was given. */ + unsigned int traces_extr_given ; /**< @brief Whether traces-extr was given. */ + unsigned int traces_print_given ; /**< @brief Whether traces-print was given. */ + unsigned int traces_nop2p_given ; /**< @brief Whether traces-nop2p was given. */ + unsigned int traces_nocolls_given ; /**< @brief Whether traces-nocolls was given. */ + unsigned int traces_nbcify_given ; /**< @brief Whether traces-nbcify was given. */ + +} ; + +/** @brief The additional parameters to pass to parser functions */ +struct cmdline_parser_params +{ + int override; /**< @brief whether to override possibly already present options (default 0) */ + int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ + int check_required; /**< @brief whether to check that all required options were provided (default 1) */ + int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ + int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ +} ; + +/** @brief the purpose string of the program */ +extern const char *gengetopt_args_info_purpose; +/** @brief the usage string of the program */ +extern const char *gengetopt_args_info_usage; +/** @brief the description string of the program */ +extern const char *gengetopt_args_info_description; +/** @brief all the lines making the help output */ +extern const char *gengetopt_args_info_help[]; + +/** + * The command line parser + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser (int argc, char **argv, + struct gengetopt_args_info *args_info); + +/** + * The command line parser (version with additional parameters - deprecated) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param override whether to override possibly already present options + * @param initialize whether to initialize the option structure my_args_info + * @param check_required whether to check that all required options were provided + * @return 0 if everything went fine, NON 0 if an error took place + * @deprecated use cmdline_parser_ext() instead + */ +int cmdline_parser2 (int argc, char **argv, + struct gengetopt_args_info *args_info, + int override, int initialize, int check_required); + +/** + * The command line parser (version with additional parameters) + * @param argc the number of command line options + * @param argv the command line options + * @param args_info the structure where option information will be stored + * @param params additional parameters for the parser + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser_ext (int argc, char **argv, + struct gengetopt_args_info *args_info, + struct cmdline_parser_params *params); + +/** + * Save the contents of the option struct into an already open FILE stream. + * @param outfile the stream where to dump options + * @param args_info the option struct to dump + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser_dump(FILE *outfile, + struct gengetopt_args_info *args_info); + +/** + * Save the contents of the option struct into a (text) file. + * This file can be read by the config file parser (if generated by gengetopt) + * @param filename the file where to save + * @param args_info the option struct to save + * @return 0 if everything went fine, NON 0 if an error took place + */ +int cmdline_parser_file_save(const char *filename, + struct gengetopt_args_info *args_info); + +/** + * Print the help + */ +void cmdline_parser_print_help(void); +/** + * Print the version + */ +void cmdline_parser_print_version(void); + +/** + * Initializes all the fields a cmdline_parser_params structure + * to their default values + * @param params the structure to initialize + */ +void cmdline_parser_params_init(struct cmdline_parser_params *params); + +/** + * Allocates dynamically a cmdline_parser_params structure and initializes + * all its fields to their default values + * @return the created and initialized cmdline_parser_params structure + */ +struct cmdline_parser_params *cmdline_parser_params_create(void); + +/** + * Initializes the passed gengetopt_args_info structure's fields + * (also set default values for options that have a default) + * @param args_info the structure to initialize + */ +void cmdline_parser_init (struct gengetopt_args_info *args_info); +/** + * Deallocates the string fields of the gengetopt_args_info structure + * (but does not deallocate the structure itself) + * @param args_info the structure to deallocate + */ +void cmdline_parser_free (struct gengetopt_args_info *args_info); + +/** + * Checks that all the required options were specified + * @param args_info the structure to check + * @param prog_name the name of the program that will be used to print + * possible errors + * @return + */ +int cmdline_parser_required (struct gengetopt_args_info *args_info, + const char *prog_name); + +extern const char *cmdline_parser_ptrn_values[]; /**< @brief Possible values for ptrn. */ + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* SCHEDGEN_CMDLINE_H */ diff --git a/src/Schedgen2/__pycache__/additional_microbenchmarks.cpython-311.pyc b/src/Schedgen2/__pycache__/additional_microbenchmarks.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bb25b5724d395d023e373d2f9911d2c0645e225c GIT binary patch literal 1274 zcmcgry=xRf6rZ`h-P^mpZ#Bl8!dgizvLYxJVrfJq3P}{wgvri&x7>alGjmA76(ZJR zBWWx}3H}}SQ7o1PL9j}+)%_V+;21IaakT1A6 zBIl6VUjt^FaKdRsV!B2tsp^k6xEYkV1)~DP4h&um$`5P2_S9T6kJ;nE9*ftP$$WDU z589!*6@^K_#NI_%iZZ~>yy~ZMye`A7Ah$VFOml`}{k%Lh}fE%t?XFBg7ZWL z!3M~yEb6BsRD(FTM@+CN3L=3y>_C5T`qe^I(H3{)*6}@e~AX ziM$W+m=tYNZ$H2G!RhTz|8pzvo!&>ye{wnnvFldW?PZ-aS-q8Y=d#YJZ1zIY0I}8; zO#-`G-v77* zQE)@_K!y)Pz5^%>N@+%VyFdR$owU1Idp0|JzHmAeS`3i2x`hGr=VqrcQD~7`qo^Qf c6Q@~Jk*krJx$h?0ZVC(k+#|-Med|hn1#*KfC;$Ke literal 0 HcmV?d00001 diff --git a/src/Schedgen2/__pycache__/goal.cpython-311.pyc b/src/Schedgen2/__pycache__/goal.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..98a01168f49a251c32710418f90265a94746146c GIT binary patch literal 21275 zcmeHvYit`=mSz=SA}LaQ=wUtWlH`{XS+N~&qV_Yk<%bemj&0@9>Ld)UD#?r`O0J?} zo2DFXBS2_F11p9CGXwVycaYB76HT{!CIfhYS-=a-0R58`xGRFY28>-au-P9A8FpiX z01NDQZn270q~v(Fvzf+jUltE<-Fxdk&pqedb58N!c)e~8VatIg>ERZR`!95(g{orY z@n2au?j|R4B0t6raTe|fCt5z{MC+GG{|a9<4Dl?-h8%lYj)mnokW(dDzO>>ge2Y(6 zS)LPlu8KSx%X1^Ix+2fc@;u1%mbKsLCKx=Xipe_zr@W~dV;xaJTDA+CAY{m=_S%Ndejh+ykf0b zw@`1MC!U*a|HE6CyoT0&hDP{dzG`*B^E1h18fCyxSdXGiu+$gx zD)3xc4bRlB$e#v=p60sNd_%1a4C`$nqOI`bjkvkVN!$=Gazhr8|Ck%H5;hOnL@S_O z1pW>=L_6wn6g)>J!eht6XQZ()Ngmefpn3_12!|i<1;F0m6I=)}HLyFqbc92mzDwAh zj{PEcn!95e_=XC1*$VEcbTJkhqXr8u79XA%A1_o*OoqhBaID~>TNb^;7i@|&Hlomz z!gt$Vcteq7<%L*ee5>-pTNCoR7miJg9y#&)>B#sCiah+n>EW}II4VWAzc7j+^-NwW zI76XGG!hGi;`PQ+_Grm=RIGFW%y9YUmZWXgmv3suPfdPJ6Mj7TCQ7VH;`11#xM6*W zxS;{E>4_q8lS^QFK0r(jA96AuU56BXij27lem9CGxQl!#U*zLnY9X}B6D34C&B+ct z-er-AuE|a{j)%E|WnxmHJ_>?N`>x0wRf&=zBN!W1f?6FiZ>uE(o^2F?k)cLGOph(_VJDW%y$obY~oa@Iz0p#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%^5bg**CtDBZ-woZ*k0M}$ah~kczK3;8O6K|uVPZm^j&bY=@cS3cdEBJ2TV&Y z=WEI3Oqxf@ffrEEIdJR^NafYMuElSF$AUb~xbZB7xoI`CB!`8j`5U(!+1dCIAyYuI zUhQ2?r>#wP^(~zWNprEz8<+smUA$rYQa$L&g`Jx|4|1@59V8uluWa&3CLhhGxR!h> zD0>GAua&*qWPhk?g*MoqKx`zhve%1bmpyP(+f5b+rNE^6lx$NK+mysjsZqMw7In`r zfEq2f@VD54+h_{`@@v6x!_?6lMrsXH2W#*(YiuFwL)^sau&Lbx)XkyT;nF0){~xlV zaF)EbQ|&{1kNO5}GXvoh1pXwD4a-jlCd5mYe*qX+erNmg^DWCiP+$J7L1FcI&x++#CX(Zef0`UXzDSB?-7nqShyh5AyuBk8)(v~)ia83OVHcPNn(mg3^e z_!Jajy&%B>n^pA;!^p^dnf}QrAhkX+Iw(Evsd8w7Il)x*Z!pZOOcl`|+3u`W$ozPktlPS)23ijZm$ho5EQidt zW@)ugjlN9LAj=LglN4=ILz~plpk6}*RzuUI2~M4_qj{JKKqHjuMi{Catyj?~tD;es zN~?WpbU)QCQ01Rz+*JgGV!nILMaqsC>E_( z!6>VuQML;?;hIQU+EMLZqkEgMJ;d%Xi4)qCPiRwydTq+UYEuSQ#cp&|yKkiQeEknv ClD3Kf literal 0 HcmV?d00001 diff --git a/src/Schedgen2/__pycache__/patterns.cpython-311.pyc b/src/Schedgen2/__pycache__/patterns.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..797b0e3646f33c5357ef9339a14b7c950cfdc646 GIT binary patch literal 13689 zcmeHNYit`=cAnvL_$EbC6eU?2JuTX@Wch8!>#So%i5)-WNO{R1^X8C}?@Im0H7c7EV zu!YOLqu@#RTzxZUsHQ7z4he3)K~qy5ABLJd<(i$xa)2`aC7s55Z)A3fZ4mSl^;kupG))n)(!;KCk4=T2fHHeDOwjZ-Dpk zQ?EfPL!bJaSu1avW#DJibEh;dN?FTgD5|y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q+px#mVC%%A$U{)M# zk#q$2bL@!P6Y)iOoM~LU3+u4muK*KiHxsl2NGuaK1%WY_t`*f@-DjxARscHTNIo1X z+JI{rd;Bfwwy`1urIDupA*>DY7!K1gk`W;KN&nuV+Nz&o93^v^FgR3Z%G(N4>}s5Q z8BP-&_;vRueTzMd;akt<+Mmw1Kb>oSI@d6iZy3tChGf^!U0)ccxGVrgslhv3{cs)- z-J_~ef}lR))XXzN8ucI?F*|VDtG0*6K~8KGv{odvQC@u&EDQX>rP>shlGT9A_TQ21 zF!b=j16T?7x9Gg$cO3y(7C**{V0?05lWfJiXwWSR%{s$1a^FqWHv!xYcIAUzMGxdG zV>Xy1LHnHTet-%!1GcU2&ewMrDZ33mFCcS6cbuESd98Ts6>nJa`U!1NyiJOC{j$%7 z%MnPiN{m>vK{x8vS%f96X@d>8U`b;efIu6Zlx>sZ^eRr5;tVQI51|3Y8B&}bP?-%F zfk0(I>Z_jevIR`$RXw_(TE<58=mENi)eIA{Wk=Ox2ZUXiGES^U5f{M?N?n2* zApMZpI{^lIT-Yc60v=&yP||16sG^akX@zoKB!3FkB(HWWRExaYtx#cEe-~lmTa=E@ zqGKoREmA-fPhHUn|L?keMKfkvD7&j@#S}w%{Y4w5>{LseTEtCR+(i%OVPOqP(^P#o zk-Qc2fe^{?pGd|`RWhbj$(T|lV@j2bDJ-lZpu0eFogam}*5fN6L^%8>!ZA}7jww|* zrtFlvUPy^QF8=+}f%SaVF3=t;oIz2@*$%iOU zFf%&e@!pB7DLcB*@yUr#JaVu<@7Y|m5(WlG(MFPX97YF8Iw_C8=psosRTnIJNYaaq zQ|qh4*7->;sakD7iKYyt7B;t)8+nArJ|HCnf(bGrBwrm8l2pfpB< 0: self.outfile.write("\n".join(prologs)+"\n//end of prologs\n") @@ -176,6 +239,8 @@ def write_argument_tracers(self, func, mode): elem_count_expr = "0" if ('elem_count' in sem_param) and (sem_param['elem_count'] is not None): elem_count_expr = sem_param['elem_count'] + if (mode == 'fortran'): + elem_count_expr = self.deref_args(elem_count_expr, func) self.outfile.write(f" WRITE_TRACE(\"%p,%i[\", (void*) {sem_param['name']}, (int) {elem_count_expr});\n") self.outfile.write(f" if (0) {{ }} else {{ \n") self.outfile.write(f" for (int trace_elem_idx=0; trace_elem_idx<{elem_count_expr}; trace_elem_idx++) "+"{\n") @@ -184,13 +249,19 @@ def write_argument_tracers(self, func, mode): name = sem_param['name'] + "[trace_elem_idx]" basetype, brackets = self.split_type(sem_param['type']) typestr = basetype + brackets[2:] - code = self.tracer_for_simple_arg(name, typestr, func, sep=";") + if mode == 'c': + code = self.tracer_for_simple_arg(name, typestr, func, sep=";") + else: + code = self.tracer_for_simple_arg_fortran(name, typestr, func, sep=";") self.outfile.write(" "+code) self.outfile.write(" }\n") self.outfile.write(" WRITE_TRACE(\"]%s\", \":\");\n") self.outfile.write("}\n") else: - code = self.tracer_for_simple_arg(sem_param['name'], sem_param['type'], func, sep=":") + if mode == 'c': + code = self.tracer_for_simple_arg(sem_param['name'], sem_param['type'], func, sep=":") + else: + code = self.tracer_for_simple_arg_fortran(sem_param['name'], sem_param['type'], func, sep=":") self.outfile.write(" " + code) @@ -198,7 +269,10 @@ def produce_fortran_pmpi_prototypes(self): for func in self.semantics: param_signatures = [] for param in self.semantics[func]['params']: - param_signatures.append(f"int* {param['name']}") + argtype = "int*" + if "char" in self.get_param_argtype(param['name'], func): + argtype = "char*" + param_signatures.append(f"{argtype} {param['name']}") param_signatures.append("int* ierr") params = ", ".join(param_signatures) pfunc = f"P{func}" @@ -223,7 +297,10 @@ def produce_tracers(self, mode='c'): type_prefix, type_suffix = self.split_type(param['type']) param_signatures.append(f"{type_prefix} {param['name']}{type_suffix}") elif mode == 'fortran': - param_signatures.append(f"int* {param['name']}") + argtype = "int*" + if "char" in self.get_param_argtype(param['name'], func): + argtype = "char*" + param_signatures.append(f"{argtype} {param['name']}") if mode == 'fortran': param_signatures.append("int* ierr") params = ", ".join(param_signatures) diff --git a/src/liballprof2/gensem.py b/src/liballprof2/gensem.py index 188e093..06b4746 100755 --- a/src/liballprof2/gensem.py +++ b/src/liballprof2/gensem.py @@ -40,8 +40,8 @@ def __init__(self, libclang_path): def get_count_for_param_in_func(self, param, func): # TODO minimize this mapping = {} - GET_NDIMS_CART_COMM = "int ndims; MPI_Cartdim_get(comm, &ndims);" - GET_COMM_SIZE = "int rank, size; MPI_Comm_size(comm, &size); MPI_Comm_rank(comm, &rank);" + GET_NDIMS_CART_COMM = "int ndims; PMPI_Cartdim_get(comm, &ndims);" + GET_COMM_SIZE = "int rank, size; PMPI_Comm_size(comm, &size); PMPI_Comm_rank(comm, &rank);" GET_NEIGH_GRAPH_COMM = "int ideg, odeg, wted; MPI_Dist_graph_neighbors_count(comm, &ideg, &odeg, &wted);" mapping[("MPI_Cart_create", "dims")] = "ndims" mapping[("MPI_Cart_create", "periods")] = "ndims"