Skip to content
Snippets Groups Projects

Draft: Fortran Support

1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
@@ -883,19 +883,19 @@ def get_intercomm(comm_create_func: str, tm: TemplateManager, before_idx: int =
tm.insert_instruction(ArrAsgn("triplet", 0, 0), before_instruction=before_inst)
tm.insert_instruction(ArrAsgn("triplet", 1, "nprocs"), before_instruction=before_inst)
tm.insert_instruction(ArrAsgn("triplet", 2, 2), before_instruction=before_inst)
call = MPICallFactory.mpi_group_incl(world_group, "1", "&triplet", "&" +even_group)
call = MPICallFactory.mpi_group_incl(world_group, "1", "triplet", "&" +even_group)
call.set_identifier(identifier)
tm.insert_instruction(call, before_instruction=before_inst)
tm.insert_instruction(ArrAsgn("triplet", 0, 1), before_instruction=before_inst)
call = MPICallFactory.mpi_group_incl(world_group, "1", "&triplet", "&" +odd_group)
call = MPICallFactory.mpi_group_incl(world_group, "1", "triplet", "&" +odd_group)
call.set_identifier(identifier)
tm.insert_instruction(call, before_instruction=before_inst)
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)
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)
Loading