[MPICH] MPI_GET_ADDRESS

Kenneth Rempe kenneth.rempe at studsvikscandpower.com
Fri Apr 21 08:02:42 CDT 2006


William Gropp wrote:

> At 04:52 PM 4/20/2006, Kenneth Rempe wrote:
>
>
>> I running been having problems with MPI_GET_ADDRESS on a  Linux box 
>> and on a  AIX v 5.2 box. These machines both
>> have more than 2GB of  memory ( real + swap ). I appears that when an 
>> array of memory is allocated with an
>> address above 2GB then MPI_GET_ADDRESS returns a incorrect (negative 
>> address ) . I believe this is because the
>> variable use to hold the address is a 4 byte signed integer so the 
>> max value is 2^^31 or 2GB.  The follow code shows
>> the problem.  On both my linux box and AIX box it fails with a memory 
>> addressing error even though the memory
>> has been allocated successfully. Has anybody seen this problem before 
>> and is there any fix beside using a 64bit version of mpi?
>
>
> What is the value of MPI_ADDRESS_KIND, and which Fortran compilers are 
> you using? If MPICH was configured for a system that has 8 byte 
> addresses, it should have set MPI_ADDRESS_KIND to the Fortran integer 
> type that corresponds to that address size.
>
> Bill
>
>
>
>>      program memtest
>>      use mpi
>>      implicit none
>>      integer (kind=MPI_ADDRESS_KIND) address
>>      real, allocatable :: a1(:)
>>      real, allocatable :: a2(:)
>>      real, allocatable :: a3(:)
>>      real, allocatable :: a4(:)
>>      real, allocatable :: a5(:)
>>      real, allocatable :: a6(:)
>>      real, allocatable :: a7(:)
>>      real, allocatable :: a8(:)
>>      real, allocatable :: a9(:)  ! This should be beyond 2GB limit
>>      integer, parameter :: space=67108864   ! 256 MB
>>      integer            :: stat
>>      integer            :: ierror
>>
>>      call MPI_INIT(ierror)
>>      allocate(a1(space),stat=stat)
>>      if(stat .ne. 0 ) stop 'memory allocation error a1'
>>      call MPI_GET_ADDRESS(a1,address,ierror)
>>      if( address .lt. 0 ) stop 'memory addressing error a1'
>>
>>      allocate(a2(space),stat=stat)
>>      if(stat .ne. 0 ) stop 'memory allocation error a2 '
>>      call MPI_GET_ADDRESS(a2,address,ierror)
>>      if( address .lt. 0 ) stop 'memory addressing error a2'
>>
>>      allocate(a3(space),stat=stat)
>>      if(stat .ne. 0 ) stop 'memory allocation error a3'
>>      call MPI_GET_ADDRESS(a3,address,ierror)
>>      if( address .lt. 0 ) stop 'memory addressing error a3'
>>
>>      allocate(a4(space),stat=stat)
>>      if(stat .ne. 0 ) stop 'memory allocation error a4'
>>      call MPI_GET_ADDRESS(a4,address,ierror)
>>      if( address .lt. 0 ) stop 'memory addressing error a4'
>>
>>      allocate(a5(space),stat=stat)
>>      if(stat .ne. 0 ) stop 'memory allocation error a5'
>>      call MPI_GET_ADDRESS(a5,address,ierror)
>>      if( address .lt. 0 ) stop 'memory addressing error a5'
>>
>>      allocate(a6(space),stat=stat)
>>      if(stat .ne. 0 ) stop 'memory allocation error a6'
>>      call MPI_GET_ADDRESS(a6,address,ierror)
>>      if( address .lt. 0 ) stop 'memory addressing error a6'
>>
>>      allocate(a7(space),stat=stat)
>>      if(stat .ne. 0 ) stop 'memory allocation error a7'
>>      call MPI_GET_ADDRESS(a7,address,ierror)
>>      if( address .lt. 0 ) stop 'memory addressing error a7'
>>
>>      allocate(a8(space),stat=stat)
>>      if(stat .ne. 0 ) stop 'memory allocation error a8'
>>      call MPI_GET_ADDRESS(a8,address,ierror)
>>      if( address .lt. 0 ) stop 'memory addressing error a8'
>>
>>      allocate(a9(space),stat=stat)
>>      if(stat .ne. 0 ) stop 'memory allocation error a9'
>>      call MPI_GET_ADDRESS(a9,address,ierror)
>>      if( address .lt. 0 ) stop 'memory addressing error a9'
>>
>>      stop 'Normal Termination'
>>      end
>
>
> William Gropp
> http://www.mcs.anl.gov/~gropp

On both the Linux and IBM the value of MPI_ADDRESS_KIND is set to a 4 
byte integer.

Linux   Red Hat Enterprise 3
           Lahey Fortran Compiler version 6.2c
           gcc version 3.2.3

IBM    Aix 5.2
           xlf compiler version 8.1
           xlc compiler version 6.0


-- 
*** NOTE: soa.com will no longer be used after February 1, 2006, please change your address book ***

Kenneth R. Rempe                * email: kenneth.rempe at studsvikscandpower.com
Studsvik Scandpower, Inc.       * 
504 Shoup Avenue Suite #201     * voice:  208-522-4630
Idaho Falls, ID USA 83402-3502  * fax:    208-522-1187




More information about the mpich-discuss mailing list