Commit 7fe131b7 authored by Rajeev Thakur's avatar Rajeev Thakur
Browse files

[svn-r4822] applied Jim Hoekstra's patch to fix missing use of MTest...

[svn-r4822] applied Jim Hoekstra's patch to fix missing use of MTest convention in test suite. ticket #629
parent 7fe80387
......@@ -7,6 +7,7 @@
#include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include "mpitest.h"
/* tests multiple invocations of Keyval_free on the same keyval */
......@@ -20,7 +21,9 @@ int main (int argc, char **argv)
MPI_Comm duped;
int keyval = MPI_KEYVAL_INVALID;
int keyval_copy = MPI_KEYVAL_INVALID;
MPI_Init(&argc, &argv);
int errs=0;
MTest_Init( &argc, &argv );
MPI_Comm_dup(MPI_COMM_SELF, &duped);
MPI_Keyval_create(MPI_NULL_COPY_FN, delete_fn, &keyval, NULL);
......@@ -32,7 +35,7 @@ int main (int argc, char **argv)
MPI_Comm_free(&duped); /* first MPI_Keyval_free */
MPI_Keyval_free(&keyval); /* second MPI_Keyval_free */
MPI_Keyval_free(&keyval_copy); /* third MPI_Keyval_free */
printf(" No Errors\n");
MTest_Finalize( errs );
MPI_Finalize(); /* fourth MPI_Keyval_free */
return 0;
}
......@@ -5,12 +5,13 @@ DEPADD = @MPILIBLOC@ ../util/mtest.o
smvar_do_sharedlibs = 0
#
bcasttest_SOURCES = bcasttest.c
bcasttest_LDADD = ../util/mtest.o
bcast2_SOURCES = bcast2.c
bcast2_LDADD = ../util/mtest.o
bcast3_SOURCES = bcast3.c
bcast3_LDADD = ../util/mtest.o
allred_SOURCES = allred.c
allred_LDADD = -lm
allred_LDADD = -lm ../util/mtest.o
allred2_SOURCES = allred2.c
allred2_LDADD = ../util/mtest.o
allred3_SOURCES = allred3.c
......@@ -36,11 +37,13 @@ alltoallw2_LDADD = ../util/mtest.o
alltoall1_SOURCES = alltoall1.c
redscat_SOURCES = redscat.c
redscat2_SOURCES = redscat2.c
redscat2_LDADD = ../util/mtest.o
coll9_SOURCES = coll9.c
coll7_SOURCES = coll7.c
coll6_SOURCES = coll6.c
coll5_SOURCES = coll5.c
coll4_SOURCES = coll4.c
coll4_LDADD = ../util/mtest.o
coll3_SOURCES = coll3.c
coll2_SOURCES = coll2.c
allredmany_SOURCES = allredmany.c
......
......@@ -8,9 +8,10 @@
#include <stdlib.h>
#include <string.h>
#include "mpi.h"
#include "mpitest.h"
int count, size, rank;
int cerrcnt, gerrcnt;
int cerrcnt;
struct int_test { int a; int b; };
struct long_test { long a; int b; };
......@@ -280,7 +281,7 @@ struct double_test { double a; int b; };
int main( int argc, char **argv )
{
MPI_Init(&argc, &argv);
MTest_Init( &argc, &argv );
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
......@@ -329,15 +330,7 @@ int main( int argc, char **argv )
minloc_test(struct float_test, MPI_FLOAT_INT);
minloc_test(struct double_test, MPI_DOUBLE_INT);
MPI_Allreduce(&cerrcnt, &gerrcnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
if (rank == 0) {
if (gerrcnt)
printf(" Found %d errors\n", gerrcnt);
else
printf(" No Errors\n");
fflush(stdout);
}
MTest_Finalize( cerrcnt );
MPI_Finalize();
return 0;
}
......@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "mpitest.h"
#define ROOT 0
#define NUM_REPS 5
......@@ -20,7 +21,7 @@ int main( int argc, char **argv)
int sizes[NUM_SIZES] = { 100, 64*1024, 128*1024 };
int num_errors=0, tot_errors;
MPI_Init(&argc, &argv);
MTest_Init( &argc, &argv );
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (argc > 1)
......@@ -94,16 +95,9 @@ int main( int argc, char **argv)
}
}
/* printf("Node %d done\n", rank); */
MPI_Reduce( &num_errors, &tot_errors, 1, MPI_INT, MPI_SUM, 0,
MPI_COMM_WORLD );
if (rank == 0 && tot_errors == 0)
printf(" No Errors\n");
fflush(stdout);
free(buf);
MTest_Finalize( num_errors );
MPI_Finalize();
return 0;
}
......@@ -5,6 +5,7 @@
*/
#include "mpi.h"
#include <stdio.h>
#include "mpitest.h"
#define MAX_PROCESSES 10
......@@ -13,11 +14,11 @@ int main( int argc, char **argv )
int rank, size, i,j;
int table[MAX_PROCESSES][MAX_PROCESSES];
int row[MAX_PROCESSES];
int errors=0, toterrs = 0;
int errors=0;
int participants;
MPI_Comm comm;
MPI_Init( &argc, &argv );
MTest_Init( &argc, &argv );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
MPI_Comm_size( MPI_COMM_WORLD, &size );
......@@ -49,18 +50,11 @@ int main( int argc, char **argv )
/* Now see if our row looks right */
for (i=0; i<MAX_PROCESSES; i++)
if ( row[i] != i+rank ) errors++;
MPI_Allreduce( &errors, &toterrs, 1, MPI_INT, MPI_SUM, comm );
}
MPI_Comm_free( &comm );
MTest_Finalize( errors );
MPI_Finalize();
if (errors)
printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
else {
if (rank == 0 && toterrs == 0)
printf( " No Errors\n");
}
return errors;
}
......@@ -15,6 +15,7 @@
#include "mpi.h"
#include <stdio.h>
#include <stdlib.h>
#include "mpitest.h"
int err = 0;
......@@ -66,7 +67,6 @@ void nc_sum(void *a, void *b, int *count, MPI_Datatype *type)
int main( int argc, char **argv )
{
int toterr;
int *sendbuf, *recvcounts;
int block_size;
int *recvbuf;
......@@ -74,7 +74,7 @@ int main( int argc, char **argv )
MPI_Comm comm;
MPI_Op left_op, right_op, nc_sum_op;
MPI_Init( &argc, &argv );
MTest_Init( &argc, &argv );
comm = MPI_COMM_WORLD;
MPI_Comm_size( comm, &size );
......@@ -114,20 +114,12 @@ int main( int argc, char **argv )
free(sendbuf);
}
MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
if (rank == 0) {
if (toterr == 0) {
printf( " No Errors\n" );
}
else {
printf( "found %d errors\n", toterr );
}
}
MPI_Op_free(&left_op);
MPI_Op_free(&right_op);
MPI_Op_free(&nc_sum_op);
MTest_Finalize( err );
MPI_Finalize( );
return toterr;
return err;
}
......@@ -9,14 +9,15 @@
*/
#include "mpi.h"
#include <stdio.h>
#include "mpitest.h"
int main( int argc, char *argv[] )
{
MPI_Comm intercomm;
int remote_rank, rank, size, errs = 0, toterr;
int remote_rank, rank, size, errs = 0;
volatile int trigger;
MPI_Init( &argc, &argv );
MTest_Init( &argc, &argv );
trigger = 1;
/* while (trigger) ; */
......@@ -55,16 +56,7 @@ int main( int argc, char *argv[] )
/* The next test should create an intercomm with groups of different
sizes FIXME */
MPI_Allreduce( &errs, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
if (rank == 0) {
if (toterr == 0) {
printf( " No Errors\n" );
}
else {
printf (" Found %d errors\n", toterr );
}
}
MTest_Finalize( errs );
MPI_Finalize();
return 0;
......
......@@ -28,6 +28,7 @@ simple-size-extent_SOURCES = simple-size-extent.c
slice-pack_SOURCES = slice-pack.c
struct-no-real-types_SOURCES = struct-no-real-types.c
struct-no-real-types_LDADD = ../util/mtest.o
slice-pack-external_SOURCES = slice-pack-external.c
......@@ -41,6 +42,7 @@ lots-of-types_LDADD = ../util/mtest.o
simple-pack-external_SOURCES = simple-pack-external.c
darray-pack_SOURCES = darray-pack.c
darray-pack_LDADD = ../util/mtest.o
subarray-pack_SOURCES = subarray-pack.c
......@@ -65,10 +67,12 @@ struct-ezhov_SOURCES = struct-ezhov.c
pairtype-size-extent_SOURCES = pairtype-size-extent.c
struct-derived-zeros_SOURCES = struct-derived-zeros.c
struct-derived-zeros_LDADD = ../util/mtest.o
localpack_SOURCES = localpack.c
lbub_SOURCES = lbub.c
lbub_LDADD = ../util/mtest.o
unpack_SOURCES = unpack.c
unpack_LDADD = ../util/mtest.o
......
......@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mpitest.h"
/*
The default behavior of the test routines should be to briefly indicate
......@@ -30,9 +31,8 @@ static int pack_and_unpack(char *typebuf,
int main(int argc, char **argv)
{
int err, errs = 0;
int toterrs, rank;
MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
MTest_Init( &argc, &argv );
parse_args(argc, argv);
/* To improve reporting of problems about operations, we
......@@ -54,16 +54,8 @@ int main(int argc, char **argv)
/* Allow the use of more than one process - some MPI implementations
(including IBM's) check that the number of processes given to
Type_create_darray is no larger than MPI_COMM_WORLD */
MPI_Reduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
if (rank == 0) {
if (toterrs) {
fprintf(stderr, "Found %d errors\n", toterrs);
}
else {
printf(" No Errors\n");
}
}
MTest_Finalize( errs );
MPI_Finalize();
return 0;
}
......
......@@ -39,7 +39,7 @@ int main(int argc, char **argv)
{
int err, errs = 0;
MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
MTest_Init( &argc, &argv );
parse_args(argc, argv);
/* To improve reporting of problems about operations, we
......@@ -87,13 +87,7 @@ int main(int argc, char **argv)
if (err && verbose) fprintf(stderr, "found %d errors in negstrided negextent vector test\n", err);
errs += err;
/* print message and exit */
if (errs) {
fprintf(stderr, "Found %d errors\n", errs);
}
else {
printf(" No Errors\n");
}
MTest_Finalize( errs );
MPI_Finalize();
return 0;
}
......@@ -1310,6 +1304,7 @@ int vector_blklen_negstride_negextent_of_int_with_lb_ub_test(void)
return errs;
}
#if 0
/* Use this unless mtest is included. */
void MTestPrintError( int errcode )
{
......@@ -1321,3 +1316,4 @@ void MTestPrintError( int errcode )
printf( "Error class %d (%s)\n", errclass, string );
fflush( stdout );
}
#endif
......@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mpitest.h"
static int verbose = 0;
......@@ -24,7 +25,7 @@ int main(int argc, char **argv)
{
int err, errs = 0;
MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
MTest_Init(&argc, &argv);
parse_args(argc, argv);
/* To improve reporting of problems about operations, we
......@@ -52,13 +53,7 @@ int main(int argc, char **argv)
"%d errors in struct of basics test.\n", err);
errs += err;
/* print message and exit */
if (errs) {
fprintf(stderr, "Found %d errors\n", errs);
}
else {
printf(" No Errors\n");
}
MTest_Finalize( errs );
MPI_Finalize();
return 0;
}
......
......@@ -8,14 +8,16 @@
#include <stdio.h>
#include <mpi.h>
#include "mpitest.h"
int main(int argc, char *argv[])
{
MPI_Datatype mystruct, vecs[3];
MPI_Aint stride = 5, displs[3];
int i=0, blockcount[3];
int errs=0;
MPI_Init(&argc, &argv);
MTest_Init( &argc, &argv );
for(i = 0; i < 3; i++)
{
......@@ -51,10 +53,9 @@ int main(int argc, char *argv[])
{
MPI_Type_free(&vecs[i]);
}
printf(" No Errors\n");
MTest_Finalize( errs );
MPI_Finalize();
return 0;
}
......@@ -6,6 +6,7 @@
#include "mpi.h"
#include <stdio.h>
#include <stdlib.h>
#include "mpitest.h"
#include "mpitestconf.h"
#ifdef HAVE_STRING_H
#include <string.h>
......@@ -29,7 +30,7 @@ int main(int argc, char **argv)
{
int err, errs = 0;
MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
MTest_Init(&argc, &argv);
parse_args(argc, argv);
/* To improve reporting of problems about operations, we
......@@ -42,13 +43,7 @@ int main(int argc, char **argv)
err);
errs += err;
/* print message and exit */
if (errs) {
fprintf(stderr, "Found %d errors\n", errs);
}
else {
printf(" No Errors\n");
}
MTest_Finalize( errs );
MPI_Finalize();
return 0;
}
......
......@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "mpi.h"
#include "mpitest.h"
int main(int argc, char *argv[]);
......@@ -36,7 +37,7 @@ int main(int argc, char *argv[])
}
/* Initialize MPI */
MPI_Init(&argc, &argv);
MTest_Init( &argc, &argv );
parse_args(argc, argv);
......@@ -79,13 +80,7 @@ int main(int argc, char *argv[])
}
}
/* print message and exit */
if (errs) {
printf( "Found %d errors\n", errs);
}
else {
printf(" No Errors\n");
}
MTest_Finalize( errs );
MPI_Finalize();
return 0;
}
......
......@@ -5,6 +5,7 @@
*/
#include <stdio.h>
#include "mpi.h"
#include "mpitest.h"
/* Very simple test that Bcast handled mismatched lengths (while not a
common user error, we've seen it several times, so good handling of
......@@ -20,7 +21,7 @@ int main( int argc, char *argv[] )
char str[MPI_MAX_ERROR_STRING+1];
int slen;
MPI_Init( &argc, &argv );
MTest_Init( &argc, &argv );
MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
......@@ -73,15 +74,7 @@ int main( int argc, char *argv[] )
MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL );
MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
if (rank == 0) {
if (toterrs == 0) {
printf( " No Errors\n" );
}
else {
printf( " Found %d errors\n", toterrs );
}
}
MTest_Finalize( errs );
MPI_Finalize( );
return 0;
}
......@@ -5,6 +5,7 @@
*/
#include <stdio.h>
#include "mpi.h"
#include "mpitest.h"
/* Very simple test that Allreduce detects invalid (datatype,operation)
pair */
......@@ -13,12 +14,11 @@ int verbose = 0;
int main( int argc, char *argv[] )
{
int a, b, ierr, errs=0, toterrs;
int rank;
int a, b, ierr, errs=0;
char str[MPI_MAX_ERROR_STRING+1];
int slen;
MPI_Init( &argc, &argv );
MTest_Init( &argc, &argv );
MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
......@@ -36,16 +36,7 @@ int main( int argc, char *argv[] )
MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
if (rank == 0) {
if (toterrs == 0) {
printf( " No Errors\n" );
}
else {
printf( " Found %d errors\n", toterrs );
}
}
MTest_Finalize( errs );
MPI_Finalize( );
return 0;
}
......@@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#include "mpitest.h"
/* Test that comm_split fails gracefully when the number of communicators
is exhausted. Original version submitted by Paul Sack.
......@@ -18,9 +19,10 @@ int main(int argc, char* argv[])
{
int i, rank;
int rc, maxcomm;
int errs = 0;
MPI_Comm comm[MAX_COMMS];
MPI_Init (&argc, &argv);
MTest_Init( &argc, &argv );
MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
......@@ -46,9 +48,7 @@ int main(int argc, char* argv[])
MPI_Comm_free( &comm[i] );
}
/* If we complete, there are no errors */
if (rank == 0) {
printf( " No Errors\n" );
}
MTest_Finalize( errs );
MPI_Finalize();
return 0;
}
......@@ -3,6 +3,8 @@ DEPADD = @MPILIBLOC@
smvar_do_sharedlibs = 0
errgetx_SOURCES = errgetx.cxx
errgetx_LDADD = ../../../cxx/util/mtest.o
errsetx_SOURCES = errsetx.cxx
errsetx_LDADD = ../../../cxx/util/mtest.o
throwtest_SOURCES = throwtest.cxx
......@@ -12,8 +12,10 @@
value as was set.
*/
#include "mpitestconf.h"
#include <mpi.h>
#include <iostream>
#include "mpitestcxx.h"
/* #define VERBOSE */
......@@ -63,7 +65,7 @@ int main( int argc, char *argv[] )
MPI::Win win = MPI::WIN_NULL;
MPI::File file = MPI::FILE_NULL;
MPI::Init();
MTest_Init( );
const unsigned int rank = MPI::COMM_WORLD.Get_rank();
......@@ -78,12 +80,7 @@ int main( int argc, char *argv[] )
errs += testRetrieveErrhandler(file);
}
if (errs == 0) {
std::cout << " No Errors" << std::endl;
}
else {
std::cout << " Found " << errs << " errors" << std::endl;
}
MTest_Finalize( errs );
win.Free();
file.Close();
......
......@@ -4,8 +4,8 @@
* (C) 2006 by Argonne National Laboratory.