|
10 | 10 |
|
11 | 11 | FORTRAN_EXTS = {".f", ".for", ".f90", ".F", ".F90"} |
12 | 12 | TAPENADE_USELESS_ZONES = 3 |
| 13 | +GENLIBTMP = "TMPGENLIB" |
13 | 14 |
|
14 | 15 | def is_fortran(p: Path) -> bool: |
15 | 16 | return p.suffix in FORTRAN_EXTS |
@@ -8163,7 +8164,7 @@ def run_task(task): |
8163 | 8164 | if (args.genlib): |
8164 | 8165 | # When generating the general lib useful to Tapenade, we will save everything in a tmp file |
8165 | 8166 | # 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() |
8167 | 8168 | tmp_dir.mkdir(parents=True, exist_ok=True) |
8168 | 8169 | func_out_dir = tmp_dir |
8169 | 8170 | genlib_dir = out_dir |
@@ -8332,7 +8333,6 @@ def parse_tap_trace4inout(fname): |
8332 | 8333 | # Format command for logging (properly quoted for shell copy-paste) |
8333 | 8334 | print("CMD:", cmd) |
8334 | 8335 | cmd_str = ' '.join(shlex.quote(str(arg)) for arg in cmd) |
8335 | | - print(cmd_str) |
8336 | 8336 | logf.write(f"Command: {cmd_str}\n") |
8337 | 8337 | logf.write(f"Function: {func_name}\n") |
8338 | 8338 | logf.write(f"Parsed inputs: {inputs}\n") |
@@ -8804,43 +8804,7 @@ def parse_tap_trace4inout(fname): |
8804 | 8804 |
|
8805 | 8805 | # Return the worst return code (non-zero if any mode failed) |
8806 | 8806 | 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) |
8844 | 8808 |
|
8845 | 8809 | # Serial or parallel execution |
8846 | 8810 | results = [] |
@@ -8937,6 +8901,9 @@ def parse_tap_trace4inout(fname): |
8937 | 8901 | if "reverse" in args.mode or args.mode == "both": |
8938 | 8902 | print(" make vector-reverse # Build vector reverse mode only") |
8939 | 8903 | print(" ./test_<function>_vector_forward # Run vector forward mode test") |
| 8904 | + |
| 8905 | + if args.genlib: |
| 8906 | + shrm(Path(GENLIBTMP)) |
8940 | 8907 |
|
8941 | 8908 | def generate_top_level_makefile(out_dir, flat_mode=False): |
8942 | 8909 | """Generate the top-level Makefile for building all subdirectories or flat makefiles""" |
|
0 commit comments