[petsc-users] Different behavior of code on different machines

2019-07-20 Thread Yuyun Yang via petsc-users
Hello team, I'm encountering a problem with my code's behavior on multiple processors. When I run it on my personal computer it works just fine, but when I use it on our computing cluster it produces an error (in one of the root-finding functions, an assert statement is not satisfied) and

Re: [petsc-users] Question on KSPSetReusePreconditioner

2019-04-18 Thread Yuyun Yang via petsc-users
estion on KSPSetReusePreconditioner > On Apr 18, 2019, at 10:44 AM, Yuyun Yang via petsc-users > wrote: > > Hello team, > > I have a question on when I should be setting KSPSetReusePreconditioner to > PETSC_TRUE or PETSC_FALSE. It made a pretty big difference in the solutions I > get w

Re: [petsc-users] Question on KSPSetReusePreconditioner

2019-04-18 Thread Yuyun Yang via petsc-users
: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] Question on KSPSetReusePreconditioner On Thu, Apr 18, 2019 at 11:44 AM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: Hello team, I have a question on when I should be setting KSPSetReusePreconditioner to PETS

[petsc-users] Question on KSPSetReusePreconditioner

2019-04-18 Thread Yuyun Yang via petsc-users
Hello team, I have a question on when I should be setting KSPSetReusePreconditioner to PETSC_TRUE or PETSC_FALSE. It made a pretty big difference in the solutions I get when I ran my code testing both settings, so is recalculating the preconditioner better since it will make the convergence

Re: [petsc-users] Using -malloc_dump to examine memory leak

2019-04-18 Thread Yuyun Yang via petsc-users
;, int) > (fault.cpp:953) > > The first argument of this function is a Petsc array (obtained from > VecGetArray, and after calling this function, VecRestoreArray was called on > that same object). I can’t think of a way why valgrind thinks there is an > uninitialized value. Is this by an

Re: [petsc-users] Using -malloc_dump to examine memory leak

2019-04-18 Thread Yuyun Yang via petsc-users
sages? Thanks for your help on this. Best regards, Yuyun From: petsc-users mailto:petsc-users-boun...@mcs.anl.gov>> On Behalf Of Yuyun Yang via petsc-users Sent: Tuesday, April 16, 2019 7:30 AM To: Smith, Barry F. mailto:bsm...@mcs.anl.gov>> Cc: petsc-users@mcs.anl.gov<mailto:p

Re: [petsc-users] Using -malloc_dump to examine memory leak

2019-04-16 Thread Yuyun Yang via petsc-users
nd you can keep them under control from the beginning (when the code is small and growing) rather than wait until the code is large and there are many unfreed objects to chase down. Good luck Barry > On Apr 16, 2019, at 1:14 AM, Yuyun Yang via petsc-users > wrote: > > H

[petsc-users] Using -malloc_dump to examine memory leak

2019-04-16 Thread Yuyun Yang via petsc-users
Hello team, I'm trying to use the options -malloc_dump and -malloc_debug to examine memory leaks. The messages however, are quite generic, and don't really tell me where the problems occur, for example: [ 0]1520 bytes VecCreate() line 35 in

Re: [petsc-users] Question about KSP, and makefile linking MPICH

2019-04-13 Thread Yuyun Yang via petsc-users
I won't end up using Cholesky, so it's >>> not really a big issue. >>> >>> Thanks again for the timely help! >>> Yuyun >>> >>> Get Outlook for iOS >>> From: Smith, Barry F. >>> Sent: Thursday, April 11, 2019 6:44:54 PM >

Re: [petsc-users] Question about KSP, and makefile linking MPICH

2019-04-13 Thread Yuyun Yang via petsc-users
t end up using Cholesky, so it's > > not really a big issue. > > > > Thanks again for the timely help! > > Yuyun > > > > Get Outlook for iOS > > From: Smith, Barry F. > > Sent: Thursday, April 11, 2019 6:44:54 PM > > To: Yuyun Yang >

Re: [petsc-users] Question about KSP, and makefile linking MPICH

2019-04-11 Thread Yuyun Yang via petsc-users
ubject: Re: [petsc-users] Question about KSP, and makefile linking MPICH > > > > > On Apr 11, 2019, at 5:44 PM, Yuyun Yang via petsc-users > > wrote: > > > > Hello team, > > > > I’d like to check if it’s ok to use the same ksp object and change its > &g

Re: [petsc-users] Question about KSP, and makefile linking MPICH

2019-04-11 Thread Yuyun Yang via petsc-users
ursday, April 11, 2019 6:44:54 PM To: Yuyun Yang Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] Question about KSP, and makefile linking MPICH > On Apr 11, 2019, at 5:44 PM, Yuyun Yang via petsc-users > wrote: > > Hello team, > > I’d like to check if it’s ok to

[petsc-users] Question about KSP, and makefile linking MPICH

2019-04-11 Thread Yuyun Yang via petsc-users
Hello team, I'd like to check if it's ok to use the same ksp object and change its operator (the matrix A) later on in the code to solve a different problem? Also, I know I've asked this before about linking to MPICH when I call mpirun, instead of using my computer's default MPI, but I want to

Re: [petsc-users] ASCIIRead error for multiple processors

2019-04-05 Thread Yuyun Yang via petsc-users
hew Knepley mailto:knep...@gmail.com>> Sent: Thursday, April 4, 2019 7:30:20 PM To: Yuyun Yang Cc: Smith, Barry F.; petsc-users@mcs.anl.gov<mailto:petsc-users@mcs.anl.gov> Subject: Re: [petsc-users] ASCIIRead error for multiple processors On Thu, Apr 4, 2019 at 9:19 PM Yuyun Yang via pet

Re: [petsc-users] ASCIIRead error for multiple processors

2019-04-05 Thread Yuyun Yang via petsc-users
iple processors On Thu, Apr 4, 2019 at 9:19 PM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: We are probably not going to use hundreds of processors, but i think it would be good to just have processor 0 read the input and broadcast that to all the other processors. Wo

Re: [petsc-users] ASCIIRead error for multiple processors

2019-04-04 Thread Yuyun Yang via petsc-users
ursday, April 4, 2019 7:30:20 PM To: Yuyun Yang Cc: Smith, Barry F.; petsc-users@mcs.anl.gov Subject: Re: [petsc-users] ASCIIRead error for multiple processors On Thu, Apr 4, 2019 at 9:19 PM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: We are probably not going to

Re: [petsc-users] ASCIIRead error for multiple processors

2019-04-04 Thread Yuyun Yang via petsc-users
fine but having hundreds or thousands of processes open the same ASCII file and reading from it will likely not be scalable. > On Apr 4, 2019, at 3:15 PM, Yuyun Yang via petsc-users > wrote: > > Hello team, > > I’m trying to use PetscViewerASCIIRead() to read in a single inter

[petsc-users] ASCIIRead error for multiple processors

2019-04-04 Thread Yuyun Yang via petsc-users
Hello team, I'm trying to use PetscViewerASCIIRead() to read in a single interger/scalar value from an input file. It works for one processor. However, when running on multiple processors, I'm getting the below error: [1]PETSC ERROR: Invalid argument [1]PETSC ERROR: Insufficient data, read

Re: [petsc-users] Saving Vecs/Mats in HDF5 and visualizing in Matlab

2019-03-19 Thread Yuyun Yang via petsc-users
Sounds good, thanks for the advice! -Original Message- From: Jed Brown Sent: Tuesday, March 19, 2019 1:23 PM To: Yuyun Yang ; zakaryah ; petsc-users@mcs.anl.gov Subject: Re: [petsc-users] Saving Vecs/Mats in HDF5 and visualizing in Matlab Yuyun Yang via petsc-users writes: > I

Re: [petsc-users] Saving Vecs/Mats in HDF5 and visualizing in Matlab

2019-03-19 Thread Yuyun Yang via petsc-users
h5info and h5read routines, then I visualize with my own routines. Is there something specific you need from Matlab? On Tue, Mar 19, 2019 at 1:18 PM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: Got it, thanks! From: Matthew Knepley mailto:knep...@gmail.com>

Re: [petsc-users] Saving Vecs/Mats in HDF5 and visualizing in Matlab

2019-03-19 Thread Yuyun Yang via petsc-users
Got it, thanks! From: Matthew Knepley Sent: Tuesday, March 19, 2019 10:10 AM To: Yuyun Yang Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] Saving Vecs/Mats in HDF5 and visualizing in Matlab On Tue, Mar 19, 2019 at 11:58 AM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov

[petsc-users] Saving Vecs/Mats in HDF5 and visualizing in Matlab

2019-03-19 Thread Yuyun Yang via petsc-users
Hello team, Currently we're using the PETSc binary file format to save Vecs and Mats and visualize them in Matlab. It looks like HDF5 works more efficiently with large data sets (faster I/O), and we're wondering if PETSc Vecs/Mats saved in HDF5 viewer can be visualized in Matlab as well?

Re: [petsc-users] Using PETSc with GPU

2019-03-15 Thread Yuyun Yang via petsc-users
nl.gov Subject: Re: [petsc-users] Using PETSc with GPU Yuyun Yang via petsc-users writes: > Currently we are forming the sparse matrices explicitly, but I think the goal > is to move towards matrix-free methods and use a stencil, which I suppose is > good to use GPUs for and more efficien

Re: [petsc-users] Using PETSc with GPU

2019-03-15 Thread Yuyun Yang via petsc-users
Friday, March 15, 2019 2:54:02 PM To: Yuyun Yang Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] Using PETSc with GPU On Fri, Mar 15, 2019 at 5:30 PM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: Hello team, Our group is thinking of using GPUs for the linear solves

[petsc-users] Using PETSc with GPU

2019-03-15 Thread Yuyun Yang via petsc-users
Hello team, Our group is thinking of using GPUs for the linear solves in our code, which is written in PETSc. I was reading the 2013 book chapter on implementation of PETSc using GPUs but wonder if there is any more updated reference that I check out? I also saw one example cuda code online

[petsc-users] Conceptual question about DMDA

2019-03-11 Thread Yuyun Yang via petsc-users
Hello team, May I know for what types of computations is DMDA better to use compared to regular Vec/Mat? It is more complicated in terms of usage, thus so far I've only used Vec/Mat. Would DMDA improve the performance of solving large linear systems (say for variable grid spacing as a result

Re: [petsc-users] Append vector to existing file

2019-03-08 Thread Yuyun Yang via petsc-users
I see, thank you! Yuyun From: Matthew Knepley Sent: Friday, March 8, 2019 4:51 PM To: Yuyun Yang Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] Append vector to existing file On Fri, Mar 8, 2019 at 5:53 PM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: Hell

[petsc-users] Append vector to existing file

2019-03-08 Thread Yuyun Yang via petsc-users
Hello team, This is a very simple question, but I just want to be sure I understand how the viewer works. I have a file with some vectors already written into it. Now I'm calling PetscViewerASCIIOpen, setting the format and then the file mode into append: PetscViewer viewer; ierr =

Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed

2019-03-03 Thread Yuyun Yang via petsc-users
; - ierr = d.setFields(); CHKERRQ(ierr); - ierr = d.setScatters(); CHKERRQ(ierr); - +ierr = d.setFields(); CHKERRQ(ierr); +ierr = d.setScatters(); CHKERRQ(ierr); } PetscFinalize(); return ierr; } Yuyun Yang via petsc-users writes: > Yes, please see the attached files for a mini

Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed

2019-03-03 Thread Yuyun Yang via petsc-users
l.gov<mailto:petsc-users@mcs.anl.gov> Subject: Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed On Sun, Mar 3, 2019 at 1:03 PM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: I tried compiling without the sanitizer and running

Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed

2019-03-03 Thread Yuyun Yang via petsc-users
()-ed On Sun, Mar 3, 2019 at 1:03 PM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: I tried compiling without the sanitizer and running on valgrind. Got a bunch of errors “Uninitialised value was created by a stack allocation at 0x41B280: ComputeVel_qd::computeVel(

Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed

2019-03-03 Thread Yuyun Yang via petsc-users
Yang mailto:yyan...@stanford.edu>> Cc: Matthew Knepley mailto:knep...@gmail.com>>; petsc-users@mcs.anl.gov<mailto:petsc-users@mcs.anl.gov> Subject: Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed On Wed, Feb 27, 2019 at 10:41 AM Yuyun Yan

Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed

2019-02-27 Thread Yuyun Yang via petsc-users
Knepley mailto:knep...@gmail.com>>; petsc-users@mcs.anl.gov<mailto:petsc-users@mcs.anl.gov> Subject: Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed On Wed, Feb 27, 2019 at 10:41 AM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>&

Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed

2019-02-27 Thread Yuyun Yang via petsc-users
t malloc()-ed On Wed, Feb 27, 2019 at 10:41 AM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: I called VecDestroy() in the destructor for this object – is that not the right way to do it? In Domain::testScatters(), you have many VecDuplicate(,), You need to VecDestroy(

Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed

2019-02-27 Thread Yuyun Yang via petsc-users
:50 AM To: Yuyun Yang Cc: Matthew Knepley ; petsc-users@mcs.anl.gov Subject: Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed On Wed, Feb 27, 2019 at 10:41 AM Yuyun Yang via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: I called VecD

Re: [petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed

2019-02-27 Thread Yuyun Yang via petsc-users
: attempting free on address which was not malloc()-ed You call VecDuplicate() a bunch, but VecDestroy() only once in the bottom function. This is wrong. Also, CHECK ALL RETURN CODES. This is the fastest way to find errors. Matt On Wed, Feb 27, 2019 at 2:06 AM Yuyun Yang via petsc-users

[petsc-users] AddressSanitizer: attempting free on address which was not malloc()-ed

2019-02-26 Thread Yuyun Yang via petsc-users
Hello team, I ran into the address sanitizer error that I hope you could help me with. I don't really know what's wrong with the way the code frees memory. The relevant code file is attached. The line number following domain.cpp specifically referenced to the vector _q, which seems a little

[petsc-users] Kronecker product

2019-02-25 Thread Yuyun Yang via petsc-users
Hello team, I'd like to ask whether PETSc has a function to compute the Kronecker product of a sparse matrix with an identity matrix? A Google search didn't lead me to a manual page (like most of the other PETSc functions), so I'm wondering if this has been implemented yet. Thanks very much!

Re: [petsc-users] PetscBinaryRead fails

2019-02-18 Thread Yuyun Yang via petsc-users
unction. > > Thanks a lot! > Yuyun > > -Original Message- > From: Smith, Barry F. > Sent: Monday, February 18, 2019 6:41 PM > To: Yuyun Yang > Cc: petsc-users@mcs.anl.gov > Subject: Re: [petsc-users] PetscBinaryRead fails > > > Send program and data file if you

Re: [petsc-users] PetscBinaryRead fails

2019-02-18 Thread Yuyun Yang via petsc-users
- From: Smith, Barry F. Sent: Monday, February 18, 2019 6:41 PM To: Yuyun Yang Cc: petsc-users@mcs.anl.gov Subject: Re: [petsc-users] PetscBinaryRead fails Send program and data file if you cannot get it to work. > On Feb 18, 2019, at 8:08 PM, Yuyun Yang via petsc-users > wrote: >

[petsc-users] PetscBinaryRead fails

2019-02-18 Thread Yuyun Yang via petsc-users
Hello, I am writing a very simple function just to read in a single value from an input file (which also just contains one single scalar value). Using PetscBinaryRead(fd, , 1, PETSC_SCALAR) gives me the following error. Could you help me figure out why? [0]PETSC ERROR: -