Re: [petsc-users] VecScatter

2022-10-11 Thread Barry Smith
You need to first convert the Vec to the "natural" ordering and then bring that vector down to one rank. Something like DMDACreateNaturalVector(dm,); DMDAGlobalToNaturalBegin/End(dm, n); > VecScatterCreateToZero(n, , ); > VecScatterBegin(scat, n Xseq, INSERT_VALUES, SCATTER_FORWARD); >

[petsc-users] VecScatter

2022-10-11 Thread Jorti, Zakariae via petsc-users
Hello, I have a code that handles a PETSc Vec on many procs and I would like to use VecScatterCreateToZero to have all elements of this vector on a single proc, call VecGetArrayRead on this proc to get the corresponding array to carry out some diagnostics. Unfortunately, what I noticed is

Re: [petsc-users] VecScatter betweeen Vectors with different parallel layouts

2017-02-13 Thread Jed Brown
"Barletta, Ivano" writes: > Hello PETSc users > > I was wondering if you've got any suggestion for the issue > mentioned in the topic. > > I'm solving a linear system on my unstructured grid that has its > own partitioning. When I set up the linear system in PETSc I > use the

Re: [petsc-users] VecScatter betweeen Vectors with different parallel layouts

2017-02-13 Thread Matthew Knepley
On Mon, Feb 13, 2017 at 5:51 AM, Barletta, Ivano wrote: > Hello PETSc users > > I was wondering if you've got any suggestion for the issue > mentioned in the topic. > > I'm solving a linear system on my unstructured grid that has its > own partitioning. When I set up the

[petsc-users] VecScatter betweeen Vectors with different parallel layouts

2017-02-13 Thread Barletta, Ivano
Hello PETSc users I was wondering if you've got any suggestion for the issue mentioned in the topic. I'm solving a linear system on my unstructured grid that has its own partitioning. When I set up the linear system in PETSc I use the model partitioning whose grid points might not be evenly

[petsc-users] VecScatter Error w/Multiple Processors

2014-07-01 Thread Arthur Kurlej
Hello, I am trying to use VecScatter to grab values from nonlocal processors, and I've run into the following error when I try to run for 8+ processors. The error is as follows: [0]PETSC ERROR: VecScatterCreate() line 1161 in src/vec/vec/utils/vscat.c And the code that causes it is Mat A

Re: [petsc-users] VecScatter Error w/Multiple Processors

2014-07-01 Thread Barry Smith
There are several problems with this code. On Jul 1, 2014, at 12:04 PM, Arthur Kurlej akur...@gmail.com wrote: Hello, I am trying to use VecScatter to grab values from nonlocal processors, and I've run into the following error when I try to run for 8+ processors. The error is as

Re: [petsc-users] VecScatter from slice of global vector to sequential vector + AO errors

2013-10-03 Thread Matthew Knepley
On Thu, Oct 3, 2013 at 2:07 PM, Randall Mackie rlmackie...@gmail.comwrote: I am trying to create a VecScatter that will scatter all the values from a horizontal slice of a 3D DMDA global vector (with dof=3) to a sequential vector on every processor. So far I have been unsuccessful, most likely

Re: [petsc-users] VecScatter from slice of global vector to sequential vector + AO errors

2013-10-03 Thread Barry Smith
Randy, Take a look at DMDAGetRay() in src/dm/impls/da/dasub.c (now called DMDACreateRay()) this takes a row or column from a 2d DADM. You can use the same kind of approach to get a slice from a 3d DMDA. Barry On Oct 3, 2013, at 2:07 PM, Randall Mackie rlmackie...@gmail.com

Re: [petsc-users] VecScatter from slice of global vector to sequential vector + AO errors

2013-10-03 Thread Randall Mackie
On Oct 3, 2013, at 12:24 PM, Matthew Knepley knep...@gmail.com wrote: On Thu, Oct 3, 2013 at 2:07 PM, Randall Mackie rlmackie...@gmail.com wrote: I am trying to create a VecScatter that will scatter all the values from a horizontal slice of a 3D DMDA global vector (with dof=3) to a

[petsc-users] VecScatter from comm to subcomm: should I aggregate?

2013-04-21 Thread Hui Zhang
On Apr 19, 2013, at 5:15 PM, Hui Zhang wrote: I'm doing something like gasm.c. I can construct one VecScatte from comm to each subcomm. But I can also construct VecScatter's from comm to the processors in subcomm. Which mode do you think is good? Why? Thanks for teaching me! After

[petsc-users] VecScatter from comm to subcomm: should I aggregate?

2013-04-19 Thread Hui Zhang
I'm doing something like gasm.c. I can construct one VecScatte from comm to each subcomm. But I can also construct VecScatter's from comm to the processors in subcomm. Which mode do you think is good? Why? Thanks for teaching me!

[petsc-users] VecScatter Question

2012-02-09 Thread Mohammad Mirzadeh
Hi guys, I'm just wondering if I understand how the VecScatter works. Considering (petsc 3.2-p6 manual page 53): VecScatterCreate(Vec x,IS ix,Vec y,IS iy,VecScatter *ctx); VecScatterBegin(VecScatter ctx,Vec x,Vec y,INSERT VALUES,SCATTER FORWARD); VecScatterEnd(VecScatter ctx,Vec x,Vec y,INSERT

[petsc-users] VecScatter Question

2012-02-09 Thread Satish Balay
On Thu, 9 Feb 2012, Mohammad Mirzadeh wrote: Hi guys, I'm just wondering if I understand how the VecScatter works. Considering (petsc 3.2-p6 manual page 53): VecScatterCreate(Vec x,IS ix,Vec y,IS iy,VecScatter *ctx); VecScatterBegin(VecScatter ctx,Vec x,Vec y,INSERT VALUES,SCATTER

[petsc-users] VecScatter Question

2012-02-09 Thread Mohammad Mirzadeh
So this actually means it somehow matches the local indecies? What i mean by that is, y[ iy[i] ] = x[ ix[i] ]. Is that why ix and iy should have the same size? Mohammad On Thu, Feb 9, 2012 at 3:17 PM, Satish Balay balay at mcs.anl.gov wrote: On Thu, 9 Feb 2012, Mohammad Mirzadeh wrote: Hi

[petsc-users] VecScatter Question

2012-02-09 Thread Satish Balay
On Thu, 9 Feb 2012, Mohammad Mirzadeh wrote: So this actually means it somehow matches the local indices? Hm - no local indices here. What i mean by that is, y[ iy[i] ] = x[ ix[i] ]. Sure - with global indices. Is that why ix and iy should have the same size? When you specify data

[petsc-users] VecScatter Question

2012-02-09 Thread Mohammad Mirzadeh
Thanks Satish. That all makes sense. Truth is I am trying to move data from a parallel vector to a serial one on rank 0. I make an index set, in parallel, with stride 1 and use it for both source and destination and i believe that should do the job ... but it does not. Somehow it seems that the

[petsc-users] VecScatter Question

2012-02-09 Thread Mohammad Mirzadeh
Alright just got it :D The IS needs to be build in serial otherwise each processor only copies the portion it owns! Thanks, Mohammad On Thu, Feb 9, 2012 at 3:52 PM, Mohammad Mirzadeh mirzadeh at gmail.comwrote: Thanks Satish. That all makes sense. Truth is I am trying to move data from a

[petsc-users] VecScatter in 'add' mode?

2011-09-28 Thread Hui Zhang
Hi all, When using PetscErrorCode VecScatterCreate(Vec xin,IS ix,Vec yin,IS iy,VecScatter *newctx) I want to add those values of xin to the original values of yin. Is there a way to do this without copy of yin? Thanks! Hui -- next part -- An HTML attachment was

[petsc-users] VecScatter in 'add' mode?

2011-09-28 Thread Matthew Knepley
On Wed, Sep 28, 2011 at 3:54 PM, Hui Zhang mike.hui.zhang at hotmail.comwrote: Hi all, When using PetscErrorCode VecScatterCreate(Vec xin,IS ix,Vec yin,IS iy,VecScatter *newctx) I want to add those values of xin to the original values of yin. Is there a way to do this without copy of

[petsc-users] VecScatter in 'add' mode?

2011-09-28 Thread Hui Zhang
On Sep 28, 2011, at 5:58 PM, Matthew Knepley wrote: On Wed, Sep 28, 2011 at 3:54 PM, Hui Zhang mike.hui.zhang at hotmail.com wrote: Hi all, When using PetscErrorCode VecScatterCreate(Vec xin,IS ix,Vec yin,IS iy,VecScatter *newctx) I want to add those values of xin to the original

[petsc-users] VecScatter in 'add' mode?

2011-09-28 Thread Matthew Knepley
On Wed, Sep 28, 2011 at 4:05 PM, Hui Zhang mike.hui.zhang at hotmail.comwrote: On Sep 28, 2011, at 5:58 PM, Matthew Knepley wrote: On Wed, Sep 28, 2011 at 3:54 PM, Hui Zhang mike.hui.zhang at hotmail.comwrote: Hi all, When using PetscErrorCode VecScatterCreate(Vec xin,IS ix,Vec

[petsc-users] VecScatter in 'add' mode?

2011-09-28 Thread Hui Zhang
On Sep 28, 2011, at 6:08 PM, Matthew Knepley wrote: On Wed, Sep 28, 2011 at 4:05 PM, Hui Zhang mike.hui.zhang at hotmail.com wrote: On Sep 28, 2011, at 5:58 PM, Matthew Knepley wrote: On Wed, Sep 28, 2011 at 3:54 PM, Hui Zhang mike.hui.zhang at hotmail.com wrote: Hi all, When using

[petsc-users] VecScatter in 'add' mode?

2011-09-28 Thread Matthew Knepley
On Wed, Sep 28, 2011 at 4:15 PM, Hui Zhang mike.hui.zhang at hotmail.comwrote: On Sep 28, 2011, at 6:08 PM, Matthew Knepley wrote: On Wed, Sep 28, 2011 at 4:05 PM, Hui Zhang mike.hui.zhang at hotmail.comwrote: On Sep 28, 2011, at 5:58 PM, Matthew Knepley wrote: On Wed, Sep 28, 2011 at

[petsc-users] VecScatter in 'add' mode?

2011-09-28 Thread Hui Zhang
On Sep 28, 2011, at 6:16 PM, Matthew Knepley wrote: On Wed, Sep 28, 2011 at 4:15 PM, Hui Zhang mike.hui.zhang at hotmail.com wrote: On Sep 28, 2011, at 6:08 PM, Matthew Knepley wrote: On Wed, Sep 28, 2011 at 4:05 PM, Hui Zhang mike.hui.zhang at hotmail.com wrote: On Sep 28, 2011,

[petsc-users] Vecscatter question

2011-08-30 Thread Matthew Knepley
On Tue, Aug 30, 2011 at 1:36 AM, Jed Brown jedbrown at mcs.anl.gov wrote: On Mon, Aug 29, 2011 at 20:32, Tabrez Ali stali at geology.wisc.edu wrote: If during Vecscatter (say from a global vector x to a local vector y) if 'is' and 'iy' are such that almost all values being scattered happen to

[petsc-users] Vecscatter question

2011-08-29 Thread Tabrez Ali
Hello If during Vecscatter (say from a global vector x to a local vector y) if 'is' and 'iy' are such that almost all values being scattered happen to be on the local proc then almost 0 or very little MPI calls would be made internally. Is this correct? Such a setup would not cause

[petsc-users] Vecscatter question

2011-08-29 Thread Barry Smith
On Aug 29, 2011, at 8:32 PM, Tabrez Ali wrote: Hello If during Vecscatter (say from a global vector x to a local vector y) if 'is' and 'iy' are such that almost all values being scattered happen to be on the local proc then almost 0 or very little MPI calls would be made internally. Is

[petsc-users] Vecscatter question

2011-08-29 Thread Jed Brown
On Mon, Aug 29, 2011 at 20:32, Tabrez Ali stali at geology.wisc.edu wrote: If during Vecscatter (say from a global vector x to a local vector y) if 'is' and 'iy' are such that almost all values being scattered happen to be on the local proc then almost 0 or very little MPI calls would be made

[petsc-users] VecScatter

2011-08-03 Thread Jed Brown
On Wed, Aug 3, 2011 at 04:08, Mohammad Mirzadeh mirzadeh at gmail.com wrote: I have a question regarding the VecScatter routine. If I make a call like: VecScatterCreate(old_vec, PETSC_NULL, new_vec, is_scat, vec_scat); This creates map from the entire old_vec to the subset of new_vec indexed

[petsc-users] VecScatter

2011-08-03 Thread Mohammad Mirzadeh
Thank you Jed. On Wed, Aug 3, 2011 at 6:47 AM, Jed Brown jedbrown at mcs.anl.gov wrote: On Wed, Aug 3, 2011 at 04:08, Mohammad Mirzadeh mirzadeh at gmail.comwrote: I have a question regarding the VecScatter routine. If I make a call like: VecScatterCreate(old_vec, PETSC_NULL, new_vec,