From 601f36eb77ae50e4acf96b50f18ea4672c182f19 Mon Sep 17 00:00:00 2001 From: James Edwards Date: Wed, 27 Dec 2023 07:39:30 -0700 Subject: [PATCH] handle more errors --- tests/ctest.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/ctest.c b/tests/ctest.c index 79b0fc4..6e78c1b 100644 --- a/tests/ctest.c +++ b/tests/ctest.c @@ -242,7 +242,8 @@ void test_simple_bindexed2() int i; MPI_Request rcvid; MPI_Status status; - + int mpierr; + //block indexed of simple types printf("\nBlock indexed type of MPI_INT, sending MPI_INT.\n"); @@ -257,7 +258,18 @@ void test_simple_bindexed2() mpierr = MPI_Type_create_indexed_block(len, blocksize, displace, MPI_INT, &mtype); + if(mpierr){ + printf("\n>>>FAILED: %d %d\n",__LINE__,mpierr); + errcount++; + return; + } mpierr = MPI_Type_commit(&mtype); + if(mpierr){ + printf("\n>>>FAILED: %d %d\n",__LINE__,mpierr); + errcount++; + return; + } + #ifdef TEST_INTERNAL copy_data(&a, &b, indexed_type); @@ -266,12 +278,27 @@ void test_simple_bindexed2() mpierr = MPI_Irecv(rbuf, 1, mtype, 0, 1, MPI_COMM_WORLD, &rcvid); + if(mpierr){ + printf("\n>>>FAILED: %d %d\n",__LINE__,mpierr); + errcount++; + return; + } mpierr = MPI_Send(sbuf, 4, MPI_INT, 0, 1, MPI_COMM_WORLD); - + if(mpierr){ + printf("\n>>>FAILED: %d %d\n",__LINE__,mpierr); + errcount++; + return; + } mpierr = MPI_Wait(&rcvid, &status); + if(mpierr){ + printf("\n>>>FAILED: %d %d\n",__LINE__,mpierr); + errcount++; + return; + } + #endif printf("a = [");