|
| 1 | +diff --git a/gen/gen_decl.py b/gen/gen_decl.py |
| 2 | +index 1005b95..696b4e0 100755 |
| 3 | +--- a/gen/gen_decl.py |
| 4 | ++++ b/gen/gen_decl.py |
| 5 | +@@ -9,8 +9,8 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "..", "mpiabi")) |
| 6 | + |
| 7 | + from mpi_constants import constants |
| 8 | + from mpi_functions import functions |
| 9 | +-from mpi_constants_fortran import constants_fortran |
| 10 | +-from mpi_functions_fortran import functions_fortran |
| 11 | ++# from mpi_constants_fortran import constants_fortran |
| 12 | ++# from mpi_functions_fortran import functions_fortran |
| 13 | + |
| 14 | + support_profiling = True |
| 15 | + have_weak_symbols = False |
| 16 | +@@ -24,7 +24,7 @@ def wrap(line): |
| 17 | + lines.append(line) |
| 18 | + return "\n".join(lines) |
| 19 | + |
| 20 | +-with open("include/mpi_decl_constants_c.h", "w") as file: |
| 21 | ++with open(sys.argv[1], "w") as file: |
| 22 | + file.write("// Declare C MPI constants\n") |
| 23 | + file.write("\n") |
| 24 | + for (tp, nm) in constants: |
| 25 | +@@ -32,7 +32,7 @@ with open("include/mpi_decl_constants_c.h", "w") as file: |
| 26 | + 'mpi_nm': nm} |
| 27 | + file.write(Template("extern $mpi_tp MPITRAMPOLINE_CONST $mpi_nm;\n").substitute(subs)) |
| 28 | + |
| 29 | +-with open("include/mpi_decl_functions_c.h", "w") as file: |
| 30 | ++with open(sys.argv[2], "w") as file: |
| 31 | + file.write("// Declare C MPI functions\n") |
| 32 | + file.write("\n") |
| 33 | + for (tp, nm, args, flags) in functions: |
| 34 | +@@ -90,7 +90,7 @@ with open("include/mpi_decl_functions_c.h", "w") as file: |
| 35 | + file.write(Template("\n".join(tmpl)).substitute(subs)) |
| 36 | + file.write("\n") |
| 37 | + |
| 38 | +-with open("include/mpi_decl_constants_fortran.h", "w") as file: |
| 39 | ++if False: |
| 40 | + file.write("! Declare Fortran MPI constants\n") |
| 41 | + file.write("\n") |
| 42 | + for (tp, nm) in constants_fortran: |
| 43 | +@@ -104,7 +104,7 @@ with open("include/mpi_decl_constants_fortran.h", "w") as file: |
| 44 | + file.write("\n".join(map(lambda line: wrap(Template(line).substitute(subs)), tmpl))) |
| 45 | + file.write("\n") |
| 46 | + |
| 47 | +-with open("include/mpi_decl_functions_fortran.h", "w") as file: |
| 48 | ++if False: |
| 49 | + file.write("! Declare Fortran MPI functions\n") |
| 50 | + file.write("\n") |
| 51 | + for (tp, nm, args) in functions_fortran: |
| 52 | +diff --git a/gen/gen_defn.py b/gen/gen_defn.py |
| 53 | +index bf31f35..318222e 100755 |
| 54 | +--- a/gen/gen_defn.py |
| 55 | ++++ b/gen/gen_defn.py |
| 56 | +@@ -9,14 +9,14 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "..", "mpiabi")) |
| 57 | + |
| 58 | + from mpi_constants import constants |
| 59 | + from mpi_functions import functions |
| 60 | +-from mpi_constants_fortran import constants_fortran |
| 61 | +-from mpi_functions_fortran import functions_fortran |
| 62 | ++# from mpi_constants_fortran import constants_fortran |
| 63 | ++# from mpi_functions_fortran import functions_fortran |
| 64 | + |
| 65 | + support_profiling = True |
| 66 | + have_weak_symbols = False |
| 67 | + replace_sentinels = False |
| 68 | + |
| 69 | +-with open("src/mpi_defn_constants_c.h", "w") as file: |
| 70 | ++with open(sys.argv[1], "w") as file: |
| 71 | + file.write("// Define C MPI constants") |
| 72 | + file.write("\n") |
| 73 | + for (tp, nm) in constants: |
| 74 | +@@ -24,7 +24,7 @@ with open("src/mpi_defn_constants_c.h", "w") as file: |
| 75 | + 'mpi_nm': nm} |
| 76 | + file.write(Template("$mpi_tp $mpi_nm = ($mpi_tp)0xdeadbeef;\n").substitute(subs)) |
| 77 | + |
| 78 | +-with open("src/mpi_defn_functions_c.h", "w") as file: |
| 79 | ++with open(sys.argv[2], "w") as file: |
| 80 | + file.write("// Define C MPI functions\n") |
| 81 | + file.write("\n") |
| 82 | + for (tp, nm, args, flags) in functions: |
| 83 | +@@ -89,7 +89,7 @@ with open("src/mpi_defn_functions_c.h", "w") as file: |
| 84 | + file.write(Template("\n".join(tmpl)).substitute(subs)) |
| 85 | + file.write("\n") |
| 86 | + |
| 87 | +-with open("src/mpi_defn_constants_fortran.h", "w") as file: |
| 88 | ++if False: |
| 89 | + file.write("// Define Fortran MPI constants\n") |
| 90 | + file.write("\n") |
| 91 | + for (tp, nm) in constants_fortran: |
| 92 | +@@ -98,7 +98,7 @@ with open("src/mpi_defn_constants_fortran.h", "w") as file: |
| 93 | + # Fortran common blocks with `-march=skylake-avx512` are aligned to 64 bytes |
| 94 | + file.write(Template("$mpi_tp $abi_nm __attribute__((__aligned__(64))) = (int)0xdeadbeef;\n").substitute(subs)) |
| 95 | + |
| 96 | +-with open("src/mpi_defn_functions_fortran.h", "w") as file: |
| 97 | ++if False: |
| 98 | + file.write("// Define Fortran MPI functions\n") |
| 99 | + file.write("\n") |
| 100 | + for (tp, nm, args) in functions_fortran: |
| 101 | +diff --git a/gen/gen_init.py b/gen/gen_init.py |
| 102 | +index 4939261..0e52822 100755 |
| 103 | +--- a/gen/gen_init.py |
| 104 | ++++ b/gen/gen_init.py |
| 105 | +@@ -9,14 +9,14 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "..", "mpiabi")) |
| 106 | + |
| 107 | + from mpi_constants import constants |
| 108 | + from mpi_functions import functions |
| 109 | +-from mpi_constants_fortran import constants_fortran |
| 110 | +-from mpi_functions_fortran import functions_fortran |
| 111 | ++# from mpi_constants_fortran import constants_fortran |
| 112 | ++# from mpi_functions_fortran import functions_fortran |
| 113 | + |
| 114 | + support_profiling = True |
| 115 | + have_weak_symbols = False |
| 116 | + replace_sentinels = False |
| 117 | + |
| 118 | +-with open("src/mpi_init_constants_c.h", "w") as file: |
| 119 | ++with open(sys.argv[1], "w") as file: |
| 120 | + file.write("// Initialize C MPI constants") |
| 121 | + file.write("\n") |
| 122 | + for (tp, nm) in constants: |
| 123 | +@@ -25,7 +25,7 @@ with open("src/mpi_init_constants_c.h", "w") as file: |
| 124 | + 'abi_nm': re.sub(r"MPI(X?)_", r"MPI\1ABI_", nm)} |
| 125 | + file.write(Template("$mpi_nm = *($mpi_tp const *)get_symbol(handle, \"$abi_nm\");\n").substitute(subs)) |
| 126 | + |
| 127 | +-with open("src/mpi_init_functions_c.h", "w") as file: |
| 128 | ++with open(sys.argv[2], "w") as file: |
| 129 | + file.write("// Initialize C MPI functions\n") |
| 130 | + file.write("\n") |
| 131 | + for (tp, nm, args, flags) in functions: |
| 132 | +@@ -39,7 +39,7 @@ with open("src/mpi_init_functions_c.h", "w") as file: |
| 133 | + subs['anm{0}'.format(i)] = anm |
| 134 | + file.write(Template("$abi_nm = get_symbol(handle, \"$abi_nm\");\n").substitute(subs)) |
| 135 | + |
| 136 | +-with open("src/mpi_init_constants_fortran.h", "w") as file: |
| 137 | ++if False: |
| 138 | + file.write("// Initialize Fortran MPI constants\n") |
| 139 | + file.write("\n") |
| 140 | + for (tp, nm) in constants_fortran: |
| 141 | +@@ -47,7 +47,7 @@ with open("src/mpi_init_constants_fortran.h", "w") as file: |
| 142 | + 'abi_nm': re.sub(r"MPI(X?)_", r"MPI\1ABI_", nm).lower() + "_"} |
| 143 | + file.write(Template("$abi_nm = *($abi_tp const*)get_symbol(handle, \"$abi_nm\");\n").substitute(subs)) |
| 144 | + |
| 145 | +-with open("src/mpi_init_functions_fortran.h", "w") as file: |
| 146 | ++if False: |
| 147 | + file.write("// Initialize Fortran MPI functions\n") |
| 148 | + file.write("\n") |
| 149 | + for (tp, nm, args) in functions_fortran: |
0 commit comments