[petsc-users] function name and meaning of -pc_fieldsplit_schur_factorization_type
2) It would be nice to know what exactly is being dropped. full is obvious and apparently diag drops the right most matrix, but what do lower and upper drop? http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/PC/PCFIELDSPLIT.html 3) I'm confused about the minus sign in the diag form and its motivation. It doesn't come from the factorization. Is the rhs multiplied with a minus sign as well? Why not follow the sign convention of Elman's taxonomy (eq 3 and 4, JCP 227, 2008)? It makes the PC positive definite. Matt Thanks Matt, these petsc-dev manual pages are much clearer than current. dr. ir. Christiaan Klaij CFD Researcher Research Development E mailto:C.Klaij at marin.nl T +31 317 49 33 44 MARIN 2, Haagsteeg, P.O. Box 28, 6700 AA Wageningen, The Netherlands T +31 317 49 39 11, F +31 317 49 32 45, I www.marin.nl
[petsc-users] function name and meaning of -pc_fieldsplit_schur_factorization_type
The manual page 87 states that there are several variants of the Schur complement preconditioner obtained by dropping some of the terms, these can be obtained with -pc_fieldsplit_schur_factorization_type diag,lower,upper,full 1) What is (will be) the name of the corresponding function? It looks like PCFieldSplitSetSchurFactorizationType() is missing. Would be nice to have. 3) I'm confused about the minus sign in the diag form and its motivation. It doesn't come from the factorization. Is the rhs multiplied with a minus sign as well? Why not follow the sign convention of Elman's taxonomy (eq 3 and 4, JCP 227, 2008)? Elman's convention is rather specific to finite element discretization of incompressible flow. He arbitrarily slaps a negative on one of the matrices in the system because it represents a certain kind of stabilization. That minus sign would be pretty silly if the matrix was actually positive (mixed elasticity, finite-time step stiff waves, etc). The negative sign in the DIAG form appears because the minimal polynomial with that preconditioner has degree 3 (for a nonsingular problem) if you have a minus sign there. Read Murphy's note: http://eprints.maths.ox.ac.uk/1291/1/NA-99-07.pdf If you skip that minus sign, that property goes away. Also, if you are solving Stokes flow or constrained problems in elasticity, that sign convention causes the DIAG form to be positive definite which means that you could use it with MINRES which was is the main motivation for using DIAG in the first place. Jed, thanks for pointing me to Murphy's note, I didn't realize we were allowed to choose the sign in this case. It's rather counter-intuitive to have a preconditioner which is not an approximate inverse. dr. ir. Christiaan Klaij CFD Researcher Research Development E mailto:C.Klaij at marin.nl T +31 317 49 33 44 MARIN 2, Haagsteeg, P.O. Box 28, 6700 AA Wageningen, The Netherlands T +31 317 49 39 11, F +31 317 49 32 45, I www.marin.nl
[petsc-users] real and complex numbers
Thank you for your help. Using h5py I finally wrote a 10 lines python script that translates a real hdf5 file to a complex one. On Sun, Mar 18, 2012 at 8:57 PM, Jed Brown jedbrown at mcs.anl.gov wrote: On Sun, Mar 18, 2012 at 14:52, Barry Smith bsmith at mcs.anl.gov wrote: Just run your single code in complex numbers (where the nonlinear part may have zero imaginary part). You are introducing a complicated work flow (saving to files ...) (that is also not well supported in PETSc) just to save some work on the nonlinear part when generally most nonlinear solvers spend much more time in the linear solve than the nonlinear computations. Make your life easy, just use complex numbers; your time is much more valuable than the computers. Also, if the nonlinear function is very expensive, you can read the state from the Vec into PetscReal locally (e.g. one stencil at a time) and compute with reals. Writing to files creates a _serious_ bottleneck that will likely take orders of magnitude longer than everything else your code does if you scale it to large problems/computers. -- next part -- An HTML attachment was scrubbed... URL: http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120319/40622dc4/attachment.htm
[petsc-users] Solving a Linear System with two different Solvers (one each thread)..?
Hello Petsc Team, I has some experience with PETSc + MPI, but neither with PETSc+Pthreads nor Pthreads alone. Taking in to account that pthread was recenltly added to petsc, is it possible to code a program that solve the same linear system with two different solvers, one on each thread?. I guess that can be done calling different ksp object, one on each thread, but I don't have clear, first if this is possible and second how to do that. Sorry if my question is meaningless, I just started to study pthreads. I will really appreciated any advice. Thanks in advance. Best Regards -- Pedro Torres -- next part -- An HTML attachment was scrubbed... URL: http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120319/685c6583/attachment.htm
[petsc-users] Solving a Linear System with two different Solvers (one each thread)..?
On Mon, Mar 19, 2012 at 15:47, Pedro Torres torres.pedrozpk at gmail.comwrote: I has some experience with PETSc + MPI, but neither with PETSc+Pthreads nor Pthreads alone. Taking in to account that pthread was recenltly added to petsc, is it possible to code a program that solve the same linear system with two different solvers, one on each thread?. I guess that can be done calling different ksp object, one on each thread, but I don't have clear, first if this is possible and second how to do that. Sorry if my question is meaningless, I just started to study pthreads. I will really appreciated any advice. Thanks in advance. No, the threading model does not work like this (and the performance of a system that did work that way would be a delicate beast). -- next part -- An HTML attachment was scrubbed... URL: http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120319/7170cb21/attachment.htm
[petsc-users] Solving a Linear System with two different Solvers (one each thread)..?
Jed, thanks for your response. 2012/3/19 Jed Brown jedbrown at mcs.anl.gov On Mon, Mar 19, 2012 at 15:47, Pedro Torres torres.pedrozpk at gmail.comwrote: I has some experience with PETSc + MPI, but neither with PETSc+Pthreads nor Pthreads alone. Taking in to account that pthread was recenltly added to petsc, is it possible to code a program that solve the same linear system with two different solvers, one on each thread?. I guess that can be done calling different ksp object, one on each thread, but I don't have clear, first if this is possible and second how to do that. Sorry if my question is meaningless, I just started to study pthreads. I will really appreciated any advice. Thanks in advance. No, the threading model does not work like this (and the performance of a system that did work that way would be a delicate beast). Ok, so the only way to implement that is coding by hand each algorithm for each thread, rigth?. Anyway, at least can I use petsc object like Vec/Mat on each thread?. Thanks for your help! -- Pedro Torres -- next part -- An HTML attachment was scrubbed... URL: http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120319/4064536d/attachment.htm
[petsc-users] Solving a Linear System with two different Solvers (one each thread)..?
Pedro, Taking in to account that pthread was recenltly added to petsc, is it possible to code a program that solve the same linear system with two different solvers, one on each thread?. I guess that can be done calling different ksp object, one on each thread, but I don't have clear, first if this is possible and second how to do that. No, this is not possible currently and may not be available in the future too. I don't think there may be any performance benefit by solving the same linear system using different KSPs on different threads. What are you trying to do using pthreads in PETSc? Shri - Original Message - Hello Petsc Team, I has some experience with PETSc + MPI, but neither with PETSc+Pthreads nor Pthreads alone. Taking in to account that pthread was recenltly added to petsc, is it possible to code a program that solve the same linear system with two different solvers, one on each thread?. I guess that can be done calling different ksp object, one on each thread, but I don't have clear, first if this is possible and second how to do that. Sorry if my question is meaningless, I just started to study pthreads. I will really appreciated any advice. Thanks in advance. Best Regards -- Pedro Torres -- next part -- An HTML attachment was scrubbed... URL: http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120319/35dbe609/attachment.htm
[petsc-users] -ksp_diagonal_scale question
I was looking at the documentation for KSPSetDiagonalScale and it contains this comment: This routine is only used if the matrix and preconditioner matrix are the same thing. However,?I have found that even if the matrix and preconditioner are different, using the -ksp_diagonal_scale command line argument changes the convergence behavior of the solvers. Is the man page correct? Also, can you point me towards documentation of the type of scaling that is applied? Thanks for your help, Max Rudolph
[petsc-users] AOCreateMapping
Hi, When using AOCreateMapping, it is not possible to ask for mapping of indecies that do not exist in the AO -- You get [0]PETSC ERROR: Argument out of range! : [0]PETSC ERROR: - Error Message [0]PETSC ERROR: Argument out of range! [0]PETSC ERROR: Invalid input index 21! [0]PETSC ERROR: [0]PETSC ERROR: Petsc Release Version 3.2.0, Patch 6, Wed Jan 11 09:28:45 CST 2012 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: [0]PETSC ERROR: ./petsc on a arch-linu named mohammad-laptop by mohammad Mon Mar 19 17:16:13 2012 [0]PETSC ERROR: Libraries linked from /home/mohammad/soft/petsc-3.2-p6/arch-linux2-cxx-debug/lib [0]PETSC ERROR: Configure run at Thu Feb 16 02:16:40 2012 [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --with-clanguage=cxx --download-f-blas-lapack=1 --download-mpich=1 --download-hypre=1 --download-ml=1 --with-parmetis-include=/home/mohammad/soft/parmetis/include --with-parmetis-lib=-L/home/mohammad/soft/parmetis/lib -lparmetis -lmetis --download-superlu_dist=1 [0]PETSC ERROR: [0]PETSC ERROR: AOApplicationToPetsc_Mapping() line 136 in /home/mohammad/soft/petsc-3.2-p6/src/dm/ao/impls/mapping/aomapping.c [0]PETSC ERROR: AOApplicationToPetsc() line 250 in /home/mohammad/soft/petsc-3.2-p6/src/dm/ao/interface/ao.c Is there an easy way to have the AO return a flag integer (like -1) for nodes that do not exist in the AO? Mohammad -- next part -- An HTML attachment was scrubbed... URL: http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120319/32ffa7d4/attachment.htm
[petsc-users] errors in compiling ~\petsc-3.2-p7\src\ksp\ksp\examples\tutorials\ex2f.F
Hello, I am trying to compile the example source code of ~\petsc-3.2-p7\src\ksp\ksp\examples\tutorials\ex2f.F. However the error information shows: ex2f.o: In function `MAIN__':ex2f.F90:(.text+0x1b): undefined reference to `_gfortran_set_std'ex2f.F90:(.text+0x6f1): undefined reference to `_gfortran_st_write'ex2f.F90:(.text+0x706): undefined reference to `_gfortran_transfer_real'ex2f.F90:(.text+0x71b): undefined reference to `_gfortran_transfer_integer'ex2f.F90:(.text+0x727): undefined reference to `_gfortran_st_write_done'ex2f.F90:(.text+0x773): undefined reference to `_gfortran_st_write'ex2f.F90:(.text+0x788): undefined reference to `_gfortran_transfer_integer'ex2f.F90:(.text+0x794): undefined reference to `_gfortran_st_write_done'ex2f.o: In function `mykspmonitor_':ex2f.F90:(.text+0x896): undefined reference to `_gfortran_st_write'ex2f.F90:(.text+0x8ae): undefined reference to `_gfortran_transfer_integer'ex2f.F90:(.text+0x8ba): undefined reference to `_gfortran_st_write_done'ex2f.F90:(.text+0x924): undefined reference to `_gfortran_st_write'ex2f.F90:(.text+0x93c): undefined reference to `_gfortran_transfer_integer'ex2f.F90:(.text+0x954): undefined reference to `_gfortran_transfer_real'ex2f.F90:(.text+0x960): undefined reference to `_gfortran_st_write_done'make: *** [ex2f] Error 1 My makefile is like this: PETSC_DIR =/usr/global/petsc/3.1-p8PETSC_ARCH =linux-intel11-debugFFLAGS = -I${PETSC_DIR}/include -I${PETSC_DIR}/${PETSC_ARCH}/includeLFLAGS = -L${PETSC_DIR}/${PETSC_ARCH}/lib -lpetsc\ -L/usr/global/intel/mkl/10.3.1.107/mkl/lib/intel64\ -Wl,-R/usr/global/intel/mkl/10.3.1.107/mkl/lib/intel64\ -lmkl_solver_lp64_sequential\ -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group\ -lX11 FC = mpif90BIN = ex2fOBJS= ex2f.o ${BIN}: ${OBJS}${FC} -o ex2f ${OBJS} ${LFLAGS} ex2f.o:ex2f.F90 ${FC} -c ${FFLAGS} ex2f.F90 clean: rm -f ex2f *.o Should there any more libraries be included in the makefile? -- next part -- An HTML attachment was scrubbed... URL: http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120319/02ce31b4/attachment.htm
[petsc-users] errors in compiling ~\petsc-3.2-p7\src\ksp\ksp\examples\tutorials\ex2f.F
Run make ex5f on src/snes/examples/tutorials Does that compile and link correctly? Note all the libraries that being linked (they are printed to the screen) and make sure you have them all. Also note that you must use the same BLAS in building PETSc that you link against. So make sure you built PETSc with the mkl libraries. Barry On Mar 19, 2012, at 9:18 PM, Roc Wang wrote: Hello, I am trying to compile the example source code of ~\petsc-3.2-p7\src\ksp\ksp\examples\tutorials\ex2f.F. However the error information shows: ex2f.o: In function `MAIN__': ex2f.F90:(.text+0x1b): undefined reference to `_gfortran_set_std' ex2f.F90:(.text+0x6f1): undefined reference to `_gfortran_st_write' ex2f.F90:(.text+0x706): undefined reference to `_gfortran_transfer_real' ex2f.F90:(.text+0x71b): undefined reference to `_gfortran_transfer_integer' ex2f.F90:(.text+0x727): undefined reference to `_gfortran_st_write_done' ex2f.F90:(.text+0x773): undefined reference to `_gfortran_st_write' ex2f.F90:(.text+0x788): undefined reference to `_gfortran_transfer_integer' ex2f.F90:(.text+0x794): undefined reference to `_gfortran_st_write_done' ex2f.o: In function `mykspmonitor_': ex2f.F90:(.text+0x896): undefined reference to `_gfortran_st_write' ex2f.F90:(.text+0x8ae): undefined reference to `_gfortran_transfer_integer' ex2f.F90:(.text+0x8ba): undefined reference to `_gfortran_st_write_done' ex2f.F90:(.text+0x924): undefined reference to `_gfortran_st_write' ex2f.F90:(.text+0x93c): undefined reference to `_gfortran_transfer_integer' ex2f.F90:(.text+0x954): undefined reference to `_gfortran_transfer_real' ex2f.F90:(.text+0x960): undefined reference to `_gfortran_st_write_done' make: *** [ex2f] Error 1 My makefile is like this: PETSC_DIR =/usr/global/petsc/3.1-p8 PETSC_ARCH=linux-intel11-debug FFLAGS = -I${PETSC_DIR}/include -I${PETSC_DIR}/${PETSC_ARCH}/include LFLAGS = -L${PETSC_DIR}/${PETSC_ARCH}/lib -lpetsc\ -L/usr/global/intel/mkl/10.3.1.107/mkl/lib/intel64\ -Wl,-R/usr/global/intel/mkl/10.3.1.107/mkl/lib/intel64\ -lmkl_solver_lp64_sequential\ -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group\ -lX11 FC = mpif90 BIN = ex2f OBJS= ex2f.o ${BIN}: ${OBJS} ${FC} -o ex2f ${OBJS} ${LFLAGS} ex2f.o:ex2f.F90 ${FC} -c ${FFLAGS} ex2f.F90 clean: rm -f ex2f *.o Should there any more libraries be included in the makefile?