On Tue, 24 Aug 2010, Sebastian Steiger wrote:

> While valgrinding our software I discovered the following error (running on a 
> single machine):
>
> ==3358== Invalid write of size 4
> ==3358==    at 0x586E8BA: libMesh::MeshBase::n_subdomains() const 
> (parallel.h:2629)
> ==3358==    by 0x586F845: libMesh::MeshBase::get_info() const 
> (mesh_base.C:240)
> ==3358==    by 0x586FE50: libMesh::MeshBase::print_info(std::ostream&) const 
> (mesh_base.C:249)
> ==3358==    by 0x40BB1B: test_1D_integration::test_method() 
> (testboost.cpp:54)
>
>
> Looking at the code:
>
>  template <typename T>
>  inline void allgather(T send,
>                       std::vector<T> &recv,
>                        const Communicator &comm)
>  {
>    START_LOG ("allgather()","Parallel");
>
>    recv.resize(comm.size());
>
>    if (comm.size() > 1)
>      {
>       MPI_Allgather (&send,
>                      1,
>                      datatype<T>(),
>                      &recv[0],
>                      1,
>                      datatype<T>(),
>                      comm.get());
>      }
>    else
>      recv[0] = send;
>
>    STOP_LOG ("allgather()","Parallel");
>  }
>
>
> Line 2629 is the 'recv[0] = send' statement. It seems like that vector has 
> length 0 when being run on a single CPU. I checked the svn log a little and 
> it seems like there have been modifications in the past few months - not 100% 
> sure though if it's not my problem...

The problem isn't in allgather - there recv gets sized to comm.size(),
which should never be 0 on a Communicator that proxies anything except
MPI_COMM_NULL.

It looks like here n_subdomains() is calling set_union() which is
calling gather() which is calling all_gather().  There's actually a
bug I'll now fix here (some of those Parallel:: functions aren't
passing their input Communicator along properly), but that shouldn't
be a problem in the n_subdomains() case where the default COMM_WORLD
proxy is being used.

Can you check and make sure your Communicator_World._size is properly
getting set?
---
Roy

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to