Skip to content
Snippets Groups Projects
Commit 351c26a8 authored by Jammer, Tim's avatar Jammer, Tim
Browse files

fix generation of type missmatches and generate missmatches with size 1 and matching size

parent 67d1775e
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ from scripts.Infrastructure.Variables import * ...@@ -5,7 +5,7 @@ from scripts.Infrastructure.Variables import *
from scripts.Infrastructure.ErrorGenerator import ErrorGenerator from scripts.Infrastructure.ErrorGenerator import ErrorGenerator
from scripts.Infrastructure.MPICallFactory import MPICallFactory, CorrectMPICallFactory from scripts.Infrastructure.MPICallFactory import MPICallFactory, CorrectMPICallFactory
from scripts.Infrastructure.TemplateFactory import get_collective_template, predefined_types, user_defined_types, \ from scripts.Infrastructure.TemplateFactory import get_collective_template, predefined_types, user_defined_types, \
predefined_mpi_dtype_consants predefined_mpi_dtype_consants, get_type_buffers, get_bytes_size_for_type
class InvalidComErrorColl(ErrorGenerator): class InvalidComErrorColl(ErrorGenerator):
...@@ -93,31 +93,71 @@ class InvalidComErrorColl(ErrorGenerator): ...@@ -93,31 +93,71 @@ class InvalidComErrorColl(ErrorGenerator):
continue continue
tm = get_collective_template(func_to_use) tm = get_collective_template(func_to_use)
type_var_1, buf_name_1, type_var_2, buf_name_2 = get_type_buffers(tm, type_1, type_2,1,1)
# local missmatch
tm.set_description("ParamMatching-Type-" + func_to_use, tm.set_description("ParamMatching-Type-" + func_to_use,
"Wrong datatype matching: %s vs %s" % (type_1, type_2)) "Wrong datatype matching: %s vs %s" % (type_1, type_2))
for call in tm.get_instruction("MPICALL", return_list=True): for call in tm.get_instruction("MPICALL", return_list=True):
call.set_rank_executing(0) call.set_rank_executing(0)
call.set_arg("datatype", type_1) call.set_arg("datatype", type_var_1)
call.set_arg("count",1)
call.set_has_error()
if call.has_arg("recvbuf"):
call.set_arg("recvbuf", buf_name_1)
call.set_arg("sendbuf", buf_name_1)
else:
call.set_arg("buffer", buf_name_1)
c = CorrectMPICallFactory.get(func_to_use)
c.set_rank_executing('not0')
c.set_arg("datatype", type_var_2)
call.set_arg("count", 1)
c.set_has_error()
if c.has_arg("recvbuf"):
c.set_arg("recvbuf", buf_name_2)
c.set_arg("sendbuf", buf_name_2)
else:
c.set_arg("buffer", buf_name_2)
tm.insert_instruction(c, after_instruction=call)
yield tm
# missmatch with matching sizes
tm = get_collective_template(func_to_use)
type_var_1, buf_name_1, type_var_2, buf_name_2 = get_type_buffers(tm, type_1, type_2, get_bytes_size_for_type(
type_2), get_bytes_size_for_type(
type_1))
tm.set_description("ParamMatching-Type-" + func_to_use,
"Wrong datatype matching: %s vs %s" % (type_1, type_2))
for call in tm.get_instruction("MPICALL", return_list=True):
call.set_rank_executing(0)
call.set_arg("datatype", type_var_1)
call.set_arg("count", get_bytes_size_for_type(
type_2))
call.set_has_error() call.set_has_error()
if call.has_arg("recvbuf"): if call.has_arg("recvbuf"):
call.set_arg("recvbuf", type_1) call.set_arg("recvbuf", buf_name_1)
call.set_arg("sendbuf", type_1) call.set_arg("sendbuf", buf_name_1)
else: else:
call.set_arg("buffer", type_1) call.set_arg("buffer", buf_name_1)
c = CorrectMPICallFactory.get(func_to_use) c = CorrectMPICallFactory.get(func_to_use)
c.set_rank_executing('not0') c.set_rank_executing('not0')
c.set_arg("datatype", type_2) c.set_arg("datatype", type_var_2)
call.set_arg("count", get_bytes_size_for_type(
type_1))
c.set_has_error() c.set_has_error()
if c.has_arg("recvbuf"): if c.has_arg("recvbuf"):
c.set_arg("recvbuf", type_2) c.set_arg("recvbuf", buf_name_2)
c.set_arg("sendbuf", type_2) c.set_arg("sendbuf", buf_name_2)
else: else:
c.set_arg("buffer", type_2) c.set_arg("buffer", buf_name_2)
tm.insert_instruction(c, after_instruction=call) tm.insert_instruction(c, after_instruction=call)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment