Skip to content

Commit b86321e

Browse files
author
Jean Luc Bouchot
committed
Removing useless comments and tmp folder
1 parent c44126f commit b86321e

1 file changed

Lines changed: 6 additions & 39 deletions

File tree

run_tapenade_blas.py

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
FORTRAN_EXTS = {".f", ".for", ".f90", ".F", ".F90"}
1212
TAPENADE_USELESS_ZONES = 3
13+
GENLIBTMP = "TMPGENLIB"
1314

1415
def is_fortran(p: Path) -> bool:
1516
return p.suffix in FORTRAN_EXTS
@@ -8163,7 +8164,7 @@ def run_task(task):
81638164
if (args.genlib):
81648165
# When generating the general lib useful to Tapenade, we will save everything in a tmp file
81658166
# and only the lib in a local folder used to concatenate everything afterwards.
8166-
tmp_dir = Path("TMPGENLIB").resolve()
8167+
tmp_dir = Path(GENLIBTMP).resolve()
81678168
tmp_dir.mkdir(parents=True, exist_ok=True)
81688169
func_out_dir = tmp_dir
81698170
genlib_dir = out_dir
@@ -8332,7 +8333,6 @@ def parse_tap_trace4inout(fname):
83328333
# Format command for logging (properly quoted for shell copy-paste)
83338334
print("CMD:", cmd)
83348335
cmd_str = ' '.join(shlex.quote(str(arg)) for arg in cmd)
8335-
print(cmd_str)
83368336
logf.write(f"Command: {cmd_str}\n")
83378337
logf.write(f"Function: {func_name}\n")
83388338
logf.write(f"Parsed inputs: {inputs}\n")
@@ -8804,43 +8804,7 @@ def parse_tap_trace4inout(fname):
88048804

88058805
# Return the worst return code (non-zero if any mode failed)
88068806
final_rc = max(return_codes.values()) if return_codes else 999
8807-
return (src, final_rc)
8808-
8809-
8810-
8811-
8812-
# if (args.genlib):
8813-
# '''
8814-
# WORKING HERE
8815-
# XXXXXXXXXX
8816-
# Need to figure out:
8817-
# -> The various parameters of a subroutine, their types
8818-
# -> Convert these types into Tapenade's GenLib format
8819-
# -> Link the number of a parameter in the prototype of the subroutine with its rank in tapenade's inout analysis
8820-
# -> Dump everything into a single genlib file
8821-
# '''
8822-
# # Add tests for existence of file / correct extension / ...
8823-
# file_path = fortran_dir / args.genlib
8824-
8825-
# tasks = []
8826-
# func_stem = file_path.stem.lower()
8827-
# rel = file_path.relative_to(fortran_dir)
8828-
# out_dir = out_root / rel.parent
8829-
# out_dir.mkdir(parents=True, exist_ok=True)
8830-
# log_path = out_dir / (file_path.stem + ".tapenade.log")
8831-
# # Explicitely force the diff modes for now:
8832-
# run_d, run_dv, run_b, run_bv = True, False, False, False
8833-
# tasks.append((file_path, out_dir, log_path, run_d, run_dv, run_b, run_bv))
8834-
# run_task(tasks[0])
8835-
8836-
# return
8837-
8838-
8839-
8840-
8841-
8842-
8843-
8807+
return (src, final_rc)
88448808

88458809
# Serial or parallel execution
88468810
results = []
@@ -8937,6 +8901,9 @@ def parse_tap_trace4inout(fname):
89378901
if "reverse" in args.mode or args.mode == "both":
89388902
print(" make vector-reverse # Build vector reverse mode only")
89398903
print(" ./test_<function>_vector_forward # Run vector forward mode test")
8904+
8905+
if args.genlib:
8906+
shrm(Path(GENLIBTMP))
89408907

89418908
def generate_top_level_makefile(out_dir, flat_mode=False):
89428909
"""Generate the top-level Makefile for building all subdirectories or flat makefiles"""

0 commit comments

Comments
 (0)