← Back to team overview

dolfin team mailing list archive

Re: Broadcast/receive

 

On Mon, Dec 03, 2007 at 11:15:35AM +0000, Garth N. Wells wrote:
> 
> 
> Anders Logg wrote:
> > I worked some on the logic for broadcast/receive. Take a look at the
> > constuctor of UnitSquare. It has two lines (now commented out)
> > that take care of broadcast/receive:
> > 
> >   if (MPIManager::receive()) { receive(); return; }
> > 
> >   [code for creating UnitSquare goes here]
> > 
> >   if (MPIManager::broadcast()) { broadcast(); }
> > 
> 
> Looks good. Is there a reason why this is commented out in UnitSquare.cpp?
> 
> Garth

Yes, it didn't seem to do anything sensible for me on my laptop (my
MPI install/configuration looks broken). I think it looks ok, so if it
works for you, just uncomment.

-- 
Anders


> > The function MPIManager::receive() determines whether the mesh should
> > be received from another process instead of created, according to the
> > current policy for communication. Right now, only one policy is
> > implemented but this may change (depending on for example whether the
> > user wants to take care of communication or let's DOLFIN decide on a
> > suitable policy). The current implementation just returns
> > 
> >   return numProcesses() > 0 && processNumber() > 0;
> > 
> > If MPI is not available it just returns false.
> > 
> > Similarly, the function MPIManager::broadcast() determines whether the
> > mesh should be broadcast to all other processes:
> > 
> >   return numProcesses() > 0 && processNumber() == 0;
> > 
> 
> 
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev


Follow ups

References