|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* (C) 2003 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
#include "mpi.h"
|
|
Packit Service |
c5cf8c |
#include "mpitestconf.h"
|
|
Packit Service |
c5cf8c |
#include <stdio.h>
|
|
Packit Service |
c5cf8c |
#include "mpitest.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
static char MTEST_Descrip[] = "Test MPI_BOR operations on optional datatypes dupported by MPICH";
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
* This test looks at the handling of logical and for types that are not
|
|
Packit Service |
c5cf8c |
* integers or are not required integers (e.g., long long). MPICH allows
|
|
Packit Service |
c5cf8c |
* these as well. A strict MPI test should not include this test.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
int main(int argc, char *argv[])
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int errs = 0;
|
|
Packit Service |
c5cf8c |
int rc;
|
|
Packit Service |
c5cf8c |
int rank, size;
|
|
Packit Service |
c5cf8c |
MPI_Comm comm;
|
|
Packit Service |
c5cf8c |
char cinbuf[3], coutbuf[3];
|
|
Packit Service |
c5cf8c |
signed char scinbuf[3], scoutbuf[3];
|
|
Packit Service |
c5cf8c |
unsigned char ucinbuf[3], ucoutbuf[3];
|
|
Packit Service |
c5cf8c |
short sinbuf[3], soutbuf[3];
|
|
Packit Service |
c5cf8c |
unsigned short usinbuf[3], usoutbuf[3];
|
|
Packit Service |
c5cf8c |
long linbuf[3], loutbuf[3];
|
|
Packit Service |
c5cf8c |
unsigned long ulinbuf[3], uloutbuf[3];
|
|
Packit Service |
c5cf8c |
unsigned uinbuf[3], uoutbuf[3];
|
|
Packit Service |
c5cf8c |
int iinbuf[3], ioutbuf[3];
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MTest_Init(&argc, &argv);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
comm = MPI_COMM_WORLD;
|
|
Packit Service |
c5cf8c |
/* Set errors return so that we can provide better information
|
|
Packit Service |
c5cf8c |
* should a routine reject one of the operand/datatype pairs */
|
|
Packit Service |
c5cf8c |
MPI_Errhandler_set(comm, MPI_ERRORS_RETURN);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Comm_rank(comm, &rank;;
|
|
Packit Service |
c5cf8c |
MPI_Comm_size(comm, &size);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifndef USE_STRICT_MPI
|
|
Packit Service |
c5cf8c |
/* char */
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_CHAR\n");
|
|
Packit Service |
c5cf8c |
cinbuf[0] = 0xff;
|
|
Packit Service |
c5cf8c |
cinbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
cinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
coutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
coutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
coutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(cinbuf, coutbuf, 3, MPI_CHAR, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_CHAR", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (coutbuf[0] != (char) 0xff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "char BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (coutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "char BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (coutbuf[2] != (char) 0xff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "char BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif /* USE_STRICT_MPI */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* signed char */
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_SIGNED_CHAR\n");
|
|
Packit Service |
c5cf8c |
scinbuf[0] = 0xff;
|
|
Packit Service |
c5cf8c |
scinbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
scinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
scoutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
scoutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
scoutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_SIGNED_CHAR", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (scoutbuf[0] != (signed char) 0xff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "signed char BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (scoutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "signed char BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (scoutbuf[2] != (signed char) 0xff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "signed char BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* unsigned char */
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_UNSIGNED_CHAR\n");
|
|
Packit Service |
c5cf8c |
ucinbuf[0] = 0xff;
|
|
Packit Service |
c5cf8c |
ucinbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
ucinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
ucoutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
ucoutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
ucoutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_UNSIGNED_CHAR", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (ucoutbuf[0] != 0xff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "unsigned char BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (ucoutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "unsigned char BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (ucoutbuf[2] != 0xff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "unsigned char BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* bytes */
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_BYTE\n");
|
|
Packit Service |
c5cf8c |
cinbuf[0] = 0xff;
|
|
Packit Service |
c5cf8c |
cinbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
cinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
coutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
coutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
coutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(cinbuf, coutbuf, 3, MPI_BYTE, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_BYTE", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (coutbuf[0] != (char) 0xff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "byte BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (coutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "byte BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (coutbuf[2] != (char) 0xff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "byte BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* short */
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_SHORT\n");
|
|
Packit Service |
c5cf8c |
sinbuf[0] = 0xffff;
|
|
Packit Service |
c5cf8c |
sinbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
sinbuf[2] = (rank > 0) ? 0x3c3c : 0xc3c3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
soutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
soutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
soutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(sinbuf, soutbuf, 3, MPI_SHORT, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_SHORT", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (soutbuf[0] != (short) 0xffff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "short BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (soutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "short BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (soutbuf[2] != (short) 0xffff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "short BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* unsigned short */
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_UNSIGNED_SHORT\n");
|
|
Packit Service |
c5cf8c |
usinbuf[0] = 0xffff;
|
|
Packit Service |
c5cf8c |
usinbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
usinbuf[2] = (rank > 0) ? 0x3c3c : 0xc3c3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
usoutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
usoutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
usoutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(usinbuf, usoutbuf, 3, MPI_UNSIGNED_SHORT, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_UNSIGNED_SHORT", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (usoutbuf[0] != 0xffff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "short BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (usoutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "short BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (usoutbuf[2] != 0xffff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "short BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* unsigned */
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_UNSIGNED\n");
|
|
Packit Service |
c5cf8c |
uinbuf[0] = 0xffffffff;
|
|
Packit Service |
c5cf8c |
uinbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
uinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
uoutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
uoutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
uoutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(uinbuf, uoutbuf, 3, MPI_UNSIGNED, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_UNSIGNED", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (uoutbuf[0] != 0xffffffff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "unsigned BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (uoutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "unsigned BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (uoutbuf[2] != 0xffffffff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "unsigned BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* int */
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_INT\n");
|
|
Packit Service |
c5cf8c |
iinbuf[0] = 0xffffffff;
|
|
Packit Service |
c5cf8c |
iinbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
iinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
ioutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
ioutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
ioutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(iinbuf, ioutbuf, 3, MPI_INT, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_INT", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (ioutbuf[0] != 0xffffffff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "int BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (ioutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "int BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (ioutbuf[2] != 0xffffffff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "int BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* long */
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_LONG\n");
|
|
Packit Service |
c5cf8c |
linbuf[0] = 0xffffffff;
|
|
Packit Service |
c5cf8c |
linbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
linbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
loutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
loutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
loutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(linbuf, loutbuf, 3, MPI_LONG, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_LONG", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (loutbuf[0] != 0xffffffff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "long BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (loutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "long BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (loutbuf[2] != 0xffffffff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "long BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* unsigned long */
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_UNSIGNED_LONG\n");
|
|
Packit Service |
c5cf8c |
ulinbuf[0] = 0xffffffff;
|
|
Packit Service |
c5cf8c |
ulinbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
ulinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
uloutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
uloutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
uloutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(ulinbuf, uloutbuf, 3, MPI_UNSIGNED_LONG, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_UNSIGNED_LONG", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (uloutbuf[0] != 0xffffffff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "unsigned long BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (uloutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "unsigned long BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (uloutbuf[2] != 0xffffffff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "unsigned long BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_LONG_LONG
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
long long llinbuf[3], lloutbuf[3];
|
|
Packit Service |
c5cf8c |
/* long long */
|
|
Packit Service |
c5cf8c |
llinbuf[0] = 0xffffffff;
|
|
Packit Service |
c5cf8c |
llinbuf[1] = 0;
|
|
Packit Service |
c5cf8c |
llinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
lloutbuf[0] = 0;
|
|
Packit Service |
c5cf8c |
lloutbuf[1] = 1;
|
|
Packit Service |
c5cf8c |
lloutbuf[2] = 1;
|
|
Packit Service |
c5cf8c |
if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
|
|
Packit Service |
c5cf8c |
MTestPrintfMsg(10, "Reduce of MPI_LONG_LONG\n");
|
|
Packit Service |
c5cf8c |
rc = MPI_Reduce(llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_BOR, 0, comm);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
MTestPrintErrorMsg("MPI_BOR and MPI_LONG_LONG", rc);
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
if (rank == 0) {
|
|
Packit Service |
c5cf8c |
if (lloutbuf[0] != 0xffffffff) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "long long BOR(1) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (lloutbuf[1]) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "long long BOR(0) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
if (lloutbuf[2] != 0xffffffff && size > 1) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
fprintf(stderr, "long long BOR(>) test failed\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Errhandler_set(comm, MPI_ERRORS_ARE_FATAL);
|
|
Packit Service |
c5cf8c |
MTest_Finalize(errs);
|
|
Packit Service |
c5cf8c |
return MTestReturnValue(errs);
|
|
Packit Service |
c5cf8c |
}
|