[MPICH2-dev] MPICH2/baseattrwinf90 fails on testing

Derbunovich, Andrey andrey.derbunovich at intel.com
Wed Oct 12 05:29:24 CDT 2005


Dear All,

 

We have found bug in the implementation of Fortran binding for
MPI_Win_get_attr function. It does not work correctly for 64-bit
platform like x86_64 (EM64t). The tests showing problem are
test/mpi/f77/attr/baseattrwinf.f and corresponding
test/mpi/f90/attr/baseattrwinf90.f90. 

 

Problem description:

 

1.	The 3-rd argument passed to MPI_win_get_attr function should be
big enough to fit address value. But in the baseattrwinf tests this
parameter defined as INTEGER*4 which is too short for 64-bit
architecture. We suggest that definition should be changed to INTEGER
(kind=MPI_ADDRESS_KIND) for f90 test and automatically changed at
configuration phase to INTEGER*8 for f77 test.
2.	There is a wrong data assignment in the MPI_win_get_attr()
function. Data of MPI_Aint type (actually long) assigned to variable
MPI_Fint type (actually int). Look at the src/mpi/attr/win_get_attr.c
(lines 140, 145). This is not correct operation on 64-bit platform like
em64t because may cause data lost or memory garbage in the Fortran
application. There is a suggestion to change definition of internal
variable attr_int in the MPI_Win_get_attr function from MPI_Fint to
MPI_Aint to avoid such behavior. You could find the suggested patch
below.

 

--- win_get_attr.c.ori  2005-10-06 19:40:13.000000000 +0400

+++ win_get_attr.c      2005-10-06 19:40:59.000000000 +0400

@@ -112,7 +112,7 @@

        int attr_idx = win_keyval & 0x0000000f;

        void **attr_val_p = (void **)attribute_val;

 #ifdef HAVE_FORTRAN_BINDING

-       MPI_Fint  *attr_int = (MPI_Fint *)attribute_val;

+       MPI_Aint  *attr_int = (MPI_Aint *)attribute_val;

 #endif

        *flag = 1;

 

Best regards,

Andrey

 

-- 

Andrey Derbunovich           E-mail:   Andrey.Derbunovich at intel.com
<blocked::mailto:Andrey.Derbunovich at intel.com> 

Intel                        Phone:    +7 (831 30)70 700

Sarov, Russia                iNET:     313-2480

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mcs.anl.gov/mailman/private/mpich2-dev/attachments/20051012/0af6b42a/attachment.htm>


More information about the mpich2-dev mailing list