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

add some comments and make generated tests compile

parent b3b604f7
No related branches found
No related tags found
1 merge request!1Initial template infrastructure
Pipeline #348656 failed
...@@ -38,16 +38,16 @@ int main(int argc, char **argv) { ...@@ -38,16 +38,16 @@ int main(int argc, char **argv) {
int rank = -1; int rank = -1;
MPI_Init(&argc, &argv); MPI_Init(&argc, &argv);
@{mpi_init}@ // @{mpi_init}@ // One could also templte this
MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_rank(MPI_COMM_WORLD, &rank);
@{num_ranks_check}@ //@{num_ranks_check}@ // One could also templte this
if (nprocs < 2) if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n"); printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
@{test_code}@ @{test_code}@
@{mpi_finalize}@ //@{mpi_finalize}@// One could also templte this
MPI_Finalize(); MPI_Finalize();
printf("Rank %d finished normally\\n", rank); printf("Rank %d finished normally\\n", rank);
return 0; return 0;
...@@ -261,6 +261,7 @@ class Invalid_negative_rank_error: ...@@ -261,6 +261,7 @@ class Invalid_negative_rank_error:
tm.set_description("Invalid Rank: %s" % self.invalid_ranks[self.rank_to_use]) tm.set_description("Invalid Rank: %s" % self.invalid_ranks[self.rank_to_use])
# include the buffer allocation in the template (all ranks execute it)
tm.register_instruction_block(correct_params.get_buffer_alloc()) tm.register_instruction_block(correct_params.get_buffer_alloc())
send = MPI_Call_Factory().mpi_send( send = MPI_Call_Factory().mpi_send(
...@@ -274,8 +275,10 @@ class Invalid_negative_rank_error: ...@@ -274,8 +275,10 @@ class Invalid_negative_rank_error:
send.set_has_error() send.set_has_error()
b = InstructionBlock() b = InstructionBlock()
b.register_operation(send, 1) # only rank 0 execute the send
b.register_operation(get_matching_recv(send), 0) b.register_operation(send, 0)
# only rank 1 execute the recv
b.register_operation(get_matching_recv(send), 1)
tm.register_instruction_block(b) tm.register_instruction_block(b)
return tm return tm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment