[petsc-dev] error messages
90 plus percent of PETSc users must view error messages as a “useless blob of gunk that merely tells you an error has occurred”. How can we get them to understand that they contain useful information? Better formatting? Color? Barry
[petsc-dev] Show download URL
Hi, I recently came across an issue with a segfault in ddot. It turns out that the problem was not at all in petsc, but rather that the machine I was compiling PETSc from had no direct access to the internet (quite common in industry HPC clusters), and that the admin was downloading chaco from sandia directly instead of the patched tarball hosted on petsc servers. (I could also elaborate on the sanity of redefining ddot in a LIBRARY...) This brings my first request: the chaco tarball on MCS and sandia have the same name. Would it make sense to clearly indicate when a packaged hosted by petsc is different from the upstream package? It would have made it clear from the beginning that the admin was not using the PETSc patched tarball. Secondly: right now, short of knowing that the url are in the python config files in $PETSC_DIR/config/PETSc/packages (or config/BuildSYstem/config/packages, for some reason), the workflow to download packages on a machine with no direct internet access is to configure with --download-coolpackage, wait a long time for configure to run, wait until download fails, and a message Unable to download package Chaco from: http://ftp.mcs.anl.gov/pub/petsc/externalpackages/coolpackage.tar.gz to pop up Would it be possible to 1. print the download url _before_ trying to download a package 2. add a configure options that would print the url of all packages for which a download has been requested? Not understanding the logic of BuildSystem, I don’t know if 2. is even possible, but it sure would be nice... Regards, Blaise -- Department of Mathematics and Center for Computation Technology Louisiana State University, Baton Rouge, LA 70803, USA Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin
[petsc-dev] all next nightly builds broken due to library versioning stuff being added
http://ftp.mcs.anl.gov/pub/petsc/nightlylogs/archive/2014/02/13/next.html
Re: [petsc-dev] all next nightly builds broken due to library versioning stuff being added
Barry Smith bsm...@mcs.anl.gov writes: http://ftp.mcs.anl.gov/pub/petsc/nightlylogs/archive/2014/02/13/next.html Fixed now, sorry. pgpqShDjzITPt.pgp Description: PGP signature
Re: [petsc-dev] Show download URL
Damn, damn, damn, and this was a known problem but both Satish and I now have grey hair and terrible memory! This is a screwup on our part, we did not properly institutionalize our knowledge by imbedding it into the code. I have pushed to maint and next two changes 1) When using the Sandia tar ball you will now get ~/Src/petsc barry/fix-chaco $ ./configure --download-chaco=/Users/barrysmith/Downloads/Chaco-2.2.tar.gz --download-mpich === Configuring PETSc to compile on your system === === Compiling chaco; this may take several minutes === TESTING: check from config.libraries(config/BuildSystem/config/libraries.py:145) *** UNABLE to CONFIGURE with GIVEN OPTIONS(see configure.log for details): --- You cannot use Chaco package from Sandia as it contains an incorrect ddot() routine that conflicts with BLAS Use --download-chaco *** 2) Your first request. ./configure will print the location of the download tar ball it is getting before trying to get it ~/Src/petsc barry/fix-chaco $ ./configure --download-chaco --download-mpich === Configuring PETSc to compile on your system === === Trying to download http://ftp.mcs.anl.gov/pub/petsc/externalpackages/Chaco-2.2-p1.tar.gz for CHACO === === Compiling chaco; this may take several minutes Your second request is harder, configure doesn’t know everything it is doing in advance (before it has successfully done everything up to that point) so just getting ./configure to dump the locations of all the tar balls is not trivial. The easiest way is with grep self.download config/PETSc/packages/*.py I’m sorry we wasted so much of your time and embarrassed ourselves in front of the important company. Barry Needless to say their refusal to give access to the internet from their “HPC” systems is a silly non-productive way of trying to protect their (probably worthless anyway) IP and much better strategies can be used to protect themselves. On Feb 13, 2014, at 9:33 AM, Blaise A Bourdin bour...@lsu.edu wrote: Hi, I recently came across an issue with a segfault in ddot. It turns out that the problem was not at all in petsc, but rather that the machine I was compiling PETSc from had no direct access to the internet (quite common in industry HPC clusters), and that the admin was downloading chaco from sandia directly instead of the patched tarball hosted on petsc servers. (I could also elaborate on the sanity of redefining ddot in a LIBRARY...) This brings my first request: the chaco tarball on MCS and sandia have the same name. Would it make sense to clearly indicate when a packaged hosted by petsc is different from the upstream package? It would have made it clear from the beginning that the admin was not using the PETSc patched tarball. Secondly: right now, short of knowing that the url are in the python config files in
Re: [petsc-dev] [petsc-maint] SNESMF
On Feb 13, 2014, at 9:44 PM, pano...@mech.upatras.gr pano...@mech.upatras.gr wrote: Barry, I am trying to make a dual time implicit scheme where essentially I have a pseudo-time step which appears only in the Jacobian. Hmm, so if this is a reasonable thing (Jed and Matt?) shouldn’t we add support for it for TSPSEUDO? This is also much like a trust region in that you are adding some scaling of the identity (or some other matrix) to the Jacobian, maybe. Barry Request-assigned: who, add support to TSPSEUDO for pseudo-time step which appears only in the Jacobian For example: So far I had the classical implicit scheme where I had to solve at each time step the following non-linear scheme after linearizing it: [M/Dt + dR/dt ] * DU = -F where [M/Dt + dR/dt ] = dF/dU. Now I have resulted into a new linearized system using pseudo-time step: [M/Dtau + M/Dt + dR/dt ] * DU = -F where the F is the same as above. As you see if I differentiate the F function at RHS I will not take the operator due to the fact that have an additional term (M/Dtau). Of course this problem is coming up due to the numerical differentiation. If I could do it analytically by hand I will have the same function for both RHS and operator. Ok. From what you said to me petsc works as I need. Therefore I am ok for the time being. Kostas. Just curious but why for your problem do you wish to use a different function for differencing for the Jacobian than that you want to find the zero of? Barry On Feb 13, 2014, at 8:58 PM, pano...@mech.upatras.gr pano...@mech.upatras.gr wrote: Thank you a lot. But, As far as I saw I cant do what I need with that because I noticed after implementing it that the first function (Non_linear_function_1 which has been set by SNESsetfunction) is called when petsc wants just to show me the non-linear residual. To be understandable take a look at the following print: As you can see the Non_linear_function_1 is called only at the beginning of each newton step and not at any intermediate gmres stage. Intermediate steps of GMRES never need to recompute the RHS b since it is stored and stays the same for the entire GMRES solve And here I am wondering whether when petsc goes to compute the RHS (b vector of Ax=b) of the linear system at the k Newton iteration uses the Non_linear_function_1 It is using 1 or the Non_linear_function_2. If petsc uses the Non_linear_function_1 whenever it needs a value of (b) then I am ok. Otherwise I cant use it. Basically, with that I want to solve a dual time implicit method for compressible flows where the operator is computed by slighlty different function than the RHS. Just to know what I try to do. Non_linear_function_1 Non_linear_function_1 Non_linear_function_1 Non_linear_function_1 Above 1 is computing the rhs 0 SNES Function norm 1.942206120770e-02 0 KSP unpreconditioned resid norm 1.942206120770e-02 true resid norm 1.942206120770e-02 ||r(i)||/||b|| 1.e+00 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 1 KSP unpreconditioned resid norm 3.959771148164e-04 true resid norm 3.959771148164e-04 ||r(i)||/||b|| 2.038800674047e-02 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 2 KSP unpreconditioned resid norm 8.488671743678e-06 true resid norm 8.488680869120e-06 ||r(i)||/||b|| 4.370638511711e-04 Above 2 is being used to do matrix vector products Non_linear_function_1 Non_linear_function_1 Non_linear_function_1 Non_linear_function_1 Above 1 is being used for the line search. 1 SNES Function norm 1.938487707733e-02 Based on the output above it is doing exactly what it is suppose to be doing. Just curious but why for your problem do you wish to use a different function for differencing for the Jacobian than that you want to find the zero of? Barry Thanks and I am sorry for this confusion that maybe I have caused to you. Kostas Ok, it is now fixed and ready for your use. You will need to obtain PETSc with git clone https://bitbucket.org/petsc/petsc.git petsc cd petsc git branch barry/fix-setfunction-for-snesmf (if you are not currently getting PETSc from git) then configure and make it in the usual manner. You can then pass your ctx through the call to MatMFFDSetFunction() and not snes. See src/snes/examples/tests/ex7.c for a sample use of MatMFFDSetFunction() though your code should be ok. Any problems please let us know Barry On Feb 13, 2014, at 9:26 AM, pano...@mech.upatras.gr pano...@mech.upatras.gr wrote: Ok I corrected the snes arguments but now how can I
Re: [petsc-dev] [petsc-maint] SNESMF
Mr.Matthew, yes, It is something like you said. Basically, I augmented the diagonal elements of the operator. Also, Yes, I want to find the solution of n+1 time using the steady state solution of non-linear system. That is to reply to the other guy. Thanks a lot for your help Kostas On Feb 13, 2014, at 9:44 PM, pano...@mech.upatras.gr pano...@mech.upatras.gr wrote: Barry, I am trying to make a dual time implicit scheme where essentially I have a pseudo-time step which appears only in the Jacobian. Hmm, so if this is a reasonable thing (Jed and Matt?) shouldn’t we add support for it for TSPSEUDO? This is also much like a trust region in that you are adding some scaling of the identity (or some other matrix) to the Jacobian, maybe. Barry Request-assigned: who, add support to TSPSEUDO for pseudo-time step which appears only in the Jacobian For example: So far I had the classical implicit scheme where I had to solve at each time step the following non-linear scheme after linearizing it: [M/Dt + dR/dt ] * DU = -F where [M/Dt + dR/dt ] = dF/dU. Now I have resulted into a new linearized system using pseudo-time step: [M/Dtau + M/Dt + dR/dt ] * DU = -F where the F is the same as above. As you see if I differentiate the F function at RHS I will not take the operator due to the fact that have an additional term (M/Dtau). Of course this problem is coming up due to the numerical differentiation. If I could do it analytically by hand I will have the same function for both RHS and operator. Ok. From what you said to me petsc works as I need. Therefore I am ok for the time being. Kostas. Just curious but why for your problem do you wish to use a different function for differencing for the Jacobian than that you want to find the zero of? Barry On Feb 13, 2014, at 8:58 PM, pano...@mech.upatras.gr pano...@mech.upatras.gr wrote: Thank you a lot. But, As far as I saw I cant do what I need with that because I noticed after implementing it that the first function (Non_linear_function_1 which has been set by SNESsetfunction) is called when petsc wants just to show me the non-linear residual. To be understandable take a look at the following print: As you can see the Non_linear_function_1 is called only at the beginning of each newton step and not at any intermediate gmres stage. Intermediate steps of GMRES never need to recompute the RHS b since it is stored and stays the same for the entire GMRES solve And here I am wondering whether when petsc goes to compute the RHS (b vector of Ax=b) of the linear system at the k Newton iteration uses the Non_linear_function_1 It is using 1 or the Non_linear_function_2. If petsc uses the Non_linear_function_1 whenever it needs a value of (b) then I am ok. Otherwise I cant use it. Basically, with that I want to solve a dual time implicit method for compressible flows where the operator is computed by slighlty different function than the RHS. Just to know what I try to do. Non_linear_function_1 Non_linear_function_1 Non_linear_function_1 Non_linear_function_1 Above 1 is computing the rhs 0 SNES Function norm 1.942206120770e-02 0 KSP unpreconditioned resid norm 1.942206120770e-02 true resid norm 1.942206120770e-02 ||r(i)||/||b|| 1.e+00 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 1 KSP unpreconditioned resid norm 3.959771148164e-04 true resid norm 3.959771148164e-04 ||r(i)||/||b|| 2.038800674047e-02 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 Non_linear_function_2 2 KSP unpreconditioned resid norm 8.488671743678e-06 true resid norm 8.488680869120e-06 ||r(i)||/||b|| 4.370638511711e-04 Above 2 is being used to do matrix vector products Non_linear_function_1 Non_linear_function_1 Non_linear_function_1 Non_linear_function_1 Above 1 is being used for the line search. 1 SNES Function norm 1.938487707733e-02 Based on the output above it is doing exactly what it is suppose to be doing. Just curious but why for your problem do you wish to use a different function for differencing for the Jacobian than that you want to find the zero of? Barry Thanks and I am sorry for this confusion that maybe I have caused to you. Kostas Ok, it is now fixed and ready for your use. You will need to obtain PETSc with git clone https://bitbucket.org/petsc/petsc.git petsc cd petsc git branch barry/fix-setfunction-for-snesmf (if you are not currently getting PETSc from git) then configure and make it in the usual manner. You can then pass your ctx through the call to MatMFFDSetFunction() and not snes. See src/snes/examples/tests/ex7.c for a sample use of
[petsc-dev] Changing Mat block size?
I'm confronted with code that looks like this: MatCreateShell(...,B); MatSetBlockSize(B,3); This used to work, but then we made block sizes stricter and since MatCreate_Shell calls PetscLayoutSetUp, we can't change the block size later. Is there a sane way to fix this (perhaps leaving [rc]map-bs=-1 and collapsing it to 1 the first time it is actually used), or must we replace that code with the following? MatCreate(comm,B); MatSetBlockSize(B,3); MatSetSizes(B,m,n,M,N); MatSetType(B,MATSHELL); MatShellSetContext(B,ctx); MatSetUp(B); pgpiA4KZ9I4s2.pgp Description: PGP signature