See the code below. The commented-out combinations for sbuf,rbuf do
work, but the one passing sbuf=rbuf=NULL (i.e, the uncommented one
show below) makes the call fail with MPI_ERR_ARG.

#include <mpi.h>

int main( int argc, char ** argv ) {
  int ierr;
  int sbuf,rbuf;
  MPI_Init(&argc, &argv);
  ierr = MPI_Reduce(/*&sbuf, &rbuf,*/
                    /*&sbuf, NULL,*/
                    /*NULL, &rbuf,*/
                    NULL, NULL,
                    0, MPI_INT,
                    MPI_SUM, 0, MPI_COMM_WORLD);
  MPI_Finalize();
  return 0;
}


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594

Reply via email to