<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 26, 2010, at 3:53 PM, Barry Smith wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br> ./configure an optimized version of PETSc (that is with the ./configure flag of --with-debugging=0)</div></blockquote><div><br></div><div><div> ./configure --with -debugging=0</div><div>it says I should config/configure.py --with-mpi=0 --with-debugging=no --download-f-blas-lapack=1</div><div>so I did this.</div><div><br></div><div>When I compile my code again, I got:</div><div><br></div><div><div>gcc -Wall -Wwrite-strings -Wno-strict-aliasing -O -o pihm pihm.o f.o read_alloc.o initialize.o is_sm_et.o update.o print.o -Wl,-rpath,/gpfs/home/xxy113/soft/petsc-3.1-p2/linux-gnu-c-opt/lib -L/gpfs/home/xxy113/soft/petsc-3.1-p2/linux-gnu-c-opt/lib -lpetsc -lX11 -Wl,-rpath,/gpfs/home/xxy113/soft/petsc-3.1-p2/linux-gnu-c-opt/lib -L/gpfs/home/xxy113/soft/petsc-3.1-p2/linux-gnu-c-opt/lib -lflapack -lfblas -lm -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -ldl -lgcc_s -lgfortran -lm -lm -ldl -lgcc_s -ldl </div><div>/usr/bin/ld: cannot find -lpetsc</div><div>collect2: ld returned 1 exit status</div><div><br></div></div><div><br></div></div><div><br></div><br><blockquote type="cite"><div> and run with -log_summary to get a summary of where it is spending the time.</div></blockquote><div><br></div><div><br></div><div><br></div><br><blockquote type="cite"><div> This will give you a better idea of why it is taking so long.<br><br> Barry<br><br>On Jul 26, 2010, at 2:49 PM, Xuan YU wrote:<br><br><blockquote type="cite">Hi,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I am using TS solving a nonlinear problem. I created an approximate data structure for Jacobian matrix to be used with matcoloring, my MatFDColoringView is like this:<br></blockquote><blockquote type="cite"><Picture 1.png><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">But the speed of code is too slow than what I expected. Only 10 time step costs 11seconds!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">What's wrong with my code? How can I speed up?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">This is the ts_view result.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">TS Object:<br></blockquote><blockquote type="cite"> type: beuler<br></blockquote><blockquote type="cite"> maximum steps=100<br></blockquote><blockquote type="cite"> maximum time=10<br></blockquote><blockquote type="cite"> total number of nonlinear solver iterations=186<br></blockquote><blockquote type="cite"> total number of linear solver iterations=423<br></blockquote><blockquote type="cite"> SNES Object:<br></blockquote><blockquote type="cite"> type: ls<br></blockquote><blockquote type="cite"> line search variant: SNESLineSearchCubic<br></blockquote><blockquote type="cite"> alpha=0.0001, maxstep=1e+08, minlambda=1e-12<br></blockquote><blockquote type="cite"> maximum iterations=50, maximum function evaluations=10000<br></blockquote><blockquote type="cite"> tolerances: relative=1e-08, absolute=1e-50, solution=1e-08<br></blockquote><blockquote type="cite"> total number of linear solver iterations=1<br></blockquote><blockquote type="cite"> total number of function evaluations=19<br></blockquote><blockquote type="cite"> KSP Object:<br></blockquote><blockquote type="cite"> type: gmres<br></blockquote><blockquote type="cite"> GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<br></blockquote><blockquote type="cite"> GMRES: happy breakdown tolerance 1e-30<br></blockquote><blockquote type="cite"> maximum iterations=10000, initial guess is zero<br></blockquote><blockquote type="cite"> tolerances: relative=1e-05, absolute=1e-50, divergence=10000<br></blockquote><blockquote type="cite"> left preconditioning<br></blockquote><blockquote type="cite"> using PRECONDITIONED norm type for convergence test<br></blockquote><blockquote type="cite"> PC Object:<br></blockquote><blockquote type="cite"> type: ilu<br></blockquote><blockquote type="cite"> ILU: out-of-place factorization<br></blockquote><blockquote type="cite"> 0 levels of fill<br></blockquote><blockquote type="cite"> tolerance for zero pivot 1e-12<br></blockquote><blockquote type="cite"> using diagonal shift to prevent zero pivot<br></blockquote><blockquote type="cite"> matrix ordering: natural<br></blockquote><blockquote type="cite"> factor fill ratio given 1, needed 1<br></blockquote><blockquote type="cite"> Factored matrix follows:<br></blockquote><blockquote type="cite"> Matrix Object:<br></blockquote><blockquote type="cite"> type=seqaij, rows=1838, cols=1838<br></blockquote><blockquote type="cite"> package used to perform factorization: petsc<br></blockquote><blockquote type="cite"> total: nonzeros=8464, allocated nonzeros=8464<br></blockquote><blockquote type="cite"> total number of mallocs used during MatSetValues calls =0<br></blockquote><blockquote type="cite"> not using I-node routines<br></blockquote><blockquote type="cite"> linear system matrix = precond matrix:<br></blockquote><blockquote type="cite"> Matrix Object:<br></blockquote><blockquote type="cite"> type=seqaij, rows=1838, cols=1838<br></blockquote><blockquote type="cite"> total: nonzeros=8464, allocated nonzeros=9745<br></blockquote><blockquote type="cite"> total number of mallocs used during MatSetValues calls =37<br></blockquote><blockquote type="cite"> not using I-node routines<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Xuan YU<br></blockquote><blockquote type="cite"><a href="mailto:xxy113@psu.edu">xxy113@psu.edu</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><br><br></div></blockquote></div><br><div apple-content-edited="true"> <div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Xuan YU (<span class="Apple-style-span" style="font-family: arial; font-size: 16px; white-space: pre; ">俞烜<span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; white-space: normal; ">)</span></span></div><div><a href="mailto:xxy113@psu.edu">xxy113@psu.edu</a></div><div><br></div></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"> </div><br></body></html>