Skip to content
Snippets Groups Projects
Commit af3a83ae authored by Simon Schwitanski's avatar Simon Schwitanski :slight_smile:
Browse files

Fix RMA LocalConcurrency tests

A few generated local concurrency tests for RMA were invalid RMA programs (e.g., P0 locks window of P1 but then tries to put to itself) and some other tests were falsely classified. This commit fixes those errors.
parent 6c7f54bd
No related branches found
No related tags found
1 merge request!21Fix RMA LocalConcurrency tests
......@@ -756,6 +756,7 @@ def get_rma_call(tm: TemplateManager, rma_func, rank, identifier="RMACall") -> T
rma_call = getattr(cfmpi, rma_func)()
rma_call.set_identifier(identifier)
rma_call.set_rank_executing(rank)
rma_call.set_arg("target_rank", "1")
# request-based RMA call, add request
if rma_call.has_arg("request"):
......
......@@ -22,8 +22,8 @@ class LocalConcurrencyErrorRMA(ErrorGenerator):
self.cfmpi = CorrectMPICallFactory()
# generate standard buffer access instructions
self.buf_instructions = {
"bufread": Instruction(f'printf("buf is %d\\n", {CorrectParameterFactory().buf_var_name}[1]);', 0, "bufread"),
"bufwrite": Instruction(f'{CorrectParameterFactory().buf_var_name}[1] = 42;', 0, "bufwrite")
"bufread": Instruction(f'printf("buf is %d\\n", {CorrectParameterFactory().buf_var_name}[0]);', 0, "bufread"),
"bufwrite": Instruction(f'{CorrectParameterFactory().buf_var_name}[0] = 42;', 0, "bufwrite")
}
def get_feature(self):
......@@ -318,7 +318,7 @@ class LocalConcurrencyErrorRMA(ErrorGenerator):
for (op1, op2) in itertools.product(ops1, ops2):
self.tm = TemplateManager()
(win_declare, win_alloc, win_free) = get_allocated_window(
"mpi_win_create", cf.get("win"), cf.winbuf_var_name, "int", "10")
"mpi_win_create", cf.get("win"), cf.winbuf_var_name, "int", "20")
# window allocation boilerplate
self.tm.register_instruction(win_declare)
self.tm.register_instruction(win_alloc)
......@@ -332,9 +332,15 @@ class LocalConcurrencyErrorRMA(ErrorGenerator):
alloc1, inst1, inst1_free = self.get_mem_op(op1, 0)
alloc2, inst2, inst2_free = self.get_mem_op(op2, 0)
# avoid race at the target rank by setting the target rank to 1 for the second operation
if sync_mode not in [self.lockflush, self.lockflushlocal, self.lockunlock]:
# avoid race at the target rank by setting the target rank to 0 for the second operation
if isinstance(inst2, MPICall):
inst2.set_arg("target_rank", "0")
else:
# cannot set target rank to 0, because this would be not allowed with exclusive locks here
# avoid race at the target rank by setting the target disp to 10 for the second operation
if isinstance(inst2, MPICall):
inst2.set_arg("target_disp", "10")
# if the operations are not conflicting and we should sync, we do not have to generate this test case
if not hasconflict and shouldsync:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment