Commit f0f2c00a authored by Wesley Bland's avatar Wesley Bland Committed by Huiwei Lu
Browse files

Cleanup FT tests



Some of the FT tests were not correctly setting their error handlers to
MPI_ERRORS_RETURN. While this doesn't seem to have caused problems, it's
safer to do so.

This commit also cleans up some unused variables, reorders communicator
creation, and correctly frees some variables to avoid some debugging
output.
Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
parent 06a9f9e6
......@@ -22,6 +22,7 @@ int main(int argc, char **argv)
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
if (size < 3) {
fprintf( stderr, "Must run with at least 3 processes\n" );
MPI_Abort(MPI_COMM_WORLD, 1);
......
......@@ -22,6 +22,8 @@ int main(int argc, char **argv)
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
if (size < 4) {
fprintf( stderr, "Must run with at least 4 processes\n" );
MPI_Abort(MPI_COMM_WORLD, 1);
......
......@@ -32,6 +32,10 @@ int main(int argc, char **argv)
MPI_Abort( MPI_COMM_WORLD, 1 );
}
MPI_Comm_group(MPI_COMM_WORLD, &world);
MPI_Group_excl(world, 1, deadprocs, &newgroup);
MPI_Comm_create_group(MPI_COMM_WORLD, newgroup, 0, &newcomm);
if (rank == 1) {
exit(EXIT_FAILURE);
}
......@@ -76,10 +80,6 @@ int main(int argc, char **argv)
}
#endif
MPI_Comm_group(MPI_COMM_WORLD, &world);
MPI_Group_excl(world, 1, deadprocs, &newgroup);
MPI_Comm_create_group(MPI_COMM_WORLD, newgroup, 0, &newcomm);
rc = MPI_Reduce(&errs, &toterrs, 1, MPI_INT, MPI_SUM, 0, newcomm);
if(rc)
fprintf(stderr, "Failed to get errors from other processes\n");
......@@ -96,6 +96,10 @@ int main(int argc, char **argv)
free(sendbuf);
MPI_Comm_free(&newcomm);
MPI_Group_free(&newgroup);
MPI_Group_free(&world);
MPI_Finalize();
return 0;
......
......@@ -14,11 +14,12 @@
*/
int main(int argc, char **argv)
{
int rank, size, err;
int rank, err;
char buf[10];
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
if (rank == 1) {
exit(EXIT_FAILURE);
......
......@@ -17,8 +17,6 @@ int main(int argc, char **argv)
{
int rank, size, newsize, rc, errclass, errs = 0;
MPI_Comm newcomm;
int sendbuf = 0;
int recvbuf = 0;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment