Exemple #1
0
def generate(config, formats):
    for format in formats:
        for scenario in config["scenarios"]:

            # dict only has one item
            for (scenario_name, _) in scenario.items():
                pass

            args = [""]
            if format in config["generator_optional_arguments"]:
                for optional_argument in config["generator_optional_arguments"][format]:
                    args.append("-" + optional_argument)

            for arg in args:
                path = "./hu.bme.mit.trainbenchmark.generator.{FORMAT}/".format(FORMAT=format)
                util.set_working_directory(path)
                target = util.get_generator_jar(format)
                for size in config["sizes"]:
                    cmd = flatten(["java", 
                         config["java_opts"],
                         "-jar", target,
                         "-scenario", scenario_name,
                         "-size", str(size),
                         arg])
                    try:
                        subprocess.check_call(cmd)
                    except subprocess.CalledProcessError:
                        print("An error occured during model generation, skipping larger sizes for this scenario/format.")
                        break
                util.set_working_directory("..")
Exemple #2
0
def generate(conf):
    """Generates the models.
    """
    target = util.get_generator_jar()
    for size in conf.sizes:
        subprocess.check_call(
            flatten(["java", conf.vmargs, "-jar", target, "-size",
                     str(size)]))
Exemple #3
0
def generate(formats, scenarios, sizes):
    """
    Generates the models after the configurations parameter.
    """

    for scenario in scenarios:
        for format in formats:
            path = "./hu.bme.mit.trainbenchmark.generator.{FORMAT}/".format(FORMAT=format)
            util.set_working_directory(path)
            target = util.get_generator_jar(format)
            for size in sizes:
                print("Generate model: <format: " + format +
                      ", scenario: " + scenario +
                      ", size: " + str(size) + ">")
                subprocess.call(["java", "-Xmx" + java_xmx,
                                 "-jar", target,
                                 "-scenario", scenario,
                                 "-size", str(size)])
            util.set_working_directory("..")
Exemple #4
0
def generate(formats, scenarios, sizes):
    """
    Generates the models after the configurations parameter.
    """

    for scenario in scenarios:
        for format in formats:
            path = "./hu.bme.mit.trainbenchmark.generator.{FORMAT}/".format(
                FORMAT=format)
            util.set_working_directory(path)
            target = util.get_generator_jar(format)
            for size in sizes:
                print("Generate model: <format: " + format + ", scenario: " +
                      scenario + ", size: " + str(size) + ">")
                subprocess.call([
                    "java", "-Xmx" + java_xmx, "-jar", target, "-scenario",
                    scenario, "-size",
                    str(size)
                ])
            util.set_working_directory("..")
import util

if __name__ == "__main__":

    with open("config/config.yml", 'r') as stream:
        config = yaml.load(stream)

    formats = ["emf", "graph", "rdf", "sql"]

    for format in formats:
        for query in config["queries"]:
            args = [""]
            if format in config["generator_optional_arguments"]:
                for optional_argument in config["generator_optional_arguments"][format]:
                    args.append("-" + optional_argument)

            for arg in args:
                path = "./hu.bme.mit.trainbenchmark.generator.{FORMAT}/".format(FORMAT=format)
                util.set_working_directory(path)
                target = util.get_generator_jar(format)
                cmd = ["java", "-Xmx" + config["java_opts"]["xmx"],
                     "-jar", target,
                     "-scenario", "Minimal",
                     "-query", query,
                   arg]
                try:
                    subprocess.check_call(cmd)
                except subprocess.CalledProcessError:
                    print("An error occured during model generation.")
                util.set_working_directory("..")
Exemple #6
0
def generate(conf):
    """Generates the models.
    """
    target = util.get_generator_jar()
    for size in conf.sizes:
        subprocess.check_call(flatten(["java", conf.vmargs, "-jar", target, "-size", str(size)]))