Skip to content
Snippets Groups Projects

Draft: Fortran Support

1 file
+ 11
2
Compare changes
  • Side-by-side
  • Inline
@@ -891,9 +891,18 @@ def get_intercomm(comm_create_func: str, tm: TemplateManager, before_idx: int =
@@ -891,9 +891,18 @@ def get_intercomm(comm_create_func: str, tm: TemplateManager, before_idx: int =
call.set_identifier(identifier)
call.set_identifier(identifier)
tm.insert_instruction(call, before_instruction=before_inst)
tm.insert_instruction(call, before_instruction=before_inst)
call = MPICallFactory.mpi_intercomm_create_from_groups("(rank % 2 ? " + even_group + ":" + odd_group + ")",
tm.add_stack_variable("MPI_Group", "local_group")
 
tm.add_stack_variable("MPI_Group", "remote_group")
 
if infvars.generator_language == "c":
 
tm.insert_instruction(Instruction("local_group = (rank % 2 ? " + even_group + ":" + odd_group + ")"), before_instruction=before_inst)
 
tm.insert_instruction(Instruction("remote_group = (!(rank % 2) ? " + even_group + ":" + odd_group + ")"), before_instruction=before_inst)
 
else:
 
tm.insert_instruction(Instruction("local_group = merge(" + even_group + ", " + odd_group + ", modulo(rank, 2) == 0)"), before_instruction=before_inst)
 
tm.insert_instruction(Instruction("remote_group = merge(" + even_group + ", " + odd_group + ", modulo(rank, 2) == 1)"), before_instruction=before_inst)
 
 
call = MPICallFactory.mpi_intercomm_create_from_groups("local_group",
"0",
"0",
"(!(rank % 2) ? " + even_group + ":" + odd_group + ")",
"remote_group",
"0",
"0",
CorrectParameterFactory().get("stringtag"),
CorrectParameterFactory().get("stringtag"),
CorrectParameterFactory().get("INFO"),
CorrectParameterFactory().get("INFO"),
Loading