[mpich-discuss] mpi_put works only with target_displacement=0

Ted Sariyski tsariysk at craft-tech.com
Sun Apr 27 08:05:35 CDT 2014


Thanks Rajeev! It works.
--Ted


On 04/26/2014 10:47 PM, Rajeev Thakur wrote:
> The size parameter to MPI_Win_create should be the size in bytes, and the disp_unit parameter should be sizeofreal, not mpi_real.
>
> Rajeev
>
> On Apr 26, 2014, at 9:08 PM, Ted Sariyski <tsariysk at craft-tech.com>
>   wrote:
>
>> Attached is a test program (mpi_alloc_mem is called from alloc.c).
>> 'run' will compile tst.f90 and alloc.c, and run the code on two cpus. If line 99, "target_displacement=0", is commented out, code breaks.
>>
>> /> mpif90 --version
>> GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
>>
>> Thanks for the prompt response.
>> --Ted
>>
>>> Can you send a small test program that can be compiled and run?
>>> Rajeev
>>
>>
>> On 04/26/2014 11:03 AM, Ted Sariyski wrote:
>>> HI,
>>> I am trying to apply RMA so that each process evaluates its segment of data and PUTs it at process 0. Here is what I do (see attachment):
>>>
>>>     1. Process 0 creates a window win0 with size=GLOBAL_SIZE of the array
>>>     2. Rest of processes create NULL() win0 with size 0.
>>>     3. Eeach  process evaluates it portion dat with size myCount
>>>     4. All create mpi_shared_lock on 0 (dat on different process are strictly non-overlapping)
>>>     5. Put dat on 0 with appropriate offset (myOffset)
>>>
>>> Code works on two cpus ONLY when target_displacement=0. If target_displacement=myOffset, I get:
>>>
>>>> rank 0 in job 383  craft28.craft-tech.com_57409   caused collective abort of all ranks
>>>> exit status of rank 0: killed by signal 11
>>> What do I miss here?
>>>
>>> Any help will be highly appreciated. Thank in advance,
>>> --Ted
>>>
>>> P.S. Mixed  C and  fortran90 with  mpich2.1.5 on Linux/x86_64 (CentOS 6.5)
>>>
>>>
>>> ...
>>>    integer(mpi_address_kind) :: size=0,target_displacement=0
>>>    if ( myid == 0 ) then
>>>         call mpi_win_create(mdat,size,mpi_realsize,info,comm,win0,ierr)
>>>     else
>>>         call mpi_win_create(NULL(),0,1,info,comm,win0,ierr)
>>>     end if
>>>     ...
>>>     target_rank=0
>>>     call mpi_win_lock(mpi_lock_shared,target_rank,mpi_mode_nocheck,win0,ierr)
>>>     ...
>>>     origin_count=myCount
>>>     target_count=myCount
>>>     target_displacement=myOffset
>>>     ...
>>>     call mpi_put(ldat,origin_count,mpi_real,target_rank,target_displacement,target_count,mpi_real,win0,ierr)
>>>     ...




More information about the discuss mailing list