- MTest_Init( &argc, &argv );
-
- MPI_Op_create( uop, 0, &op );
-
- while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
- if (comm == MPI_COMM_NULL) {
- continue;
- }
- MPI_Comm_size( comm, &size );
- matSize = size;
-
- /* Only one matrix for now */
- count = 1;
-
- /* A single matrix, the size of the communicator */
- MPI_Type_contiguous( size*size, MPI_INT, &mattype );
- MPI_Type_commit( &mattype );
-
- max_offset = count * size * size;
- buf = (int *)malloc( max_offset * sizeof(int) );
- if (!buf) {
- MPI_Abort( MPI_COMM_WORLD, 1 );
- exit(1);
- }
- bufout = (int *)malloc( max_offset * sizeof(int) );
- if (!bufout) {
- MPI_Abort( MPI_COMM_WORLD, 1 );
- exit(1);
- }
-
- initMat( comm, buf );
- MPI_Allreduce( buf, bufout, count, mattype, op, comm );
- errs += isIdentity( comm, bufout );
-
- /* Try the same test, but using MPI_IN_PLACE */
- initMat( comm, bufout );
- MPI_Allreduce( MPI_IN_PLACE, bufout, count, mattype, op, comm );
- errs += isIdentity( comm, bufout );
-
- free( buf );
- free( bufout );
-
- //MPI_Type_free( &mattype );
- MTestFreeComm( &comm );
+ MTest_Init(&argc, &argv);
+
+ MPI_Op_create(uop, 0, &op);
+
+ while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
+ if (comm == MPI_COMM_NULL) {
+ continue;
+ }
+ MPI_Comm_size(comm, &size);
+ matSize = size;
+
+ /* Only one matrix for now */
+ count = 1;
+
+ /* A single matrix, the size of the communicator */
+ MPI_Type_contiguous(size * size, MPI_INT, &mattype);
+ MPI_Type_commit(&mattype);
+
+ max_offset = count * size * size;
+ buf = (int *) malloc(max_offset * sizeof(int));
+ if (!buf) {
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+ bufout = (int *) malloc(max_offset * sizeof(int));
+ if (!bufout) {
+ MPI_Abort(MPI_COMM_WORLD, 1);
+ }
+
+ initMat(comm, buf);
+ MPI_Allreduce(buf, bufout, count, mattype, op, comm);
+ errs += isIdentity(comm, bufout);
+
+ /* Try the same test, but using MPI_IN_PLACE */
+ initMat(comm, bufout);
+ MPI_Allreduce(MPI_IN_PLACE, bufout, count, mattype, op, comm);
+ errs += isIdentity(comm, bufout);
+
+ free(buf);
+ free(bufout);
+
+ MPI_Type_free(&mattype);
+ MTestFreeComm(&comm);