[mpich-discuss] Buffered send and tcp on Windows

Mikko Lyly Mikko.Lyly at csc.fi
Fri Aug 29 13:45:28 CDT 2008


Dear all,

I have a small question related to MPICH2 1.0.7, and I was hoping if you could help me to understand the case a little bit better.

Attached to this mail (see below) is a small sample program in f90, which fails to run both on Linux and Windows when executed as follows:

$ mpiexec -localonly 4 test

It runs fine for n=1,2,3.  For  n=4 and grater, I get:

Fatal error in MPI_Bsend: Invalid buffer pointer, error stack:
MPI_Bsend(182).......: MPI_Bsend(buf=0023EE50, count=1000, MPI_INTEGER, dest=3, tag=1000, MPI_COMM_WORLD) failed
MPIR_Bsend_isend(342): Insufficient space in Bsend buffer; requested 4000; total buffer size is 10000

I fail to understand, why is the buffer size not sufficient (sending 3000, bufsize is 10000), and why the error is "requested 4000"?

Thank you and have a very nice weekend,
Mikko Lyly


PROGRAM test
  IMPLICIT NONE
  INCLUDE 'mpif.h'
  INTEGER :: receiver, sender, rc, ntasks, id
  INTEGER :: status(MPI_STATUS_SIZE)
  INTEGER, PARAMETER :: send_buf_size = 10000
  INTEGER, PARAMETER :: data_buf_size = 1000
  INTEGER :: send_buf(send_buf_size)
  INTEGER :: data_buf(data_buf_size)

  CALL MPI_INIT(rc)
  CALL MPI_COMM_SIZE(MPI_COMM_WORLD, ntasks, rc)

  CALL MPI_COMM_RANK(MPI_COMM_WORLD, id, rc)
  CALL MPI_BUFFER_ATTACH(send_buf, send_buf_size, rc)

  ! Sending (ntasks-1) times 1000 integers (buffer size is 10000):
  DO receiver = 0, ntasks-1
     IF(receiver /= id) THEN
        PRINT *, 'Send:', id, '->', receiver
        CALL MPI_BSEND(data_buf, data_buf_size, MPI_INTEGER, receiver, 1000, MPI_COMM_WORLD, rc)
     END IF
  END DO

  ! Receiving (ntasks-1) times 1000 integers:
  DO sender = 0, ntasks-1
     IF(sender /= id) THEN
        PRINT *, 'Recv:', sender, '->', id
        CALL MPI_RECV(data_buf, data_buf_size, MPI_INTEGER, sender, 1000, MPI_COMM_WORLD, status, rc)
     END IF
  END DO

  CALL MPI_FINALIZE(rc)

END PROGRAM test




More information about the mpich-discuss mailing list