Commit eccb86b7 authored by erodrigu's avatar erodrigu
Browse files

Removed unused imports

parent fde33a06
# Script that automatically creates different versions of a routine with different precisions
# Import classes and functions from RPE_Utils
# from AutoRPE.UtilsRPE.MainFunctions import parse_sources, postprocess_sources, assign_sbits_to_rpe_variables, \
# create_read_precisions_module_and_add_to_file, preprocess_sources
# from AutoRPE.UtilsRPE.Functions import load_vault, remove_comments
# Import classes and functions from UtilsRPE
from AutoRPE.UtilsRPE.CurrentBlock import CurrentBlock
from AutoRPE.UtilsRPE.Inserter import replace_real_declaration
from AutoRPE.UtilsRPE.SourceManager import preprocess_sources, parse_sources, load_vault
from AutoRPE.UtilsRPE.Cleaner import remove_comments
from os import listdir, mkdir
from os.path import join, isdir, isfile
from os import mkdir
from os.path import join, isdir
from shutil import rmtree
import re
from math import factorial
import itertools
......@@ -111,7 +106,7 @@ def obtain_routine_source(routine, sources_path):
routine_code = "".join(lines[indices[0]:indices[1] + 1])
routine_code = merge_declaration_lines(routine_code)
return routine_code
return routine_code, indices
def replace_routine_name(old_name, new_name, code_text):
......@@ -151,7 +146,7 @@ if __name__ == "__main__":
print("Routine %s not found in vault." % routine_name)
exit(0)
routine_code = obtain_routine_source(routine, path_to_input_sources)
routine_code, indices = obtain_routine_source(routine, path_to_input_sources)
routine_lines = routine_code.split("\n")
sensitive_variables = [v for v in routine.variables if v.is_dummy_argument and v.type == "double"]
......@@ -159,6 +154,9 @@ if __name__ == "__main__":
# All possible combinations of precisions
precision_combinations = list(itertools.product(["dp", "sp"], repeat=len(sensitive_variables)))
# Get filepath
filepath = join(path_to_input_sources, "%s.f90" % routine.module.name)
code_versions = {}
interface = "module procedure "
for c_index, combination in enumerate(precision_combinations):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment