Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.0rc2: Regression in MPI_Ireduce_scatter_block() #1636

Closed
dalcinl opened this issue May 5, 2016 · 2 comments
Closed

2.0.0rc2: Regression in MPI_Ireduce_scatter_block() #1636

dalcinl opened this issue May 5, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@dalcinl
Copy link
Contributor

dalcinl commented May 5, 2016

The following trivial test checks that MPI_Reduce_scatter_block() and MPI_Ireduce_scatter_block() produce the expected output and do not overwrite past the receive buffer. To keep it simple, it can be run in at most 16 processes.

Using Open MPI 1.10.2, I get the expected output in all cases, so this is definitely a regression in 2.0.0rc2.

#include <stdlib.h>
#include <stdio.h>
#include <mpi.h>
int main(int argc, char *argv[])
{
  int i,size,rank;
  int sendbuf[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
  int recvbuf[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int rcount    = 1;

  MPI_Init(&argc, &argv);
  MPI_Comm_size(MPI_COMM_WORLD, &size);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  if (size > 16) MPI_Abort(MPI_COMM_WORLD,1);
#ifndef NBCOLL
#define NBCOLL 1
#endif
#if NBCOLL
  MPI_Request request;
  MPI_Ireduce_scatter_block(sendbuf, recvbuf, rcount, MPI_INT,
                            MPI_SUM, MPI_COMM_WORLD, &request);
  MPI_Wait(&request,MPI_STATUS_IGNORE);
#else
  MPI_Reduce_scatter_block(sendbuf, recvbuf, rcount, MPI_INT,
                           MPI_SUM, MPI_COMM_WORLD);
#endif
  printf("[%d] rbuf[%d]=%2d  expected:%2d\n", rank, 0, recvbuf[0], size);
  for (i=1; i<size+1; i++) {
    printf("[%d] rbuf[%d]=%2d  expected:%2d\n", rank, i, recvbuf[i], 0);
  }
  MPI_Finalize();
  return 0;
}

Using MPI_Reduce_scatter_block(), I get the expected output for any number of processes

$ mpicc -DNBCOLL=0 ireduce_scatter_block.c

$ mpiexec -n 1 ./a.out 
[0] rbuf[0]= 1  expected: 1
[0] rbuf[1]= 0  expected: 0

$ mpiexec -n 3 ./a.out 
[0] rbuf[0]= 3  expected: 3
[0] rbuf[1]= 0  expected: 0
[0] rbuf[2]= 0  expected: 0
[0] rbuf[3]= 0  expected: 0
[1] rbuf[0]= 3  expected: 3
[1] rbuf[1]= 0  expected: 0
[1] rbuf[2]= 0  expected: 0
[1] rbuf[3]= 0  expected: 0
[2] rbuf[0]= 3  expected: 3
[2] rbuf[1]= 0  expected: 0
[2] rbuf[2]= 0  expected: 0
[2] rbuf[3]= 0  expected: 0

Using MPI_Ireduce_scatter_block(), the output for one process P=1 is wrong, but for P>1 we are good:

$ mpicc -DNBCOLL=1 ireduce_scatter_block.c

$ mpiexec -n 1 ./a.out 
[0] rbuf[0]= 0  expected: 1
[0] rbuf[1]= 0  expected: 0

$ mpiexec -n 3 ./a.out 
[0] rbuf[0]= 3  expected: 3
[0] rbuf[1]= 0  expected: 0
[0] rbuf[2]= 0  expected: 0
[0] rbuf[3]= 0  expected: 0
[1] rbuf[0]= 3  expected: 3
[1] rbuf[1]= 0  expected: 0
[1] rbuf[2]= 0  expected: 0
[1] rbuf[3]= 0  expected: 0
[2] rbuf[0]= 3  expected: 3
[2] rbuf[1]= 0  expected: 0
[2] rbuf[2]= 0  expected: 0
[2] rbuf[3]= 0  expected: 0
@ggouaillardet
Copy link
Contributor

the fix got lost when libnbc was rewritten ...
I will fix that tomorrow

@ggouaillardet ggouaillardet added this to the v2.0.0 milestone May 5, 2016
@ggouaillardet ggouaillardet self-assigned this May 5, 2016
ggouaillardet added a commit to ggouaillardet/ompi-release that referenced this issue May 6, 2016
Thanks Lisandro Dalcin for the report

Fixes open-mpi/ompi#1636

(cherry picked from commit open-mpi/ompi@6c9d65c)
@ggouaillardet
Copy link
Contributor

Fixed in open-mpi/ompi-release#1143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants