Skip to content
Snippets Groups Projects

Draft: Fortran Support

1 file
+ 10
12
Compare changes
  • Side-by-side
  • Inline
+ 10
12
@@ -5,7 +5,7 @@ from Infrastructure.ErrorGenerator import ErrorGenerator
from Infrastructure.Instruction import Instruction
from Infrastructure.MPICallFactory import CorrectMPICallFactory, MPICallFactory
from Infrastructure.TemplateFactory import get_send_recv_template, get_invalid_param_p2p_case, replace_wait
from Infrastructure.TemplateFactory import get_send_recv_template, get_invalid_param_p2p_case, replace_wait, flag_wait_header, flag_wait_trailer
class InvalidFlagErrorP2P(ErrorGenerator):
@@ -57,13 +57,12 @@ class InvalidFlagErrorP2P(ErrorGenerator):
probe_call.set_rank_executing(0)
if probe_to_use == "mpi_iprobe":
tm.add_stack_variable("int") # the flag
tm.insert_instruction(Instruction("int flag=0;", rank=0), before_instruction="MPICALL",
before_first_of_list=True)
tm.insert_instruction(Instruction("while (!flag){", rank=0), before_instruction="MPICALL",
flag_name = tm.add_stack_variable("bool", "flag") # the flag
probe_call.set_arg("flag", flag_name)
tm.insert_instruction(Instruction(flag_wait_header(flag_name), rank=0), before_instruction="MPICALL",
before_first_of_list=True)
tm.insert_instruction(probe_call, before_instruction="MPICALL", before_first_of_list=True)
tm.insert_instruction(Instruction("}", rank=0), before_instruction="MPICALL",
tm.insert_instruction(Instruction(flag_wait_trailer(), rank=0), before_instruction="MPICALL",
before_first_of_list=True) # end while
else:
tm.insert_instruction(probe_call, before_instruction="MPICALL", before_first_of_list=True)
@@ -96,7 +95,7 @@ class InvalidFlagErrorP2P(ErrorGenerator):
for flag in self.invalid_flag:
tm = get_send_recv_template("mpi_send", "mpi_recv")
if flag == "not_allocated":
tm.add_stack_variable("int*", "not_allocated")
tm.add_stack_variable("bool*", "not_allocated")
arg = "flag"
wait_func="mpi_iprobe"
tm.set_description("InvalidParam-" + arg + "-" + wait_func, ("Invalid %s: %s" % (arg, flag)))
@@ -104,19 +103,18 @@ class InvalidFlagErrorP2P(ErrorGenerator):
probe_call.set_arg("flag", flag)
probe_call.set_has_error()
probe_call.set_rank_executing(0)
tm.insert_instruction(Instruction("int flag=0;", rank=0), before_instruction="MPICALL",
before_first_of_list=True)
tm.insert_instruction(Instruction("while (!flag){", rank=0), before_instruction="MPICALL",
flag_name = tm.add_stack_variable("bool", "flag")
tm.insert_instruction(Instruction(flag_wait_header(flag_name), rank=0), before_instruction="MPICALL",
before_first_of_list=True)
tm.insert_instruction(probe_call, before_instruction="MPICALL", before_first_of_list=True)
tm.insert_instruction(Instruction("}", rank=0), before_instruction="MPICALL", before_first_of_list=True)
tm.insert_instruction(Instruction(flag_wait_trailer(), rank=0), before_instruction="MPICALL", before_first_of_list=True)
yield tm
tm = get_send_recv_template("mpi_send", ["mpi_improbe", "mpi_mrecv"])
arg = "flag"
wait_func = "mpi_improbe"
tm.set_description("InvalidParam-" + arg + "-" + wait_func, ("Invalid %s: %s" % (arg, flag)))
if flag == "not_allocated":
tm.add_stack_variable("int*", "not_allocated")
tm.add_stack_variable("bool*", "not_allocated")
for call in tm.get_instruction(identifier="MPICALL", return_list=True):
if call.get_rank_executing() == 0:
call.set_arg("flag", flag)
Loading