[mpich-discuss] MPI_Win_create synch

Rajeev Thakur thakur at mcs.anl.gov
Tue Jul 8 08:11:28 CDT 2008


Some communication takes place inside the Win_create function to keep track
of that.

Rajeev 

> -----Original Message-----
> From: owner-mpich-discuss at mcs.anl.gov 
> [mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of Alberto 
> Giannetti
> Sent: Tuesday, July 08, 2008 7:09 AM
> To: mpich-discuss at mcs.anl.gov
> Subject: Re: [mpich-discuss] MPI_Win_create synch
> 
> It doesn't. I was just wondering how processes are returned the  
> handler to the correct window region when multiple memory 
> windows are  
> created in the master. For example:
> 
> if( rank == 0 ) { // Master, create memory
>    ...
>    Mem = MPI::Alloc_mem(memSize, MPI_INFO_NULL);
>    winQueue = MPI::Win::Create(pMem, memSize, sizeof(int),  
> MPI_INFO_NULL, MPI::COMM_WORLD);
> 
>    Mem2 = MPI::Alloc_mem(memSize2, MPI_INFO_NULL);
>    winQueue2 = MPI::Win::Create(pMem2, memSize2, sizeof(int),  
> MPI_INFO_NULL, MPI::COMM_WORLD);
>    ...
> } else { // Slave, get handler to remote memory
>    ...
>    winQueue = MPI::Win::Create((void*)0, 0, sizeof(int),  
> MPI_INFO_NULL, MPI::COMM_WORLD);
> 
>    winQueue2 = MPI::Win::Create((void*)0, 0, sizeof(int),  
> MPI_INFO_NULL, MPI::COMM_WORLD);
>    ...
> }
> 
> How does the MPICH implementation guarantees that the slave first  
> call to Create returns an handle (winQueue) to pMem and the second  
> call (winQueue2) to pMem2? Without using global identifiers or  
> synchronization, the two slave Create calls could be assigned in  
> reverse order: the first call could be assigned to the remote memory  
> region pointed by pMem2, rather than pMem.
> 
> I don't see any id to match the two window segments in the 
> master and  
> the slave, so I think there is a barrier implicit after each 
> Create()  
> collective call?
> 
> On Jul 7, 2008, at 11:28 PM, Rajeev Thakur wrote:
> 
> > Win_create is a collective operation. All processes in the  
> > communicator
> > (COMM_WORLD in this case) must call it. Does it hang if you call a  
> > second
> > Win_create in both master and slave?
> >
> > Rajeev
> >
> >> -----Original Message-----
> >> From: owner-mpich-discuss at mcs.anl.gov
> >> [mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of 
> Robert Kubrick
> >> Sent: Monday, July 07, 2008 9:23 PM
> >> To: mpich-discuss at mcs.anl.gov
> >> Subject: [mpich-discuss] MPI_Win_create synch
> >>
> >> I want to create a window region in my master process. Slave
> >> processes are connecting to the region for some one-sided
> >> operations and I don't need to create extra windows in each slave.
> >> The code will look something like this:
> >>
> >> if( rank == 0 ) { // Master
> >>    ...
> >>    pMem = MPI::Alloc_mem(memSize, MPI_INFO_NULL);
> >>    winQueue = MPI::Win::Create(pMem, memSize, sizeof(int),
> >> MPI_INFO_NULL, MPI::COMM_WORLD);
> >>    ...
> >> } else { // Slaves
> >>    ...
> >>    winQueue = MPI::Win::Create((void*)0, 0, sizeof(int),
> >> MPI_INFO_NULL, MPI::COMM_WORLD);
> >>    ...
> >> }
> >>
> >> How does MPI match the correct window handle in the slave.
> >> Lets say I create more than one window in the master, which
> >> window handle is returned to the slave after Create()?
> >> I noticed that if I add Create() calls to the master, the
> >> program hangs, I think because it must match the extra
> >> windows in each slave.
> >> Is there a sort of barrier embedded in each Win::Create()?
> >>
> >> Rob
> >>
> >>
> >
> 
> 




More information about the mpich-discuss mailing list