Skip to content
Snippets Groups Projects
Select Git revision
  • 6a88f0fa5e60eae24790372821cbb38493707b97
  • main default protected
  • parcoach
  • fix-rma-lockunlock
  • paper_repro
  • fortran
  • usertypes
  • must-toolcoverage
  • toolcoverage
  • tools
  • must-json
  • merged
  • tools-parallel
  • coll
  • rma
  • dtypes
  • p2p
  • infrastructure-patch-3
  • infrastructure-patch2
  • devel-TJ
  • infrasructure-patch-1
21 results

main.py

Blame
  • Tim Jammer's avatar
    Jammer, Tim authored
    6a88f0fa
    History
    main.py 1.84 KiB
    #! /usr/bin/python3
    import os
    
    import argparse
    
    from scripts.Infrastructure.GeneratorManager import GeneratorManager
    
    if __name__ == "__main__":
        parser = argparse.ArgumentParser("generate MBB Testcases")
        parser.add_argument("--outpath", action="store", default="gencodes",required=False,
                            help="Path to generate the codes into")
        parser.add_argument("--level", action="store", default=1, type=int, required=False,
                            help="Level of tests to generate. 1: simple cases, 2: caseswith sufficient coverage, 3: all possible usage combinations")
        parser.add_argument("--mpi_version", default="4.1", required=False, help="maximum MPI versions to use")
    
        debug = parser.add_argument_group("Debug", "Arguments used to debug and test the generation progess")
        debug.add_argument("--generator_dir", action="store", default="scripts/errors", required=False,
                           help="Directory where the generators are")
        debug.add_argument("--compile", action="store_true", default=False, required=False,
                           help="Check if the generated codes compile")
        debug.add_argument("--remove_previous_generation_results", action="store_true", default=False, required=False,
                           help="Clear the outpath before generation (for ease of debugging)")
        ARGS = parser.parse_args()
    
        gencodes_dir = ARGS.outpath
    
        gm = GeneratorManager(ARGS.generator_dir)
    
        # remove all testcases from previous execution (ease of debugging)
        if ARGS.remove_previous_generation_results:
            for root, dirs, files in os.walk(gencodes_dir):
                for file in files:
                    if file.endswith(".c"):
                        os.remove(os.path.join(root, file))
    
        gm.generate(gencodes_dir, try_compile=ARGS.compile, generation_level=ARGS.level, max_mpi_version=ARGS.mpi_version)
    
        pass