From mpivi at slac.stanford.edu Tue Jan 1 21:21:21 2008 From: mpivi at slac.stanford.edu (Pivi, Mauro Torino Francesco) Date: Tue, 1 Jan 2008 19:21:21 -0800 Subject: libX11.so.6 Message-ID: I have just installed PETSC on a x86_64-linux machine. I am at the level of running the first exercises and after "make" and running the ex2.c file in parallel I get the message "./ex2: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory" WHAT SHOULD I DO?? I spent few days with this. Please, help. PS: I used the link found the file libX11.so.6 in the directory /usr/X11R6/lib. Thus I run configure.py again with the option --with-x-include=/usr/X11R6/lib But NO IMPROOVEMENT. Thank you! Mauro From bsmith at mcs.anl.gov Tue Jan 1 21:42:33 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 1 Jan 2008 21:42:33 -0600 Subject: libX11.so.6 In-Reply-To: References: Message-ID: <657B41CA-81F0-4AEB-9036-116A17CEB924@mcs.anl.gov> Please send configure.log and make_log and bmake/$PETSC_ARCH/ petscconf On Jan 1, 2008, at 9:21 PM, Pivi, Mauro Torino Francesco wrote: > I have just installed PETSC on a x86_64-linux machine. > > I am at the level of running the first exercises and after "make" > and running the ex2.c file in parallel I get the message > > "./ex2: error while loading shared libraries: libX11.so.6: cannot > open shared object file: No such file or directory" > > WHAT SHOULD I DO?? > I spent few days with this. Please, help. > > PS: I used the link found the file libX11.so.6 in the directory /usr/ > X11R6/lib. Thus I run configure.py again with the option > --with-x-include=/usr/X11R6/lib > But NO IMPROOVEMENT. > > Thank you! > Mauro > From sanjay at ce.berkeley.edu Wed Jan 2 06:11:47 2008 From: sanjay at ce.berkeley.edu (Sanjay Govindjee) Date: Wed, 02 Jan 2008 13:11:47 +0100 Subject: libX11.so.6 In-Reply-To: <657B41CA-81F0-4AEB-9036-116A17CEB924@mcs.anl.gov> References: <657B41CA-81F0-4AEB-9036-116A17CEB924@mcs.anl.gov> Message-ID: <477B7F83.1000101@ce.berkeley.edu> Mauro, on many x86_64-linux machines you need to link with /usr/X11R6/lib64. It depends on the version/distro you are using. -sanjay Barry Smith wrote: > > Please send configure.log and make_log and bmake/$PETSC_ARCH/petscconf > > On Jan 1, 2008, at 9:21 PM, Pivi, Mauro Torino Francesco wrote: > >> I have just installed PETSC on a x86_64-linux machine. >> >> I am at the level of running the first exercises and after "make" and >> running the ex2.c file in parallel I get the message >> >> "./ex2: error while loading shared libraries: libX11.so.6: cannot >> open shared object file: No such file or directory" >> >> WHAT SHOULD I DO?? >> I spent few days with this. Please, help. >> >> PS: I used the link found the file libX11.so.6 in the directory >> /usr/X11R6/lib. Thus I run configure.py again with the option >> --with-x-include=/usr/X11R6/lib >> But NO IMPROOVEMENT. >> >> Thank you! >> Mauro >> > -- ------------------------------------------------------------------------ Sanjay Govindjee, PhD, PE Voice: (510) 642-6060 Professor of Civil Engineering FAX: (510) 643-8928 WWW: http://www.ce.berkeley.edu/~sanjay E-mail: sanjay at ce.berkeley.edu 709 Davis Hall Structural Engineering, Mechanics and Materials Department of Civil Engineering University of California Berkeley, CA 94720-1710 ------------------------------------------------------------------------ From recrusader at gmail.com Wed Jan 2 13:27:31 2008 From: recrusader at gmail.com (Yujie) Date: Wed, 2 Jan 2008 11:27:31 -0800 Subject: how to visit the variable "bs" in pmat of preconditioner In-Reply-To: <219D5EF9-DFFB-409A-B2E3-825C64F1E54E@mcs.anl.gov> References: <7ff0ee010712202316i57a8927ehfaaa933bc7c17304@mail.gmail.com> <219D5EF9-DFFB-409A-B2E3-825C64F1E54E@mcs.anl.gov> Message-ID: <7ff0ee010801021127r189f58eelc1c4e23496be8209@mail.gmail.com> Dear Barry: Thank you for your reply. Further problem is whether I only set the block size of Mat using MatSetBlockSize() in Processor 0 when I run my code on Cluster? thank a lot. Happy new year:). Regards, Yujie On 12/21/07, Barry Smith wrote: > > > pmat is the matrix you set with KSPSetOperators() so you just need > to set block size of that matrix. > > On Dec 21, 2007, at 1:16 AM, Yujie wrote: > > > hi, everyone > > > > now, I want to use Hypre package via PETSc in third package. I need > > to visit the variable "bs" in Mat struct. In hypre.c, this variable > > may let BoomerAMG know the block size of Mat. The code is as follows: > > > > 127: /* special case for BoomerAMG */ > > 128: if (jac->setup == HYPRE_BoomerAMGSetup) { > > 129: MatGetBlockSize(pc->pmat,&bs); > > 130: if (bs > 1) { > > 131: HYPRE_BoomerAMGSetNumFunctions(jac->hsolver,bs); > > 132: } > > 133: }; > > > > However, I can't visit this variable. Now, I have get the pointer of > > PC I use. I can't visit the variable pmat in my code. I can't find > > any function to realize this function from PETSc manual. > > Could you give me some advice about how to do? > > > > Merry X'mas! > > > > Regards, > > Yujie > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Jan 2 13:36:55 2008 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 2 Jan 2008 13:36:55 -0600 Subject: how to visit the variable "bs" in pmat of preconditioner In-Reply-To: <7ff0ee010801021127r189f58eelc1c4e23496be8209@mail.gmail.com> References: <7ff0ee010712202316i57a8927ehfaaa933bc7c17304@mail.gmail.com> <219D5EF9-DFFB-409A-B2E3-825C64F1E54E@mcs.anl.gov> <7ff0ee010801021127r189f58eelc1c4e23496be8209@mail.gmail.com> Message-ID: On Jan 2, 2008 1:27 PM, Yujie wrote: > Dear Barry: > > Thank you for your reply. Further problem is whether I only set the block > size of Mat using MatSetBlockSize() in Processor 0 when I run my code on > Cluster? thank a lot. All processors must set the correct block size. Matt > Happy new year:). > > Regards, > Yujie > > On 12/21/07, Barry Smith wrote: > > > > pmat is the matrix you set with KSPSetOperators() so you just need > > to set block size of that matrix. > > > > On Dec 21, 2007, at 1:16 AM, Yujie wrote: > > > > > hi, everyone > > > > > > now, I want to use Hypre package via PETSc in third package. I need > > > to visit the variable "bs" in Mat struct. In hypre.c, this variable > > > may let BoomerAMG know the block size of Mat. The code is as follows: > > > > > > 127: /* special case for BoomerAMG */ > > > 128: if (jac->setup == HYPRE_BoomerAMGSetup) { > > > 129: MatGetBlockSize(pc->pmat,&bs); > > > 130: if (bs > 1) { > > > 131: HYPRE_BoomerAMGSetNumFunctions(jac->hsolver,bs); > > > 132: } > > > 133: }; > > > > > > However, I can't visit this variable. Now, I have get the pointer of > > > PC I use. I can't visit the variable pmat in my code. I can't find > > > any function to realize this function from PETSc manual. > > > Could you give me some advice about how to do? > > > > > > Merry X'mas! > > > > > > Regards, > > > Yujie > > > > > > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From recrusader at gmail.com Wed Jan 2 13:55:39 2008 From: recrusader at gmail.com (Yujie) Date: Wed, 2 Jan 2008 11:55:39 -0800 Subject: how to visit the variable "bs" in pmat of preconditioner In-Reply-To: References: <7ff0ee010712202316i57a8927ehfaaa933bc7c17304@mail.gmail.com> <219D5EF9-DFFB-409A-B2E3-825C64F1E54E@mcs.anl.gov> <7ff0ee010801021127r189f58eelc1c4e23496be8209@mail.gmail.com> Message-ID: <7ff0ee010801021155h22c9ee73re80f129dd55bf48c@mail.gmail.com> Dear Matthew: Now, in my code, first, I initialize PetSC using PetscInitialize() function. And then, I set the block size of Mat using MatSetBlockSize(). Finally, I solve the equation. Regarding your reply. you mean that PetSC is not reponsible to let all the nodes know the block size of Mat. Ineed to set this size at each nodes? In addition, where will PC and its relevant parameters exist? Because I meet the following error when I set the size after I initiliaze the PetSC. [1]PETSC ERROR: MatSetBlockSize() line 5204 in src/mat/interface/matrix.c [5]PETSC ERROR: [13]PETSC ERROR: --------------------- Error Message ------------------------------------ [13]PETSC ERROR: Null argument, when expecting valid pointer! [13]PETSC ERROR: Null Object: Parameter # 1! [14]PETSC ERROR: --------------------- Error Message ------------------------------------ [14]PETSC ERROR: Null argument, when expecting valid pointer! [14]PETSC ERROR: Null Object: Parameter # 1! [14]PETSC ERROR: ------------------------------------------------------------------------ [14]PETSC ERROR: Petsc Release Version 2.3.3, Patch 8, Fri Nov 16 17:03:40 CST 2007 HG revision: 414581156e67e55c761739b0deb119f7590d0f4b [14]PETSC ERROR: See docs/changes/index.html for recent updates. [14]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [14]PETSC ERROR: See docs/index.html for manual pages. thanks a lot. Regards, Yujie On 1/2/08, Matthew Knepley < knepley at gmail.com> wrote: > > On Jan 2, 2008 1:27 PM, Yujie wrote: > > Dear Barry: > > > > Thank you for your reply. Further problem is whether I only set the > block > > size of Mat using MatSetBlockSize() in Processor 0 when I run my code on > > Cluster? thank a lot. > > All processors must set the correct block size. > > Matt > > > Happy new year:). > > > > Regards, > > Yujie > > > > On 12/21/07, Barry Smith wrote: > > > > > > pmat is the matrix you set with KSPSetOperators() so you just need > > > > to set block size of that matrix. > > > > > > On Dec 21, 2007, at 1:16 AM, Yujie wrote: > > > > > > > hi, everyone > > > > > > > > now, I want to use Hypre package via PETSc in third package. I need > > > > to visit the variable "bs" in Mat struct. In hypre.c, this variable > > > > may let BoomerAMG know the block size of Mat. The code is as > follows: > > > > > > > > 127: /* special case for BoomerAMG */ > > > > 128: if (jac->setup == HYPRE_BoomerAMGSetup) { > > > > 129: MatGetBlockSize(pc->pmat,&bs); > > > > 130: if (bs > 1) { > > > > 131: HYPRE_BoomerAMGSetNumFunctions(jac->hsolver,bs); > > > > 132: } > > > > 133: }; > > > > > > > > However, I can't visit this variable. Now, I have get the pointer of > > > > > PC I use. I can't visit the variable pmat in my code. I can't find > > > > any function to realize this function from PETSc manual. > > > > Could you give me some advice about how to do? > > > > > > > > Merry X'mas! > > > > > > > > Regards, > > > > Yujie > > > > > > > > > > > > > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grs2103 at columbia.edu Sat Jan 5 19:54:12 2008 From: grs2103 at columbia.edu (Gideon Simpson) Date: Sat, 5 Jan 2008 20:54:12 -0500 Subject: block matrices Message-ID: <76348918-49BE-4063-8860-70BE68B7B3BC@columbia.edu> Suppose I have two sparse matrices A and Q and now I want to construct a block diagonal matrix, K, K = [A,0] [0,Q] What is the "right" way to do this is? -Gideon Simpson Department of Applied Physics and Applied Mathematics Columbia University -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Sun Jan 6 07:40:29 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 6 Jan 2008 07:40:29 -0600 Subject: block matrices In-Reply-To: <76348918-49BE-4063-8860-70BE68B7B3BC@columbia.edu> References: <76348918-49BE-4063-8860-70BE68B7B3BC@columbia.edu> Message-ID: Gideon, It really depends on what you want to use this new matrix for? If you wish to do matrix vector products with it then I would suggest making a shell matrix that then calls the matrix vector product on each part. In other words, if possible you probably want to avoid explicitly constructing this entire new matrix, unless you really need it. Barry On Jan 5, 2008, at 7:54 PM, Gideon Simpson wrote: > Suppose I have two sparse matrices A and Q and now I want to > construct a block diagonal matrix, K, > > K = [A,0] > [0,Q] > > What is the "right" way to do this is? > > > -Gideon Simpson > Department of Applied Physics and Applied Mathematics > Columbia University > > From grs2103 at columbia.edu Sun Jan 6 09:27:58 2008 From: grs2103 at columbia.edu (Gideon Simpson) Date: Sun, 6 Jan 2008 10:27:58 -0500 Subject: block matrices In-Reply-To: References: <76348918-49BE-4063-8860-70BE68B7B3BC@columbia.edu> Message-ID: <4F6C8BED-CA58-4907-9C0F-7AE7041CE885@columbia.edu> Ok, I should have been more explicit. I'm trying to implement the Elman et al. style preconditioner for Stokes using FEniCS and dolfin, in which the system: K = [A B^T; B 0] A the vector laplacian, B the divergence operator, B^T the gradient operator, is preconditioned with an approximate inverse of P = [ A 0; 0 Q] where A is still the vector laplacian, and Q is the pressure mass matrix. Matrix A naturally appears in the construction of matrix K, but matrix Q will be constructed separately. I can grab matrix A as a submatrix from K, but the question then becomes how to assemble them into a matrix P to hand off to: KSPSetOperators(ksp, K, P, SAME_NONZERO_PATTERN); On Jan 6, 2008, at 8:40 AM, Barry Smith wrote: > Gideon, > > It really depends on what you want to use this new matrix for? If > you wish to do > matrix vector products with it then I would suggest making a shell > matrix that then > calls the matrix vector product on each part. In other words, if > possible you probably > want to avoid explicitly constructing this entire new matrix, > unless you really need > it. > > Barry > > > On Jan 5, 2008, at 7:54 PM, Gideon Simpson wrote: > >> Suppose I have two sparse matrices A and Q and now I want to >> construct a block diagonal matrix, K, >> >> K = [A,0] >> [0,Q] >> >> What is the "right" way to do this is? >> >> >> -Gideon Simpson >> Department of Applied Physics and Applied Mathematics >> Columbia University >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From li76pan at yahoo.com Mon Jan 7 04:21:23 2008 From: li76pan at yahoo.com (li pan) Date: Mon, 7 Jan 2008 02:21:23 -0800 (PST) Subject: vector component product Message-ID: <945293.17563.qm@web36812.mail.mud.yahoo.com> Dear all, I want to calculate component product of two vectors. If I have two vectors u and v, I want to have result as w(i) = u(i)*v(i). Is there a function in petsc to finish this job? thanx pan ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping From dave.mayhem23 at gmail.com Mon Jan 7 04:37:04 2008 From: dave.mayhem23 at gmail.com (Dave May) Date: Mon, 7 Jan 2008 21:37:04 +1100 Subject: vector component product In-Reply-To: <945293.17563.qm@web36812.mail.mud.yahoo.com> References: <945293.17563.qm@web36812.mail.mud.yahoo.com> Message-ID: <956373f0801070237j2f177216ted432eae4d0d0967@mail.gmail.com> PetscErrorCode VecPointwiseMult(Vec w, Vec x,Vec y) On Jan 7, 2008 9:21 PM, li pan wrote: > Dear all, > I want to calculate component product of two vectors. > If I have two vectors u and v, I want to have result > as w(i) = u(i)*v(i). Is there a function in petsc to > finish this job? > > thanx > > pan > > > > ____________________________________________________________________________________ > Looking for last minute shopping deals? > Find them fast with Yahoo! Search. > http://tools.search.yahoo.com/newsearch/category.php?category=shopping > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grs2103 at columbia.edu Mon Jan 7 15:19:38 2008 From: grs2103 at columbia.edu (Gideon Simpson) Date: Mon, 7 Jan 2008 16:19:38 -0500 Subject: block preconditioning questions Message-ID: Is there a robust way to implement the following? Suppose I have a block diagonal matrix P = [A 0; 0 Q]; and I know the indices of A and Q in this block matrix. I now want to apply different preconditioners on the A block and on the Q block. One way, that I've had some success with, is to write a PCSHELL, where I split the input and output vectors using index sets and apply the relevant preconditioner on each of these. However, this hardwires things, and I was wondering if there was another method. -gideon -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdettrick at gmail.com Mon Jan 7 15:30:32 2008 From: sdettrick at gmail.com (Sean Dettrick) Date: Mon, 7 Jan 2008 16:30:32 -0500 Subject: SNES Convergence Message-ID: <44114ec40801071330y31ffbbb3x74923a3fa8c814be@mail.gmail.com> Hi, I am solving a version of the Grad-Shafranov equation, F(x)=0, which but for some extra spatial dependences is similar in form to the 2D Bratu equation in snes/examples/tutorials/ex5.c. I started with the ex5.c code, introducing just enough changes to model the new system. The analytic Jacobian function appears to be correct, with a Norm of matrix ratio < 1.e9(found using -snes_type test). The problem I am having is that in most cases the SNES solver does not converge to a solution x of F(x)=0. Rather, what happens is that the fnorm (obtained in a monitor function) converges to some large non-zero value, and F(x) seems to get "stuck", i.e. it converges to a large non-zero result. Even though it is clearly not a solution, the -snes_converged_reason is reported as "Nonlinear solve converged due to CONVERGED_TR_DELTA". The intermediate KSP steps have -ksp_converged_reason reported as "Linear solve converged due to CONVERGED_STEP_LENGTH". I have been typically running with parameters -da_grid_x 100 -da_grid_y 101 -snes_converged_reason -ksp_converged_reason -snes_type tr -ksp_type gmres -snes_max_it 100. Does this sound like a familiar scenario with a familiar solution? Or can anyone point me to some documentation that describes the SNES tr and ls parameters in more detail than the manual.pdf? Or can anyone recommend the best SNES and KSP parameters for the Bratu example? Any help or advice would be greatly appreciated. Thanks, Sean Dettrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Mon Jan 7 15:35:33 2008 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 7 Jan 2008 15:35:33 -0600 Subject: SNES Convergence In-Reply-To: <44114ec40801071330y31ffbbb3x74923a3fa8c814be@mail.gmail.com> References: <44114ec40801071330y31ffbbb3x74923a3fa8c814be@mail.gmail.com> Message-ID: Are you sure that this problem (or at least what is coded) has real solutions? The behavior you see, Newton crapping out due to small updates, can easily happen when you have imaginary solutions, such as x^2 + 2 = 0. I would first try to test it in a regime in which you have an exact or asymptotic solution. Matt On Jan 7, 2008 3:30 PM, Sean Dettrick wrote: > Hi, > > I am solving a version of the Grad-Shafranov equation, F(x)=0, which but > for some extra spatial dependences is similar in form to the 2D Bratu > equation in snes/examples/tutorials/ex5.c. I started with the ex5.c code, > introducing just enough changes to model the new system. The analytic > Jacobian function appears to be correct, with a Norm of matrix ratio < 1.e9 > (found using -snes_type test). > > The problem I am having is that in most cases the SNES solver does not > converge to a solution x of F(x)=0. Rather, what happens is that the fnorm > (obtained in a monitor function) converges to some large non-zero value, and > F(x) seems to get "stuck", i.e. it converges to a large non-zero result. > Even though it is clearly not a solution, the -snes_converged_reason is > reported as "Nonlinear solve converged due to CONVERGED_TR_DELTA". The > intermediate KSP steps have -ksp_converged_reason reported as "Linear solve > converged due to CONVERGED_STEP_LENGTH". I have been typically running with > parameters -da_grid_x 100 -da_grid_y 101 -snes_converged_reason > -ksp_converged_reason -snes_type tr -ksp_type gmres -snes_max_it 100. > > Does this sound like a familiar scenario with a familiar solution? Or can > anyone point me to some documentation that describes the SNES tr and ls > parameters in more detail than the manual.pdf? > Or can anyone recommend the best SNES and KSP parameters for the Bratu > example? > > Any help or advice would be greatly appreciated. > > Thanks, > Sean Dettrick > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From bsmith at mcs.anl.gov Mon Jan 7 15:35:35 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 7 Jan 2008 15:35:35 -0600 Subject: SNES Convergence In-Reply-To: <44114ec40801071330y31ffbbb3x74923a3fa8c814be@mail.gmail.com> References: <44114ec40801071330y31ffbbb3x74923a3fa8c814be@mail.gmail.com> Message-ID: <35015C1B-3FDA-448A-8F1B-9DEEC02434DB@mcs.anl.gov> Sean, Can you run the ls version with the additional options -info - snes_monitor and send the results? You could also make a run with -snes_mf_operator and see if that "converges" in the same way or not (this is another check that the analytic Jacobian is right/wrong). Thanks Barry On Jan 7, 2008, at 3:30 PM, Sean Dettrick wrote: > Hi, > > I am solving a version of the Grad-Shafranov equation, F(x)=0, which > but for some extra spatial dependences is similar in form to the 2D > Bratu equation in snes/examples/tutorials/ex5.c. I started with the > ex5.c code, introducing just enough changes to model the new > system. The analytic Jacobian function appears to be correct, with > a Norm of matrix ratio < 1.e9 (found using -snes_type test). > > The problem I am having is that in most cases the SNES solver does > not converge to a solution x of F(x)=0. Rather, what happens is > that the fnorm (obtained in a monitor function) converges to some > large non-zero value, and F(x) seems to get "stuck", i.e. it > converges to a large non-zero result. Even though it is clearly not > a solution, the -snes_converged_reason is reported as "Nonlinear > solve converged due to CONVERGED_TR_DELTA". The intermediate KSP > steps have -ksp_converged_reason reported as "Linear solve converged > due to CONVERGED_STEP_LENGTH". I have been typically running with > parameters -da_grid_x 100 -da_grid_y 101 -snes_converged_reason - > ksp_converged_reason -snes_type tr -ksp_type gmres -snes_max_it 100. > > Does this sound like a familiar scenario with a familiar solution? > Or can anyone point me to some documentation that describes the SNES > tr and ls parameters in more detail than the manual.pdf? > Or can anyone recommend the best SNES and KSP parameters for the > Bratu example? > > Any help or advice would be greatly appreciated. > > Thanks, > Sean Dettrick From sdettrick at gmail.com Mon Jan 7 18:37:40 2008 From: sdettrick at gmail.com (Sean Dettrick) Date: Mon, 7 Jan 2008 19:37:40 -0500 Subject: SNES Convergence In-Reply-To: <35015C1B-3FDA-448A-8F1B-9DEEC02434DB@mcs.anl.gov> References: <44114ec40801071330y31ffbbb3x74923a3fa8c814be@mail.gmail.com> <35015C1B-3FDA-448A-8F1B-9DEEC02434DB@mcs.anl.gov> Message-ID: <44114ec40801071637oe0c074fwbb81caacbe8ed6fa@mail.gmail.com> On Jan 7, 2008 4:35 PM, Barry Smith wrote: > > Sean, > > Can you run the ls version with the additional options -info - > snes_monitor and send > the results? Hi Barry, Attached are the gzipped results. It says something about an inconsistent rhs. Could that be the problem? And what would the rhs in question be? You could also make a run with -snes_mf_operator and see > if that "converges" > in the same way or not (this is another check that the analytic > Jacobian is right/wrong). I tried that, and it seemed to do the same thing. Thanks a lot for the feedback. Sean > > > Thanks > > Barry > > On Jan 7, 2008, at 3:30 PM, Sean Dettrick wrote: > > > Hi, > > > > I am solving a version of the Grad-Shafranov equation, F(x)=0, which > > but for some extra spatial dependences is similar in form to the 2D > > Bratu equation in snes/examples/tutorials/ex5.c. I started with the > > ex5.c code, introducing just enough changes to model the new > > system. The analytic Jacobian function appears to be correct, with > > a Norm of matrix ratio < 1.e9 (found using -snes_type test). > > > > The problem I am having is that in most cases the SNES solver does > > not converge to a solution x of F(x)=0. Rather, what happens is > > that the fnorm (obtained in a monitor function) converges to some > > large non-zero value, and F(x) seems to get "stuck", i.e. it > > converges to a large non-zero result. Even though it is clearly not > > a solution, the -snes_converged_reason is reported as "Nonlinear > > solve converged due to CONVERGED_TR_DELTA". The intermediate KSP > > steps have -ksp_converged_reason reported as "Linear solve converged > > due to CONVERGED_STEP_LENGTH". I have been typically running with > > parameters -da_grid_x 100 -da_grid_y 101 -snes_converged_reason - > > ksp_converged_reason -snes_type tr -ksp_type gmres -snes_max_it 100. > > > > Does this sound like a familiar scenario with a familiar solution? > > Or can anyone point me to some documentation that describes the SNES > > tr and ls parameters in more detail than the manual.pdf? > > Or can anyone recommend the best SNES and KSP parameters for the > > Bratu example? > > > > Any help or advice would be greatly appreciated. > > > > Thanks, > > Sean Dettrick > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ls_result.gz Type: application/x-gzip Size: 2600 bytes Desc: not available URL: From bsmith at mcs.anl.gov Mon Jan 7 19:56:23 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 7 Jan 2008 19:56:23 -0600 Subject: SNES Convergence In-Reply-To: <44114ec40801071637oe0c074fwbb81caacbe8ed6fa@mail.gmail.com> References: <44114ec40801071330y31ffbbb3x74923a3fa8c814be@mail.gmail.com> <35015C1B-3FDA-448A-8F1B-9DEEC02434DB@mcs.anl.gov> <44114ec40801071637oe0c074fwbb81caacbe8ed6fa@mail.gmail.com> Message-ID: Your initial function norm is so big as to be obscene; 10^7. I think you need a much better initial guess to make progress. What happens with the same options and da grid of say 8 by 8? Does it converge nicely or still mess up. ex5.c stinks because it does not support grid sequencing: I recommend looking at ex19.c and sticking your form function in there, then you can use - dmmg_grid_sequence and it will use grid sequencing to get a good initial guess on the fine grid. Barry On Jan 7, 2008, at 6:37 PM, Sean Dettrick wrote: > On Jan 7, 2008 4:35 PM, Barry Smith wrote: > > Sean, > > Can you run the ls version with the additional options -info - > snes_monitor and send > the results? > > Hi Barry, > > Attached are the gzipped results. It says something about an > inconsistent rhs. Could that be the problem? And what would the > rhs in question be? > > > You could also make a run with -snes_mf_operator and see > if that "converges" > in the same way or not (this is another check that the analytic > Jacobian is right/wrong). > > I tried that, and it seemed to do the same thing. > > Thanks a lot for the feedback. > > Sean > > > > > > Thanks > > Barry > > On Jan 7, 2008, at 3:30 PM, Sean Dettrick wrote: > > > Hi, > > > > I am solving a version of the Grad-Shafranov equation, F(x)=0, which > > but for some extra spatial dependences is similar in form to the 2D > > Bratu equation in snes/examples/tutorials/ex5.c. I started with the > > ex5.c code, introducing just enough changes to model the new > > system. The analytic Jacobian function appears to be correct, with > > a Norm of matrix ratio < 1.e9 (found using -snes_type test). > > > > The problem I am having is that in most cases the SNES solver does > > not converge to a solution x of F(x)=0. Rather, what happens is > > that the fnorm (obtained in a monitor function) converges to some > > large non-zero value, and F(x) seems to get "stuck", i.e. it > > converges to a large non-zero result. Even though it is clearly not > > a solution, the -snes_converged_reason is reported as "Nonlinear > > solve converged due to CONVERGED_TR_DELTA". The intermediate KSP > > steps have -ksp_converged_reason reported as "Linear solve converged > > due to CONVERGED_STEP_LENGTH". I have been typically running with > > parameters -da_grid_x 100 -da_grid_y 101 -snes_converged_reason - > > ksp_converged_reason -snes_type tr -ksp_type gmres -snes_max_it 100. > > > > Does this sound like a familiar scenario with a familiar solution? > > Or can anyone point me to some documentation that describes the SNES > > tr and ls parameters in more detail than the manual.pdf ? > > Or can anyone recommend the best SNES and KSP parameters for the > > Bratu example? > > > > Any help or advice would be greatly appreciated. > > > > Thanks, > > Sean Dettrick > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstitt at cscs.ch Tue Jan 8 09:05:27 2008 From: tstitt at cscs.ch (Timothy Stitt) Date: Tue, 08 Jan 2008 16:05:27 +0100 Subject: Pathscale/PGI Optimisation Options Message-ID: <47839137.3050204@cscs.ch> Hi all, I am just curious if anyone has experimented with the various optimisation options available with the PGI/Pathscale compilers and can suggest a set of parameters for either compiler which maximise the performance of the final PETSc build. In the past I typically use the default optimisation settings provided by PETSc out of the box. The target platform is a Cray XT series machine. Thanks in advance, Tim. From bsmith at mcs.anl.gov Tue Jan 8 16:27:20 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 8 Jan 2008 16:27:20 -0600 Subject: Pathscale/PGI Optimisation Options In-Reply-To: <47839137.3050204@cscs.ch> References: <47839137.3050204@cscs.ch> Message-ID: <0D8E9038-8E28-44CA-8300-A0247DBC2781@mcs.anl.gov> It would be great if we could collect this kind of information; unfortunately the PETSc team doesn't have time to try the many combinations. If anyone has determined good options for particular machines we'd love to add them to the PETSc website. Barry On Jan 8, 2008, at 9:05 AM, Timothy Stitt wrote: > Hi all, > > I am just curious if anyone has experimented with the various > optimisation options available with the PGI/Pathscale compilers and > can > suggest a set of parameters for either compiler which maximise the > performance of the final PETSc build. > > In the past I typically use the default optimisation settings provided > by PETSc out of the box. The target platform is a Cray XT series > machine. > > Thanks in advance, > > Tim. > From tstitt at cscs.ch Wed Jan 9 01:36:40 2008 From: tstitt at cscs.ch (Timothy Stitt) Date: Wed, 09 Jan 2008 08:36:40 +0100 Subject: Pathscale/PGI Optimisation Options In-Reply-To: <0D8E9038-8E28-44CA-8300-A0247DBC2781@mcs.anl.gov> References: <47839137.3050204@cscs.ch> <0D8E9038-8E28-44CA-8300-A0247DBC2781@mcs.anl.gov> Message-ID: <47847988.1080705@cscs.ch> Barry, I fully understand your position regarding getting time for this type of activity so I am hoping that some users can divulge some of this knowledge...as I would be surprised that it hasn't been tried before. If I don't hear anything in reasonable time, I'll do some investigation myself and would be more than happy to pass any findings on to the PETSc team. Regards. Barry Smith wrote: > > It would be great if we could collect this kind of information; > unfortunately > the PETSc team doesn't have time to try the many combinations. If anyone > has determined good options for particular machines we'd love to add > them to the PETSc website. > > Barry > > On Jan 8, 2008, at 9:05 AM, Timothy Stitt wrote: > >> Hi all, >> >> I am just curious if anyone has experimented with the various >> optimisation options available with the PGI/Pathscale compilers and can >> suggest a set of parameters for either compiler which maximise the >> performance of the final PETSc build. >> >> In the past I typically use the default optimisation settings provided >> by PETSc out of the box. The target platform is a Cray XT series >> machine. >> >> Thanks in advance, >> >> Tim. >> > > From mfhoel at student.matnat.uio.no Thu Jan 10 04:14:24 2008 From: mfhoel at student.matnat.uio.no (Mads Hoel) Date: Thu, 10 Jan 2008 11:14:24 +0100 Subject: Referencing the manual web pages Message-ID: Hi all PETSc users! I have looked at your suggestions on how you would like others to reference PETSc, but how should one reference an entry in the manual web pages? For instance, how do I reference MatCreateMPIAIJ? Something like this?: ------------------------------ @Misc{petsc-manual-web-page, Author = "Satish Balay and Kris Buschelman and William D. Gropp and Dinesh Kaushik and Matthew G. Knepley and Lois Curfman McInnes and Barry F. Smith and Hong Zhang", Title = "{PETSc} {D}ocumentation for MatCreateMPIAIJ", Note = "http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatCreateMPIAIJ.html. 10. Jan. 2008", Year = "2001" } ------------------------------ Thanks! -- Mads Hoel From mfhoel at student.matnat.uio.no Thu Jan 10 04:14:24 2008 From: mfhoel at student.matnat.uio.no (Mads Hoel) Date: Thu, 10 Jan 2008 11:14:24 +0100 Subject: Referencing the manual web pages Message-ID: Hi all PETSc users! I have looked at your suggestions on how you would like others to reference PETSc, but how should one reference an entry in the manual web pages? For instance, how do I reference MatCreateMPIAIJ? Something like this?: ------------------------------ @Misc{petsc-manual-web-page, Author = "Satish Balay and Kris Buschelman and William D. Gropp and Dinesh Kaushik and Matthew G. Knepley and Lois Curfman McInnes and Barry F. Smith and Hong Zhang", Title = "{PETSc} {D}ocumentation for MatCreateMPIAIJ", Note = "http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatCreateMPIAIJ.html. 10. Jan. 2008", Year = "2001" } ------------------------------ Thanks! -- Mads Hoel From dave.mayhem23 at gmail.com Thu Jan 10 20:45:15 2008 From: dave.mayhem23 at gmail.com (Dave May) Date: Fri, 11 Jan 2008 13:45:15 +1100 Subject: block preconditioning questions In-Reply-To: References: Message-ID: <956373f0801101845v419b13c0m7499999059d72c10@mail.gmail.com> Hi Gideon, I've created a small package built around petsc which contains implementations for representing block vectors, matrices and preconditioners. Whilst no documentation exist yet (sorry), a number of examples are included with the package. In addition, I have only defined a subset of operations for the block objects, but there are enough to allow you to setup, precondition and solve both linear & nonlinear block systems. You can obtain the tarball from within the following URL http://www.mcc.monash.edu.au/Codes/PetscExt If you do try to use this package, and encounter any difficulties, please don't hesitate to contact me. Cheers, Dave May. On Jan 8, 2008 8:19 AM, Gideon Simpson wrote: > Is there a robust way to implement the following? > Suppose I have a block diagonal matrix > P = [A 0; 0 Q]; > and I know the indices of A and Q in this block matrix. I now want to > apply different preconditioners on the A block and on the Q block. > > One way, that I've had some success with, is to write a PCSHELL, where I > split the input and output vectors using index sets and apply the relevant > preconditioner on each of these. However, this hardwires things, and I was > wondering if there was another method. > > > -gideon > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From recrusader at gmail.com Sun Jan 13 23:23:31 2008 From: recrusader at gmail.com (Yujie) Date: Mon, 14 Jan 2008 13:23:31 +0800 Subject: how to get all the singular values of the matrix? Message-ID: <7ff0ee010801132123n5cc5194cld73b2d958be957b9@mail.gmail.com> Hi, everyone I want to select iterative methods by observing the singular values decompostion of the matrix. However, I don't know how to get all the singular values of the matrix in PETSc. I know the command "-ksp_monitor_singular_value" may get the max and min singular values at each iteration. How to get the singular values of the matrix I want to solve? In addition, when I use the preconditioned iterative method, how to get the singular values of the preconditioned iterative operator? thanks a lot. Regards, Yujie -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Mon Jan 14 00:06:19 2008 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 14 Jan 2008 00:06:19 -0600 Subject: how to get all the singular values of the matrix? In-Reply-To: <7ff0ee010801132123n5cc5194cld73b2d958be957b9@mail.gmail.com> References: <7ff0ee010801132123n5cc5194cld73b2d958be957b9@mail.gmail.com> Message-ID: You can use http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeEigenvaluesExplicitly.html with and without a preconditioner. We have not coded the SVD counterpart, but you can use http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeExplicitOperator.html and then call the LAPACK yourself. Matt On Jan 13, 2008 11:23 PM, Yujie wrote: > Hi, everyone > > I want to select iterative methods by observing the singular values > decompostion of the matrix. However, I don't know how to get all the > singular values of the matrix in PETSc. I know the command > "-ksp_monitor_singular_value" may get the max and min singular values at > each iteration. How to get the singular values of the matrix I want to > solve? In addition, when I use the preconditioned iterative method, how to > get the singular values of the preconditioned iterative operator? > > thanks a lot. > > Regards, > Yujie > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From recrusader at gmail.com Mon Jan 14 00:14:54 2008 From: recrusader at gmail.com (Yujie) Date: Mon, 14 Jan 2008 14:14:54 +0800 Subject: how to get all the singular values of the matrix? In-Reply-To: References: <7ff0ee010801132123n5cc5194cld73b2d958be957b9@mail.gmail.com> Message-ID: <7ff0ee010801132214q25159f98j1d556956b641d589@mail.gmail.com> Thank you for your advice. I have used -ksp_compute_eigenvalues_explicitly to get the eigen values. However, it is very very slow because the dimension of the matrix is about ten thousand. Yujie On 1/14/08, Matthew Knepley wrote: > > You can use > > > http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeEigenvaluesExplicitly.html > > with and without a preconditioner. We have not coded the SVD > counterpart, but you can use > > > http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeExplicitOperator.html > > and then call the LAPACK yourself. > > Matt > > On Jan 13, 2008 11:23 PM, Yujie wrote: > > Hi, everyone > > > > I want to select iterative methods by observing the singular values > > decompostion of the matrix. However, I don't know how to get all the > > singular values of the matrix in PETSc. I know the command > > "-ksp_monitor_singular_value" may get the max and min singular values at > > each iteration. How to get the singular values of the matrix I want to > > solve? In addition, when I use the preconditioned iterative method, how > to > > get the singular values of the preconditioned iterative operator? > > > > thanks a lot. > > > > Regards, > > Yujie > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hzhang at mcs.anl.gov Mon Jan 14 09:12:21 2008 From: hzhang at mcs.anl.gov (Hong Zhang) Date: Mon, 14 Jan 2008 09:12:21 -0600 (CST) Subject: how to get all the singular values of the matrix? In-Reply-To: <7ff0ee010801132214q25159f98j1d556956b641d589@mail.gmail.com> References: <7ff0ee010801132123n5cc5194cld73b2d958be957b9@mail.gmail.com> <7ff0ee010801132214q25159f98j1d556956b641d589@mail.gmail.com> Message-ID: If you want few selected eigen solutions of sparse matrix, you should use sparse eigen solver. Take a look at' slepc (http://www.grycap.upv.es/slepc/) or use slepc interface with arpack. Hong On Mon, 14 Jan 2008, Yujie wrote: > Thank you for your advice. > I have used -ksp_compute_eigenvalues_explicitly to get the eigen values. > However, it is very very > slow because the dimension of the matrix is about ten thousand. > > Yujie > > On 1/14/08, Matthew Knepley wrote: >> >> You can use >> >> >> http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeEigenvaluesExplicitly.html >> >> with and without a preconditioner. We have not coded the SVD >> counterpart, but you can use >> >> >> http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeExplicitOperator.html >> >> and then call the LAPACK yourself. >> >> Matt >> >> On Jan 13, 2008 11:23 PM, Yujie wrote: >>> Hi, everyone >>> >>> I want to select iterative methods by observing the singular values >>> decompostion of the matrix. However, I don't know how to get all the >>> singular values of the matrix in PETSc. I know the command >>> "-ksp_monitor_singular_value" may get the max and min singular values at >>> each iteration. How to get the singular values of the matrix I want to >>> solve? In addition, when I use the preconditioned iterative method, how >> to >>> get the singular values of the preconditioned iterative operator? >>> >>> thanks a lot. >>> >>> Regards, >>> Yujie >>> >> >> >> >> -- >> What most experimenters take for granted before they begin their >> experiments is infinitely more interesting than any results to which >> their experiments lead. >> -- Norbert Wiener >> >> > From recrusader at gmail.com Mon Jan 14 11:24:00 2008 From: recrusader at gmail.com (Yujie) Date: Mon, 14 Jan 2008 09:24:00 -0800 Subject: how to get all the singular values of the matrix? In-Reply-To: References: <7ff0ee010801132123n5cc5194cld73b2d958be957b9@mail.gmail.com> <7ff0ee010801132214q25159f98j1d556956b641d589@mail.gmail.com> Message-ID: <7ff0ee010801140924h5f2bdd1asb51ecf6d9e13e7f@mail.gmail.com> Dear Matt and Hong: Based what you said, it looks like a little difficult to evalute the matrix in PETSc, especailly regarding a big dimension. However, when I select iterative methods, how to select a suitable one based on some evaluation? Could you give me some advice? thanks a lot. Regards, Yujie On 1/14/08, Hong Zhang wrote: > > > If you want few selected eigen solutions of sparse matrix, > you should use sparse eigen solver. Take a look at' > slepc (http://www.grycap.upv.es/slepc/) > or use slepc interface with arpack. > > Hong > > > On Mon, 14 Jan 2008, Yujie wrote: > > > Thank you for your advice. > > I have used -ksp_compute_eigenvalues_explicitly to get the eigen values. > > However, it is very very > > slow because the dimension of the matrix is about ten thousand. > > > > Yujie > > > > On 1/14/08, Matthew Knepley wrote: > >> > >> You can use > >> > >> > >> > http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeEigenvaluesExplicitly.html > >> > >> with and without a preconditioner. We have not coded the SVD > >> counterpart, but you can use > >> > >> > >> > http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeExplicitOperator.html > >> > >> and then call the LAPACK yourself. > >> > >> Matt > >> > >> On Jan 13, 2008 11:23 PM, Yujie wrote: > >>> Hi, everyone > >>> > >>> I want to select iterative methods by observing the singular values > >>> decompostion of the matrix. However, I don't know how to get all the > >>> singular values of the matrix in PETSc. I know the command > >>> "-ksp_monitor_singular_value" may get the max and min singular values > at > >>> each iteration. How to get the singular values of the matrix I want to > >>> solve? In addition, when I use the preconditioned iterative method, > how > >> to > >>> get the singular values of the preconditioned iterative operator? > >>> > >>> thanks a lot. > >>> > >>> Regards, > >>> Yujie > >>> > >> > >> > >> > >> -- > >> What most experimenters take for granted before they begin their > >> experiments is infinitely more interesting than any results to which > >> their experiments lead. > >> -- Norbert Wiener > >> > >> > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Mon Jan 14 11:30:47 2008 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 14 Jan 2008 11:30:47 -0600 Subject: how to get all the singular values of the matrix? In-Reply-To: <7ff0ee010801140924h5f2bdd1asb51ecf6d9e13e7f@mail.gmail.com> References: <7ff0ee010801132123n5cc5194cld73b2d958be957b9@mail.gmail.com> <7ff0ee010801132214q25159f98j1d556956b641d589@mail.gmail.com> <7ff0ee010801140924h5f2bdd1asb51ecf6d9e13e7f@mail.gmail.com> Message-ID: On Jan 14, 2008 11:24 AM, Yujie wrote: > Dear Matt and Hong: > > Based what you said, it looks like a little difficult to evalute the matrix > in PETSc, especailly regarding a big dimension. However, when I select > iterative methods, how to select a suitable one based on some evaluation? > Could you give me some advice? thanks a lot. If I knew how to choose a method, I would retire. Anyone who tells you that they can is outright lying. The only alternative is to try them all. That is why we built PETSc. Matt > Regards, > Yujie > > On 1/14/08, Hong Zhang wrote: > > > > If you want few selected eigen solutions of sparse matrix, > > you should use sparse eigen solver. Take a look at' > > slepc (http://www.grycap.upv.es/slepc/) > > or use slepc interface with arpack. > > > > Hong > > > > > > On Mon, 14 Jan 2008, Yujie wrote: > > > > > Thank you for your advice. > > > I have used -ksp_compute_eigenvalues_explicitly to get the eigen values. > > > However, it is very very > > > slow because the dimension of the matrix is about ten thousand. > > > > > > Yujie > > > > > > On 1/14/08, Matthew Knepley wrote: > > >> > > >> You can use > > >> > > >> > > >> > http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeEigenvaluesExplicitly.html > > >> > > >> with and without a preconditioner. We have not coded the SVD > > >> counterpart, but you can use > > >> > > >> > > >> > http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeExplicitOperator.html > > >> > > >> and then call the LAPACK yourself. > > >> > > >> Matt > > >> > > >> On Jan 13, 2008 11:23 PM, Yujie wrote: > > >>> Hi, everyone > > >>> > > >>> I want to select iterative methods by observing the singular values > > >>> decompostion of the matrix. However, I don't know how to get all the > > >>> singular values of the matrix in PETSc. I know the command > > >>> "-ksp_monitor_singular_value" may get the max and min singular values > at > > >>> each iteration. How to get the singular values of the matrix I want to > > >>> solve? In addition, when I use the preconditioned iterative method, > how > > >> to > > >>> get the singular values of the preconditioned iterative operator? > > >>> > > >>> thanks a lot. > > >>> > > >>> Regards, > > >>> Yujie > > >>> > > >> > > >> > > >> > > >> -- > > >> What most experimenters take for granted before they begin their > > >> experiments is infinitely more interesting than any results to which > > >> their experiments lead. > > >> -- Norbert Wiener > > >> > > >> > > > > > > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From bsmith at mcs.anl.gov Mon Jan 14 11:32:07 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 14 Jan 2008 11:32:07 -0600 Subject: how to get all the singular values of the matrix? In-Reply-To: <7ff0ee010801140924h5f2bdd1asb51ecf6d9e13e7f@mail.gmail.com> References: <7ff0ee010801132123n5cc5194cld73b2d958be957b9@mail.gmail.com> <7ff0ee010801132214q25159f98j1d556956b641d589@mail.gmail.com> <7ff0ee010801140924h5f2bdd1asb51ecf6d9e13e7f@mail.gmail.com> Message-ID: <46D51BB2-B898-4DD3-BCC6-842011083478@mcs.anl.gov> You cannot compute all the eigenvalues for a large sparse matrix with PETSc alone. Barry On Jan 14, 2008, at 11:24 AM, Yujie wrote: > Dear Matt and Hong: > > Based what you said, it looks like a little difficult to evalute the > matrix in PETSc, especailly regarding a big dimension. However, when > I select iterative methods, how to select a suitable one based on > some evaluation? Could you give me some advice? thanks a lot. > > Regards, > Yujie > > On 1/14/08, Hong Zhang wrote: > > If you want few selected eigen solutions of sparse matrix, > you should use sparse eigen solver. Take a look at' > slepc (http://www.grycap.upv.es/slepc/) > or use slepc interface with arpack. > > Hong > > > On Mon, 14 Jan 2008, Yujie wrote: > > > Thank you for your advice. > > I have used -ksp_compute_eigenvalues_explicitly to get the eigen > values. > > However, it is very very > > slow because the dimension of the matrix is about ten thousand. > > > > Yujie > > > > On 1/14/08, Matthew Knepley wrote: > >> > >> You can use > >> > >> > >> http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeEigenvaluesExplicitly.html > >> > >> with and without a preconditioner. We have not coded the SVD > >> counterpart, but you can use > >> > >> > >> http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeExplicitOperator.html > >> > >> and then call the LAPACK yourself. > >> > >> Matt > >> > >> On Jan 13, 2008 11:23 PM, Yujie wrote: > >>> Hi, everyone > >>> > >>> I want to select iterative methods by observing the singular > values > >>> decompostion of the matrix. However, I don't know how to get all > the > >>> singular values of the matrix in PETSc. I know the command > >>> "-ksp_monitor_singular_value" may get the max and min singular > values at > >>> each iteration. How to get the singular values of the matrix I > want to > >>> solve? In addition, when I use the preconditioned iterative > method, how > >> to > >>> get the singular values of the preconditioned iterative operator? > >>> > >>> thanks a lot. > >>> > >>> Regards, > >>> Yujie > >>> > >> > >> > >> > >> -- > >> What most experimenters take for granted before they begin their > >> experiments is infinitely more interesting than any results to > which > >> their experiments lead. > >> -- Norbert Wiener > >> > >> > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hzhang at mcs.anl.gov Mon Jan 14 11:37:07 2008 From: hzhang at mcs.anl.gov (Hong Zhang) Date: Mon, 14 Jan 2008 11:37:07 -0600 (CST) Subject: how to get all the singular values of the matrix? In-Reply-To: <7ff0ee010801140924h5f2bdd1asb51ecf6d9e13e7f@mail.gmail.com> References: <7ff0ee010801132123n5cc5194cld73b2d958be957b9@mail.gmail.com> <7ff0ee010801132214q25159f98j1d556956b641d589@mail.gmail.com> <7ff0ee010801140924h5f2bdd1asb51ecf6d9e13e7f@mail.gmail.com> Message-ID: Yujie, > > Based what you said, it looks like a little difficult to evalute the matrix > in PETSc, especailly regarding a big dimension. However, when I select > iterative methods, how to select a suitable one based on some evaluation? > Could you give me some advice? thanks a lot. What do you mean "how to select a suitable one based on some evaluation?" Usually, one wants a few eigenvalues with largest or smallest magnitude, or eigenvalues in a real interval when matrix is Hermitian. Please refer slepc user manual, which gives detailed description. Hong > > Regards, > Yujie > > On 1/14/08, Hong Zhang wrote: >> >> >> If you want few selected eigen solutions of sparse matrix, >> you should use sparse eigen solver. Take a look at' >> slepc (http://www.grycap.upv.es/slepc/) >> or use slepc interface with arpack. >> >> Hong >> >> >> On Mon, 14 Jan 2008, Yujie wrote: >> >>> Thank you for your advice. >>> I have used -ksp_compute_eigenvalues_explicitly to get the eigen values. >>> However, it is very very >>> slow because the dimension of the matrix is about ten thousand. >>> >>> Yujie >>> >>> On 1/14/08, Matthew Knepley wrote: >>>> >>>> You can use >>>> >>>> >>>> >> http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeEigenvaluesExplicitly.html >>>> >>>> with and without a preconditioner. We have not coded the SVD >>>> counterpart, but you can use >>>> >>>> >>>> >> http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeExplicitOperator.html >>>> >>>> and then call the LAPACK yourself. >>>> >>>> Matt >>>> >>>> On Jan 13, 2008 11:23 PM, Yujie wrote: >>>>> Hi, everyone >>>>> >>>>> I want to select iterative methods by observing the singular values >>>>> decompostion of the matrix. However, I don't know how to get all the >>>>> singular values of the matrix in PETSc. I know the command >>>>> "-ksp_monitor_singular_value" may get the max and min singular values >> at >>>>> each iteration. How to get the singular values of the matrix I want to >>>>> solve? In addition, when I use the preconditioned iterative method, >> how >>>> to >>>>> get the singular values of the preconditioned iterative operator? >>>>> >>>>> thanks a lot. >>>>> >>>>> Regards, >>>>> Yujie >>>>> >>>> >>>> >>>> >>>> -- >>>> What most experimenters take for granted before they begin their >>>> experiments is infinitely more interesting than any results to which >>>> their experiments lead. >>>> -- Norbert Wiener >>>> >>>> >>> >> >> > From recrusader at gmail.com Mon Jan 14 11:39:44 2008 From: recrusader at gmail.com (Yujie) Date: Mon, 14 Jan 2008 09:39:44 -0800 Subject: how to get all the singular values of the matrix? In-Reply-To: References: <7ff0ee010801132123n5cc5194cld73b2d958be957b9@mail.gmail.com> <7ff0ee010801132214q25159f98j1d556956b641d589@mail.gmail.com> <7ff0ee010801140924h5f2bdd1asb51ecf6d9e13e7f@mail.gmail.com> Message-ID: <7ff0ee010801140939tf967888secc5d6efca5b60b@mail.gmail.com> :). Thank you for your explanation. Yujie On 1/14/08, Matthew Knepley wrote: > > On Jan 14, 2008 11:24 AM, Yujie wrote: > > Dear Matt and Hong: > > > > Based what you said, it looks like a little difficult to evalute the > matrix > > in PETSc, especailly regarding a big dimension. However, when I select > > iterative methods, how to select a suitable one based on some > evaluation? > > Could you give me some advice? thanks a lot. > > If I knew how to choose a method, I would retire. Anyone who tells you > that they > can is outright lying. The only alternative is to try them all. That > is why we built > PETSc. > > Matt > > > Regards, > > Yujie > > > > On 1/14/08, Hong Zhang wrote: > > > > > > If you want few selected eigen solutions of sparse matrix, > > > you should use sparse eigen solver. Take a look at' > > > slepc (http://www.grycap.upv.es/slepc/) > > > or use slepc interface with arpack. > > > > > > Hong > > > > > > > > > On Mon, 14 Jan 2008, Yujie wrote: > > > > > > > Thank you for your advice. > > > > I have used -ksp_compute_eigenvalues_explicitly to get the eigen > values. > > > > However, it is very very > > > > slow because the dimension of the matrix is about ten thousand. > > > > > > > > Yujie > > > > > > > > On 1/14/08, Matthew Knepley wrote: > > > >> > > > >> You can use > > > >> > > > >> > > > >> > > > http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeEigenvaluesExplicitly.html > > > >> > > > >> with and without a preconditioner. We have not coded the SVD > > > >> counterpart, but you can use > > > >> > > > >> > > > >> > > > http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/KSP/KSPComputeExplicitOperator.html > > > >> > > > >> and then call the LAPACK yourself. > > > >> > > > >> Matt > > > >> > > > >> On Jan 13, 2008 11:23 PM, Yujie wrote: > > > >>> Hi, everyone > > > >>> > > > >>> I want to select iterative methods by observing the singular > values > > > >>> decompostion of the matrix. However, I don't know how to get all > the > > > >>> singular values of the matrix in PETSc. I know the command > > > >>> "-ksp_monitor_singular_value" may get the max and min singular > values > > at > > > >>> each iteration. How to get the singular values of the matrix I > want to > > > >>> solve? In addition, when I use the preconditioned iterative > method, > > how > > > >> to > > > >>> get the singular values of the preconditioned iterative operator? > > > >>> > > > >>> thanks a lot. > > > >>> > > > >>> Regards, > > > >>> Yujie > > > >>> > > > >> > > > >> > > > >> > > > >> -- > > > >> What most experimenters take for granted before they begin their > > > >> experiments is infinitely more interesting than any results to > which > > > >> their experiments lead. > > > >> -- Norbert Wiener > > > >> > > > >> > > > > > > > > > > > > > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mfhoel at student.matnat.uio.no Tue Jan 15 14:25:25 2008 From: mfhoel at student.matnat.uio.no (Mads Hoel) Date: Tue, 15 Jan 2008 21:25:25 +0100 Subject: Useful Vim tip: adding ierr and CHKERRQ(ierr) to a line Message-ID: Hi Petsc users! The error handling in PETSc is really good! I have been using it to track down errors. I found an extremely useful Vim mapping, that I would like to share. It adds the PETSc error checking by pressing F2 on a line, (put it into your ~/.vimrc file if you would like to use/try it): map :s_^\([ \t]*\)\([^/]*\\|.*$\)_\1ierr = \2 CHKERRQ(ierr);_ So when pressing F2 one can change MatSetValues(...); to ierr = MatSetValues(...); CHKERRQ(ierr); -- Mads Hoel From recrusader at gmail.com Wed Jan 16 01:17:28 2008 From: recrusader at gmail.com (Yujie) Date: Wed, 16 Jan 2008 15:17:28 +0800 Subject: whether do I need to consider the symmetric preconditioner when using CG? Message-ID: <7ff0ee010801152317v5abf2c8t86fdce0c6595cec5@mail.gmail.com> hi, everyone I know there are three types of preconditioners, that is left, split and right preconditioners? When I use CG method in PETSc, whether do I need to consider select one type of preconditioner? Whether do different types affect the performance of preconditioned CG? thanks a lot. Regards, Yujie -------------- next part -------------- An HTML attachment was scrubbed... URL: From niko.karin at gmail.com Wed Jan 16 08:40:14 2008 From: niko.karin at gmail.com (Nicolas Tardieu) Date: Wed, 16 Jan 2008 09:40:14 -0500 Subject: Parallel use of Prometheus Message-ID: Hi everyone, I have been using Prometheus for scalar and vector problems with great success on sequential computers. But when trying to use it in parallel, Prometheus crashes. Then I tried it on some PETSc tests (src/ksp/ksp/examples/tests/ex3.c for instance) on parallel and they also crash... Does anyone have experienced Prometheus in parallel? Thanks, Nicolas -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanjay at ce.berkeley.edu Wed Jan 16 10:01:09 2008 From: sanjay at ce.berkeley.edu (Sanjay Govindjee) Date: Wed, 16 Jan 2008 17:01:09 +0100 Subject: Parallel use of Prometheus In-Reply-To: References: Message-ID: <478E2A45.2010408@ce.berkeley.edu> We have used it extensively with good success in the past. -sanjay Nicolas Tardieu wrote: > Hi everyone, > > I have been using Prometheus for scalar and vector problems with great > success on sequential computers. > But when trying to use it in parallel, Prometheus crashes. > Then I tried it on some PETSc tests (src/ksp/ksp/examples/tests/ex3.c > for instance) on parallel and they also crash... > Does anyone have experienced Prometheus in parallel? > > Thanks, > > Nicolas > From niko.karin at gmail.com Wed Jan 16 10:09:59 2008 From: niko.karin at gmail.com (Nicolas Tardieu) Date: Wed, 16 Jan 2008 11:09:59 -0500 Subject: Parallel use of Prometheus In-Reply-To: <478E2A45.2010408@ce.berkeley.edu> References: <478E2A45.2010408@ce.berkeley.edu> Message-ID: Hi Sanjay, Have you used it on simple examples of the PETSc distribution? Nicolas 2008/1/16, Sanjay Govindjee : > > We have used it extensively with good success in the past. > -sanjay > > Nicolas Tardieu wrote: > > Hi everyone, > > > > I have been using Prometheus for scalar and vector problems with great > > success on sequential computers. > > But when trying to use it in parallel, Prometheus crashes. > > Then I tried it on some PETSc tests (src/ksp/ksp/examples/tests/ex3.c > > for instance) on parallel and they also crash... > > Does anyone have experienced Prometheus in parallel? > > > > Thanks, > > > > Nicolas > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dalcinl at gmail.com Wed Jan 16 10:20:03 2008 From: dalcinl at gmail.com (Lisandro Dalcin) Date: Wed, 16 Jan 2008 13:20:03 -0300 Subject: whether do I need to consider the symmetric preconditioner when using CG? In-Reply-To: <7ff0ee010801152317v5abf2c8t86fdce0c6595cec5@mail.gmail.com> References: <7ff0ee010801152317v5abf2c8t86fdce0c6595cec5@mail.gmail.com> Message-ID: KSPCG only supports left preconditioning. On 1/16/08, Yujie wrote: > hi, everyone > > I know there are three types of preconditioners, that is left, split and > right preconditioners? When I use CG method in PETSc, whether do I need to > consider select one type of preconditioner? Whether do different types > affect the performance of preconditioned CG? thanks a lot. > > Regards, > Yujie > -- Lisandro Dalc?n --------------- Centro Internacional de M?todos Computacionales en Ingenier?a (CIMEC) Instituto de Desarrollo Tecnol?gico para la Industria Qu?mica (INTEC) Consejo Nacional de Investigaciones Cient?ficas y T?cnicas (CONICET) PTLC - G?emes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 From recrusader at gmail.com Wed Jan 16 11:15:43 2008 From: recrusader at gmail.com (Yujie) Date: Wed, 16 Jan 2008 09:15:43 -0800 Subject: whether do I need to consider the symmetric preconditioner when using CG? In-Reply-To: References: <7ff0ee010801152317v5abf2c8t86fdce0c6595cec5@mail.gmail.com> Message-ID: <7ff0ee010801160915y6dfccb1asa94fcb28ff5927d8@mail.gmail.com> Dear Lisandro: >From PETSc manual, I know KSPCG only supports left preconditioning. However, I want to know whether does this affect the performance of preconditioned CG? The main problem is that it should be better to generate a symmetric preconditioned operator for CG method. However, Left preconditioner should have some difficulty to get such operator? Do you have any testings about it regarding left, split and right preconditinoers and CG realization in PETSc? thanks a lot. Regards, Yujie On 1/16/08, Lisandro Dalcin wrote: > > KSPCG only supports left preconditioning. > > On 1/16/08, Yujie wrote: > > hi, everyone > > > > I know there are three types of preconditioners, that is left, split and > > right preconditioners? When I use CG method in PETSc, whether do I need > to > > consider select one type of preconditioner? Whether do different types > > affect the performance of preconditioned CG? thanks a lot. > > > > Regards, > > Yujie > > > > > -- > Lisandro Dalc?n > --------------- > Centro Internacional de M?todos Computacionales en Ingenier?a (CIMEC) > Instituto de Desarrollo Tecnol?gico para la Industria Qu?mica (INTEC) > Consejo Nacional de Investigaciones Cient?ficas y T?cnicas (CONICET) > PTLC - G?emes 3450, (3000) Santa Fe, Argentina > Tel/Fax: +54-(0)342-451.1594 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Jan 16 11:23:25 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 16 Jan 2008 11:23:25 -0600 Subject: whether do I need to consider the symmetric preconditioner when using CG? In-Reply-To: <7ff0ee010801160915y6dfccb1asa94fcb28ff5927d8@mail.gmail.com> References: <7ff0ee010801152317v5abf2c8t86fdce0c6595cec5@mail.gmail.com> <7ff0ee010801160915y6dfccb1asa94fcb28ff5927d8@mail.gmail.com> Message-ID: Yujie, I now understand the reason for your question. CG can be implemented with right, left or split preconditioner and in ALL three cases it is still a symmetric implementation of CG! All give similar convergence rates. The largest effect of left, right or split is in stopping criteria; right preconditioning always uses the TRUE residual norm to determine convergence || b - A x||, left preconditioning using || B(b - Ax) ||. You can use -ksp_norm_type unpreconditioned with left preconditioner or natural norm. You can see the code KSPSolve_CG for exact details. Barry On Jan 16, 2008, at 11:15 AM, Yujie wrote: > Dear Lisandro: > > From PETSc manual, I know KSPCG only supports left preconditioning. > However, I want to know whether does this affect the performance of > preconditioned CG? The main problem is that it should be better to > generate a symmetric preconditioned operator for CG method. However, > Left preconditioner should have some difficulty to get such > operator? Do you have any testings about it regarding left, split > and right preconditinoers and CG realization in PETSc? thanks a lot. > > Regards, > Yujie > > On 1/16/08, Lisandro Dalcin wrote: > KSPCG only supports left preconditioning. > > On 1/16/08, Yujie wrote: > > hi, everyone > > > > I know there are three types of preconditioners, that is left, > split and > > right preconditioners? When I use CG method in PETSc, whether do I > need to > > consider select one type of preconditioner? Whether do different > types > > affect the performance of preconditioned CG? thanks a lot. > > > > Regards, > > Yujie > > > > > -- > Lisandro Dalc?n > --------------- > Centro Internacional de M?todos Computacionales en Ingenier?a (CIMEC) > Instituto de Desarrollo Tecnol?gico para la Industria Qu?mica (INTEC) > Consejo Nacional de Investigaciones Cient?ficas y T?cnicas (CONICET) > PTLC - G?emes 3450, (3000) Santa Fe, Argentina > Tel/Fax: +54-(0)342-451.1594 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From recrusader at gmail.com Wed Jan 16 11:30:27 2008 From: recrusader at gmail.com (Yujie) Date: Wed, 16 Jan 2008 09:30:27 -0800 Subject: whether do I need to consider the symmetric preconditioner when using CG? In-Reply-To: References: <7ff0ee010801152317v5abf2c8t86fdce0c6595cec5@mail.gmail.com> <7ff0ee010801160915y6dfccb1asa94fcb28ff5927d8@mail.gmail.com> Message-ID: <7ff0ee010801160930n22757e92q8d25954e901b53c1@mail.gmail.com> Dear Barry: Thank you for your explanation. Currently, I am reading Yousef Saad's book, Iterative methods for sparse linear systems. Therefore, I have such a problem. Thanks again. Regards, Yujie On 1/16/08, Barry Smith wrote: > > > Yujie, > I now understand the reason for your question. CG can be implemented > with right, left or split preconditioner and in > ALL three cases it is still a symmetric implementation of CG! All give > similar convergence rates. > > The largest effect of left, right or split is in stopping criteria; > right preconditioning always uses the TRUE residual > norm to determine convergence || b - A x||, left preconditioning using || > B(b - Ax) ||. You can use > -ksp_norm_type unpreconditioned with left preconditioner or natural norm. > You can see the code KSPSolve_CG > for exact details. > > Barry > > > On Jan 16, 2008, at 11:15 AM, Yujie wrote: > > Dear Lisandro: > > From PETSc manual, I know KSPCG only supports left preconditioning. > However, I want to know whether does this affect the performance of > preconditioned CG? The main problem is that it should be better to generate > a symmetric preconditioned operator for CG method. However, Left > preconditioner should have some difficulty to get such operator? Do you have > any testings about it regarding left, split and right preconditinoers and CG > realization in PETSc? thanks a lot. > > Regards, > Yujie > > On 1/16/08, Lisandro Dalcin wrote: > > > > KSPCG only supports left preconditioning. > > > > On 1/16/08, Yujie wrote: > > > hi, everyone > > > > > > I know there are three types of preconditioners, that is left, split > > and > > > right preconditioners? When I use CG method in PETSc, whether do I > > need to > > > consider select one type of preconditioner? Whether do different types > > > affect the performance of preconditioned CG? thanks a lot. > > > > > > Regards, > > > Yujie > > > > > > > > > -- > > Lisandro Dalc?n > > --------------- > > Centro Internacional de M?todos Computacionales en Ingenier?a (CIMEC) > > Instituto de Desarrollo Tecnol?gico para la Industria Qu?mica (INTEC) > > Consejo Nacional de Investigaciones Cient?ficas y T?cnicas (CONICET) > > PTLC - G?emes 3450, (3000) Santa Fe, Argentina > > Tel/Fax: +54-(0)342-451.1594 > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanjay at ce.berkeley.edu Wed Jan 16 13:02:59 2008 From: sanjay at ce.berkeley.edu (Sanjay Govindjee) Date: Wed, 16 Jan 2008 20:02:59 +0100 Subject: Parallel use of Prometheus In-Reply-To: References: <478E2A45.2010408@ce.berkeley.edu> Message-ID: <478E54E3.3030802@ce.berkeley.edu> I have not tried this with any of the examples in the distribution only with my own program. The steps are relatively straightforward but you must know them already since you have it working in serial. Nonetheless here is the order of call I have: call MatCreateMPIBAIJ(... ! must be blocked call MatAssemblyBegin (... ! Assemble the matrix call MatAssemblyEnd (... call VecAssemblyBegin (... !Assemble the RHS call VecAssemblyEnd (... call KSPCreate (... call KSPSetOperators (... call KSPGetPC (... call PCSetCoordinates(... ! I'm not fully certain but your problem may have to be defined over R^3 for this to work well call KSPSetFromOptions(... call KSPSolve (... Nicolas Tardieu wrote: > Hi Sanjay, > > Have you used it on simple examples of the PETSc distribution? > > Nicolas > > 2008/1/16, Sanjay Govindjee >: > > We have used it extensively with good success in the past. > -sanjay > > Nicolas Tardieu wrote: > > Hi everyone, > > > > I have been using Prometheus for scalar and vector problems with > great > > success on sequential computers. > > But when trying to use it in parallel, Prometheus crashes. > > Then I tried it on some PETSc tests > (src/ksp/ksp/examples/tests/ex3.c > > for instance) on parallel and they also crash... > > Does anyone have experienced Prometheus in parallel? > > > > Thanks, > > > > Nicolas > > > > From niko.karin at gmail.com Wed Jan 16 15:24:13 2008 From: niko.karin at gmail.com (Nicolas Tardieu) Date: Wed, 16 Jan 2008 16:24:13 -0500 Subject: Parallel use of Prometheus In-Reply-To: <478E54E3.3030802@ce.berkeley.edu> References: <478E2A45.2010408@ce.berkeley.edu> <478E54E3.3030802@ce.berkeley.edu> Message-ID: I also did this on my software and it shows terrific performance in serial. My problem may come from the default distribution of the matrix in PETSc : N rows on proc 0, N rows on proc 1, .... How did you distribute the matrix in your program? Nicolas 2008/1/16, Sanjay Govindjee : > > I have not tried this with any of the examples in the distribution only > with my own program. > > The steps are relatively straightforward but you must know them already > since you have it > working in serial. Nonetheless here is the order of call I have: > > call MatCreateMPIBAIJ(... ! must be blocked > call MatAssemblyBegin (... ! Assemble the matrix > call MatAssemblyEnd (... > > call VecAssemblyBegin (... !Assemble the RHS > call VecAssemblyEnd (... > > call KSPCreate (... > call KSPSetOperators (... > call KSPGetPC (... > call PCSetCoordinates(... ! I'm not fully certain > but your problem may have to be defined over R^3 for this to work well > call KSPSetFromOptions(... > > call KSPSolve (... > > > Nicolas Tardieu wrote: > > Hi Sanjay, > > > > Have you used it on simple examples of the PETSc distribution? > > > > Nicolas > > > > 2008/1/16, Sanjay Govindjee > >: > > > > We have used it extensively with good success in the past. > > -sanjay > > > > Nicolas Tardieu wrote: > > > Hi everyone, > > > > > > I have been using Prometheus for scalar and vector problems with > > great > > > success on sequential computers. > > > But when trying to use it in parallel, Prometheus crashes. > > > Then I tried it on some PETSc tests > > (src/ksp/ksp/examples/tests/ex3.c > > > for instance) on parallel and they also crash... > > > Does anyone have experienced Prometheus in parallel? > > > > > > Thanks, > > > > > > Nicolas > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From z.sheng at ewi.tudelft.nl Thu Jan 17 04:20:07 2008 From: z.sheng at ewi.tudelft.nl (Zhifeng Sheng) Date: Thu, 17 Jan 2008 11:20:07 +0100 Subject: add a smaller matrix to a larger one? In-Reply-To: References: <478E2A45.2010408@ce.berkeley.edu> <478E54E3.3030802@ce.berkeley.edu> Message-ID: <478F2BD7.1050003@ewi.tudelft.nl> Dear all I have a problem, I want to add a small matrix to a larger matrix, where the row and column indexes of the small matrix is mapped to global indexes of the global one. the problem comes from a kind of finite element method, however, I have to do some operations on the small matrix, and it prevent me from directly assembling the local entries. So I have local matrices and I would like to add it to the global one. At this moment, I have to get the matrix value and add it to the global matrix one by one ... is there a better way to do it? Thanks Best regards Zhifeng From knepley at gmail.com Thu Jan 17 07:40:27 2008 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 17 Jan 2008 07:40:27 -0600 Subject: add a smaller matrix to a larger one? In-Reply-To: <478F2BD7.1050003@ewi.tudelft.nl> References: <478E2A45.2010408@ce.berkeley.edu> <478E54E3.3030802@ce.berkeley.edu> <478F2BD7.1050003@ewi.tudelft.nl> Message-ID: If the small matrix is dense, just use MatSetValues. If not, I do not know of a nice way to do this, and would switch to using the individual element matrices. Matt On Jan 17, 2008 4:20 AM, Zhifeng Sheng wrote: > Dear all > > I have a problem, I want to add a small matrix to a larger matrix, where > the row and column indexes of the small matrix is mapped to global > indexes of the global one. > > the problem comes from a kind of finite element method, however, I have > to do some operations on the small matrix, and it prevent me from > directly assembling the local entries. So I have local matrices and I > would like to add it to the global one. At this moment, I have to get > the matrix value and add it to the global matrix one by one ... > > is there a better way to do it? > > Thanks > > Best regards > Zhifeng > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From tyoung at ippt.gov.pl Fri Jan 18 04:32:04 2008 From: tyoung at ippt.gov.pl (Toby D. Young) Date: Fri, 18 Jan 2008 11:32:04 +0100 Subject: zero out columns In-Reply-To: References: <478E2A45.2010408@ce.berkeley.edu> <478E54E3.3030802@ce.berkeley.edu> <478F2BD7.1050003@ewi.tudelft.nl> Message-ID: <20080118113204.66869137@rav.ippt.gov.pl> Hello users, The procedure I wish to program with petsc requires setting a series of matrix elements to zero, and for a given number of rows and columns. The operation is intended to run for large parallel sparse matrices. Using MatZeroRowsIS() I can easily achieve zeroing out the rows I want and now I am wondering how to zero out the columns. I imagine there are a few other ways of doing this, I've come up with two: Method 1 MatGetColumnIJ() // get a specified column VecSetValues() // set wanted indices to zero MatRestoreColumnIJ() // restore vector to the matrix The Petsc manual warns "Since PETSc matrices are usually stored in compressed row format, this routine will generally be slow." (of MatGetColumnIJ). Method 2 MatTranspose() // Take the transpose of the matrix MatZeroRowsIS() // Zeroi out the row which was the target column This requires creating a new matrix, i.e. the transpose and then releasing memory from the old matrix. The advantage is that it is relatively straightforward to code up. The rather obvious third way is to simply force the column elements to be zero with MatSetValues() which, I am guessing, is not likely to be efficient and I am not really considering this. I am wondering if anyone has a clue as to which of the methods above is likely to be more efficient for large parallel sparse matrices. Perhaps someone may have a suggesttion for an alternative approach. Thanks in advance. Best, Toby -- Toby D. Young - Adiunkt (Assistant Professor) Department of Computational Science Institute of Fundamental Technological Research Polish Academy of Sciences Room 206, Swietokrzyska 21 00-049 Warsaw, POLAND From knepley at gmail.com Fri Jan 18 08:34:43 2008 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 18 Jan 2008 08:34:43 -0600 Subject: zero out columns In-Reply-To: <20080118113204.66869137@rav.ippt.gov.pl> References: <478E2A45.2010408@ce.berkeley.edu> <478E54E3.3030802@ce.berkeley.edu> <478F2BD7.1050003@ewi.tudelft.nl> <20080118113204.66869137@rav.ippt.gov.pl> Message-ID: I am guessing that you want to do this in order to 1) enforce a Dirichlet condition (or other strong condition) 2) maintain symmetry in the system If not, maybe you are stuck with the solution below. However, if you are setting boundary conditions, I would strongly advise you to eliminate those variables up front. I have solved systems of this kind for more than a decade and have tried every approach. I believe the best one (except for active set optimization problems) is to eliminate the constrained variables. PETSc provides a nice mechanism for doing so. You must generate some sort of map from degrees of freedom to Vec/Mat indices. For constrained variables, map them to a negative index. Then when you call MatSetValues/VecSetValues() they will be ignored automatically. This is the bottom layer of my BC handling. Thanks, Matt On Jan 18, 2008 4:32 AM, Toby D. Young wrote: > > > > Hello users, > > The procedure I wish to program with petsc requires setting a series of > matrix elements to zero, and for a given number of rows and columns. > The operation is intended to run for large parallel sparse matrices. > > Using MatZeroRowsIS() I can easily achieve zeroing out the rows I want > and now I am wondering how to zero out the columns. I imagine there are > a few other ways of doing this, I've come up with two: > > > Method 1 > MatGetColumnIJ() // get a specified column > VecSetValues() // set wanted indices to zero > MatRestoreColumnIJ() // restore vector to the matrix > > The Petsc manual warns "Since PETSc matrices are usually stored in > compressed row format, this routine will generally be > slow." (of MatGetColumnIJ). > > Method 2 > MatTranspose() // Take the transpose of the matrix > MatZeroRowsIS() // Zeroi out the row which was the target column > > This requires creating a new matrix, i.e. the transpose and then > releasing memory from the old matrix. The advantage is that it is > relatively straightforward to code up. > > The rather obvious third way is to simply force the column elements to > be zero with MatSetValues() which, I am guessing, is not likely to be > efficient and I am not really considering this. > > I am wondering if anyone has a clue as to which of the methods above is > likely to be more efficient for large parallel sparse matrices. Perhaps > someone may have a suggesttion for an alternative approach. > > Thanks in advance. > > Best, > Toby > > > > > -- > > Toby D. Young - Adiunkt (Assistant Professor) > Department of Computational Science > Institute of Fundamental Technological Research > Polish Academy of Sciences > Room 206, Swietokrzyska 21 > 00-049 Warsaw, POLAND > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From bsmith at mcs.anl.gov Fri Jan 18 08:41:52 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 18 Jan 2008 08:41:52 -0600 Subject: zero out columns In-Reply-To: References: <478E2A45.2010408@ce.berkeley.edu> <478E54E3.3030802@ce.berkeley.edu> <478F2BD7.1050003@ewi.tudelft.nl> <20080118113204.66869137@rav.ippt.gov.pl> Message-ID: <1A5E7FF0-25E3-4704-BF7A-CF713191C64B@mcs.anl.gov> You can also use MatGetSubMatrix() to pull out the part of the matrix you want to keep; this is actually efficient speed-wise, the drawback is that it requires memory since it is storing essentially two copies of the matrices. Barry On Jan 18, 2008, at 8:34 AM, Matthew Knepley wrote: > I am guessing that you want to do this in order to > > 1) enforce a Dirichlet condition (or other strong condition) > > 2) maintain symmetry in the system > > If not, maybe you are stuck with the solution below. However, if > you are setting boundary conditions, I would strongly advise you > to eliminate those variables up front. I have solved systems of > this kind for more than a decade and have tried every approach. > I believe the best one (except for active set optimization problems) > is to eliminate the constrained variables. > > PETSc provides a nice mechanism for doing so. You must generate > some sort of map from degrees of freedom to Vec/Mat indices. For > constrained variables, map them to a negative index. Then when > you call MatSetValues/VecSetValues() they will be ignored > automatically. > This is the bottom layer of my BC handling. > > Thanks, > > Matt > > On Jan 18, 2008 4:32 AM, Toby D. Young wrote: >> >> >> >> Hello users, >> >> The procedure I wish to program with petsc requires setting a >> series of >> matrix elements to zero, and for a given number of rows and columns. >> The operation is intended to run for large parallel sparse matrices. >> >> Using MatZeroRowsIS() I can easily achieve zeroing out the rows I >> want >> and now I am wondering how to zero out the columns. I imagine there >> are >> a few other ways of doing this, I've come up with two: >> >> >> Method 1 >> MatGetColumnIJ() // get a specified column >> VecSetValues() // set wanted indices to zero >> MatRestoreColumnIJ() // restore vector to the matrix >> >> The Petsc manual warns "Since PETSc matrices are usually stored in >> compressed row format, this routine will generally be >> slow." (of MatGetColumnIJ). >> >> Method 2 >> MatTranspose() // Take the transpose of the matrix >> MatZeroRowsIS() // Zeroi out the row which was the target column >> >> This requires creating a new matrix, i.e. the transpose and then >> releasing memory from the old matrix. The advantage is that it is >> relatively straightforward to code up. >> >> The rather obvious third way is to simply force the column elements >> to >> be zero with MatSetValues() which, I am guessing, is not likely to be >> efficient and I am not really considering this. >> >> I am wondering if anyone has a clue as to which of the methods >> above is >> likely to be more efficient for large parallel sparse matrices. >> Perhaps >> someone may have a suggesttion for an alternative approach. >> >> Thanks in advance. >> >> Best, >> Toby >> >> >> >> >> -- >> >> Toby D. Young - Adiunkt (Assistant Professor) >> Department of Computational Science >> Institute of Fundamental Technological Research >> Polish Academy of Sciences >> Room 206, Swietokrzyska 21 >> 00-049 Warsaw, POLAND >> >> > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > From dave.mayhem23 at gmail.com Fri Jan 18 08:56:32 2008 From: dave.mayhem23 at gmail.com (Dave May) Date: Sat, 19 Jan 2008 01:56:32 +1100 Subject: zero out columns In-Reply-To: <20080118113204.66869137@rav.ippt.gov.pl> References: <478E2A45.2010408@ce.berkeley.edu> <478E54E3.3030802@ce.berkeley.edu> <478F2BD7.1050003@ewi.tudelft.nl> <20080118113204.66869137@rav.ippt.gov.pl> Message-ID: <956373f0801180656o2f768b46uc150f79430b87c4d@mail.gmail.com> For some finite element codes I've written in the past I have wanted to leave the constraints in the matrix. Since the global FE stiffness is assembled from element (local) contributions, a masking matrix used to zero out entries can also be applied on the element level as well. I would assemble the full matrix, then apply the mask. I found this approach efficient enough (provided you used MAT_FLUSH_ASSEMBLY when switching from ADD_VALUES to INSERT_VALUES) as you are not generating any new non entires within the matrix sparsity pattern. Cheers, Dave. On Jan 18, 2008 9:32 PM, Toby D. Young wrote: > > > > Hello users, > > The procedure I wish to program with petsc requires setting a series of > matrix elements to zero, and for a given number of rows and columns. > The operation is intended to run for large parallel sparse matrices. > > Using MatZeroRowsIS() I can easily achieve zeroing out the rows I want > and now I am wondering how to zero out the columns. I imagine there are > a few other ways of doing this, I've come up with two: > > > Method 1 > MatGetColumnIJ() // get a specified column > VecSetValues() // set wanted indices to zero > MatRestoreColumnIJ() // restore vector to the matrix > > The Petsc manual warns "Since PETSc matrices are usually stored in > compressed row format, this routine will generally be > slow." (of MatGetColumnIJ). > > Method 2 > MatTranspose() // Take the transpose of the matrix > MatZeroRowsIS() // Zeroi out the row which was the target column > > This requires creating a new matrix, i.e. the transpose and then > releasing memory from the old matrix. The advantage is that it is > relatively straightforward to code up. > > The rather obvious third way is to simply force the column elements to > be zero with MatSetValues() which, I am guessing, is not likely to be > efficient and I am not really considering this. > > I am wondering if anyone has a clue as to which of the methods above is > likely to be more efficient for large parallel sparse matrices. Perhaps > someone may have a suggesttion for an alternative approach. > > Thanks in advance. > > Best, > Toby > > > > > -- > > Toby D. Young - Adiunkt (Assistant Professor) > Department of Computational Science > Institute of Fundamental Technological Research > Polish Academy of Sciences > Room 206, Swietokrzyska 21 > 00-049 Warsaw, POLAND > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwicks at cs.brown.edu Fri Jan 18 13:26:29 2008 From: jwicks at cs.brown.edu (John R. Wicks) Date: Fri, 18 Jan 2008 14:26:29 -0500 Subject: Reusing PC's In-Reply-To: Message-ID: <000201c85a08$071a2010$0201a8c0@jwickslptp> For a given (very large) system of equations, I would like to vary the preconditioner and solve method used. Since constructing the preconditioner is somewhat expensive, I would like to be able to reuse the PC and vary the KSP method, i.e., the outer loop should vary the PCType and the inner loop should vary the KSPType. Is it possible to reuse KSP contexts and PC's in this way? Ideally, I should only need to call KSPCreate once, outside both loops, extract the PC, and then call PCSetType in the outer loop and KSPSetType in the inner loop. How do I make sure that any ancillary data structures are properly destroyed/reallocated when I change types? From dalcinl at gmail.com Fri Jan 18 14:01:00 2008 From: dalcinl at gmail.com (Lisandro Dalcin) Date: Fri, 18 Jan 2008 17:01:00 -0300 Subject: Reusing PC's In-Reply-To: <000201c85a08$071a2010$0201a8c0@jwickslptp> References: <000201c85a08$071a2010$0201a8c0@jwickslptp> Message-ID: On 1/18/08, John R. Wicks wrote: > How do I make sure that any ancillary data > structures are properly destroyed/reallocated when I change types? Just give a try. KSP and PC are designed for correctly handle the change of type. If you have any problem, please report it. -- Lisandro Dalc?n --------------- Centro Internacional de M?todos Computacionales en Ingenier?a (CIMEC) Instituto de Desarrollo Tecnol?gico para la Industria Qu?mica (INTEC) Consejo Nacional de Investigaciones Cient?ficas y T?cnicas (CONICET) PTLC - G?emes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 From bsmith at mcs.anl.gov Fri Jan 18 13:50:30 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 18 Jan 2008 13:50:30 -0600 Subject: Reusing PC's In-Reply-To: <000201c85a08$071a2010$0201a8c0@jwickslptp> References: <000201c85a08$071a2010$0201a8c0@jwickslptp> Message-ID: <18FD17BA-B780-4ADE-B593-2F62C4584EC2@mcs.anl.gov> Just do it. Barry On Jan 18, 2008, at 1:26 PM, John R. Wicks wrote: > For a given (very large) system of equations, I would like to vary the > preconditioner and solve method used. Since constructing the > preconditioner > is somewhat expensive, I would like to be able to reuse the PC and > vary the > KSP method, i.e., the outer loop should vary the PCType and the > inner loop > should vary the KSPType. Is it possible to reuse KSP contexts and > PC's in > this way? Ideally, I should only need to call KSPCreate once, > outside both > loops, extract the PC, and then call PCSetType in the outer loop and > KSPSetType in the inner loop. How do I make sure that any ancillary > data > structures are properly destroyed/reallocated when I change types? > From knepley at gmail.com Fri Jan 18 13:36:42 2008 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 18 Jan 2008 13:36:42 -0600 Subject: Reusing PC's In-Reply-To: <000201c85a08$071a2010$0201a8c0@jwickslptp> References: <000201c85a08$071a2010$0201a8c0@jwickslptp> Message-ID: On Jan 18, 2008 1:26 PM, John R. Wicks wrote: > For a given (very large) system of equations, I would like to vary the > preconditioner and solve method used. Since constructing the preconditioner > is somewhat expensive, I would like to be able to reuse the PC and vary the > KSP method, i.e., the outer loop should vary the PCType and the inner loop > should vary the KSPType. Is it possible to reuse KSP contexts and PC's in > this way? Ideally, I should only need to call KSPCreate once, outside both > loops, extract the PC, and then call PCSetType in the outer loop and > KSPSetType in the inner loop. How do I make sure that any ancillary data > structures are properly destroyed/reallocated when I change types? That sounds like it should work. The set type call should only deal with implementation data structures, leaving the help objects alone (like the PC held by the KSP). Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From vijay.m at gmail.com Tue Jan 22 15:54:08 2008 From: vijay.m at gmail.com (Vijay M) Date: Tue, 22 Jan 2008 15:54:08 -0600 Subject: Memory corruption error in SNESSolve Message-ID: Hi all, I am currently trying to use LibMesh with PETSc SNES solver to solve a nonlinear Diffusion-reaction problem. The code works fine with 1 processor but when i use 2 processors for the exact same problem, it throws me this error regarding memory corruption. I am not sure what this error is about and was wondering if someone can help me out on this. Note: My residual function is being called successfully and returns the residual back without any problem since i can see some print message at the end of the call ! Hence, this problem is not in my custom FormFunction. [1]PETSC ERROR: PetscMallocValidate: error detected at SNESComputeFunction() line 950 in src/snes/interface/snes.c [1]PETSC ERROR: Memory at address 0xa5cf40 is corrupted [1]PETSC ERROR: Probably write past beginning or end of array [1]PETSC ERROR: Last intact block allocated in PetscStrallocpy() line 82 in src/sys/utils/str.c [0]PETSC ERROR: PetscMallocValidate: error detected at SNESComputeFunction() line 950 in src/snes/interface/snes.c [0]PETSC ERROR: Memory at address 0xa5cf30 is corrupted [0]PETSC ERROR: Probably write past beginning or end of array [0]PETSC ERROR: Last intact block allocated in PetscStrallocpy() line 82 in src/sys/utils/str.c [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Memory corruption! [0]PETSC ERROR: ! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 7, Fri Oct 26 14:21:35 CDT 2007 HG revision: 2e223033ba960114833e1f9713ab393ec78c056f [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: ./myProg-opt on a linux-gnu named [1]PETSC ERROR: --------------------- Error Message ------------------------------------ [1]PETSC ERROR: Memory corruption! [1]PETSC ERROR: ! [1]PETSC ERROR: ------------------------------------------------------------------------ [1]PETSC ERROR: Petsc Release Version 2.3.3, Patch 7, Fri Oct 26 14:21:35 CDT 2007 HG revision: 2e223033ba960114833e1f9713ab393ec78c056f [1]PETSC ERROR: See docs/changes/index.html for recent updates. [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [1]PETSC ERROR: See docs/index.html for manual pages. [1]PETSC ERROR: ----------------------------[cli_0]: aborting job: application called MPI_Abort(comm=0x84000000, 78) - process 0 [cli_1]: aborting job: application called MPI_Abort(comm=0x84000000, 78) - process 1 grove.ne.tamu.edu by vijaysm Tue Jan 22 15:47:58 2008 [0]PETSC ERROR: Libraries linked from /state/partition1/local/petsc-2.3.3-p7/lib/linux-gnu-c-debug [0]PETSC ERROR: Configure run at Fri Nov 9 15:02:46 2007 [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=ifort --with-cxx=g++ --download-f-blas-lapack=1 --download-mpich=1 --with-shared=1 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: PetscMallocValidate() line 139 in src/sys/memory/mtr.c [0]PETSC ERROR: SNESComputeFunction() line 950 in src/snes/interface/snes.c [0]PETSC ERROR: SNESSolve_LS() line 158 in src/snes/impls/ls/ls.c [0]PETSC ERROR: SNESSolve() line 1871 in src/snes/interface/snes.c [0]PETSC ERROR: main() line 395 in unknowndirectory/myProg.C If you need some more information, feel free to let me know. Thanks in advance ! Vijay From knepley at gmail.com Tue Jan 22 17:02:00 2008 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 22 Jan 2008 17:02:00 -0600 Subject: Memory corruption error in SNESSolve In-Reply-To: References: Message-ID: On Jan 22, 2008 3:54 PM, Vijay M wrote: > Hi all, > > I am currently trying to use LibMesh with PETSc SNES solver to solve a > nonlinear Diffusion-reaction problem. The code works fine with 1 > processor but when i use 2 processors for the exact same problem, it > throws me this error regarding memory corruption. I am not sure what > this error is about and was wondering if someone can help me out on > this. Note: My residual function is being called successfully and > returns the residual back without any problem since i can see some > print message at the end of the call ! Hence, this problem is not in > my custom FormFunction. Actually, it is very likely that the problem is in your FormFunction. The error is being reported because after every call to FormFunction, we walk the PETSc heap and validate all the pieces of memory we allocated. Something wrote over a piece of memory we already own, so the OS did not complain and you saw your printout, however there is still corruption. I would advise you to run 'valgrind' on the code. It is the best tool I have used for finding these kind of errors. Matt > [1]PETSC ERROR: PetscMallocValidate: error detected at > SNESComputeFunction() line 950 in src/snes/interface/snes.c > [1]PETSC ERROR: Memory at address 0xa5cf40 is corrupted > [1]PETSC ERROR: Probably write past beginning or end of array > [1]PETSC ERROR: Last intact block allocated in PetscStrallocpy() line > 82 in src/sys/utils/str.c > [0]PETSC ERROR: PetscMallocValidate: error detected at > SNESComputeFunction() line 950 in src/snes/interface/snes.c > [0]PETSC ERROR: Memory at address 0xa5cf30 is corrupted > [0]PETSC ERROR: Probably write past beginning or end of array > [0]PETSC ERROR: Last intact block allocated in PetscStrallocpy() line > 82 in src/sys/utils/str.c > [0]PETSC ERROR: --------------------- Error Message > ------------------------------------ > [0]PETSC ERROR: Memory corruption! > [0]PETSC ERROR: ! > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 7, Fri Oct 26 > 14:21:35 CDT 2007 HG revision: > 2e223033ba960114833e1f9713ab393ec78c056f > [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: ./myProg-opt on a linux-gnu named [1]PETSC ERROR: > --------------------- Error Message > ------------------------------------ > [1]PETSC ERROR: Memory corruption! > [1]PETSC ERROR: ! > [1]PETSC ERROR: > ------------------------------------------------------------------------ > [1]PETSC ERROR: Petsc Release Version 2.3.3, Patch 7, Fri Oct 26 > 14:21:35 CDT 2007 HG revision: > 2e223033ba960114833e1f9713ab393ec78c056f > [1]PETSC ERROR: See docs/changes/index.html for recent updates. > [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > [1]PETSC ERROR: See docs/index.html for manual pages. > [1]PETSC ERROR: ----------------------------[cli_0]: aborting job: > application called MPI_Abort(comm=0x84000000, 78) - process 0 > [cli_1]: aborting job: > application called MPI_Abort(comm=0x84000000, 78) - process 1 > grove.ne.tamu.edu by vijaysm Tue Jan 22 15:47:58 2008 > [0]PETSC ERROR: Libraries linked from > /state/partition1/local/petsc-2.3.3-p7/lib/linux-gnu-c-debug > [0]PETSC ERROR: Configure run at Fri Nov 9 15:02:46 2007 > [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=ifort > --with-cxx=g++ --download-f-blas-lapack=1 --download-mpich=1 > --with-shared=1 > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: PetscMallocValidate() line 139 in src/sys/memory/mtr.c > [0]PETSC ERROR: SNESComputeFunction() line 950 in src/snes/interface/snes.c > [0]PETSC ERROR: SNESSolve_LS() line 158 in src/snes/impls/ls/ls.c > [0]PETSC ERROR: SNESSolve() line 1871 in src/snes/interface/snes.c > [0]PETSC ERROR: main() line 395 in unknowndirectory/myProg.C > > If you need some more information, feel free to let me know. Thanks in advance ! > > Vijay > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From vijay.m at gmail.com Tue Jan 22 18:19:10 2008 From: vijay.m at gmail.com (Vijay M) Date: Tue, 22 Jan 2008 18:19:10 -0600 Subject: Memory corruption error in SNESSolve In-Reply-To: References: Message-ID: Well thanks for the reply Matt. I currently do not have valgrind installed in the server i am running my code and will not have access to the person who can for couple of days. I guess what you are saying makes sense and the problem could still be in my function. I did check for it again and could not see what could be the problem. I even tried with the following formfunction which is a very simplified 1-D poisson problem with reaction=0 and diffusion=1; essentially linear. But I still get the same kind of errors. If there is something you do find in the following code that would corrupt the memory, please let me know. The code runs correctly in a single processor with both FormJacobian and -snes_mf options but multi-processor seems to mess things up. Here's the function. PetscErrorCode FormFunction(SNES snes,Vec x,Vec f,void *ctx) { PetscScalar *xx,*ff,d; PetscErrorCode ierr; PetscInt i,n; PetscFunctionBegin; ierr = VecGetArray(x,&xx);CHKERRQ(ierr); ierr = VecGetArray(f,&ff);CHKERRQ(ierr); ierr = VecGetSize(x,&n);CHKERRQ(ierr); double h = 1.0/(n-1) ; d = (PetscReal)(n - 1); d = d*d; double pos ; ff[0] = xx[0]; // left boundary with Dirichlet = 0 // residual : (un-1 -2*un + un+1)/h^2 + Reaction*u - f for (i=1; i wrote: > On Jan 22, 2008 3:54 PM, Vijay M wrote: > > Hi all, > > > > I am currently trying to use LibMesh with PETSc SNES solver to solve a > > nonlinear Diffusion-reaction problem. The code works fine with 1 > > processor but when i use 2 processors for the exact same problem, it > > throws me this error regarding memory corruption. I am not sure what > > this error is about and was wondering if someone can help me out on > > this. Note: My residual function is being called successfully and > > returns the residual back without any problem since i can see some > > print message at the end of the call ! Hence, this problem is not in > > my custom FormFunction. > > Actually, it is very likely that the problem is in your FormFunction. The > error is being reported because after every call to FormFunction, we > walk the PETSc heap and validate all the pieces of memory we allocated. > Something wrote over a piece of memory we already own, so the OS > did not complain and you saw your printout, however there is still corruption. > I would advise you to run 'valgrind' on the code. It is the best tool I have > used for finding these kind of errors. > > Matt > > > > [1]PETSC ERROR: PetscMallocValidate: error detected at > > SNESComputeFunction() line 950 in src/snes/interface/snes.c > > [1]PETSC ERROR: Memory at address 0xa5cf40 is corrupted > > [1]PETSC ERROR: Probably write past beginning or end of array > > [1]PETSC ERROR: Last intact block allocated in PetscStrallocpy() line > > 82 in src/sys/utils/str.c > > [0]PETSC ERROR: PetscMallocValidate: error detected at > > SNESComputeFunction() line 950 in src/snes/interface/snes.c > > [0]PETSC ERROR: Memory at address 0xa5cf30 is corrupted > > [0]PETSC ERROR: Probably write past beginning or end of array > > [0]PETSC ERROR: Last intact block allocated in PetscStrallocpy() line > > 82 in src/sys/utils/str.c > > [0]PETSC ERROR: --------------------- Error Message > > ------------------------------------ > > [0]PETSC ERROR: Memory corruption! > > [0]PETSC ERROR: ! > > [0]PETSC ERROR: > > ------------------------------------------------------------------------ > > [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 7, Fri Oct 26 > > 14:21:35 CDT 2007 HG revision: > > 2e223033ba960114833e1f9713ab393ec78c056f > > [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: ./myProg-opt on a linux-gnu named [1]PETSC ERROR: > > --------------------- Error Message > > ------------------------------------ > > [1]PETSC ERROR: Memory corruption! > > [1]PETSC ERROR: ! > > [1]PETSC ERROR: > > ------------------------------------------------------------------------ > > [1]PETSC ERROR: Petsc Release Version 2.3.3, Patch 7, Fri Oct 26 > > 14:21:35 CDT 2007 HG revision: > > 2e223033ba960114833e1f9713ab393ec78c056f > > [1]PETSC ERROR: See docs/changes/index.html for recent updates. > > [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > > [1]PETSC ERROR: See docs/index.html for manual pages. > > [1]PETSC ERROR: ----------------------------[cli_0]: aborting job: > > application called MPI_Abort(comm=0x84000000, 78) - process 0 > > [cli_1]: aborting job: > > application called MPI_Abort(comm=0x84000000, 78) - process 1 > > grove.ne.tamu.edu by vijaysm Tue Jan 22 15:47:58 2008 > > [0]PETSC ERROR: Libraries linked from > > /state/partition1/local/petsc-2.3.3-p7/lib/linux-gnu-c-debug > > [0]PETSC ERROR: Configure run at Fri Nov 9 15:02:46 2007 > > [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=ifort > > --with-cxx=g++ --download-f-blas-lapack=1 --download-mpich=1 > > --with-shared=1 > > [0]PETSC ERROR: > > ------------------------------------------------------------------------ > > [0]PETSC ERROR: PetscMallocValidate() line 139 in src/sys/memory/mtr.c > > [0]PETSC ERROR: SNESComputeFunction() line 950 in src/snes/interface/snes.c > > [0]PETSC ERROR: SNESSolve_LS() line 158 in src/snes/impls/ls/ls.c > > [0]PETSC ERROR: SNESSolve() line 1871 in src/snes/interface/snes.c > > [0]PETSC ERROR: main() line 395 in unknowndirectory/myProg.C > > > > If you need some more information, feel free to let me know. Thanks in advance ! > > > > Vijay > > > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > From dave.mayhem23 at gmail.com Tue Jan 22 18:55:08 2008 From: dave.mayhem23 at gmail.com (Dave May) Date: Wed, 23 Jan 2008 11:55:08 +1100 Subject: Memory corruption error in SNESSolve In-Reply-To: References: Message-ID: <956373f0801221655o2c7cd9d2q586af4e39056360@mail.gmail.com> Hey Vijay, I can spot something wrong. VecGetSize gives you the global length of the vector. However VecGetArray only gives you access to the LOCAL portion of the vector data for that processor. Thus you need to use a local index if you are going to set the values directly into the array. In parallel, xx[n-1] will always be outside the bounds of the processors local portion of the vector if n is the global vector length. Cheers, Dave. Here's the function. > > PetscErrorCode FormFunction(SNES snes,Vec x,Vec f,void *ctx) > { > PetscScalar *xx,*ff,d; > PetscErrorCode ierr; > PetscInt i,n; > > PetscFunctionBegin; > ierr = VecGetArray(x,&xx);CHKERRQ(ierr); > ierr = VecGetArray(f,&ff);CHKERRQ(ierr); > ierr = VecGetSize(x,&n);CHKERRQ(ierr); > > double h = 1.0/(n-1) ; > d = (PetscReal)(n - 1); d = d*d; > double pos ; > > ff[0] = xx[0]; // left boundary with Dirichlet = 0 > // residual : (un-1 -2*un + un+1)/h^2 + Reaction*u - f > for (i=1; i pos = i*h ; > ff[i] = -Diffusion(pos, 0, 0, 0, xx[i])*d*(xx[i-1] - 2.0*xx[i] + > xx[i+1]) + Reaction(pos, 0, 0, 0, xx[i])*xx[i] - RHS(pos, 0, 0, 0, > xx[i]) ; > } > ff[n-1] = xx[n-1] - 1.0; // right boundary with Dirichlet = 1 > > ierr = VecRestoreArray(x,&xx);CHKERRQ(ierr); > ierr = VecRestoreArray(f,&ff);CHKERRQ(ierr); > PetscFunctionReturn(0); > } > > One question though. If i use GetArray and RestoreArray to change the > values directly in memory, do i still have to make the > VecAssemblyBegin-End calls ? > > Thanks again for the help Matt. > > Vijay > > On Jan 22, 2008 5:02 PM, Matthew Knepley wrote: > > On Jan 22, 2008 3:54 PM, Vijay M wrote: > > > Hi all, > > > > > > I am currently trying to use LibMesh with PETSc SNES solver to solve a > > > nonlinear Diffusion-reaction problem. The code works fine with 1 > > > processor but when i use 2 processors for the exact same problem, it > > > throws me this error regarding memory corruption. I am not sure what > > > this error is about and was wondering if someone can help me out on > > > this. Note: My residual function is being called successfully and > > > returns the residual back without any problem since i can see some > > > print message at the end of the call ! Hence, this problem is not in > > > my custom FormFunction. > > > > Actually, it is very likely that the problem is in your FormFunction. > The > > error is being reported because after every call to FormFunction, we > > walk the PETSc heap and validate all the pieces of memory we allocated. > > Something wrote over a piece of memory we already own, so the OS > > did not complain and you saw your printout, however there is still > corruption. > > I would advise you to run 'valgrind' on the code. It is the best tool I > have > > used for finding these kind of errors. > > > > Matt > > > > > > > [1]PETSC ERROR: PetscMallocValidate: error detected at > > > SNESComputeFunction() line 950 in src/snes/interface/snes.c > > > [1]PETSC ERROR: Memory at address 0xa5cf40 is corrupted > > > [1]PETSC ERROR: Probably write past beginning or end of array > > > [1]PETSC ERROR: Last intact block allocated in PetscStrallocpy() line > > > 82 in src/sys/utils/str.c > > > [0]PETSC ERROR: PetscMallocValidate: error detected at > > > SNESComputeFunction() line 950 in src/snes/interface/snes.c > > > [0]PETSC ERROR: Memory at address 0xa5cf30 is corrupted > > > [0]PETSC ERROR: Probably write past beginning or end of array > > > [0]PETSC ERROR: Last intact block allocated in PetscStrallocpy() line > > > 82 in src/sys/utils/str.c > > > [0]PETSC ERROR: --------------------- Error Message > > > ------------------------------------ > > > [0]PETSC ERROR: Memory corruption! > > > [0]PETSC ERROR: ! > > > [0]PETSC ERROR: > > > > ------------------------------------------------------------------------ > > > [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 7, Fri Oct 26 > > > 14:21:35 CDT 2007 HG revision: > > > 2e223033ba960114833e1f9713ab393ec78c056f > > > [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: ./myProg-opt on a linux-gnu named [1]PETSC ERROR: > > > --------------------- Error Message > > > ------------------------------------ > > > [1]PETSC ERROR: Memory corruption! > > > [1]PETSC ERROR: ! > > > [1]PETSC ERROR: > > > > ------------------------------------------------------------------------ > > > [1]PETSC ERROR: Petsc Release Version 2.3.3, Patch 7, Fri Oct 26 > > > 14:21:35 CDT 2007 HG revision: > > > 2e223033ba960114833e1f9713ab393ec78c056f > > > [1]PETSC ERROR: See docs/changes/index.html for recent updates. > > > [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > > > [1]PETSC ERROR: See docs/index.html for manual pages. > > > [1]PETSC ERROR: ----------------------------[cli_0]: aborting job: > > > application called MPI_Abort(comm=0x84000000, 78) - process 0 > > > [cli_1]: aborting job: > > > application called MPI_Abort(comm=0x84000000, 78) - process 1 > > > grove.ne.tamu.edu by vijaysm Tue Jan 22 15:47:58 2008 > > > [0]PETSC ERROR: Libraries linked from > > > /state/partition1/local/petsc-2.3.3-p7/lib/linux-gnu-c-debug > > > [0]PETSC ERROR: Configure run at Fri Nov 9 15:02:46 2007 > > > [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=ifort > > > --with-cxx=g++ --download-f-blas-lapack=1 --download-mpich=1 > > > --with-shared=1 > > > [0]PETSC ERROR: > > > > ------------------------------------------------------------------------ > > > [0]PETSC ERROR: PetscMallocValidate() line 139 in src/sys/memory/mtr.c > > > [0]PETSC ERROR: SNESComputeFunction() line 950 in > src/snes/interface/snes.c > > > [0]PETSC ERROR: SNESSolve_LS() line 158 in src/snes/impls/ls/ls.c > > > [0]PETSC ERROR: SNESSolve() line 1871 in src/snes/interface/snes.c > > > [0]PETSC ERROR: main() line 395 in unknowndirectory/myProg.C > > > > > > If you need some more information, feel free to let me know. Thanks in > advance ! > > > > > > Vijay > > > > > > > > > > > > > > -- > > What most experimenters take for granted before they begin their > > experiments is infinitely more interesting than any results to which > > their experiments lead. > > -- Norbert Wiener > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Jan 22 19:39:15 2008 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 22 Jan 2008 19:39:15 -0600 Subject: Memory corruption error in SNESSolve In-Reply-To: <956373f0801221655o2c7cd9d2q586af4e39056360@mail.gmail.com> References: <956373f0801221655o2c7cd9d2q586af4e39056360@mail.gmail.com> Message-ID: Dave is correct. Also I would point out that based upon your example code, you probably want to use FormFunctionLocal() instead. For this, please refer to SNES ex5. Thanks, Matt On Jan 22, 2008 6:55 PM, Dave May wrote: > Hey Vijay, > I can spot something wrong. VecGetSize gives you the global length of > the vector. However VecGetArray only gives you access to the LOCAL portion > of the vector data for that processor. Thus you need to use a local index if > you are going to set the values directly into the array. > > In parallel, xx[n-1] will always be outside the bounds of the processors > local portion of the vector if n is the global vector length. > > Cheers, > Dave. > > > > > > > Here's the function. > > > > PetscErrorCode FormFunction(SNES snes,Vec x,Vec f,void *ctx) > > { > > PetscScalar *xx,*ff,d; > > PetscErrorCode ierr; > > PetscInt i,n; > > > > PetscFunctionBegin; > > ierr = VecGetArray(x,&xx);CHKERRQ(ierr); > > ierr = VecGetArray(f,&ff);CHKERRQ(ierr); > > ierr = VecGetSize(x,&n);CHKERRQ(ierr); > > > > double h = 1.0/(n-1) ; > > d = (PetscReal)(n - 1); d = d*d; > > double pos ; > > > > ff[0] = xx[0]; // left boundary with Dirichlet = 0 > > // residual : (un-1 -2*un + un+1)/h^2 + Reaction*u - f > > for (i=1; i > pos = i*h ; > > ff[i] = -Diffusion(pos, 0, 0, 0, xx[i])*d*(xx[i-1] - 2.0*xx[i] + > > xx[i+1]) + Reaction(pos, 0, 0, 0, xx[i])*xx[i] - RHS(pos, 0, 0, 0, > > xx[i]) ; > > } > > ff[n-1] = xx[n-1] - 1.0; // right boundary with Dirichlet = 1 > > > > ierr = VecRestoreArray(x,&xx);CHKERRQ(ierr); > > ierr = VecRestoreArray(f,&ff);CHKERRQ(ierr); > > PetscFunctionReturn(0); > > } > > > > One question though. If i use GetArray and RestoreArray to change the > > values directly in memory, do i still have to make the > > VecAssemblyBegin-End calls ? > > > > Thanks again for the help Matt. > > > > Vijay > > > > > > > > > > On Jan 22, 2008 5:02 PM, Matthew Knepley wrote: > > > On Jan 22, 2008 3:54 PM, Vijay M < vijay.m at gmail.com> wrote: > > > > Hi all, > > > > > > > > I am currently trying to use LibMesh with PETSc SNES solver to solve a > > > > nonlinear Diffusion-reaction problem. The code works fine with 1 > > > > processor but when i use 2 processors for the exact same problem, it > > > > throws me this error regarding memory corruption. I am not sure what > > > > this error is about and was wondering if someone can help me out on > > > > this. Note: My residual function is being called successfully and > > > > returns the residual back without any problem since i can see some > > > > print message at the end of the call ! Hence, this problem is not in > > > > my custom FormFunction. > > > > > > Actually, it is very likely that the problem is in your FormFunction. > The > > > error is being reported because after every call to FormFunction, we > > > walk the PETSc heap and validate all the pieces of memory we allocated. > > > Something wrote over a piece of memory we already own, so the OS > > > did not complain and you saw your printout, however there is still > corruption. > > > I would advise you to run 'valgrind' on the code. It is the best tool I > have > > > used for finding these kind of errors. > > > > > > Matt > > > > > > > > > > [1]PETSC ERROR: PetscMallocValidate: error detected at > > > > SNESComputeFunction() line 950 in src/snes/interface/snes.c > > > > [1]PETSC ERROR: Memory at address 0xa5cf40 is corrupted > > > > [1]PETSC ERROR: Probably write past beginning or end of array > > > > [1]PETSC ERROR: Last intact block allocated in PetscStrallocpy() line > > > > 82 in src/sys/utils/str.c > > > > [0]PETSC ERROR: PetscMallocValidate: error detected at > > > > SNESComputeFunction() line 950 in src/snes/interface/snes.c > > > > [0]PETSC ERROR: Memory at address 0xa5cf30 is corrupted > > > > [0]PETSC ERROR: Probably write past beginning or end of array > > > > [0]PETSC ERROR: Last intact block allocated in PetscStrallocpy() line > > > > 82 in src/sys/utils/str.c > > > > [0]PETSC ERROR: --------------------- Error Message > > > > ------------------------------------ > > > > [0]PETSC ERROR: Memory corruption! > > > > [0]PETSC ERROR: ! > > > > [0]PETSC ERROR: > > > > > ------------------------------------------------------------------------ > > > > [0]PETSC ERROR: Petsc Release Version 2.3.3, Patch 7, Fri Oct 26 > > > > 14:21:35 CDT 2007 HG revision: > > > > 2e223033ba960114833e1f9713ab393ec78c056f > > > > [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: ./myProg-opt on a linux-gnu named [1]PETSC ERROR: > > > > --------------------- Error Message > > > > ------------------------------------ > > > > [1]PETSC ERROR: Memory corruption! > > > > [1]PETSC ERROR: ! > > > > [1]PETSC ERROR: > > > > > ------------------------------------------------------------------------ > > > > [1]PETSC ERROR: Petsc Release Version 2.3.3, Patch 7, Fri Oct 26 > > > > 14:21:35 CDT 2007 HG revision: > > > > 2e223033ba960114833e1f9713ab393ec78c056f > > > > [1]PETSC ERROR: See docs/changes/index.html for recent updates. > > > > [1]PETSC ERROR: See docs/faq.html for hints about trouble shooting. > > > > [1]PETSC ERROR: See docs/index.html for manual pages. > > > > [1]PETSC ERROR: ----------------------------[cli_0]: aborting job: > > > > application called MPI_Abort(comm=0x84000000, 78) - process 0 > > > > [cli_1]: aborting job: > > > > application called MPI_Abort(comm=0x84000000, 78) - process 1 > > > > grove.ne.tamu.edu by vijaysm Tue Jan 22 15:47:58 2008 > > > > [0]PETSC ERROR: Libraries linked from > > > > /state/partition1/local/petsc-2.3.3-p7/lib/linux-gnu-c-debug > > > > [0]PETSC ERROR: Configure run at Fri Nov 9 15:02:46 2007 > > > > [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=ifort > > > > --with-cxx=g++ --download-f-blas-lapack=1 --download-mpich=1 > > > > --with-shared=1 > > > > [0]PETSC ERROR: > > > > > ------------------------------------------------------------------------ > > > > [0]PETSC ERROR: PetscMallocValidate() line 139 in src/sys/memory/mtr.c > > > > [0]PETSC ERROR: SNESComputeFunction() line 950 in > src/snes/interface/snes.c > > > > [0]PETSC ERROR: SNESSolve_LS() line 158 in src/snes/impls/ls/ls.c > > > > [0]PETSC ERROR: SNESSolve() line 1871 in src/snes/interface/snes.c > > > > [0]PETSC ERROR: main() line 395 in unknowndirectory/myProg.C > > > > > > > > If you need some more information, feel free to let me know. Thanks in > advance ! > > > > > > > > Vijay > > > > > > > > > > > > > > > > > > > > -- > > > What most experimenters take for granted before they begin their > > > experiments is infinitely more interesting than any results to which > > > their experiments lead. > > > -- Norbert Wiener > > > > > > > > > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From recrusader at gmail.com Tue Jan 22 20:50:09 2008 From: recrusader at gmail.com (Yujie) Date: Tue, 22 Jan 2008 18:50:09 -0800 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? Message-ID: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> Hi everyone: #include "petsc.h" PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char name[],PetscViewer *lab) #include "petsc.h" PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char name[],PetscFileMode type,PetscViewer *binv) if the difference between them is that one for ASCII output and the other for Binary output, why are there different parameters? The speed to output matrix is very fast when I use PetscViewerBinaryOpen. However, when I use PetscViewerASCIIOpen, I can't get the matrix output. the code always is running and it has taken about one day! what's the problem? thank you. Regards, Yujie -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Jan 22 21:25:43 2008 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 22 Jan 2008 21:25:43 -0600 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? In-Reply-To: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> Message-ID: On Jan 22, 2008 8:50 PM, Yujie wrote: > Hi everyone: > > #include "petsc.h" > PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char > name[],PetscViewer *lab) > > #include "petsc.h" > PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char > name[],PetscFileMode type,PetscViewer *binv) > > if the difference between them is that one for ASCII output and the other > for Binary output, why are there different parameters? It is historical. If you want to be generic, you should use PetscViewerCreate() PetscViewerSetType() PetscViewerFileSetMode() PetscViewerFileSetName() which can create both. > The speed to output matrix is very fast when I use PetscViewerBinaryOpen. > However, when I use PetscViewerASCIIOpen, I can't get the matrix output. the > code always is running and it has taken about one day! what's the problem? > thank you. ASCII files do not make sense for large matrices. You should use binary files. Matt > Regards, > Yujie > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From recrusader at gmail.com Tue Jan 22 23:01:15 2008 From: recrusader at gmail.com (Yujie) Date: Wed, 23 Jan 2008 13:01:15 +0800 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? In-Reply-To: References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> Message-ID: <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> Dear Matt: thank you for your reply. Do you have any method to generate an ascii file of the huge sparse matrix? thanks Regards, Yujie On 1/23/08, Matthew Knepley wrote: > > On Jan 22, 2008 8:50 PM, Yujie wrote: > > Hi everyone: > > > > #include "petsc.h" > > PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char > > name[],PetscViewer *lab) > > > > #include "petsc.h" > > PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char > > name[],PetscFileMode type,PetscViewer *binv) > > > > if the difference between them is that one for ASCII output and the > other > > for Binary output, why are there different parameters? > > It is historical. If you want to be generic, you should use > > PetscViewerCreate() > PetscViewerSetType() > PetscViewerFileSetMode() > PetscViewerFileSetName() > > which can create both. > > > The speed to output matrix is very fast when I > use PetscViewerBinaryOpen. > > However, when I use PetscViewerASCIIOpen, I can't get the matrix output. > the > > code always is running and it has taken about one day! what's the > problem? > > thank you. > > ASCII files do not make sense for large matrices. You should use binary > files. > > Matt > > > Regards, > > Yujie > > > > > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Jan 23 07:53:00 2008 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 23 Jan 2008 07:53:00 -0600 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? In-Reply-To: <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> Message-ID: On Jan 22, 2008 11:01 PM, Yujie wrote: > Dear Matt: > > thank you for your reply. Do you have any method to generate an ascii file > of the huge sparse matrix? thanks I think you miss my point. The PETSc function is not a bad way to generate ASCII matrices. ASCII matrices make "no sense" for large operators. Matt > Regards, > Yujie > > > > On 1/23/08, Matthew Knepley wrote: > > On Jan 22, 2008 8:50 PM, Yujie wrote: > > > Hi everyone: > > > > > > #include "petsc.h" > > > PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char > > > name[],PetscViewer *lab) > > > > > > #include "petsc.h" > > > PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char > > > name[],PetscFileMode type,PetscViewer *binv) > > > > > > if the difference between them is that one for ASCII output and the > other > > > for Binary output, why are there different parameters? > > > > It is historical. If you want to be generic, you should use > > > > PetscViewerCreate() > > PetscViewerSetType() > > PetscViewerFileSetMode() > > PetscViewerFileSetName() > > > > which can create both. > > > > > The speed to output matrix is very fast when I use > PetscViewerBinaryOpen. > > > However, when I use PetscViewerASCIIOpen, I can't get the matrix output. > the > > > code always is running and it has taken about one day! what's the > problem? > > > thank you. > > > > ASCII files do not make sense for large matrices. You should use binary > files. > > > > Matt > > > > > Regards, > > > Yujie > > > > > > > > > > > > > > > > > -- > > What most experimenters take for granted before they begin their > > experiments is infinitely more interesting than any results to which > > their experiments lead. > > -- Norbert Wiener > > > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From recrusader at gmail.com Wed Jan 23 14:18:24 2008 From: recrusader at gmail.com (Yujie) Date: Wed, 23 Jan 2008 12:18:24 -0800 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? In-Reply-To: References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> Message-ID: <7ff0ee010801231218xc0281b2n8a7db71713ede8fb@mail.gmail.com> Thank you for your further explanation. I just want to use this data in other packages. I think that ASCII file is likely better. Because I don't know the format of the binary file? how to find it? In addition, do you have any better methods to save the sparsity structure picture of the matrix? Now, I use "-mat_view_draw" to do this. However, the speed is very slow and the picture is small. I want to get a big picture and directly save it to the disk? could you give me some advice? thanks a lot. Regards, Yujie On 1/23/08, Matthew Knepley wrote: > > On Jan 22, 2008 11:01 PM, Yujie wrote: > > Dear Matt: > > > > thank you for your reply. Do you have any method to generate an ascii > file > > of the huge sparse matrix? thanks > > I think you miss my point. The PETSc function is not a bad way to generate > ASCII matrices. ASCII matrices make "no sense" for large operators. > > Matt > > > Regards, > > Yujie > > > > > > > > On 1/23/08, Matthew Knepley wrote: > > > On Jan 22, 2008 8:50 PM, Yujie wrote: > > > > Hi everyone: > > > > > > > > #include "petsc.h" > > > > PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char > > > > name[],PetscViewer *lab) > > > > > > > > #include "petsc.h" > > > > PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char > > > > name[],PetscFileMode type,PetscViewer *binv) > > > > > > > > if the difference between them is that one for ASCII output and the > > other > > > > for Binary output, why are there different parameters? > > > > > > It is historical. If you want to be generic, you should use > > > > > > PetscViewerCreate() > > > PetscViewerSetType() > > > PetscViewerFileSetMode() > > > PetscViewerFileSetName() > > > > > > which can create both. > > > > > > > The speed to output matrix is very fast when I use > > PetscViewerBinaryOpen. > > > > However, when I use PetscViewerASCIIOpen, I can't get the matrix > output. > > the > > > > code always is running and it has taken about one day! what's the > > problem? > > > > thank you. > > > > > > ASCII files do not make sense for large matrices. You should use > binary > > files. > > > > > > Matt > > > > > > > Regards, > > > > Yujie > > > > > > > > > > > > > > > > > > > > > > > > -- > > > What most experimenters take for granted before they begin their > > > experiments is infinitely more interesting than any results to which > > > their experiments lead. > > > -- Norbert Wiener > > > > > > > > > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Jan 23 14:47:11 2008 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 23 Jan 2008 14:47:11 -0600 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? In-Reply-To: <7ff0ee010801231218xc0281b2n8a7db71713ede8fb@mail.gmail.com> References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> <7ff0ee010801231218xc0281b2n8a7db71713ede8fb@mail.gmail.com> Message-ID: On Jan 23, 2008 2:18 PM, Yujie wrote: > Thank you for your further explanation. I just want to use this data in > other packages. I think that ASCII file is likely better. Because I don't > know the format of the binary file? how to find it? Look at MatView_SeqAIJ_Binary() in src/mat/impls/aij/seq/aij.c. The format is pretty simple. > In addition, do you have any better methods to save the sparsity structure > picture of the matrix? Now, I use "-mat_view_draw" to do this. However, the > speed is very slow and the picture is small. I want to get a big picture and > directly save it to the disk? > could you give me some advice? thanks a lot. We do not have a better way to make the sparsity picture. I assume you could write something that decides how many pixels to use, calculates an average occupancy per pixel, and writes a BMP or something. Matt > Regards, > Yujie > > On 1/23/08, Matthew Knepley wrote: > > On Jan 22, 2008 11:01 PM, Yujie wrote: > > > Dear Matt: > > > > > > thank you for your reply. Do you have any method to generate an ascii > file > > > of the huge sparse matrix? thanks > > > > I think you miss my point. The PETSc function is not a bad way to generate > > ASCII matrices. ASCII matrices make "no sense" for large operators. > > > > Matt > > > > > Regards, > > > Yujie > > > > > > > > > > > > On 1/23/08, Matthew Knepley wrote: > > > > On Jan 22, 2008 8:50 PM, Yujie < recrusader at gmail.com> wrote: > > > > > Hi everyone: > > > > > > > > > > #include "petsc.h" > > > > > PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char > > > > > name[],PetscViewer *lab) > > > > > > > > > > #include "petsc.h" > > > > > PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char > > > > > name[],PetscFileMode type,PetscViewer *binv) > > > > > > > > > > if the difference between them is that one for ASCII output and the > > > other > > > > > for Binary output, why are there different parameters? > > > > > > > > It is historical. If you want to be generic, you should use > > > > > > > > PetscViewerCreate() > > > > PetscViewerSetType() > > > > PetscViewerFileSetMode() > > > > PetscViewerFileSetName() > > > > > > > > which can create both. > > > > > > > > > The speed to output matrix is very fast when I use > > > PetscViewerBinaryOpen. > > > > > However, when I use PetscViewerASCIIOpen, I can't get the matrix > output. > > > the > > > > > code always is running and it has taken about one day! what's the > > > problem? > > > > > thank you. > > > > > > > > ASCII files do not make sense for large matrices. You should use > binary > > > files. > > > > > > > > Matt > > > > > > > > > Regards, > > > > > Yujie > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > What most experimenters take for granted before they begin their > > > > experiments is infinitely more interesting than any results to which > > > > their experiments lead. > > > > -- Norbert Wiener > > > > > > > > > > > > > > > > > > > > > > -- > > What most experimenters take for granted before they begin their > > experiments is infinitely more interesting than any results to which > > their experiments lead. > > -- Norbert Wiener > > > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From recrusader at gmail.com Wed Jan 23 18:44:36 2008 From: recrusader at gmail.com (Yujie) Date: Wed, 23 Jan 2008 16:44:36 -0800 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? In-Reply-To: References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> <7ff0ee010801231218xc0281b2n8a7db71713ede8fb@mail.gmail.com> Message-ID: <7ff0ee010801231644k66ca9c7eib9342761e9ff069f@mail.gmail.com> Do you have any examples to show how to output the sparsity picture? thanks a lot. Yujie On 1/23/08, Matthew Knepley wrote: > > On Jan 23, 2008 2:18 PM, Yujie wrote: > > Thank you for your further explanation. I just want to use this data in > > other packages. I think that ASCII file is likely better. Because I > don't > > know the format of the binary file? how to find it? > > Look at MatView_SeqAIJ_Binary() in src/mat/impls/aij/seq/aij.c. The > format is pretty simple. > > > In addition, do you have any better methods to save the sparsity > structure > > picture of the matrix? Now, I use "-mat_view_draw" to do this. However, > the > > speed is very slow and the picture is small. I want to get a big picture > and > > directly save it to the disk? > > could you give me some advice? thanks a lot. > > We do not have a better way to make the sparsity picture. I assume you > could > write something that decides how many pixels to use, calculates an average > occupancy per pixel, and writes a BMP or something. > > Matt > > > Regards, > > Yujie > > > > On 1/23/08, Matthew Knepley wrote: > > > On Jan 22, 2008 11:01 PM, Yujie wrote: > > > > Dear Matt: > > > > > > > > thank you for your reply. Do you have any method to generate an > ascii > > file > > > > of the huge sparse matrix? thanks > > > > > > I think you miss my point. The PETSc function is not a bad way to > generate > > > ASCII matrices. ASCII matrices make "no sense" for large operators. > > > > > > Matt > > > > > > > Regards, > > > > Yujie > > > > > > > > > > > > > > > > On 1/23/08, Matthew Knepley wrote: > > > > > On Jan 22, 2008 8:50 PM, Yujie < recrusader at gmail.com> wrote: > > > > > > Hi everyone: > > > > > > > > > > > > #include "petsc.h" > > > > > > PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char > > > > > > name[],PetscViewer *lab) > > > > > > > > > > > > #include "petsc.h" > > > > > > PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char > > > > > > name[],PetscFileMode type,PetscViewer *binv) > > > > > > > > > > > > if the difference between them is that one for ASCII output and > the > > > > other > > > > > > for Binary output, why are there different parameters? > > > > > > > > > > It is historical. If you want to be generic, you should use > > > > > > > > > > PetscViewerCreate() > > > > > PetscViewerSetType() > > > > > PetscViewerFileSetMode() > > > > > PetscViewerFileSetName() > > > > > > > > > > which can create both. > > > > > > > > > > > The speed to output matrix is very fast when I use > > > > PetscViewerBinaryOpen. > > > > > > However, when I use PetscViewerASCIIOpen, I can't get the matrix > > output. > > > > the > > > > > > code always is running and it has taken about one day! what's > the > > > > problem? > > > > > > thank you. > > > > > > > > > > ASCII files do not make sense for large matrices. You should use > > binary > > > > files. > > > > > > > > > > Matt > > > > > > > > > > > Regards, > > > > > > Yujie > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > What most experimenters take for granted before they begin their > > > > > experiments is infinitely more interesting than any results to > which > > > > > their experiments lead. > > > > > -- Norbert Wiener > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > What most experimenters take for granted before they begin their > > > experiments is infinitely more interesting than any results to which > > > their experiments lead. > > > -- Norbert Wiener > > > > > > > > > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aldo.bonfiglioli at unibas.it Wed Jan 23 03:21:06 2008 From: aldo.bonfiglioli at unibas.it (Aldo Bonfiglioli) Date: Wed, 23 Jan 2008 10:21:06 +0100 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? In-Reply-To: <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> Message-ID: <47970702.3060205@unibas.it> > thank you for your reply. Do you have any method to generate an ascii > file of the huge sparse matrix? thanks I have been using HYPRE calls (from PETSc) to accomplish this. Each processor will write his own portion of the global matrix in his own file. The enclosed file should explain how. Regards, Aldo -- Dr. Aldo Bonfiglioli Dip.to di Ingegneria e Fisica dell'Ambiente (DIFA) Universita' della Basilicata V.le dell'Ateneo lucano, 10 85100 Potenza ITALY tel:+39.0971.205203 fax:+39.0971.205160 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: printmat.F URL: From recrusader at gmail.com Wed Jan 23 20:38:57 2008 From: recrusader at gmail.com (Yujie) Date: Wed, 23 Jan 2008 18:38:57 -0800 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? In-Reply-To: References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> <7ff0ee010801231218xc0281b2n8a7db71713ede8fb@mail.gmail.com> Message-ID: <7ff0ee010801231838s2dd6bcbbpfee184e2b02ad09e@mail.gmail.com> To generate the sparsity picture, could you tell me how to find the code used by "-mat_view_draw"? I have searched the whole PETSc package. However, it is difficult to find it. Thanks a lot. Regards, Yujie On 1/23/08, Matthew Knepley wrote: > > On Jan 23, 2008 2:18 PM, Yujie wrote: > > Thank you for your further explanation. I just want to use this data in > > other packages. I think that ASCII file is likely better. Because I > don't > > know the format of the binary file? how to find it? > > Look at MatView_SeqAIJ_Binary() in src/mat/impls/aij/seq/aij.c. The > format is pretty simple. > > > In addition, do you have any better methods to save the sparsity > structure > > picture of the matrix? Now, I use "-mat_view_draw" to do this. However, > the > > speed is very slow and the picture is small. I want to get a big picture > and > > directly save it to the disk? > > could you give me some advice? thanks a lot. > > We do not have a better way to make the sparsity picture. I assume you > could > write something that decides how many pixels to use, calculates an average > occupancy per pixel, and writes a BMP or something. > > Matt > > > Regards, > > Yujie > > > > On 1/23/08, Matthew Knepley wrote: > > > On Jan 22, 2008 11:01 PM, Yujie wrote: > > > > Dear Matt: > > > > > > > > thank you for your reply. Do you have any method to generate an > ascii > > file > > > > of the huge sparse matrix? thanks > > > > > > I think you miss my point. The PETSc function is not a bad way to > generate > > > ASCII matrices. ASCII matrices make "no sense" for large operators. > > > > > > Matt > > > > > > > Regards, > > > > Yujie > > > > > > > > > > > > > > > > On 1/23/08, Matthew Knepley wrote: > > > > > On Jan 22, 2008 8:50 PM, Yujie < recrusader at gmail.com> wrote: > > > > > > Hi everyone: > > > > > > > > > > > > #include "petsc.h" > > > > > > PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char > > > > > > name[],PetscViewer *lab) > > > > > > > > > > > > #include "petsc.h" > > > > > > PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char > > > > > > name[],PetscFileMode type,PetscViewer *binv) > > > > > > > > > > > > if the difference between them is that one for ASCII output and > the > > > > other > > > > > > for Binary output, why are there different parameters? > > > > > > > > > > It is historical. If you want to be generic, you should use > > > > > > > > > > PetscViewerCreate() > > > > > PetscViewerSetType() > > > > > PetscViewerFileSetMode() > > > > > PetscViewerFileSetName() > > > > > > > > > > which can create both. > > > > > > > > > > > The speed to output matrix is very fast when I use > > > > PetscViewerBinaryOpen. > > > > > > However, when I use PetscViewerASCIIOpen, I can't get the matrix > > output. > > > > the > > > > > > code always is running and it has taken about one day! what's > the > > > > problem? > > > > > > thank you. > > > > > > > > > > ASCII files do not make sense for large matrices. You should use > > binary > > > > files. > > > > > > > > > > Matt > > > > > > > > > > > Regards, > > > > > > Yujie > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > What most experimenters take for granted before they begin their > > > > > experiments is infinitely more interesting than any results to > which > > > > > their experiments lead. > > > > > -- Norbert Wiener > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > What most experimenters take for granted before they begin their > > > experiments is infinitely more interesting than any results to which > > > their experiments lead. > > > -- Norbert Wiener > > > > > > > > > > > > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which > their experiments lead. > -- Norbert Wiener > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From recrusader at gmail.com Wed Jan 23 20:39:35 2008 From: recrusader at gmail.com (Yujie) Date: Wed, 23 Jan 2008 18:39:35 -0800 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? In-Reply-To: <47970702.3060205@unibas.it> References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> <47970702.3060205@unibas.it> Message-ID: <7ff0ee010801231839u24c49924k7ac9066c729dba07@mail.gmail.com> thank you very much, Aldo. On 1/23/08, Aldo Bonfiglioli wrote: > > > thank you for your reply. Do you have any method to generate an ascii > > file of the huge sparse matrix? thanks > > > I have been using HYPRE calls (from PETSc) to accomplish this. > Each processor will write his own portion of the global matrix > in his own file. > The enclosed file should explain how. > > Regards, > Aldo > > -- > Dr. Aldo Bonfiglioli > Dip.to di Ingegneria e Fisica dell'Ambiente (DIFA) > Universita' della Basilicata > V.le dell'Ateneo lucano, 10 85100 Potenza ITALY > tel:+39.0971.205203 fax:+39.0971.205160 > > > SUBROUTINE PrintMat(A,RHS,X,cols,values,maxcols,ITER,JOB) > C > IMPLICIT NONE > C > CC#define HYPER_PARCSR 5555 > C > C > C > C > C $Id: printmat.F,v 1.3 2006/11/10 08:31:31 abonfi Exp abonfi $ > C > #include "include/finclude/petsc.h" > #include "include/finclude/petscvec.h" > #include "include/finclude/petscmat.h" > #include "include/finclude/petscksp.h" > #include "include/finclude/petscpc.h" > #include "include/finclude/petscis.h" > #include "include/finclude/petscviewer.h" > C#include "HYPRE.h" > C#include "IJ_mv.h" > > C > Mat A > Vec RHS,X > INTEGER ITER,JOB > INTEGER rstart,rend,ncols,i,k > INTEGER HYPRE_PARCSR > parameter(HYPRE_PARCSR=5555) > INTEGER maxcols > integer cols(maxcols) > double precision values(maxcols) > double precision info(MAT_INFO_SIZE) > INTEGER nz_a > C > C > C > C > C .. Parameters .. > C .. > C .. Scalar Arguments .. > C .. > C .. Arrays in Common .. > C .. > C .. Local Scalars .. > INTEGER IFAIL,MY_PE > C .. > C .. Local Arrays .. > PetscViewer MyOpenMindedViewer > INTEGER*8 ij > CHARACTER* 6 matfile,rhsfile,solfile > PetscScalar x_array(1) > PetscOffset i_x > PetscInt n > ! PetscErrorCode IFAIL > > C .. > C .. External Functions .. > C .. > C .. External Subroutines .. > C .. > C > C .. Intrinsic Functions .. > C .. > C .. Common blocks .. > COMMON /MPICOM/MY_PE > C .. > C .. Equivalences .. > C .. > C .. Data statements .. > DATA matfile,rhsfile,solfile/"matXXX","rhsXXX","solXXX"/ > C .. > C Executable statements > C > IF(JOB.EQ.0)THEN > call MatGetInfo(A,MAT_LOCAL,info,IFAIL) > nz_a = info(MAT_INFO_NZ_ALLOCATED) > maxcols = info(MAT_INFO_COLUMNS_LOCAL) > CALL VecGetLocalSize(rhs,n,IFAIL) > maxcols = max(maxcols,n) > write(6,*)'PE # ',MY_PE,nz_a,maxcols,n > RETURN > ENDIF > C > IF( ITER. NE. 3 )RETURN > C > WRITE(matfile(4:6),FMT="(I3.3)")0 > WRITE(rhsfile(4:6),FMT="(I3.3)")0 > WRITE(solfile(4:6),FMT="(I3.3)")0 > CALL MatGetOwnershipRange(A,rstart,rend,IFAIL) > CALL HYPRE_IJMatrixCreate(PETSC_COMM_WORLD,rstart,rend-1,rstart, > &rend-1,ij,IFAIL) > ! write(6,*)'HYPRE_IJMatrixCreate has returned ifail = ',ifail > CALL HYPRE_IJMatrixSetObjectType(ij,HYPRE_PARCSR,IFAIL) > ! write(6,*)'HYPRE_IJMatrixSetObjectType has returned ifail = ', > ! &ifail > CALL HYPRE_IJMatrixInitialize(ij,IFAIL) > ! write(6,*)'HYPRE_IJMatrixInitialize has returned ifail = ', > ! &ifail > do i= rstart, rend-1 > CALL MatGetRow(A,i,ncols,cols,values,IFAIL) > if(ncols.GT.maxcols)STOP 'Must increase maxcols' > CALL HYPRE_IJMatrixSetValues(ij,1,ncols,i,cols,values,IFAIL) > CALL MatRestoreRow(A,i,ncols,cols,values,IFAIL) > enddo > CALL HYPRE_IJMatrixAssemble(ij,IFAIL) > CALL HYPRE_IJMatrixPrint(ij,matfile,IFAIL) > ! write(6,*)'HYPRE_IJMatrixPrint has returned ifail = ', > ! &ifail > CALL HYPRE_IJMatrixDestroy(ij,IFAIL) > ! write(6,*)'HYPRE_IJMatrixDestroy has returned ifail = ', > ! &ifail > C > C now dump rhs > C > CALL VecGetOwnerShipRange(rhs,rstart,rend,IFAIL) > CALL HYPRE_IJVectorCreate(PETSC_COMM_WORLD,rstart,rend-1, > &ij,IFAIL) > ! write(6,*)'HYPRE_IJVectorCreate has returned ifail = ', > ! &ifail > CALL HYPRE_IJVectorSetObjectType(ij,HYPRE_PARCSR,IFAIL) > ! write(6,*)'HYPRE_IJSetObjectType has returned ifail = ', > ! &ifail > CALL HYPRE_IJVectorInitialize(ij,IFAIL) > ! write(6,*)'HYPRE_IJVectorInitialize has returned ifail = ', > ! &ifail > CALL VecGetLocalSize(rhs,n,IFAIL) > if(n.GT.maxcols)STOP 'Must increase maxcols' > CALL VecGetArray(rhs,x_array,i_x,IFAIL) > k = 0 > do i = rstart,rend-1 > k = k + 1 > cols(k) = i > enddo > ! write(6,*)rend-rstart,n > CALL HYPRE_IJVectorSetValues(ij,n,cols,x_array(i_x + 1),IFAIL) > ! write(6,*)'HYPRE_IJVectorSetValues has returned ifail = ', > ! &ifail > CALL HYPRE_IJVectorAssemble(ij,IFAIL) > CALL VecRestoreArray(rhs,x_array,i_x,IFAIL) > CALL HYPRE_IJVectorPrint(ij,rhsfile,IFAIL) > ! write(6,*)'HYPRE_IJVectorPrint has returned ifail = ', > ! &ifail > CALL HYPRE_IJVectorDestroy(ij,IFAIL) > c > c dump solution > c > CALL VecGetOwnerShipRange(x,rstart,rend,IFAIL) > CALL HYPRE_IJVectorCreate(PETSC_COMM_WORLD,rstart,rend-1, > &ij,IFAIL) > ! write(6,*)'HYPRE_IJVectorCreate has returned ifail = ', > ! &ifail > CALL HYPRE_IJVectorSetObjectType(ij,HYPRE_PARCSR,IFAIL) > ! write(6,*)'HYPRE_IJSetObjectType has returned ifail = ', > ! &ifail > CALL HYPRE_IJVectorInitialize(ij,IFAIL) > ! write(6,*)'HYPRE_IJVectorInitialize has returned ifail = ', > ! &ifail > CALL VecGetLocalSize(x,n,IFAIL) > if(n.GT.maxcols)STOP 'Must increase maxcols' > CALL VecGetArray(x,x_array,i_x,IFAIL) > k = 0 > do i = rstart,rend-1 > k = k + 1 > cols(k) = i > enddo > CALL HYPRE_IJVectorSetValues(ij,n,cols,x_array(i_x + 1),IFAIL) > ! write(6,*)'HYPRE_IJVectorSetValues has returned ifail = ', > ! &ifail > CALL VecRestoreArray(x,x_array,i_x,IFAIL) > CALL HYPRE_IJVectorAssemble(ij,IFAIL) > CALL HYPRE_IJVectorPrint(ij,solfile,IFAIL) > ! write(6,*)'HYPRE_IJVectorPrint has returned ifail = ', > ! &ifail > CALL HYPRE_IJVectorDestroy(ij,IFAIL) > RETURN > END > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Jan 23 20:50:11 2008 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 23 Jan 2008 20:50:11 -0600 Subject: what's the difference between PetscViewerASCIIOpen() and PetscViewerBinaryOpen()? In-Reply-To: <7ff0ee010801231838s2dd6bcbbpfee184e2b02ad09e@mail.gmail.com> References: <7ff0ee010801221850h4a4161efu6ec3190f3525346d@mail.gmail.com> <7ff0ee010801222101k471b3c00xe22e933efacb7939@mail.gmail.com> <7ff0ee010801231218xc0281b2n8a7db71713ede8fb@mail.gmail.com> <7ff0ee010801231838s2dd6bcbbpfee184e2b02ad09e@mail.gmail.com> Message-ID: MatView_SeqAIJ_Draw_Zoom() in src/mat/impls/aij/seq/aij.c To find any function, I would use the debugger. Matt On Jan 23, 2008 8:38 PM, Yujie wrote: > To generate the sparsity picture, could you tell me how to find the code > used by "-mat_view_draw"? I have searched the whole PETSc package. However, > it is difficult to find it. Thanks a lot. > > Regards, > Yujie > > On 1/23/08, Matthew Knepley wrote: > > On Jan 23, 2008 2:18 PM, Yujie wrote: > > > Thank you for your further explanation. I just want to use this data in > > > other packages. I think that ASCII file is likely better. Because I > don't > > > know the format of the binary file? how to find it? > > > > Look at MatView_SeqAIJ_Binary() in src/mat/impls/aij/seq/aij.c. The > > format is pretty simple. > > > > > In addition, do you have any better methods to save the sparsity > structure > > > picture of the matrix? Now, I use "-mat_view_draw" to do this. However, > the > > > speed is very slow and the picture is small. I want to get a big picture > and > > > directly save it to the disk? > > > could you give me some advice? thanks a lot. > > > > We do not have a better way to make the sparsity picture. I assume you > could > > write something that decides how many pixels to use, calculates an average > > occupancy per pixel, and writes a BMP or something. > > > > Matt > > > > > Regards, > > > Yujie > > > > > > On 1/23/08, Matthew Knepley wrote: > > > > On Jan 22, 2008 11:01 PM, Yujie < recrusader at gmail.com> wrote: > > > > > Dear Matt: > > > > > > > > > > thank you for your reply. Do you have any method to generate an > ascii > > > file > > > > > of the huge sparse matrix? thanks > > > > > > > > I think you miss my point. The PETSc function is not a bad way to > generate > > > > ASCII matrices. ASCII matrices make "no sense" for large operators. > > > > > > > > Matt > > > > > > > > > Regards, > > > > > Yujie > > > > > > > > > > > > > > > > > > > > On 1/23/08, Matthew Knepley wrote: > > > > > > On Jan 22, 2008 8:50 PM, Yujie < recrusader at gmail.com> wrote: > > > > > > > Hi everyone: > > > > > > > > > > > > > > #include "petsc.h" > > > > > > > PetscErrorCode PetscViewerASCIIOpen(MPI_Comm comm,const char > > > > > > > name[],PetscViewer *lab) > > > > > > > > > > > > > > #include "petsc.h" > > > > > > > PetscErrorCode PetscViewerBinaryOpen(MPI_Comm comm,const char > > > > > > > name[],PetscFileMode type,PetscViewer *binv) > > > > > > > > > > > > > > if the difference between them is that one for ASCII output and > the > > > > > other > > > > > > > for Binary output, why are there different parameters? > > > > > > > > > > > > It is historical. If you want to be generic, you should use > > > > > > > > > > > > PetscViewerCreate() > > > > > > PetscViewerSetType() > > > > > > PetscViewerFileSetMode() > > > > > > PetscViewerFileSetName() > > > > > > > > > > > > which can create both. > > > > > > > > > > > > > The speed to output matrix is very fast when I use > > > > > PetscViewerBinaryOpen. > > > > > > > However, when I use PetscViewerASCIIOpen, I can't get the matrix > > > output. > > > > > the > > > > > > > code always is running and it has taken about one day! what's > the > > > > > problem? > > > > > > > thank you. > > > > > > > > > > > > ASCII files do not make sense for large matrices. You should use > > > binary > > > > > files. > > > > > > > > > > > > Matt > > > > > > > > > > > > > Regards, > > > > > > > Yujie > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > What most experimenters take for granted before they begin their > > > > > > experiments is infinitely more interesting than any results to > which > > > > > > their experiments lead. > > > > > > -- Norbert Wiener > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > What most experimenters take for granted before they begin their > > > > experiments is infinitely more interesting than any results to which > > > > their experiments lead. > > > > -- Norbert Wiener > > > > > > > > > > > > > > > > > > > > > > -- > > What most experimenters take for granted before they begin their > > experiments is infinitely more interesting than any results to which > > their experiments lead. > > -- Norbert Wiener > > > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From ronanrmo at ig.com.br Fri Jan 25 17:28:08 2008 From: ronanrmo at ig.com.br (USUARIO INICIAL) Date: Fri, 25 Jan 2008 21:28:08 -0200 Subject: Number of iterations of the CG method Message-ID: <7384be030801251528p76155839u85361cd3a531a035@mail.gmail.com> I have a conjugate gradient implemented in C without Petsc and when I solve the linear system of my problem (an elliptic pde) it converges with something about 270 iterations. But with Petsc (ksp_type cg pc_type none) the same linear system converges with 510 iterations. Do someone have any idea why is that happenning? I already checked the matrix and they are equal. The results are quite close and I set the same tolerance to both methods (setting rtol on petsc to a very small number, to use only atol). And besides the number of iterations, the time spent by petsc is not much more than the other method. Thanks, Ronan I'm sorry, I dont know english very well, I did the best I could. From knepley at gmail.com Fri Jan 25 17:35:04 2008 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 25 Jan 2008 17:35:04 -0600 Subject: Number of iterations of the CG method In-Reply-To: <7384be030801251528p76155839u85361cd3a531a035@mail.gmail.com> References: <7384be030801251528p76155839u85361cd3a531a035@mail.gmail.com> Message-ID: This sounds like the stopping criteria are different. Matt On Jan 25, 2008 5:28 PM, USUARIO INICIAL wrote: > I have a conjugate gradient implemented in C without Petsc and when I > solve the linear system of my problem (an elliptic pde) it converges > with something about 270 iterations. But with Petsc (ksp_type cg > pc_type none) the same linear system converges with 510 iterations. > > Do someone have any idea why is that happenning? > > I already checked the matrix and they are equal. The results are quite > close and I set the same tolerance to both methods (setting rtol on > petsc to a very small number, to use only atol). And besides the > number of iterations, the time spent by petsc is not much more than > the other method. > > Thanks, > Ronan > > I'm sorry, I dont know english very well, I did the best I could. > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From mfhoel at ifi.uio.no Fri Jan 25 18:38:08 2008 From: mfhoel at ifi.uio.no (Mads Hoel) Date: Sat, 26 Jan 2008 01:38:08 +0100 Subject: Number of iterations of the CG method In-Reply-To: References: <7384be030801251528p76155839u85361cd3a531a035@mail.gmail.com> Message-ID: Do you use the same starting vector in both cases? You can look at the residual, check it after each iteration. You can also try to let PETSc use the same convergence test/monitor. On Sat, 26 Jan 2008 00:35:04 +0100, Matthew Knepley wrote: > This sounds like the stopping criteria are different. > > Matt > > On Jan 25, 2008 5:28 PM, USUARIO INICIAL wrote: >> I have a conjugate gradient implemented in C without Petsc and when I >> solve the linear system of my problem (an elliptic pde) it converges >> with something about 270 iterations. But with Petsc (ksp_type cg >> pc_type none) the same linear system converges with 510 iterations. >> >> Do someone have any idea why is that happenning? >> >> I already checked the matrix and they are equal. The results are quite >> close and I set the same tolerance to both methods (setting rtol on >> petsc to a very small number, to use only atol). And besides the >> number of iterations, the time spent by petsc is not much more than >> the other method. >> >> Thanks, >> Ronan >> >> I'm sorry, I dont know english very well, I did the best I could. >> >> > > > -- Mads Hoel From bsmith at mcs.anl.gov Fri Jan 25 19:40:33 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 25 Jan 2008 19:40:33 -0600 Subject: Number of iterations of the CG method In-Reply-To: References: <7384be030801251528p76155839u85361cd3a531a035@mail.gmail.com> Message-ID: <1FDEEFBE-8F21-4571-8DF4-9E7661EDCA64@mcs.anl.gov> With PETSc to do this simply run with the option -ksp_monitor. The first few residual norms should be VERY similar; eventually since it is likely the order of the floating point operations is different between your code and PETSc they will eventually be a bit different. But you should see the exact, or almost the exact same number of iterations. Barry On Jan 25, 2008, at 6:38 PM, Mads Hoel wrote: > Do you use the same starting vector in both cases? You can look at > the residual, check it after each iteration. You can also try to let > PETSc use the same convergence test/monitor. > > On Sat, 26 Jan 2008 00:35:04 +0100, Matthew Knepley > wrote: > >> This sounds like the stopping criteria are different. >> >> Matt >> >> On Jan 25, 2008 5:28 PM, USUARIO INICIAL wrote: >>> I have a conjugate gradient implemented in C without Petsc and >>> when I >>> solve the linear system of my problem (an elliptic pde) it converges >>> with something about 270 iterations. But with Petsc (ksp_type cg >>> pc_type none) the same linear system converges with 510 iterations. >>> >>> Do someone have any idea why is that happenning? >>> >>> I already checked the matrix and they are equal. The results are >>> quite >>> close and I set the same tolerance to both methods (setting rtol on >>> petsc to a very small number, to use only atol). And besides the >>> number of iterations, the time spent by petsc is not much more than >>> the other method. >>> >>> Thanks, >>> Ronan >>> >>> I'm sorry, I dont know english very well, I did the best I could. >>> >>> >> >> >> > > > > -- > Mads Hoel > From mafunk at nmsu.edu Tue Jan 29 11:13:32 2008 From: mafunk at nmsu.edu (mafunk at nmsu.edu) Date: Tue, 29 Jan 2008 10:13:32 -0700 (MST) Subject: valgrind PetscInitialize Message-ID: <55609.128.123.130.224.1201626812.squirrel@webmail.nmsu.edu> Hi, i was wondering if anyone has an idea what the problem could be. All i am doing in program is to call MPI_Init() and then PetscInitialize(). I valgrind it and i get the following about PetscInitialize(). It is not a big deal but it bothers me a little. ==7369== 292 (52 direct, 240 indirect) bytes in 1 blocks are definitely lost in loss record 1 of 6 ==7369== at 0x4A1B858: malloc (vg_replace_malloc.c:149) ==7369== by 0x609963F: nss_parse_service_list (in /usr/lib/debug/libc-2.3.6.so) ==7369== by 0x6099D95: __nss_database_lookup (in /usr/lib/debug/libc-2.3.6.so) ==7369== by 0x660863F: ??? ==7369== by 0x6609723: ??? ==7369== by 0x6050F84: getpwuid_r@@GLIBC_2.2.5 (in /usr/lib/debug/libc-2.3.6.so) ==7369== by 0x605090E: getpwuid (in /usr/lib/debug/libc-2.3.6.so) ==7369== by 0x450D53: PetscGetUserName(char*, unsigned long) (fuser.c:67) ==7369== by 0x41E236: PetscErrorPrintfInitialize() (errtrace.c:69) ==7369== by 0x445D7C: PetscInitialize(int*, char***, char const*, char const*) (pinit.c:509) ==7369== by 0x4089E8: main (CardiacSim.cpp:278) I am not the expert on valgrind, but is it possible that the problem is my c library. Has anyone encountered this? mat From knepley at gmail.com Tue Jan 29 12:14:30 2008 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 29 Jan 2008 12:14:30 -0600 Subject: valgrind PetscInitialize In-Reply-To: <55609.128.123.130.224.1201626812.squirrel@webmail.nmsu.edu> References: <55609.128.123.130.224.1201626812.squirrel@webmail.nmsu.edu> Message-ID: __nss_lookup_* does not play well with valgrind. These can be ignored. It is inside the C library through the getpwuid() function. Matt On Jan 29, 2008 11:13 AM, wrote: > Hi, > > i was wondering if anyone has an idea what the problem could be. All i am > doing in program is to call MPI_Init() and then PetscInitialize(). I > valgrind it and i get the following about PetscInitialize(). It is not a > big deal but it bothers me a little. > > > ==7369== 292 (52 direct, 240 indirect) bytes in 1 blocks are definitely > lost in loss record 1 of 6 > ==7369== at 0x4A1B858: malloc (vg_replace_malloc.c:149) > ==7369== by 0x609963F: nss_parse_service_list (in > /usr/lib/debug/libc-2.3.6.so) > ==7369== by 0x6099D95: __nss_database_lookup (in > /usr/lib/debug/libc-2.3.6.so) > ==7369== by 0x660863F: ??? > ==7369== by 0x6609723: ??? > ==7369== by 0x6050F84: getpwuid_r@@GLIBC_2.2.5 (in > /usr/lib/debug/libc-2.3.6.so) > ==7369== by 0x605090E: getpwuid (in /usr/lib/debug/libc-2.3.6.so) > ==7369== by 0x450D53: PetscGetUserName(char*, unsigned long) (fuser.c:67) > ==7369== by 0x41E236: PetscErrorPrintfInitialize() (errtrace.c:69) > ==7369== by 0x445D7C: PetscInitialize(int*, char***, char const*, char > const*) (pinit.c:509) > ==7369== by 0x4089E8: main (CardiacSim.cpp:278) > > I am not the expert on valgrind, but is it possible that the problem is my > c library. Has anyone encountered this? > > mat > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener From mafunk at nmsu.edu Tue Jan 29 12:26:54 2008 From: mafunk at nmsu.edu (Matt Funk) Date: Tue, 29 Jan 2008 11:26:54 -0700 Subject: valgrind PetscInitialize In-Reply-To: References: <55609.128.123.130.224.1201626812.squirrel@webmail.nmsu.edu> Message-ID: <200801291126.54996.mafunk@nmsu.edu> Thanks mat On Tuesday 29 January 2008 11:14, Matthew Knepley wrote: > l From grs2103 at columbia.edu Tue Jan 29 19:43:50 2008 From: grs2103 at columbia.edu (Gideon Simpson) Date: Tue, 29 Jan 2008 20:43:50 -0500 Subject: HYPRE problem Message-ID: <08BD23D9-0CF2-415E-88C0-328DF4D93E0F@columbia.edu> While building petsc with MPICH, UMFPACK, and HYPRE, and without fortran, I get the following error: TESTING: configureLibrary from PETSc.packages.hypre(python/PETSc/ packages/hypre.py:120) using: --with- MPI-include="/opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/include" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ========================= Configuring hypre; this may take several minutes = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ********************************************************************************* UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): --------------------------------------------------------------------------------------- Error running configure on HYPRE: Could not execute 'cd /opt/ petsc-2.3.3-p8/externalpackages/hypre-2.0.0/src;make distclean;./ configure --prefix=/opt/petsc-2.3.3-p8/externalpackages/hypre-2.0.0/ darwin9.1.0-cxx-debug CC="/opt/petsc-2.3.3-p8/externalpackages/ mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- strings -Wno-long-double -Wno-strict-aliasing -g3 " CXX="/opt/ petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/ bin/mpicxx -Wall -Wwrite-strings -Wno-long-double -Wno-strict- aliasing -g -PIC " --with-MPI-include="/opt/petsc-2.3.3-p8/ externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/include" --with- MPI-lib-dirs="" --with-MPI-libs="" --with-blas-libs= --with-blas-lib- dir= --with-lapack-libs= --with-lapack-lib-dir= --with-blas=yes --with- lapack=yes --without-babel --without-mli --without-fei --without- superlu': Dist-cleaning utilities ... rm -f *.o libHYPRE* f2c.h *blas.h *lapack.h rm -rf pchdir tca.map *inslog* Dist-cleaning krylov ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning struct_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning struct_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning sstruct_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning sstruct_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning seq_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning parcsr_mv ... rm -f *.o libHYPRE* rm -f driver driver_matvec driver_matmul rm -rf pchdir tca.map *inslog* Dist-cleaning parcsr_block_mv ... rm -rf *.o libHYPRE_* rm -f driver driver_matvec driver_matmul Dist-cleaning distributed_matrix ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning matrix_matrix ... rm -f *.o lib* rm -rf pchdir tca.map *inslog* Dist-cleaning IJ_mv ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning distributed_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning parcsr_ls ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning multivector ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning lib ... rm -f *.o libHYPRE* rm -rf pchdir tca.map *inslog* Dist-cleaning test ... rm -f *.o rm -rf pchdir tca.map *inslog* rm -f ij ij_mv new_ij sstruct sstruct_fac struct maxwell_unscaled ams_driver rm -f ex1_for ex3_for ex5_for ex6_for ex7_for rm -f f77_ij f77_ij_mv f77_struct rm -f struct_b sstruct_b ij_b rm -f rm -f f77_ij_b f77_struct_b rm -f fei rm -f TEST_examples/*.out* rm -f TEST_examples/*.err* rm -f TEST_fac/*.out* rm -f TEST_fac/*.err* rm -f TEST_ij/*.out* rm -f TEST_ij/*.err* rm -f TEST_ij/*.txt* rm -f TEST_ij/vectors.* rm -f TEST_sstruct/*.out* rm -f TEST_sstruct/*.err* rm -f TEST_struct/*.out* rm -f TEST_struct/*.err* rm -f ex1 ex2 ex3 ex4 ex5 ex5b ex5b77 ex6 ex7 ex8 ex9 Dist-cleaning seq_ls ... checking build system type... i686-apple-darwin9.1.0 checking host system type... i686-apple-darwin9.1.0 checking for mpxlf... no checking for mpf77... no checking for mpif77... mpif77 checking for ranlib... ranlib checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether ln -s works... yes checking whether make sets $(MAKE)... yes checking for gcc... /opt/petsc-2.3.3-p8/externalpackages/ mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- strings -Wno-long-double -Wno-strict-aliasing -g3 checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g3 accepts -g... yes checking for /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g3 option to accept ANSI C... none needed checking how to run the C preprocessor... /opt/petsc-2.3.3-p8/ externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC - Wall -Wwrite-strings -Wno-long-double -Wno-strict-aliasing -g3 -E checking for gcc... (cached) /opt/petsc-2.3.3-p8/externalpackages/ mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- strings -Wno-long-double -Wno-strict-aliasing -g3 checking whether we are using the GNU C compiler... (cached) yes checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g3 accepts -g... (cached) yes checking for /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g3 option to accept ANSI C... (cached) none needed checking whether we are using the GNU C++ compiler... yes checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ darwin9.1.0-cxx-debug/bin/mpicxx -Wall -Wwrite-strings -Wno-long- double -Wno-strict-aliasing -g -PIC accepts -g... yes checking how to run the C++ preprocessor... /opt/petsc-2.3.3-p8/ externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicxx - Wall -Wwrite-strings -Wno-long-double -Wno-strict-aliasing -g -PIC -E checking whether we are using the GNU Fortran 77 compiler... no checking whether mpif77 accepts -g... no checking how to get verbose linking output from mpif77... checking for Fortran libraries of mpif77... checking for dummy main to link with Fortran libraries... none checking for Fortran name-mangling scheme... make[1]: *** No rule to make target `distclean'. Stop. make: *** [distclean] Error 2 rm: conftest.dSYM: is a directory configure: WARNING: compilation failed rm: conftest.dSYM: is a directory rm: conftest.dSYM: is a directory configure: error: cannot compile a simple Fortran program See `config.log' for more details. From bsmith at mcs.anl.gov Tue Jan 29 19:49:48 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 29 Jan 2008 19:49:48 -0600 Subject: HYPRE problem In-Reply-To: <08BD23D9-0CF2-415E-88C0-328DF4D93E0F@columbia.edu> References: <08BD23D9-0CF2-415E-88C0-328DF4D93E0F@columbia.edu> Message-ID: Please send to petsc-maint at mcs.anl.gov (NOT this list) 1) the entire petsc configure.log and 2) the file config.log from the directory externalpackages/hypre-2.0.0 Barry On Jan 29, 2008, at 7:43 PM, Gideon Simpson wrote: > While building petsc with MPICH, UMFPACK, and HYPRE, and without > fortran, I get the following error: > > TESTING: configureLibrary from PETSc.packages.hypre(python/PETSc/ > packages/hypre.py:120) using: -- > with-MPI-include="/opt/petsc-2.3.3-p8/externalpackages/ > mpich2-1.0.5p4/darwin9.1.0-cxx-debug/include" > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > ======================= > Configuring hypre; this may take several > minutes > > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > = > ********************************************************************************* > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log > for details): > --------------------------------------------------------------------------------------- > Error running configure on HYPRE: Could not execute 'cd /opt/ > petsc-2.3.3-p8/externalpackages/hypre-2.0.0/src;make distclean;./ > configure --prefix=/opt/petsc-2.3.3-p8/externalpackages/hypre-2.0.0/ > darwin9.1.0-cxx-debug CC="/opt/petsc-2.3.3-p8/externalpackages/ > mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- > strings -Wno-long-double -Wno-strict-aliasing -g3 " CXX="/opt/ > petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/ > bin/mpicxx -Wall -Wwrite-strings -Wno-long-double -Wno-strict- > aliasing -g -PIC " --with-MPI-include="/opt/petsc-2.3.3-p8/ > externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/include" -- > with-MPI-lib-dirs="" --with-MPI-libs="" --with-blas-libs= --with- > blas-lib-dir= --with-lapack-libs= --with-lapack-lib-dir= --with- > blas=yes --with-lapack=yes --without-babel --without-mli --without- > fei --without-superlu': > Dist-cleaning utilities ... > rm -f *.o libHYPRE* f2c.h *blas.h *lapack.h > rm -rf pchdir tca.map *inslog* > Dist-cleaning krylov ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning struct_mv ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning struct_ls ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning sstruct_mv ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning sstruct_ls ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning seq_mv ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning parcsr_mv ... > rm -f *.o libHYPRE* > rm -f driver driver_matvec driver_matmul > rm -rf pchdir tca.map *inslog* > Dist-cleaning parcsr_block_mv ... > rm -rf *.o libHYPRE_* > rm -f driver driver_matvec driver_matmul > Dist-cleaning distributed_matrix ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning matrix_matrix ... > rm -f *.o lib* > rm -rf pchdir tca.map *inslog* > Dist-cleaning IJ_mv ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning distributed_ls ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning parcsr_ls ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning multivector ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning lib ... > rm -f *.o libHYPRE* > rm -rf pchdir tca.map *inslog* > Dist-cleaning test ... > rm -f *.o > rm -rf pchdir tca.map *inslog* > rm -f ij ij_mv new_ij sstruct sstruct_fac struct maxwell_unscaled > ams_driver > rm -f ex1_for ex3_for ex5_for ex6_for ex7_for > rm -f f77_ij f77_ij_mv f77_struct > rm -f struct_b sstruct_b ij_b > rm -f > rm -f f77_ij_b f77_struct_b > rm -f fei > rm -f TEST_examples/*.out* > rm -f TEST_examples/*.err* > rm -f TEST_fac/*.out* > rm -f TEST_fac/*.err* > rm -f TEST_ij/*.out* > rm -f TEST_ij/*.err* > rm -f TEST_ij/*.txt* > rm -f TEST_ij/vectors.* > rm -f TEST_sstruct/*.out* > rm -f TEST_sstruct/*.err* > rm -f TEST_struct/*.out* > rm -f TEST_struct/*.err* > rm -f ex1 ex2 ex3 ex4 ex5 ex5b ex5b77 ex6 ex7 ex8 ex9 > Dist-cleaning seq_ls ... > checking build system type... i686-apple-darwin9.1.0 > checking host system type... i686-apple-darwin9.1.0 > checking for mpxlf... no > checking for mpf77... no > checking for mpif77... mpif77 > checking for ranlib... ranlib > checking for a BSD-compatible install... /usr/bin/install -c > checking for gawk... no > checking for mawk... no > checking for nawk... no > checking for awk... awk > checking whether ln -s works... yes > checking whether make sets $(MAKE)... yes > checking for gcc... /opt/petsc-2.3.3-p8/externalpackages/ > mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- > strings -Wno-long-double -Wno-strict-aliasing -g3 > checking for C compiler default output file name... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ > darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno- > long-double -Wno-strict-aliasing -g3 accepts -g... yes > checking for /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ > darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno- > long-double -Wno-strict-aliasing -g3 option to accept ANSI C... > none needed > checking how to run the C preprocessor... /opt/petsc-2.3.3-p8/ > externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc - > PIC -Wall -Wwrite-strings -Wno-long-double -Wno-strict-aliasing -g3 > -E > checking for gcc... (cached) /opt/petsc-2.3.3-p8/externalpackages/ > mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite- > strings -Wno-long-double -Wno-strict-aliasing -g3 > checking whether we are using the GNU C compiler... (cached) yes > checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ > darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno- > long-double -Wno-strict-aliasing -g3 accepts -g... (cached) yes > checking for /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ > darwin9.1.0-cxx-debug/bin/mpicc -PIC -Wall -Wwrite-strings -Wno- > long-double -Wno-strict-aliasing -g3 option to accept ANSI C... > (cached) none needed > checking whether we are using the GNU C++ compiler... yes > checking whether /opt/petsc-2.3.3-p8/externalpackages/mpich2-1.0.5p4/ > darwin9.1.0-cxx-debug/bin/mpicxx -Wall -Wwrite-strings -Wno-long- > double -Wno-strict-aliasing -g -PIC accepts -g... yes > checking how to run the C++ preprocessor... /opt/petsc-2.3.3-p8/ > externalpackages/mpich2-1.0.5p4/darwin9.1.0-cxx-debug/bin/mpicxx - > Wall -Wwrite-strings -Wno-long-double -Wno-strict-aliasing -g - > PIC -E > checking whether we are using the GNU Fortran 77 compiler... no > checking whether mpif77 accepts -g... no > checking how to get verbose linking output from mpif77... > checking for Fortran libraries of mpif77... > checking for dummy main to link with Fortran libraries... none > checking for Fortran name-mangling scheme... make[1]: *** No rule to > make target `distclean'. Stop. > make: *** [distclean] Error 2 > rm: conftest.dSYM: is a directory > configure: WARNING: compilation failed > rm: conftest.dSYM: is a directory > rm: conftest.dSYM: is a directory > configure: error: cannot compile a simple Fortran program > See `config.log' for more details. > From scott.busch at colorado.edu Thu Jan 31 17:56:44 2008 From: scott.busch at colorado.edu (Scott Busch) Date: Thu, 31 Jan 2008 16:56:44 -0700 Subject: Old PETSc Version Documentation Message-ID: <5cfd2d780801311556j57d8bc21ve1f413451aac6344@mail.gmail.com> Hello everyone, I am in the process of attempting to update some code that uses an older version of PETSc (I think somewhere about v2.0.0 to v2.1.0 from looking through the change logs) to the newest version (2.3.3). I was going to see if anyone knew of a place online or where I might be able to download the manual pages from these previous releases? I have stumbled across a couple websites that have certain versions of the old documentation available but those seem few and far between. Does anyone know of a good location to find some of this old documentation? Thank you, Scott Busch Computer Science University of Colorado at Boulder From balay at mcs.anl.gov Thu Jan 31 19:14:13 2008 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 31 Jan 2008 19:14:13 -0600 (CST) Subject: Old PETSc Version Documentation In-Reply-To: <5cfd2d780801311556j57d8bc21ve1f413451aac6344@mail.gmail.com> References: <5cfd2d780801311556j57d8bc21ve1f413451aac6344@mail.gmail.com> Message-ID: The documentation for each release of PETSc is within the tarball for that release. [most of the old tarballs are downloadable from our ftp site] We have these untared sources avaiable online aswell [starting with petsc-2.1.2]. For eg: you can check: http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-2.1.2/docs/index.html Satish On Thu, 31 Jan 2008, Scott Busch wrote: > Hello everyone, > > I am in the process of attempting to update some code that uses an > older version of PETSc (I think somewhere about v2.0.0 to v2.1.0 from > looking through the change logs) to the newest version (2.3.3). > > I was going to see if anyone knew of a place online or where I might > be able to download the manual pages from these previous releases? > > I have stumbled across a couple websites that have certain versions of > the old documentation available but those seem few and far between. > > Does anyone know of a good location to find some of this old documentation? > > Thank you, > Scott Busch > Computer Science > University of Colorado at Boulder > > From bsmith at mcs.anl.gov Thu Jan 31 19:14:30 2008 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 31 Jan 2008 19:14:30 -0600 Subject: Old PETSc Version Documentation In-Reply-To: <5cfd2d780801311556j57d8bc21ve1f413451aac6344@mail.gmail.com> References: <5cfd2d780801311556j57d8bc21ve1f413451aac6344@mail.gmail.com> Message-ID: <9B48D5A2-0E88-4D43-A770-695DACD6802D@mcs.anl.gov> Scott At the anonymous ftp site: ftp.mcs.anl.gov in the directory pub/ petsc/software_old you can find many of the old releases. The ones NOT labeled with lite will have their documentation in them. Barry On Jan 31, 2008, at 5:56 PM, Scott Busch wrote: > Hello everyone, > > I am in the process of attempting to update some code that uses an > older version of PETSc (I think somewhere about v2.0.0 to v2.1.0 from > looking through the change logs) to the newest version (2.3.3). > > I was going to see if anyone knew of a place online or where I might > be able to download the manual pages from these previous releases? > > I have stumbled across a couple websites that have certain versions of > the old documentation available but those seem few and far between. > > Does anyone know of a good location to find some of this old > documentation? > > Thank you, > Scott Busch > Computer Science > University of Colorado at Boulder > From knepley at gmail.com Thu Jan 31 19:37:30 2008 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 31 Jan 2008 19:37:30 -0600 Subject: Old PETSc Version Documentation In-Reply-To: <9B48D5A2-0E88-4D43-A770-695DACD6802D@mcs.anl.gov> References: <5cfd2d780801311556j57d8bc21ve1f413451aac6344@mail.gmail.com> <9B48D5A2-0E88-4D43-A770-695DACD6802D@mcs.anl.gov> Message-ID: Also, I would highly recommend the Changes documentation: http://www-unix.mcs.anl.gov/petsc/petsc-as/documentation/changes/index.html We try to put all the changes here, or at least the most important. Matt On Jan 31, 2008 7:14 PM, Barry Smith wrote: > > Scott > > At the anonymous ftp site: ftp.mcs.anl.gov in the directory pub/ > petsc/software_old > you can find many of the old releases. The ones NOT labeled with lite > will > have their documentation in them. > > Barry > > > On Jan 31, 2008, at 5:56 PM, Scott Busch wrote: > > > Hello everyone, > > > > I am in the process of attempting to update some code that uses an > > older version of PETSc (I think somewhere about v2.0.0 to v2.1.0 from > > looking through the change logs) to the newest version (2.3.3). > > > > I was going to see if anyone knew of a place online or where I might > > be able to download the manual pages from these previous releases? > > > > I have stumbled across a couple websites that have certain versions of > > the old documentation available but those seem few and far between. > > > > Does anyone know of a good location to find some of this old > > documentation? > > > > Thank you, > > Scott Busch > > Computer Science > > University of Colorado at Boulder > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener