Skip to content

MPI ABI fix for test/mpi/f77/pt2pt/bsendf.f #7846

Description

@jeffhammond

test/mpi/f77/pt2pt/bsendf.f hardcodes a 400-character attached buffer for a buffered send of 10 MPI_INTEGER values. This happens to work with MPICH's native MPI_BSEND_OVERHEAD value, but it is not portable to MPI implementations or ABI layers with a larger MPI_BSEND_OVERHEAD.

With a 512-byte overhead, the test's 400-byte attached buffer is smaller than the required size for even one 10-integer buffered send. The observed behavior in VAPAA was a hang: rank 1 blocked in MPI_Recv because the rank 0 MPI_Bsend did not produce the expected message under the undersized attached buffer.

Patch

diff --git a/test/mpi/f77/pt2pt/bsendf.f b/test/mpi/f77/pt2pt/bsendf.f
index 4c76ea0..a1d7f8c 100644
--- a/test/mpi/f77/pt2pt/bsendf.f
+++ b/test/mpi/f77/pt2pt/bsendf.f
@@ -4,21 +4,23 @@ C     See COPYRIGHT in top-level directory
 C
 
 C Basic test for MPI_Bsend
-C     We test a basic buffered send of 10 INTEGERs and assume a buffer
-C     of 400 CHARACTERs are sufficient to account for MPI_BSEND_OVERHEAD
+C     We test a basic buffered send of 10 INTEGERs and size the
+C     attached buffer from MPI_BSEND_OVERHEAD.
 
       program bsend
       implicit none
       include 'mpif.h'
       integer ierr, errs, comm
-      character dummy_buf(400)
-      INTEGER dummy_size
+      integer dummy_size
+      integer dummy_buf_size
+      parameter (dummy_buf_size=MPI_BSEND_OVERHEAD+400)
+      character dummy_buf(dummy_buf_size)
 C
       errs = 0
       comm = MPI_COMM_WORLD;
       call MTest_Init( ierr )
-      call mpi_buffer_attach(dummy_buf, 400, ierr )
+      call mpi_buffer_attach(dummy_buf, dummy_buf_size, ierr )
       call test_bsend( comm, errs )
       call mpi_buffer_detach(dummy_buf, dummy_size, ierr )
       call MTest_Finalize( errs )
       end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions