[mpich-discuss] Buffered send and tcp on Windows

Rajeev Thakur thakur at mcs.anl.gov
Fri Aug 29 14:30:35 CDT 2008


The size parameter to MPI_Buffer_attach specifies the buffer size in bytes.

Rajeev
 

> -----Original Message-----
> From: owner-mpich-discuss at mcs.anl.gov 
> [mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of Mikko Lyly
> Sent: Friday, August 29, 2008 2:24 PM
> To: mpich-discuss at mcs.anl.gov
> Subject: RE: [mpich-discuss] Buffered send and tcp on Windows
> 
> 
> >________________________________________
> >From: owner-mpich-discuss at mcs.anl.gov 
> [owner-mpich-discuss at mcs.anl.gov] On Behalf Of Rajeev Thakur 
> [thakur at mcs.anl.gov]
> >Sent: Friday, August 29, 2008 9:57 PM
> >To: mpich-discuss at mcs.anl.gov
> >Subject: RE: [mpich-discuss] Buffered send and tcp on Windows
> 
> >You are sending 1000 integers = 4000 bytes. The buffer is 
> 10000 bytes, so it
> >has room for only 2 bsends.
> >
> >Rajeev
> 
> Thank you for the reply.
> 
> But isn't the buffer size in the test case 40000 bytes (10000 
> integers have been allocated for the send buffer)? It should 
> be plenty enough for 3 times 1000 integers?
> 
> Mikko
> 
> 
> 
> > -----Original Message-----
> > From: owner-mpich-discuss at mcs.anl.gov
> > [mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of Mikko Lyly
> > Sent: Friday, August 29, 2008 1:45 PM
> > To: mpich-discuss at mcs.anl.gov
> > Subject: [mpich-discuss] Buffered send and tcp on Windows
> >
> > 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