---------- Forwarded message ----------
From: John Peterson <jwpeter...@gmail.com>
Date: Thu, Jul 14, 2016 at 8:52 AM
Subject: Re: [Libmesh-users] Bug in PetscVector::create_subvector
To: Jonas Ballani <jonas.ball...@epfl.ch>



On Thu, Jul 14, 2016 at 7:08 AM, Jonas Ballani <jonas.ball...@epfl.ch>
wrote:

>
>
Apparently, the vector y is not distributed correctly to the processors. Is
> this a bug?


Sure seems like one.

PetscVector< Number > y( mesh.comm(), x->size() );


You are initializing the subvector "y" before passing it to
create_subvector().  This constructor ends up calling:

this->init(n, n, false, ptype);

i.e. setting the global and local sizes equal to n.  When the Vec type is
AUTOMATIC and n==n_local, this ends up creating a SERIAL Vec under the
hood, so I think this explains (first,last) being the same on both procs.

There is a different code path in create_subvector() for when y is not
already initialized... can you try that instead?

-- 
John



-- 
John
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to