- for (count = 1; count < 65000; count = 2 * count) {
- /* The left group will send rank to the right group;
- The right group will send -rank to the left group */
- rbuf = (int *)malloc( count * rsize * sizeof(int) );
- sbuf = (int *)malloc( count * sizeof(int) );
- for (i=0; i<count*rsize; i++) rbuf[i] = -1;
- if (leftGroup) {
- for (i=0; i<count; i++) sbuf[i] = i + rank*count;
- }
- else {
- for (i=0; i<count; i++) sbuf[i] = -(i + rank*count);
- }
- err = MPI_Allgather( sbuf, count, datatype,
- rbuf, count, datatype, comm );
- if (err) {
- errs++;
- MTestPrintError( err );
- }
- if (leftGroup) {
- for (i=0; i<count*rsize; i++) {
- if (rbuf[i] != -i) {
- errs++;
- }
- }
- }
- else {
- for (i=0; i<count*rsize; i++) {
- if (rbuf[i] != i) {
- errs++;
- }
- }
- }
+ for (count = 1; count < 65000; count = 2 * count) {
+ /* The left group will send rank to the right group;
+ * The right group will send -rank to the left group */
+ rbuf = (int *) malloc(count * rsize * sizeof(int));
+ sbuf = (int *) malloc(count * sizeof(int));
+ for (i = 0; i < count * rsize; i++)
+ rbuf[i] = -1;
+ if (leftGroup) {
+ for (i = 0; i < count; i++)
+ sbuf[i] = i + rank * count;
+ }
+ else {
+ for (i = 0; i < count; i++)
+ sbuf[i] = -(i + rank * count);
+ }
+ err = MTest_Allgather(sbuf, count, datatype, rbuf, count, datatype, comm);
+ if (err) {
+ errs++;
+ MTestPrintError(err);
+ }
+ if (leftGroup) {
+ for (i = 0; i < count * rsize; i++) {
+ if (rbuf[i] != -i) {
+ errs++;
+ }
+ }
+ }
+ else {
+ for (i = 0; i < count * rsize; i++) {
+ if (rbuf[i] != i) {
+ errs++;
+ }
+ }
+ }