[petsc-users] Speed of matrix assembly

2022-11-30 Thread 김성익
Hello, I set a large-sized global matrix through matsetsize and proceed with the process of assembling multiple local-sized matrices into a global matrix (By using MatSetValue). However, only using matsetsize much less than expected performance. In this case, what can be done to speed up

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread Barry Smith
Note you can use -help to have the running code print all possible options it can currently handle. This produces a lot of output so generally, one can do things like ./code various options -help | grep mumps to see what the exact option is named for mumps in your situation. Also if

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread Matthew Knepley
On Wed, Nov 30, 2022 at 10:03 AM Pierre Jolivet wrote: > > > On 30 Nov 2022, at 3:54 PM, Matthew Knepley wrote: > > On Wed, Nov 30, 2022 at 9:31 AM 김성익 wrote: > >> After folloing the comment, ./app -pc_type lu -ksp_type preonly >> -ksp_monitor_true_residual -ksp_converged_reason -ksp_view >>

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread Pierre Jolivet
> On 30 Nov 2022, at 3:54 PM, Matthew Knepley wrote: > > On Wed, Nov 30, 2022 at 9:31 AM 김성익 > wrote: >> After folloing the comment, ./app -pc_type lu -ksp_type preonly >> -ksp_monitor_true_residual -ksp_converged_reason -ksp_view >> -mat_mumps_icntl_7 5 > >

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread 김성익
Following your comments my options are as below. mpirun -np 3 ./app -mpi_linear_solver_server -mpi_linear_solver_server_view -pc_type mpi -ksp_type preonly -mpi_ksp_monitor -mpi_ksp_converged_reason -mpi_pc_type lu -pc_mpi_always_use_server -ksp_monitor_true_residual -ksp_converged_reason

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread Matthew Knepley
On Wed, Nov 30, 2022 at 9:31 AM 김성익 wrote: > After folloing the comment, ./app -pc_type lu -ksp_type preonly > -ksp_monitor_true_residual -ksp_converged_reason -ksp_view > -mat_mumps_icntl_7 5 > Okay, you can see that it is using METIS: INFOG(7) (ordering option effectively used

Re: [petsc-users] Question About Assembly matrix and declaration of KSP & pc

2022-11-30 Thread Mark Adams
On Wed, Nov 30, 2022 at 8:31 AM Matthew Knepley wrote: > On Wed, Nov 30, 2022 at 8:25 AM 김성익 wrote: > >> >> In your comments, >> KSPSetOperators is called if you want to change the system matrix. >> >> "change the system matrix" means the components of matrix are changed? >> I mean the values

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread 김성익
After folloing the comment, ./app -pc_type lu -ksp_type preonly -ksp_monitor_true_residual -ksp_converged_reason -ksp_view -mat_mumps_icntl_7 5 The outputs are as below. 0 KSP none resid norm 2.e+00 true resid norm 4.241815708566e-16 ||r(i)||/||b|| 2.120907854283e-16 1 KSP none

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread 김성익
In my code there are below. PetscCall(KSPCreate(PETSC_COMM_WORLD, )); PetscCall(KSPSetOperators(ksp, xGK, xGK)); PetscCall(KSPGetPC(ksp, )); PetscCall(PCSetType(pc, PCLU)); PetscCall(PCFactorSetMatSolverType(pc, MATSOLVERMUMPS)); PetscCall(KSPSetFromOptions(ksp)); and my runtime options are as

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread Matthew Knepley
On Wed, Nov 30, 2022 at 9:20 AM 김성익 wrote: > In my code there are below. > PetscCall(KSPCreate(PETSC_COMM_WORLD, )); > PetscCall(KSPSetOperators(ksp, xGK, xGK)); > PetscCall(KSPGetPC(ksp, )); > PetscCall(PCSetType(pc, PCLU)); > PetscCall(PCFactorSetMatSolverType(pc, MATSOLVERMUMPS)); >

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread Matthew Knepley
On Wed, Nov 30, 2022 at 9:10 AM 김성익 wrote: > When I adopt icntl by using option, the outputs are as below. > > WARNING! There are options you set that were not used! > WARNING! could be spelling mistake, etc! > There is one unused database option. It is: > Option left: name:-mat_mumps_icntl_7

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread 김성익
When I adopt icntl by using option, the outputs are as below. WARNING! There are options you set that were not used! WARNING! could be spelling mistake, etc! There is one unused database option. It is: Option left: name:-mat_mumps_icntl_7 value: 5 Is it work?? Thanks, Hyung Kim 2022년 11월 30일

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread Matthew Knepley
On Wed, Nov 30, 2022 at 8:58 AM 김성익 wrote: > I'm working on FEM. > When I used mumps alone, I fount it efficient to use mumps with metis. > So my purpose is using MUMPSsolver with METIS. > > I tried to set metis (by icntl_7 : 5) after global matrix assembly and > just before kspsolve. >

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread 김성익
I'm working on FEM. When I used mumps alone, I fount it efficient to use mumps with metis. So my purpose is using MUMPSsolver with METIS. I tried to set metis (by icntl_7 : 5) after global matrix assembly and just before kspsolve. However there is error because of 'pcfactorgetmatrix' and

Re: [petsc-users] Loading labels from a hdf5 mesh file in parallel

2022-11-30 Thread Matthew Knepley
On Thu, Mar 3, 2022 at 10:33 PM Yi Jiang wrote: > Dear Petsc developers, > We are trying to use the HDF5_XDMF parallel I/O feature to read/write > unstructured meshes. By trying some tests, we found that the topology and > geometry data (i.e., cells and vertices) can be efficiently loaded in a >

Re: [petsc-users] About Q3 tensor product Hermite element

2022-11-30 Thread Matthew Knepley
On Wed, Oct 5, 2022 at 4:39 PM Duan Junming via petsc-users < petsc-users@mcs.anl.gov> wrote: > Dear all, > I'm sorry. This email got lost in my inbox. > I need to use Q3 tensor product Hermite element in 2D (point value, > gradient, and mixed derivative at 4 vertices in a cell as unknowns). >

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread Matthew Knepley
On Wed, Nov 30, 2022 at 8:40 AM 김성익 wrote: > Following your comments, > > After matrix assembly end, > PetscCall(KSPGetPC(ksp,)); > PetscCall(KSPSetFromOptions(ksp)); > PetscCall(KSPSetUp(ksp)); > PetscCall(PCFactorGetMatrix(pc,)); > > However there is another error as below. > [0]PETSC ERROR:

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-30 Thread 김성익
Following your comments, After matrix assembly end, PetscCall(KSPGetPC(ksp,)); PetscCall(KSPSetFromOptions(ksp)); PetscCall(KSPSetUp(ksp)); PetscCall(PCFactorGetMatrix(pc,)); However there is another error as below. [0]PETSC ERROR: Object is in wrong state [0]PETSC ERROR: Not for factored matrix

Re: [petsc-users] localToGlobal with MIN_VALUES ?

2022-11-30 Thread Matthew Knepley
On Wed, Nov 30, 2022 at 8:22 AM Matteo Semplice < matteo.sempl...@uninsubria.it> wrote: > Hi. > > In DMLocalToGlobal only INSERT_VALUES or ADD_VALUES appear to be allowed. > > Is there a way to perform localToGlobal (or localtolocal) communications > inserting the minimum value instead? > It

Re: [petsc-users] Question About Assembly matrix and declaration of KSP & pc

2022-11-30 Thread Matthew Knepley
On Wed, Nov 30, 2022 at 8:25 AM 김성익 wrote: > > In your comments, > KSPSetOperators is called if you want to change the system matrix. > > "change the system matrix" means the components of matrix are changed? > I mean the values of some components of matrix are changed. > If you just change

Re: [petsc-users] Question About Assembly matrix and declaration of KSP & pc

2022-11-30 Thread 김성익
In your comments, KSPSetOperators is called if you want to change the system matrix. "change the system matrix" means the components of matrix are changed? I mean the values of some components of matrix are changed. Thanks, Hyung Kim 2022년 11월 30일 (수) 오후 10:00, Matthew Knepley 님이 작성: > On

[petsc-users] localToGlobal with MIN_VALUES ?

2022-11-30 Thread Matteo Semplice
Hi. In DMLocalToGlobal only INSERT_VALUES or ADD_VALUES appear to be allowed. Is there a way to perform localToGlobal (or localtolocal) communications inserting the minimum value instead? Best     Matteo

Re: [petsc-users] Question About Assembly matrix and declaration of KSP & pc

2022-11-30 Thread Matthew Knepley
On Wed, Nov 30, 2022 at 7:51 AM 김성익 wrote: > Thank you for your comments. > However, I have more questions. > > 1. Generally, (KSPCreate, KSPSetOperators, KSPGetPC, PCSetType, > PCFactorSetMatSolverType, KSPSetFromOptions ) > above functions are should be called after each "MatassemblyEnd??" >

Re: [petsc-users] Question About Assembly matrix and declaration of KSP & pc

2022-11-30 Thread 김성익
Thank you for your comments. However, I have more questions. 1. Generally, (KSPCreate, KSPSetOperators, KSPGetPC, PCSetType, PCFactorSetMatSolverType, KSPSetFromOptions ) above functions are should be called after each "MatassemblyEnd??" 2. Though reading the user guide, I don't fully

Re: [petsc-users] Question About Assembly matrix and declaration of KSP & pc

2022-11-30 Thread Mark Adams
On Wed, Nov 30, 2022 at 5:08 AM 김성익 wrote: > Hello, > > > > I’m working on FEM using PETSc. > > As everyone knows, it is necessary to repeatedly solve Ax=B. > > Regarding this, I have 4 questions. > > > > 1. There are many steps for preparing KSPSolve. For example > KSPcreate,

[petsc-users] Question About Assembly matrix and declaration of KSP & pc

2022-11-30 Thread 김성익
Hello, I’m working on FEM using PETSc. As everyone knows, it is necessary to repeatedly solve Ax=B. Regarding this, I have 4 questions. 1. There are many steps for preparing KSPSolve. For example KSPcreate, KSPSetOperators, KSPGetPC, PCSetType, PCFactorSetMatSolverType,