[petsc-users] Is xout always already zero'ed when being called back on PCShellSetApply ?

2017-05-21 Thread Franck Houssen
When using http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCShellSetApply.html, do I have the guaranty that xout from " PetscErrorCode apply ( PC pc, Vec xin, Vec xout)" has always been previously filled with zeros ? I may have to fill xout by blocks (I would += several possibly

[petsc-users] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-21 Thread Franck Houssen
I have a 3x3 global matrix is built (diag: 1, 2, 1): it's made of 2 overlapping 2x2 local matrix (diag: 1, 1). Getting non assembled local matrix is OK with MatISGetLocalMat. How to get assembled local matrix (initial local matrix + neigbhor contributions on the borders) ? (expected result is d

[petsc-users] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-21 Thread Franck Houssen
Using PETSc MatIS, how to matmult a global IS matrix and a global vector ? Example is attached : I don't get what I expect that is a vector such that proc0 = [1, 2] and proc1 = [2, 1] Franck // Using PETSc MatIS, how to matmult a global IS matrix and a global vector ? // // A 3x3 global matrix

Re: [petsc-users] Is xout always already zero'ed when being called back on PCShellSetApply ?

2017-05-22 Thread Franck Houssen
OK, thanks. Franck - Mail original - > De: "Matthew Knepley" > À: "Franck Houssen" > Cc: "PETSc" , "PETSc" > Envoyé: Dimanche 21 Mai 2017 18:41:10 > Objet: Re: [petsc-users] Is xout always already zero'ed when being call

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-23 Thread Franck Houssen
, localSize, localIdx, PETSC_COPY_VALUES, &is); + //MatGetLocalSubMatrix(A, is, is, &assembledLocalMat); // KO ?!... } + MatView(assembledLocalMat, PETSC_VIEWER_STDOUT_WORLD); // Would like to get => Diag: 2, 1 - Mail original - > De: "Stefano Zampini" >

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-23 Thread Franck Houssen
;Stefano Zampini" > À: "Matthew Knepley" > Cc: "Franck Houssen" , "PETSc" > , "PETSc" > Envoyé: Dimanche 21 Mai 2017 23:02:37 > Objet: Re: [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix > and a global vector ? > Fr

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-23 Thread Franck Houssen
tthew Knepley" > À: "Franck Houssen" > Cc: "Stefano Zampini" , "PETSc" > , "PETSc" > Envoyé: Mardi 23 Mai 2017 13:21:21 > Objet: Re: [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix > and a global vector ? > On T

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-23 Thread Franck Houssen
- > De: "Stefano Zampini" > À: "Franck Houssen" > Cc: "petsc-dev" , "PETSc users list" > , "petsc-maint" > Envoyé: Mardi 23 Mai 2017 13:16:18 > Objet: Re: [petsc-dev] Using PETSc MatIS, how to get local matrix (= one > doma

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-23 Thread Franck Houssen
I let this small piece of code to demonstrate the basics If you believe (like I do) that this is worth to be added to the available examples: feel free to do it !... Franck - Mail original - > De: "Franck Houssen" > À: "Matthew Knepley" > Cc: "

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-23 Thread Franck Houssen
> De: "Matthew Knepley" > À: "Franck Houssen" > Cc: "Stefano Zampini" , "PETSc" > , "PETSc" > Envoyé: Mardi 23 Mai 2017 18:46:34 > Objet: Re: [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix > and a globa

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-24 Thread Franck Houssen
nal - > De: "Stefano Zampini" > À: "Franck Houssen" > Cc: "petsc-dev" , "PETSc users list" > , "petsc-maint" > Envoyé: Mardi 23 Mai 2017 20:23:49 > Objet: Re: [petsc-dev] Using PETSc MatIS, how to get local matrix (= one > do

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-24 Thread Franck Houssen
eateIS(MPI_Comm comm,PetscInt bs,PetscInt M,PetscInt N,ISLocalToGlobalMapping rmap,ISLocalToGlobalMapping cmap,Mat *A ) // Always use PETSC_DECIDE backstage ? Franck - Mail original ----- > De: "Matthew Knepley" > À: "Franck Houssen" > Cc: "Stefano Zam

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-24 Thread Franck Houssen
OK, this is working now ! As the API changed between the latest stable and the master branch, I was actually not using the correct method. Thanks Stefano, Franck - Mail original - > De: "Stefano Zampini" > À: "Franck Houssen" > Cc: "petsc-de

[petsc-users] How to VecView with a formatted precision (%10.8f) ?

2017-05-26 Thread Franck Houssen
How to VecView with a formatted precision (%10.8f) ? Not possible ? Franck

Re: [petsc-users] How to VecView with a formatted precision (%10.8f) ?

2017-05-30 Thread Franck Houssen
ess [4] 4.93827e-06 -3.24e+06 - Mail original - > De: "Jed Brown" > À: "Franck Houssen" , "PETSc users list" > > Envoyé: Vendredi 26 Mai 2017 19:27:42 > Objet: Re: [petsc-users] How to VecView with a formatted precision (%10.8f) ? > >

[petsc-users] Must I destroy the local matrix I have (created and) set with MatISSetLocalMat ?

2017-05-30 Thread Franck Houssen
Must I destroy the local matrix I have (created and) set with MatISSetLocalMat ? Franck

[petsc-users] If I use MatISSetLocalMat with a MatCreateSeqAIJ local matrix, do I need to use MatISSetPreallocation for the global matrix ?

2017-05-31 Thread Franck Houssen
If I use MatISSetLocalMat with a preallocated MatCreateSeqAIJ local matrix, do I need to use MatISSetPreallocation for the global matrix ? Here is the pseudo-code: MatCreateIS(PETSC_COMM_WORLD, ..., &globalMat) MatISSetPreallocation(globalMatrix, ...) // Is this necessary ? MatCreateSeqAIJ(PE

[petsc-users] When using MatIS, do I need to call MatAssemblyBegin/End between MatISSetLocalMat (local set) and MatISGetMPIXAIJ (get global assembly) ?

2017-05-31 Thread Franck Houssen
When using MatIS, do I need to call MatAssemblyBegin/End between MatISSetLocalMat (local set) and MatISGetMPIXAIJ (get global assembly) ? Franck

[petsc-users] How to VecScatter from global to local vector, and then, VecGather back ?

2017-06-06 Thread Franck Houssen
How to VecScatter from global to local vector, and then, VecGather back ? This is a very simple use case: I need to split a global vector in local (possibly overlapping) pieces, then I need to modify each local piece (x2), and finally I need to assemble (+=) back local parts into a global vecto

[petsc-users] Building MatIS with dense local matrix ?

2017-06-19 Thread Franck Houssen
Hi, I try to call MatISGetMPIXAIJ on a MatIS (A) that has been feed locally by sequential (Aloc) dense matrix. Seems this ends up with this error: [0]PETSC ERROR: New nonzero at (0,1) caused a malloc. Is this a known error / limitation ? (not supposed to work with dense matrix ?) This (pseu

Re: [petsc-users] Building MatIS with dense local matrix ?

2017-06-19 Thread Franck Houssen
PetscScalar localVal[4] = {1., 0., 0., 1.}; < MatSetValues(Aloc, 2, localIdx, 2, localIdx, localVal, ADD_VALUES); // Add local 2x2 matrix --- > PetscScalar localVal[2] = {1., 0.}; PetscInt oneLocalRow = 0; > MatSetValues(Aloc, 1, &oneLocalRow, 2, localIdx, localVal, ADD_VALUES)

Re: [petsc-users] Building MatIS with dense local matrix ?

2017-06-20 Thread Franck Houssen
nk); PetscInt localIdx[2] = {0, 0}; - if (rank == 0) {localIdx[0] = 0; localIdx[1] = 1;} + if (rank == 0) {localIdx[0] = 0; localIdx[1] = 2;} else {localIdx[0] = 1; localIdx[1] = 2;} ISLocalToGlobalMapping rmap; ISLocalToGlobalMappingCreate(PETSC_COMM_WORLD, 1, 2, localIdx, PETSC_COPY_VALUES

Re: [petsc-users] Building MatIS with dense local matrix ?

2017-06-20 Thread Franck Houssen
1, PETSC_DECIDE, PETSC_DECIDE, 3, 3, rmap, cmap, &A); + MatCreateIS(PETSC_COMM_WORLD, 1, PETSC_DECIDE, PETSC_DECIDE, size+1, size+1, rmap, cmap, &A); Mat Aloc; if (matType == "csr") {cout << matType << endl; MatCreateSeqAIJ(PETSC_COMM_SELF, 2, 2, 2, NULL, &Alo

Re: [petsc-users] Building MatIS with dense local matrix ?

2017-06-20 Thread Franck Houssen
OK. Franck - Mail original - > De: "Stefano Zampini" > À: "Franck Houssen" > Cc: "PETSc users list" > Envoyé: Mardi 20 Juin 2017 17:08:29 > Objet: Re: [petsc-users] Building MatIS with dense local matrix ? > It should be fixed right

Re: [petsc-users] Building MatIS with dense local matrix ?

2017-06-21 Thread Franck Houssen
> À: "Franck Houssen" > Cc: "PETSc users list" > Envoyé: Mardi 20 Juin 2017 20:45:47 > Objet: Re: [petsc-users] Building MatIS with dense local matrix ? > Franck, > is it your "real" case working properly now? > Stefano > 2017-06-20 1

[petsc-users] How to compute RARt with A and R as distributed (MPI) matrices ?

2017-06-21 Thread Franck Houssen
How to compute RARt with A and R as distributed (MPI) matrices ? This works with sequential matrices. The doc say "currently only implemented for pairs of AIJ matrices and classes which inherit from AIJ": I supposed that MPIAIJ was someway inheriting from AIJ, seems that it doesn't. Is this

Re: [petsc-users] How to compute RARt with A and R as distributed (MPI) matrices ?

2017-06-21 Thread Franck Houssen
sized enough in the doc, in particular for a new user (the matRARt and matPtAP pages are the same with R replaced with Pt). Where was it possible to find this information ? Franck - Mail original - > De: "Dave May" > À: "Franck Houssen" , "PETSc users lis

Re: [petsc-users] [petsc-dev] How to compute RARt with A and R as distributed (MPI) matrices ?

2017-06-22 Thread Franck Houssen
Thanks, I wouldn't have expected so much ! I have to say I am too far from the code to get all the details "behind" this (I understand these details may be numerous and tricky - no problem). If I got it well, in a near future, MatRARt could support both sequential and distributed matrices, and,

Re: [petsc-users] Is OpenMP still available for PETSc?

2017-07-05 Thread Franck Houssen
The man page of slurm/sbatch is cumbersome. But, you may think of : 1. tasks "as MPI processus" 2. cpus "as threads" You should always set resources the most precise way when possible, that is (never use --tasks but prefer) to: 1. use --nodes=n. 2. use --tasks-per-node=t. 3. use --cpus-per-tasks

Re: [petsc-users] Is OpenMP still available for PETSc?

2017-07-05 Thread Franck Houssen
really make sense as you do something different (unless you fix t, and let c vary: even like that, you may not get what you expect - anyway, seems it's not what you do). Franck - Mail original - > De: "Damian Kaliszan" > À: "Franck Houssen" , &quo

Re: [petsc-users] Is OpenMP still available for PETSc?

2017-07-06 Thread Franck Houssen
you name them according to methods, options, ...) "sizes" the informations that come from "neighbor proc" : my understanding is that this information is mandatory for good local convergence and may impact it (but I may be wrong) - Mail original - > De: "Dami