Hello, Jed, in my IJacobian subroutine, I defined a PetscScalar J[4*n][4*n], and filled in the values for this J matrix by MatSetValues().
245 seconds out of the total 351 seconds in the DAE TS solving part are due to this J matrix computation. For that J matrix, half of them are constants values which doesn't change in each iteration. However, since my J is created inside each IJacobian() call, I couldn't reuse it. If that part of work belongs to redundant computation, I would like to know if there's a way to set up the Jacobian matrix outside of the IJacobian() subroutine, so that I can keep the constant part of values in J for all the iterations but only updates the changing values which depends on X? Thanks, Shuangshuang -----Original Message----- From: Jed Brown [mailto:[email protected]] On Behalf Of Jed Brown Sent: Thursday, August 15, 2013 7:27 PM To: Jin, Shuangshuang Cc: [email protected] Subject: RE: [petsc-users] Performance of PETSc TS solver "Jin, Shuangshuang" <[email protected]> writes: > Hi, Jed, > > I followed your suggestion and profiled the IJacobian stage, please see the > related profile below: Cool, all of these are pretty inexpensive, so your time is probably in compu
