Skip to content

Commit 50eddce

Browse files
committed
Remove CCE 19 pyrometheus workaround patch; test if still needed
1 parent c952529 commit 50eddce

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

toolchain/mfc/run/input.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -99,30 +99,6 @@ def generate_fpp(self, target) -> None:
9999

100100
thermochem_code = pyro.FortranCodeGenerator().generate("m_thermochem", sol, pyro.CodeGenerationOptions(scalar_type=real_type, directive_offload=directive_str))
101101

102-
# CCE 19.0.0 workaround: pyrometheus generates !DIR$ INLINEALWAYS for Cray+ACC
103-
# but omits !$acc routine seq, so thermochem routines are not registered as
104-
# OpenACC device routines. Replace with plain !$acc routine seq (no INLINEALWAYS).
105-
# This patch can be removed once pyrometheus upstream correctly emits !$acc routine seq
106-
# for Cray+OpenACC (the broken macro originates in pyrometheus's code generator).
107-
if directive_str == "acc":
108-
old_macro = "#ifdef _CRAYFTN\n#define GPU_ROUTINE(name) !DIR$ INLINEALWAYS name\n#else\n#define GPU_ROUTINE(name) !$acc routine seq\n#endif"
109-
new_macro = "#define GPU_ROUTINE(name) !$acc routine seq"
110-
patched = thermochem_code.replace(old_macro, new_macro)
111-
if patched == thermochem_code:
112-
if new_macro in thermochem_code:
113-
pass # pyrometheus already emits the correct form; no patch needed
114-
else:
115-
raise common.MFCException(
116-
"CCE 19.0.0 workaround: pyrometheus output format changed — Cray+ACC GPU_ROUTINE macro patch did not apply. Update the pattern in toolchain/mfc/run/input.py."
117-
)
118-
else:
119-
cons.print(
120-
"[yellow]Warning: Applied CCE 19.0.0 workaround patch to pyrometheus-generated "
121-
"m_thermochem.f90 (replaced _CRAYFTN GPU_ROUTINE macro with !$acc routine seq). "
122-
"Remove this patch once pyrometheus emits correct Cray+ACC directives upstream.[/yellow]"
123-
)
124-
thermochem_code = patched
125-
126102
common.file_write(os.path.join(modules_dir, "m_thermochem.f90"), thermochem_code, True)
127103

128104
cons.unindent()

0 commit comments

Comments
 (0)