Re: [petsc-users] error handling

2020-01-20 Thread Sam Guo
Hi Barry, I understand ierr != 0 means something catastrophic. I just want to release all memory before I exit PETSc. Thanks, Sam On Mon, Jan 20, 2020 at 4:06 PM Smith, Barry F. wrote: > > Sam, > > I am not sure what your goal is but PETSc error return codes are error > return codes

Re: [petsc-users] error handling

2020-01-20 Thread Smith, Barry F. via petsc-users
Sam, I am not sure what your goal is but PETSc error return codes are error return codes not exceptions. They mean that something catastrophic happened and there is no recovery. Note that PETSc solvers do not return nonzero error codes on failure to converge etc. You call, for

Re: [petsc-users] error handling

2020-01-20 Thread Matthew Knepley
Not if you initialize the pointers to zero: Mat A = NULL. Matt On Mon, Jan 20, 2020 at 6:31 PM Sam Guo wrote: > I mean MatDestroy. > > On Mon, Jan 20, 2020 at 3:28 PM Sam Guo wrote: > >> Does it hurt to call Destroy function without calling CreateFunction? For >> example >> Mat A, B; >> >>

Re: [petsc-users] error handling

2020-01-20 Thread Sam Guo
I mean MatDestroy. On Mon, Jan 20, 2020 at 3:28 PM Sam Guo wrote: > Does it hurt to call Destroy function without calling CreateFunction? For > example > Mat A, B; > > PetscErrorCode > >

Re: [petsc-users] error handling

2020-01-20 Thread Sam Guo
Does it hurt to call Destroy function without calling CreateFunction? For example Mat A, B; PetscErrorCode ierr1, ierr2; ierr1 = MatCreate

Re: [petsc-users] chowiluviennacl

2020-01-20 Thread Mills, Richard Tran via petsc-users
Hi Xiangdong, Maybe I am misunderstanding you, but it sounds like you want an exact direct solution, so I don't understand why you are using an incomplete factorization solver for this. SuperLU_DIST (as Mark has suggested) or MUMPS are two such packages that provide MPI-parallel sparse LU

Re: [petsc-users] error handling

2020-01-20 Thread Dave May
On Mon 20. Jan 2020 at 19:47, Sam Guo wrote: > Can I assume if there is MatCreat or VecCreate, I should clean up the > memory myself? > Yes. You will need to call the matching Destroy function. > On Mon, Jan 20, 2020 at 10:45 AM Sam Guo wrote: > >> I only include the first few lines of

Re: [petsc-users] error handling

2020-01-20 Thread Sam Guo
Can I assume if there is MatCreat or VecCreate, I should clean up the memory myself? On Mon, Jan 20, 2020 at 10:45 AM Sam Guo wrote: > I only include the first few lines of SLEPc example. What about following > ierr = MatCreate(PETSC_COMM_WORLD,);CHKERRQ(ierr); > ierr =

Re: [petsc-users] error handling

2020-01-20 Thread Sam Guo
I only include the first few lines of SLEPc example. What about following ierr = MatCreate(PETSC_COMM_WORLD,);CHKERRQ(ierr); ierr = MatSetSizes(A,PETSC_DECIDE,PETSC_DECIDE,n,n);CHKERRQ(ierr); Is there any memory lost? On Mon, Jan 20, 2020 at 10:41 AM Dave May wrote: > > > On Mon 20. Jan

Re: [petsc-users] error handling

2020-01-20 Thread Dave May
On Mon 20. Jan 2020 at 19:39, Sam Guo wrote: > I don't have a specific case yet. Currently every call of PETSc is > checked. If ierr is not zero, print the error and return. For example, >Mat A; /* problem matrix */ >EPS eps; /* eigenproblem solver context */ >EPSType type; >

Re: [petsc-users] error handling

2020-01-20 Thread Sam Guo
I don't have a specific case yet. Currently every call of PETSc is checked. If ierr is not zero, print the error and return. For example, Mat A; /* problem matrix */ EPS eps; /* eigenproblem solver context */ EPSType type; PetscReal error,tol,re,im; PetscScalar kr,ki; Vec xr,xi; 25

Re: [petsc-users] error handling

2020-01-20 Thread Dave May
On Mon 20. Jan 2020 at 19:11, Sam Guo wrote: > Dear PETSc dev team, >If PETSc function returns an error, what's the correct way to clean > PETSc? > The answer depends on the error message reported. Send the complete error message and a better answer can be provided. Particularly how to

[petsc-users] error handling

2020-01-20 Thread Sam Guo
Dear PETSc dev team, If PETSc function returns an error, what's the correct way to clean PETSc? Particularly how to clean up the memory? Thanks, Sam

Re: [petsc-users] Solver compilation with 64-bit version of PETSc under Windows 10 using Cygwin

2020-01-20 Thread Smith, Barry F. via petsc-users
First you need to figure out what is triggering: C:/MPI/Bin/mpiexec.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory Googling it finds all kinds of suggestions for Linux. But Windows? Maybe the debugger will help. Second >

Re: [petsc-users] Solver compilation with 64-bit version of PETSc under Windows 10 using Cygwin

2020-01-20 Thread Matthew Knepley
On Mon, Jan 20, 2020 at 5:43 AM Дмитрий Мельничук < dmitry.melnic...@geosteertech.com> wrote: > Thank you so much for your assistance! > > As far as I have been able to find out, the errors * "Type mismatch in > argument ‘ierr’"* have been successfully fixed. > But execution of command "*make

Re: [petsc-users] Solver compilation with 64-bit version of PETSc under Windows 10 using Cygwin

2020-01-20 Thread Дмитрий Мельничук
Thank you so much for your assistance!As far as I have been able to find out, the errors "Type mismatch in argument ‘ierr’" have been successfully fixed.But execution of command "make PETSC_DIR=/cygdrive/d/... PETSC_ARCH=arch-mswin-c-debug check" leads to the appereance of Segmantation Violation