- struct longdoubleint { long double val; int loc; } cinbuf[3], coutbuf[3];
-
- cinbuf[0].val = 1;
- cinbuf[0].loc = rank;
- cinbuf[1].val = 0;
- cinbuf[1].loc = rank;
- cinbuf[2].val = rank;
- cinbuf[2].loc = rank;
-
- coutbuf[0].val = 0;
- coutbuf[0].loc = -1;
- coutbuf[1].val = 1;
- coutbuf[1].loc = -1;
- coutbuf[2].val = 1;
- coutbuf[2].loc = -1;
- if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
- MPI_Reduce( cinbuf, coutbuf, 3, MPI_LONG_DOUBLE_INT, MPI_MINLOC,
- 0, comm );
- if (rank == 0) {
- if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
- errs++;
- fprintf( stderr, "long double-int MINLOC(1) test failed\n" );
- }
- if (coutbuf[1].val != 0 || coutbuf[1].loc != 0) {
- errs++;
- fprintf( stderr, "long double-int MINLOC(0) test failed\n" );
- }
- if (coutbuf[2].val != 0 || coutbuf[2].loc != 0) {
- errs++;
- fprintf( stderr, "long double-int MINLOC(>) test failed\n" );
- }
- }
- }
+ struct longdoubleint {
+ long double val;
+ int loc;
+ } cinbuf[3], coutbuf[3];
+ MTEST_VG_MEM_INIT(cinbuf, 3* sizeof(cinbuf[0]));
+
+ cinbuf[0].val = 1;
+ cinbuf[0].loc = rank;
+ cinbuf[1].val = 0;
+ cinbuf[1].loc = rank;
+ cinbuf[2].val = rank;
+ cinbuf[2].loc = rank;
+
+ coutbuf[0].val = 0;
+ coutbuf[0].loc = -1;
+ coutbuf[1].val = 1;
+ coutbuf[1].loc = -1;
+ coutbuf[2].val = 1;
+ coutbuf[2].loc = -1;
+ if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+ MPI_Reduce(cinbuf, coutbuf, 3, MPI_LONG_DOUBLE_INT, MPI_MINLOC, 0, comm);
+ if (rank == 0) {
+ if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+ errs++;
+ fprintf(stderr, "long double-int MINLOC(1) test failed\n");
+ }
+ if (coutbuf[1].val != 0 || coutbuf[1].loc != 0) {
+ errs++;
+ fprintf(stderr, "long double-int MINLOC(0) test failed\n");
+ }
+ if (coutbuf[2].val != 0 || coutbuf[2].loc != 0) {
+ errs++;
+ fprintf(stderr, "long double-int MINLOC(>) test failed\n");
+ }
+ }
+ }