<commit_before>from argparse import ArgumentParser, RawDescriptionHelpFormatter
from os import environ

import numpy as np

from devito.compiler import compiler_registry
from tti_example import run

try:
    from opescibench import Benchmark, Executor, Plotter
except:
    Benchmark = None
    Executor = None
    Plotter = None


if __name__ == "__main__":
    description = ("Benchmarking script for TTI example.\n\n" +
                   "Exec modes:\n" +
                   "\trun:   executes tti_example.py once " +
                   "with the provided parameters\n" +
                   "\ttest:  tests numerical correctness with different parameters\n"
                   "\tbench: runs a benchmark of tti_example.py\n" +
                   "\tplot:  plots a roofline plot using the results from the benchmark\n"
                   )
    parser = ArgumentParser(description=description,
                            formatter_class=RawDescriptionHelpFormatter)

    parser.add_argument(dest="execmode", nargs="?", default="run",
                        choices=["run", "test", "bench", "plot"],
                        help="Exec modes")
    parser.add_argument(dest="compiler", nargs="?",
                        default=environ.get("DEVITO_ARCH", "gnu"),
                        choices=compiler_registry.keys(),
                        help="Compiler/architecture to use. Defaults to DEVITO_ARCH")
    parser.add_argument("-o", "--omp", action="store_true",
                        help="Enable OpenMP")
    parser.add_argument("-d", "--dimensions", nargs=3, default=[50, 50, 50],
                        help="Dimension of the grid", metavar=("dim1", "dim2", "dim3"))
    parser.add_argument("-s", "--spacing", nargs=2, default=[20.0, 20.0],
                        help="Spacing on the grid", metavar=("spc1", "spc2"))
    parser.add_argument("-t", "--tn", default=250,
                        type=int, help="Number of timesteps")<commit_msg>Fixed type of dimensions and spacing<commit_after>from argparse import ArgumentParser, RawDescriptionHelpFormatter
from os import environ
import sys

import numpy as np

from devito.compiler import compiler_registry
from tti_example import run
try:
    from opescibench import Benchmark, Executor, Plotter
except:
    Benchmark = None
    Executor = None
    Plotter = None


if __name__ == "__main__":
    description = ("Benchmarking script for TTI example.\n\n" +
                   "Exec modes:\n" +
                   "\trun:   executes tti_example.py once " +
                   "with the provided parameters\n" +
                   "\ttest:  tests numerical correctness with different parameters\n"
                   "\tbench: runs a benchmark of tti_example.py\n" +
                   "\tplot:  plots a roofline plot using the results from the benchmark\n"
                   )
    parser = ArgumentParser(description=description,
                            formatter_class=RawDescriptionHelpFormatter)

    parser.add_argument(dest="execmode", nargs="?", default="run",
                        choices=["run", "test", "bench", "plot"],
                        help="Exec modes")
    parser.add_argument(dest="compiler", nargs="?",
                        default=environ.get("DEVITO_ARCH", "gnu"),
                        choices=compiler_registry.keys(),
                        help="Compiler/architecture to use. Defaults to DEVITO_ARCH")
    parser.add_argument("-o", "--omp", action="store_true",
                        help="Enable OpenMP")
    parser.add_argument("-d", "--dimensions", nargs=3, default=[50, 50, 50], type=int,
                        help="Dimension of the grid", metavar=("dim1", "dim2", "dim3"))
    parser.add_argument("-s", "--spacing", nargs=2, default=[20, 20], type=int,
                        help="Spacing on the grid", metavar=("spc1", "spc2"))
    parser.add_argument("-t", "--tn", default=250,
                        type=int, help="Number of timesteps")
{'fraction_non_alphanumeric': 0.11972720383935337, 'fraction_numerical': 0.010608739580702197, 'mean_word_length': 2.160415003990423, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '483877', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1053, 'n_words': 282}