Re: [petsc-users] Coordinate format internal reordering

2023-10-20 Thread Enrico
Yes but in the documentation it should be clear that if the global indices are not contiguous in each process, even if the memory is locally contiguous in each process, then there will be communication to build the matrix and the vector. Cheers, Enrico On 19/10/2023 20:41, Matthew Knepley wro

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Matthew Knepley
On Thu, Oct 19, 2023 at 1:46 PM Enrico wrote: > Sorry but I don't want another partition, Petsc internally is changing > the partition. I would like to have the same partition that I have in > the application. Is the example not clear? > "Petsc internally is changing the partition" This is not c

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Enrico
Sorry but I don't want another partition, Petsc internally is changing the partition. I would like to have the same partition that I have in the application. Is the example not clear? On 19/10/2023 19:43, Matthew Knepley wrote: On Thu, Oct 19, 2023 at 1:00 PM Enrico >

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Matthew Knepley
On Thu, Oct 19, 2023 at 1:00 PM Enrico wrote: > Here is a very very simple reproducer of my problem. It is a fortran > program and it has to run with 2 processes. > You seem to be saying that you start with one partition of your data, but you would like another partition. For this, you have to i

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Enrico
Here is a very very simple reproducer of my problem. It is a fortran program and it has to run with 2 processes. The output is: process 0 : xx_v(1 ) = 0.000 process 0 : xx_v(2 ) = 1.000 process 0 : xx

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Enrico
I make an example. If I have a vector with global indices {0,1,2,3,4,5} and process 0 owns {2,3,4} while process 1 owns {0,1,5}, the resulting vector data structure on Petsc on process 0 owns {0,1,2}. This means that the points {0,1} has been sent from process 1 to process 0. I would like to ha

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Matthew Knepley
On Thu, Oct 19, 2023 at 11:33 AM Enrico wrote: > The layout is not poor, just the global indices are not contiguous,this > has nothing to do with the local memory layout which is extremely > optimized for different architectures. I can not change the layout > anyway because it's a climate model w

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Enrico
The layout is not poor, just the global indices are not contiguous,this has nothing to do with the local memory layout which is extremely optimized for different architectures. I can not change the layout anyway because it's a climate model with a million lines of code. I don't understand why

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Matthew Knepley
On Thu, Oct 19, 2023 at 10:51 AM Enrico wrote: > In the application the storage is contiguous but the global indexing is > not. I would like to use AO as a translation layer but I don't > understand it. > Why would you choose to index differently from your storage? > My case is actually simple

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Enrico
In the application the storage is contiguous but the global indexing is not. I would like to use AO as a translation layer but I don't understand it. My case is actually simple even if it is in a large application, I have Mat A, Vec b and Vec x After calling KSPSolve, I use VecGetArrayReadF90

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Matthew Knepley
On Thu, Oct 19, 2023 at 8:57 AM Enrico wrote: > Maybe I wasn't clear enough. I would like to completely get rid of Petsc > ordering because I don't want extra communication between processes to > construct the vector and the matrix (since I have to fill them every > time step because I'm just usi

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Enrico
Maybe I wasn't clear enough. I would like to completely get rid of Petsc ordering because I don't want extra communication between processes to construct the vector and the matrix (since I have to fill them every time step because I'm just using the linear solver with a Mat and a Vec data struc

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Matthew Knepley
On Thu, Oct 19, 2023 at 6:51 AM Enrico wrote: > Hello, > > if I create an application ordering using AOCreateBasic, should I > provide the same array for const PetscInt myapp[] and const PetscInt > mypetsc[] in order to get the same ordering of the application within > PETSC? > Are you asking if

Re: [petsc-users] Coordinate format internal reordering

2023-10-19 Thread Enrico
Hello, if I create an application ordering using AOCreateBasic, should I provide the same array for const PetscInt myapp[] and const PetscInt mypetsc[] in order to get the same ordering of the application within PETSC? And once I define the ordering so that the local vector and matrix are de

Re: [petsc-users] Coordinate format internal reordering

2023-10-18 Thread Matthew Knepley
On Wed, Oct 18, 2023 at 5:55 AM Enrico wrote: > Hello, > > I'm trying to use Petsc to solve a linear system in an application. I'm > using the coordinate format to define the matrix and the vector (it > should work better on GPU but at the moment every test is on CPU). After > the call to VecSetV

[petsc-users] Coordinate format internal reordering

2023-10-18 Thread Enrico
Hello, I'm trying to use Petsc to solve a linear system in an application. I'm using the coordinate format to define the matrix and the vector (it should work better on GPU but at the moment every test is on CPU). After the call to VecSetValuesCOO, I've noticed that the vector is storing the