From knepley at gmail.com Thu Jan 1 00:06:19 2015 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 1 Jan 2015 00:06:19 -0600 Subject: [petsc-users] Out of memory and parallel issues In-Reply-To: <54A4D901.9050007@gmail.com> References: <54A4D901.9050007@gmail.com> Message-ID: On Wed, Dec 31, 2014 at 11:20 PM, TAY wee-beng wrote: > Hi, > > I used to run my CFD code with 96 procs, with a grid size of 231 x 461 x > 368. > > I used MPI and partition my grid in the z direction. Hence with 96 procs > (8 nodes, each 12 procs), each procs has a size of 231 x 461 x 3 or 231 x > 461 x 4. > > It worked fine. > > Now I modified the code and added some more routines which increases the > fixed memory requirement per procs. However, the grid size is still the > same. But the code aborts while solving the Poisson eqn, saying: > > Out of memory trying to allocate XXX bytes > > I'm using PETSc with HYPRE boomeramg to solve the linear Poisson eqn. I am > guessing that now the amt of memory per procs is less because I added some > routines which uses some memory. The result is less memory available for > the solving of the Poisson eqn. > I would try GAMG instead of Hypre. It tends to be memory light compared to it. -pc_type gamg Thanks, Matt > I'm now changing to KSPBCGS but it seems to take forever. When I abort it, > the error msg is: > > Out of memory. This could be due to allocating > [10]PETSC ERROR: too large an object or bleeding by not properly > [10]PETSC ERROR: destroying unneeded objects. > [10]PETSC ERROR: Memory allocated 0 Memory used by process 4028370944 > [10]PETSC ERROR: Try running with -malloc_dump or -malloc_log for info. > > I can't use more procs because some procs will have a size of 231 x 461 x > 2 (or even 1). This will give error since I need to reference the nearby > values along the z direction. > > So what options do I have? I'm thinking of these at the moment: > > 1. Remove as much fixed overhead memory per procs as possible so that > there's enough memory for each procs. > > 2. Re-partition my grid in both x,y direction or x,y,z direction so I will > not encounter extremely skew grid dimensions per procs. Btw, does having > extremely skew grid dimensions affect the performance in solving the linear > eqn? > > Are there other feasible options > > -- > Thank you. > > Yours sincerely, > > TAY wee-beng > > -- 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 zonexo at gmail.com Thu Jan 1 02:15:44 2015 From: zonexo at gmail.com (TAY wee-beng) Date: Thu, 01 Jan 2015 16:15:44 +0800 Subject: [petsc-users] Out of memory and parallel issues In-Reply-To: References: <54A4D901.9050007@gmail.com> Message-ID: <54A50230.4090107@gmail.com> On 1/1/2015 2:06 PM, Matthew Knepley wrote: > On Wed, Dec 31, 2014 at 11:20 PM, TAY wee-beng > wrote: > > Hi, > > I used to run my CFD code with 96 procs, with a grid size of 231 x > 461 x 368. > > I used MPI and partition my grid in the z direction. Hence with 96 > procs (8 nodes, each 12 procs), each procs has a size of 231 x 461 > x 3 or 231 x 461 x 4. > > It worked fine. > > Now I modified the code and added some more routines which > increases the fixed memory requirement per procs. However, the > grid size is still the same. But the code aborts while solving the > Poisson eqn, saying: > > Out of memory trying to allocate XXX bytes > > I'm using PETSc with HYPRE boomeramg to solve the linear Poisson > eqn. I am guessing that now the amt of memory per procs is less > because I added some routines which uses some memory. The result > is less memory available for the solving of the Poisson eqn. > > > I would try GAMG instead of Hypre. It tends to be memory light > compared to it. > > -pc_type gamg > > Thanks, > > Matt Hi Matt, To use gamg, must I use use DMDA to partition the grid? Also, does MPI partitioning in only the z direction affect parallel performance? Since the MPI partition grid is almost like 2D plane with 3-4 cell thickness. Lastly, using 10x10 = 100 procs seems to work for now, although there's a wastage of 20 procs since each node has 12 procs. Thanks! > > I'm now changing to KSPBCGS but it seems to take forever. When I > abort it, the error msg is: > > Out of memory. This could be due to allocating > [10]PETSC ERROR: too large an object or bleeding by not properly > [10]PETSC ERROR: destroying unneeded objects. > [10]PETSC ERROR: Memory allocated 0 Memory used by process > 4028370944 > [10]PETSC ERROR: Try running with -malloc_dump or -malloc_log for > info. > > I can't use more procs because some procs will have a size of 231 > x 461 x 2 (or even 1). This will give error since I need to > reference the nearby values along the z direction. > > So what options do I have? I'm thinking of these at the moment: > > 1. Remove as much fixed overhead memory per procs as possible so > that there's enough memory for each procs. > > 2. Re-partition my grid in both x,y direction or x,y,z direction > so I will not encounter extremely skew grid dimensions per procs. > Btw, does having extremely skew grid dimensions affect the > performance in solving the linear eqn? > > Are there other feasible options > > -- > Thank you. > > Yours sincerely, > > TAY wee-beng > > > > > -- > 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 Thu Jan 1 10:06:47 2015 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 1 Jan 2015 10:06:47 -0600 Subject: [petsc-users] Out of memory and parallel issues In-Reply-To: <54A50230.4090107@gmail.com> References: <54A4D901.9050007@gmail.com> <54A50230.4090107@gmail.com> Message-ID: On Thu, Jan 1, 2015 at 2:15 AM, TAY wee-beng wrote: > > On 1/1/2015 2:06 PM, Matthew Knepley wrote: > > On Wed, Dec 31, 2014 at 11:20 PM, TAY wee-beng wrote: > >> Hi, >> >> I used to run my CFD code with 96 procs, with a grid size of 231 x 461 x >> 368. >> >> I used MPI and partition my grid in the z direction. Hence with 96 procs >> (8 nodes, each 12 procs), each procs has a size of 231 x 461 x 3 or 231 x >> 461 x 4. >> >> It worked fine. >> >> Now I modified the code and added some more routines which increases the >> fixed memory requirement per procs. However, the grid size is still the >> same. But the code aborts while solving the Poisson eqn, saying: >> >> Out of memory trying to allocate XXX bytes >> >> I'm using PETSc with HYPRE boomeramg to solve the linear Poisson eqn. I >> am guessing that now the amt of memory per procs is less because I added >> some routines which uses some memory. The result is less memory available >> for the solving of the Poisson eqn. >> > > I would try GAMG instead of Hypre. It tends to be memory light compared > to it. > > -pc_type gamg > > Thanks, > > Matt > > Hi Matt, > > To use gamg, must I use use DMDA to partition the grid? > No. > Also, does MPI partitioning in only the z direction affect parallel > performance? Since the MPI partition grid is almost like 2D plane with 3-4 > cell thickness. > It could affect load balance. > Lastly, using 10x10 = 100 procs seems to work for now, although there's a > wastage of 20 procs since each node has 12 procs. > PETSc attempts to make square domains, but you can prescribe your own domains if that helps. Thanks, Matt > Thanks! > > > >> I'm now changing to KSPBCGS but it seems to take forever. When I abort >> it, the error msg is: >> >> Out of memory. This could be due to allocating >> [10]PETSC ERROR: too large an object or bleeding by not properly >> [10]PETSC ERROR: destroying unneeded objects. >> [10]PETSC ERROR: Memory allocated 0 Memory used by process 4028370944 >> [10]PETSC ERROR: Try running with -malloc_dump or -malloc_log for info. >> >> I can't use more procs because some procs will have a size of 231 x 461 x >> 2 (or even 1). This will give error since I need to reference the nearby >> values along the z direction. >> >> So what options do I have? I'm thinking of these at the moment: >> >> 1. Remove as much fixed overhead memory per procs as possible so that >> there's enough memory for each procs. >> >> 2. Re-partition my grid in both x,y direction or x,y,z direction so I >> will not encounter extremely skew grid dimensions per procs. Btw, does >> having extremely skew grid dimensions affect the performance in solving the >> linear eqn? >> >> Are there other feasible options >> >> -- >> Thank you. >> >> Yours sincerely, >> >> TAY wee-beng >> >> > > > -- > 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 mfadams at lbl.gov Fri Jan 2 12:18:33 2015 From: mfadams at lbl.gov (Mark Adams) Date: Fri, 2 Jan 2015 13:18:33 -0500 Subject: [petsc-users] Out of memory and parallel issues In-Reply-To: <54A4D901.9050007@gmail.com> References: <54A4D901.9050007@gmail.com> Message-ID: On Thu, Jan 1, 2015 at 12:20 AM, TAY wee-beng wrote: > Hi, > > I used to run my CFD code with 96 procs, with a grid size of 231 x 461 x > 368. > > I used MPI and partition my grid in the z direction. Hence with 96 procs > (8 nodes, each 12 procs), each procs has a size of 231 x 461 x 3 or 231 x > 461 x 4. > > It worked fine. > > Now I modified the code and added some more routines which increases the > fixed memory requirement per procs. However, the grid size is still the > same. But the code aborts while solving the Poisson eqn, saying: > > Out of memory trying to allocate XXX bytes > > I'm using PETSc with HYPRE boomeramg to solve the linear Poisson eqn. I am > guessing that now the amt of memory per procs is less because I added some > routines which uses some memory. The result is less memory available for > the solving of the Poisson eqn. > > I'm now changing to KSPBCGS but it seems to take forever. When I abort it, > the error msg is: > > Out of memory. This could be due to allocating > [10]PETSC ERROR: too large an object or bleeding by not properly > [10]PETSC ERROR: destroying unneeded objects. > [10]PETSC ERROR: Memory allocated 0 Memory used by process 4028370944 > [10]PETSC ERROR: Try running with -malloc_dump or -malloc_log for info. > > I can't use more procs because some procs will have a size of 231 x 461 x > 2 (or even 1). This will give error since I need to reference the nearby > values along the z direction. > > So what options do I have? I'm thinking of these at the moment: > > 1. Remove as much fixed overhead memory per procs as possible so that > there's enough memory for each procs. > > 2. Re-partition my grid in both x,y direction or x,y,z direction so I will > not encounter extremely skew grid dimensions per procs. You will probably have to do this at some point anyway so I'd do this. > Btw, does having extremely skew grid dimensions affect the performance in > solving the linear eqn? > GAMG and HYPRE are not affected much mathematically by funny partitionings. Mark > > Are there other feasible options > > -- > Thank you. > > Yours sincerely, > > TAY wee-beng > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mfadams at lbl.gov Fri Jan 2 15:14:06 2015 From: mfadams at lbl.gov (Mark Adams) Date: Fri, 2 Jan 2015 16:14:06 -0500 Subject: [petsc-users] no decrease in iteration counts of KSPCG during time stepping In-Reply-To: References: <54A037A9.6020308@tudelft.nl> Message-ID: On Sun, Dec 28, 2014 at 12:24 PM, Alp Kalpalp wrote: > Thanks for the answers, > > Please forgive me, I forgot to say that my stiffness matrix is not > changing during time steps. I could not remember directly but just after a > google search..I just hit this > > http://web.stanford.edu/group/frg/publications/recent/FETI-stoch.pdf > > My understanding is the that the FETI people at Sandia found in the 90s that reusing the Krylov subspace was a big win. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sghosh2012 at gatech.edu Sat Jan 3 16:11:41 2015 From: sghosh2012 at gatech.edu (Ghosh, Swarnava) Date: Sat, 3 Jan 2015 17:11:41 -0500 (EST) Subject: [petsc-users] Petsc installation with Elemental 0.85 In-Reply-To: <1454468237.12340777.1420322478888.JavaMail.root@mail.gatech.edu> Message-ID: <1349457491.12341672.1420323101218.JavaMail.root@mail.gatech.edu> Hello, I am trying to install petsc 3.4.5 with Elemental 0.85 using the following command: ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-f-blas-lapack=1 --download-mpich --download-cmake --download-elemental=/home/sghosh45/libelemental/elemental-0.85.tar.gz --with-cxx-dialect=C++11 However the installation is failing with the following statement ******************************************************************************* UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): ------------------------------------------------------------------------------- Error running make on Elemental: Could not execute "cd /home/sghosh45/petsc/petsc-3.4.5/externalpackages/elemental-0.85/arch-linux2-c-debug && make && make install": Runaway process exceeded time limit of 2500s ******************************************************************************* I am attaching the configure.log file for reference Regards, Swarnava -- Swarnava Ghosh PhD Candidate, Structural Engineering, Mechanics and Materials School of Civil and Environmental Engineering Georgia Institute of Technology Atlanta, GA 30332 -------------- next part -------------- A non-text attachment was scrubbed... Name: configure.log Type: text/x-log Size: 2207481 bytes Desc: not available URL: From ajaymanwani07 at gmail.com Mon Jan 5 04:28:08 2015 From: ajaymanwani07 at gmail.com (Ajay Manwani) Date: Mon, 5 Jan 2015 15:58:08 +0530 Subject: [petsc-users] Precision Problem in computing Eigenvalue In-Reply-To: <16086B17-E176-45AB-8987-7AF5BEA485FF@dsic.upv.es> References: <16086B17-E176-45AB-8987-7AF5BEA485FF@dsic.upv.es> Message-ID: Hello, Thank you very much for your reply. i installed PETSC in quad and complex mode without C++,(*./configure --download-mpich --with-fc-gfortran --with-cc=gcc --with-cxx=g++ --with-scalar-type=complex --with-precision=__float128 --download-f2cblaslapack *) It worked fine but problem is eigenvalues we get by PEPSolve() are correct and then as i use PEPGetPair(), i get absurd values. I want to write eigenvalues and eigenpairs to a text file hence i need to use PEPGetEigenpair command --Ajay On Thu, Dec 25, 2014 at 3:12 PM, Jose E. Roman wrote: > > El 25/12/2014, a las 09:27, Ajay Manwani escribi?: > > > Hello, > > > > I am trying to solve Schroginger equation with open boundary conditions. > The problem boils down to a complex polynomial eigenvalue equation of order > two with A0,A1,A2 matrices of the size 300 x 300. > > Here, A0 and A2 are tridiagonal matrices while A1 has only single > element at with imaginary value. > > The complex eigenvalues are such that real part is around 1 while > imaginary part is in the range of 1e-12 to 1e-15. > > > > PEP solver gives out 600 complex eigenvalues having 300 complex > conjugate pairs. > > However problem is that the real part of two states is same while > complex part of the eigenvalues differs by a order of one.( i mean ~e-14 > and ~e-15) > > > > The solver gives eigenvalues of the pair the same when the imaginary > values are more than 1e-10. > > > > I tried with -pep_tol 1e-18. -pep_max_it 10000. However, answer does not > change for eigenvalues with imaginary part of the order of ~1e-15. > > > > other options -pep_smallest imaginary and changing the solver types also > does not seem to work. > > > > Is there some way one can improve answers I mean more precise value of > very small imaginary part of eigenvalue? > > > > We have tried -st_type sinvert -st_transform as well as -pep_target > and -rg_type ellipse(region filtering) but there still the problem persists. > > Kindly suggest any way to improve precision for imaginary values below > (1e-10) > > > > Regards, > > Ajay Manwani > > > > You are close to the machine precision, so I would not be surprised of > such small differences. You could try in quad precision to get higher > relative accuracy (let me know if problems arise). > > I would try sinvert on target=1 with different types of scaling, > EPSSetScale(). We are also in the process of adjusting the convergence > criteria, which may affect you, so if you want send us your matrices and we > will give them a try (send them to slepc-maint). > > Jose > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jroman at dsic.upv.es Mon Jan 5 05:19:14 2015 From: jroman at dsic.upv.es (Jose E. Roman) Date: Mon, 5 Jan 2015 12:19:14 +0100 Subject: [petsc-users] Precision Problem in computing Eigenvalue In-Reply-To: References: <16086B17-E176-45AB-8987-7AF5BEA485FF@dsic.upv.es> Message-ID: <484D4A41-B100-4A8E-8BB8-EA4A1E9DA240@dsic.upv.es> El 05/01/2015, a las 11:28, Ajay Manwani escribi?: > Hello, Thank you very much for your reply. > i installed PETSC in quad and complex mode without C++,(./configure --download-mpich --with-fc-gfortran --with-cc=gcc --with-cxx=g++ --with-scalar-type=complex --with-precision=__float128 --download-f2cblaslapack ) > > It worked fine but problem is eigenvalues we get by PEPSolve() are correct and then as i use PEPGetPair(), i get absurd values. > I want to write eigenvalues and eigenpairs to a text file hence i need to use PEPGetEigenpair command > > > --Ajay In quad precision you need to explicitly cast to double in printf statements, see e.g. http://www.grycap.upv.es/slepc/documentation/current/src/eps/examples/tutorials/ex1.c.html Is this your problem? Otherwise, send the code excerpt where you extract and print eigenpairs. Jose From doougsini at gmail.com Mon Jan 5 12:40:39 2015 From: doougsini at gmail.com (Seungbum Koo) Date: Mon, 5 Jan 2015 12:40:39 -0600 Subject: [petsc-users] ADD_VALUES is not defined in Message-ID: In fortran include files, ADD_VALUES is not in , but rather defined in which eventually leads to attribute name conflict when compiling. But as it is said in the manual, has ADD_VALUES. Is it intended? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jed at jedbrown.org Mon Jan 5 23:55:01 2015 From: jed at jedbrown.org (Jed Brown) Date: Mon, 05 Jan 2015 22:55:01 -0700 Subject: [petsc-users] Petsc installation with Elemental 0.85 In-Reply-To: <1349457491.12341672.1420323101218.JavaMail.root@mail.gatech.edu> References: <1349457491.12341672.1420323101218.JavaMail.root@mail.gatech.edu> Message-ID: <87a91wpi6i.fsf@jedbrown.org> "Ghosh, Swarnava" writes: > Hello, > > I am trying to install petsc 3.4.5 with Elemental 0.85 using the following command: > > ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-f-blas-lapack=1 --download-mpich --download-cmake --download-elemental=/home/sghosh45/libelemental/elemental-0.85.tar.gz --with-cxx-dialect=C++11 > > However the installation is failing with the following statement > > ******************************************************************************* > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): > ------------------------------------------------------------------------------- > Error running make on Elemental: Could not execute "cd /home/sghosh45/petsc/petsc-3.4.5/externalpackages/elemental-0.85/arch-linux2-c-debug && make && make install": > Runaway process exceeded time limit of 2500s > ******************************************************************************* My guess is that it was compiling fine, just very slowly. C++ is slow everywhere, but usually not this slow. What sort of file system do you have? Is it really slow? You can compile Elemental separately and tell PETSc to use it. The timeout can also be increased, but PETSc/BuildSystem should implement a better solution. Finally, a friendly reminder to upgrade to petsc-3.5. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From natacha.bereux at gmail.com Tue Jan 6 03:57:48 2015 From: natacha.bereux at gmail.com (Natacha BEREUX) Date: Tue, 6 Jan 2015 10:57:48 +0100 Subject: [petsc-users] Least Square solver LSQR Message-ID: Dear PETSc users, I am trying to solve an over determined linear system of equations Ax =b with the least square solver LSQR. The matrix A is rectangular : it has m rows and n columns with m>n. I set the preconditioner to "PCNONE" (following for instance post https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2012-May/013591.html) Matrix A has the form : A(1:n,1:n) = Identity(n) A(n+1:m, 1:n) = 0. I define a vector u of size n and set u(1:n) to 1.0 The right hand side b= Au. The (fortran) test program is attached (it's petsc-3.5.2/src/ksp/ksp/examples/tutorials/ex1f.F slightly modified) The size of matrix A is defined at runtime The solver ends OK with m=10, n=2 but goes wrong with m=10, n=3 (KSP Converged reason = -5) The output is shown below: First run with n=2 columns ==================== ./ex1f -ksp_type lsqr -vec_type seq -ksp_monitor -m 10 -n 2 0 KSP Residual norm 1.414213562373e+00 1 KSP Residual norm 3.790370795009e-16 KSP Object: 1 MPI processes type: lsqr maximum iterations=10000, initial guess is zero tolerances: relative=1e-07, absolute=1e-50, divergence=10000 left preconditioning using UNPRECONDITIONED norm type for convergence test PC Object: 1 MPI processes type: none linear system matrix = precond matrix: Mat Object: 1 MPI processes type: seqaij rows=10, cols=2 total: nonzeros=2, allocated nonzeros=50 total number of mallocs used during MatSetValues calls =0 using I-node routines: found 4 nodes, limit used is 5 KSP Converged Reason 2 Norm of error < 1.e-12,Iterations = 1 Second run, with n=3 ================ ./ex1f -ksp_type lsqr -vec_type seq -ksp_monitor -m 10 -n 3 0 KSP Residual norm 1.732050807569e+00 KSP Object: 1 MPI processes type: lsqr maximum iterations=10000, initial guess is zero tolerances: relative=1e-07, absolute=1e-50, divergence=10000 left preconditioning using UNPRECONDITIONED norm type for convergence test PC Object: 1 MPI processes type: none linear system matrix = precond matrix: Mat Object: 1 MPI processes type: seqaij rows=10, cols=3 total: nonzeros=3, allocated nonzeros=50 total number of mallocs used during MatSetValues calls =0 using I-node routines: found 5 nodes, limit used is 5 KSP Converged Reason -5 Norm of error = 0.1732E+01, Iterations = 0 I am using version 3.5.2 of PETSc library I am probably doing something wrong, but I don't understand what the problem is. Does anyone have an idea of what is going on ? Best regards Natacha -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ex1f.F Type: text/x-fortran Size: 7436 bytes Desc: not available URL: From Lukasz.Kaczmarczyk at glasgow.ac.uk Tue Jan 6 09:13:58 2015 From: Lukasz.Kaczmarczyk at glasgow.ac.uk (Lukasz Kaczmarczyk) Date: Tue, 6 Jan 2015 15:13:58 +0000 Subject: [petsc-users] DMTSMonitorSet Message-ID: <2686115B-43AA-440B-9A9D-C2F37C8B5681@glasgow.ac.uk> Hello, I've implementing DM for my data structure, i.e. unstructured 3d meshes with hierarchical and heterogenous approximation order (l2,h1,hdiv,hcurl spaces). I setting functions for DMKSP, DMSNES and DMKSP. I found one function which in some sense is missing in petsc for consistency, i.e. DMTSMonitorSet. I used to use monitor to calculate energies or dump data on hard drive on some steps. It could be that I misuse monitor as well. Could you advise me if in future you going to have such function. I will live empty space for that to not forget about it. Kind regards, Lukasz Kaczmarczyk From knepley at gmail.com Tue Jan 6 10:18:00 2015 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 6 Jan 2015 10:18:00 -0600 Subject: [petsc-users] DMTSMonitorSet In-Reply-To: <2686115B-43AA-440B-9A9D-C2F37C8B5681@glasgow.ac.uk> References: <2686115B-43AA-440B-9A9D-C2F37C8B5681@glasgow.ac.uk> Message-ID: On Tue, Jan 6, 2015 at 9:13 AM, Lukasz Kaczmarczyk < Lukasz.Kaczmarczyk at glasgow.ac.uk> wrote: > Hello, > > I've implementing DM for my data structure, i.e. unstructured 3d meshes > with hierarchical and heterogenous approximation order (l2,h1,hdiv,hcurl > spaces). I setting functions for DMKSP, DMSNES and DMKSP. > > I found one function which in some sense is missing in petsc for > consistency, i.e. DMTSMonitorSet. I used to use monitor to calculate > energies or dump data on hard drive on some steps. It could be that I > misuse monitor as well. > > Could you advise me if in future you going to have such function. I will > live empty space for that to not forget about it. > I am not clear on exactly what you want. We have KSPMonitorSet, SNESMonitorSet, and TSMonitorSet. We do not have DMKSPMonitorSet or DMSNESMonitorSet. Will TSMonitorSet not do what you want? Thanks, Matt > > Kind regards, > Lukasz Kaczmarczyk > > > > -- 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 Tue Jan 6 11:52:28 2015 From: hzhang at mcs.anl.gov (Hong) Date: Tue, 6 Jan 2015 11:52:28 -0600 Subject: [petsc-users] Least Square solver LSQR In-Reply-To: References: Message-ID: Natacha: I can repeat the error with your ex1f.F. The lsqr solver in PETSc was contributed by a user a decade ago. I'll read the original algorithm and investigate it. I'll let you know the result. Hong Dear PETSc users, > I am trying to solve an over determined linear system of equations Ax =b > with the least square solver LSQR. > The matrix A is rectangular : it has m rows and n columns with m>n. > I set the preconditioner to "PCNONE" (following for instance post > https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2012-May/013591.html) > > Matrix A has the form : > A(1:n,1:n) = Identity(n) > A(n+1:m, 1:n) = 0. > > I define a vector u of size n and set u(1:n) to 1.0 > > The right hand side b= Au. > > The (fortran) test program is attached (it's > petsc-3.5.2/src/ksp/ksp/examples/tutorials/ex1f.F slightly modified) > > The size of matrix A is defined at runtime > > The solver ends OK with m=10, n=2 but goes wrong with m=10, n=3 (KSP > Converged reason = -5) > > The output is shown below: > > First run with n=2 columns > ==================== > ./ex1f -ksp_type lsqr -vec_type seq -ksp_monitor -m 10 -n 2 > > 0 KSP Residual norm 1.414213562373e+00 > 1 KSP Residual norm 3.790370795009e-16 > KSP Object: 1 MPI processes > type: lsqr > maximum iterations=10000, initial guess is zero > tolerances: relative=1e-07, absolute=1e-50, divergence=10000 > left preconditioning > using UNPRECONDITIONED norm type for convergence test > PC Object: 1 MPI processes > type: none > linear system matrix = precond matrix: > Mat Object: 1 MPI processes > type: seqaij > rows=10, cols=2 > total: nonzeros=2, allocated nonzeros=50 > total number of mallocs used during MatSetValues calls =0 > using I-node routines: found 4 nodes, limit used is 5 > KSP Converged Reason 2 > Norm of error < 1.e-12,Iterations = 1 > > Second run, with n=3 > ================ > ./ex1f -ksp_type lsqr -vec_type seq -ksp_monitor -m 10 -n 3 > > 0 KSP Residual norm 1.732050807569e+00 > KSP Object: 1 MPI processes > type: lsqr > maximum iterations=10000, initial guess is zero > tolerances: relative=1e-07, absolute=1e-50, divergence=10000 > left preconditioning > using UNPRECONDITIONED norm type for convergence test > PC Object: 1 MPI processes > type: none > linear system matrix = precond matrix: > Mat Object: 1 MPI processes > type: seqaij > rows=10, cols=3 > total: nonzeros=3, allocated nonzeros=50 > total number of mallocs used during MatSetValues calls =0 > using I-node routines: found 5 nodes, limit used is 5 > KSP Converged Reason -5 > Norm of error = 0.1732E+01, Iterations = 0 > > > I am using version 3.5.2 of PETSc library > > I am probably doing something wrong, but I don't understand what the > problem is. > Does anyone have an idea of what is going on ? > Best regards > Natacha > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Eric.Chamberland at giref.ulaval.ca Tue Jan 6 12:39:09 2015 From: Eric.Chamberland at giref.ulaval.ca (Eric Chamberland) Date: Tue, 06 Jan 2015 13:39:09 -0500 Subject: [petsc-users] Lumped matrix Message-ID: <54AC2BCD.4070603@giref.ulaval.ca> Hi, We are asking ourselves what would be the most efficient way to create/do assembly/solve a problem involving a lumped matrix in PETSC? #1- To create the matrix: Use an standard AIJ with 1 nnz per line (didn't find any lumped or diagonal type)? #2- Assembly: sum elementary matrices lines and the do the assembly on the diagonal only of the usual AIJ matrix? #3- Use a pc_type jacobi, lu, ? We want to preserve the "genericity" of the solving procedures, meaning we still want to manipulate a "matrix" even if it is a diagonal one to preserve operations/manipulations done in the code... Thanks for your insights! Eric From jed at jedbrown.org Tue Jan 6 12:46:04 2015 From: jed at jedbrown.org (Jed Brown) Date: Tue, 06 Jan 2015 11:46:04 -0700 Subject: [petsc-users] Lumped matrix In-Reply-To: <54AC2BCD.4070603@giref.ulaval.ca> References: <54AC2BCD.4070603@giref.ulaval.ca> Message-ID: <87wq4zoihf.fsf@jedbrown.org> Eric Chamberland writes: > Hi, > > We are asking ourselves what would be the most efficient way to > create/do assembly/solve a problem involving a lumped matrix in PETSC? Lumping frequently comes from reduced quadrature, so you could simply use the reduced quadrature. Lumping in a solver often comes from computing row sums instead of the diagonal for Jacobi smoothers/preconditioners. In that case, just -pc_jacobi_type rowsum. > #1- To create the matrix: Use an standard AIJ with 1 nnz per line > (didn't find any lumped or diagonal type)? Right, or assemble the normal matrix and use Jacobi as above. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From bsmith at mcs.anl.gov Tue Jan 6 13:11:05 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 6 Jan 2015 13:11:05 -0600 Subject: [petsc-users] DMTSMonitorSet In-Reply-To: <2686115B-43AA-440B-9A9D-C2F37C8B5681@glasgow.ac.uk> References: <2686115B-43AA-440B-9A9D-C2F37C8B5681@glasgow.ac.uk> Message-ID: > On Jan 6, 2015, at 9:13 AM, Lukasz Kaczmarczyk wrote: > > Hello, > > I've implementing DM for my data structure, i.e. unstructured 3d meshes with hierarchical and heterogenous approximation order (l2,h1,hdiv,hcurl spaces). I setting functions for DMKSP, DMSNES and DMKSP. Hmm, why not use KSPSetComputeOperator(), SNESSetFunction/Jacobian(), TSSet... etc? Barry > > I found one function which in some sense is missing in petsc for consistency, i.e. DMTSMonitorSet. I used to use monitor to calculate energies or dump data on hard drive on some steps. It could be that I misuse monitor as well. > > Could you advise me if in future you going to have such function. I will live empty space for that to not forget about it. > > > Kind regards, > Lukasz Kaczmarczyk > > > From fd.kong at siat.ac.cn Tue Jan 6 19:10:58 2015 From: fd.kong at siat.ac.cn (Fande Kong) Date: Tue, 6 Jan 2015 18:10:58 -0700 Subject: [petsc-users] PetscCommGetNewTag issue Message-ID: Hi all, I make a very simple code, but run into some error messages. Code: #include static char help[] = " simple test.\n\n"; #undef __FUNCT__ #define __FUNCT__ "main" int main(int argc,char **argv) { PetscMPIInt tag = 0; PetscErrorCode ierr; ierr = PetscInitialize(&argc,&argv,(char *)0,help);CHKERRQ(ierr); ierr = PetscCommGetNewTag(PETSC_COMM_WORLD,&tag);CHKERRQ(ierr); ierr = PetscPrintf(PETSC_COMM_SELF," tag %d \n", tag);CHKERRQ(ierr); ierr = PetscFinalize();CHKERRQ(ierr); } Run: mpirun -np 2 ./Test Error messages: [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Corrupt argument: http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind [0]PETSC ERROR: Bad MPI communicator supplied; must be a PETSc communicator [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 [0]PETSC ERROR: ./Test on a arch-darwin-cxx-debug named engr2-7-113-dhcp.int.colorado.edu by livia Tue Jan 6 18:07:27 2015 [0]PETSC ERROR: Configure options --with-clanguage=cxx --with-shared-libraries=1 --download-fblaslapack=1 --with-mpi-dir=/Users/livia/math/mpich-3.1_install --download-parmetis=1 --download-metis=1 --with-64-bit-indices=1 --download-netcdf=1 --download-exodusii=1 --download-hdf5=1 --with-mpi-dir=/Users/livia/math/mpich-3.1_install [0]PETSC ERROR: #1 PetscCommGetNewTag() line 85 in /Users/livia/math/petsc-3.5.2/src/sys/objects/tagm.c [1]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: #2 main() line 19 in /Users/livia/math/Spmcs/src/multigrid/test/Test.cpp [0]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint at mcs.anl.gov---------- [1]PETSC ERROR: Corrupt argument: http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind [1]PETSC ERROR: Bad MPI communicator supplied; must be a PETSc communicator [1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [1]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 [1]PETSC ERROR: ./Test on a arch-darwin-cxx-debug named engr2-7-113-dhcp.int.colorado.edu by livia Tue Jan 6 18:07:27 2015 [1]PETSC ERROR: Configure options --with-clanguage=cxx --with-shared-libraries=1 --download-fblaslapack=1 --with-mpi-dir=/Users/livia/math/mpich-3.1_install --download-parmetis=1 --download-metis=1 --with-64-bit-indices=1 --download-netcdf=1 --download-exodusii=1 --download-hdf5=1 --with-mpi-dir=/Users/livia/math/mpich-3.1_install [1]PETSC ERROR: application called MPI_Abort(MPI_COMM_WORLD, 64) - process 0 #1 PetscCommGetNewTag() line 85 in /Users/livia/math/petsc-3.5.2/src/sys/objects/tagm.c [1]PETSC ERROR: #2 main() line 19 in /Users/livia/math/Spmcs/src/multigrid/test/Test.cpp [cli_0]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 64) - process 0 [1]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint at mcs.anl.gov---------- application called MPI_Abort(MPI_COMM_WORLD, 64) - process 1 [cli_1]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 64) - process 1 =================================================================================== = BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES = PID 1783 RUNNING AT engr2-7-113-dhcp.int.colorado.edu = EXIT CODE: 64 = CLEANING UP REMAINING PROCESSES = YOU CAN IGNORE THE BELOW CLEANUP MESSAGES =================================================================================== Fande -------------- next part -------------- An HTML attachment was scrubbed... URL: From jed at jedbrown.org Tue Jan 6 19:21:01 2015 From: jed at jedbrown.org (Jed Brown) Date: Tue, 06 Jan 2015 18:21:01 -0700 Subject: [petsc-users] PetscCommGetNewTag issue In-Reply-To: References: Message-ID: <87fvbno076.fsf@jedbrown.org> Fande Kong writes: > Hi all, > > I make a very simple code, but run into some error messages. > > Code: > > #include > static char help[] = " simple test.\n\n"; > > #undef __FUNCT__ > #define __FUNCT__ "main" > int main(int argc,char **argv) > { > PetscMPIInt tag = 0; > PetscErrorCode ierr; > > ierr = PetscInitialize(&argc,&argv,(char *)0,help);CHKERRQ(ierr); The error message is not ideal, but the pattern used in PETSc is that each object should PetscCommDuplicate(usercomm,&mycomm,&first_tag). If you need more tags, you would pass "mycomm" to PetscCommGetNewTag(). > ierr = PetscCommGetNewTag(PETSC_COMM_WORLD,&tag);CHKERRQ(ierr); > ierr = PetscPrintf(PETSC_COMM_SELF," tag %d \n", tag);CHKERRQ(ierr); > ierr = PetscFinalize();CHKERRQ(ierr); > } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From bsmith at mcs.anl.gov Tue Jan 6 19:57:24 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 6 Jan 2015 19:57:24 -0600 Subject: [petsc-users] PetscCommGetNewTag issue In-Reply-To: <87fvbno076.fsf@jedbrown.org> References: <87fvbno076.fsf@jedbrown.org> Message-ID: > On Jan 6, 2015, at 7:21 PM, Jed Brown wrote: > > Fande Kong writes: > >> Hi all, >> >> I make a very simple code, but run into some error messages. >> >> Code: >> >> #include >> static char help[] = " simple test.\n\n"; >> >> #undef __FUNCT__ >> #define __FUNCT__ "main" >> int main(int argc,char **argv) >> { >> PetscMPIInt tag = 0; >> PetscErrorCode ierr; >> >> ierr = PetscInitialize(&argc,&argv,(char *)0,help);CHKERRQ(ierr); > > The error message is not ideal, but the pattern used in PETSc is that > each object should PetscCommDuplicate(usercomm,&mycomm,&first_tag). If > you need more tags, you would pass "mycomm" to PetscCommGetNewTag(). The point is that you should never be sending messages on PETSC_COMM_WORLD, since they could collide with someone else messages, you should always send messages only on your own comm (that no one else has access to and could send message on) thus you should never be getting tags on PETSC_COMM_WORLD. Barry > >> ierr = PetscCommGetNewTag(PETSC_COMM_WORLD,&tag);CHKERRQ(ierr); >> ierr = PetscPrintf(PETSC_COMM_SELF," tag %d \n", tag);CHKERRQ(ierr); >> ierr = PetscFinalize();CHKERRQ(ierr); >> } From thronesf at gmail.com Tue Jan 6 21:58:28 2015 From: thronesf at gmail.com (Sharp Stone) Date: Tue, 6 Jan 2015 22:58:28 -0500 Subject: [petsc-users] How to specify superlu_dist tolerance in Petsc Message-ID: Hi all, I wonder if it's possible for users to specify superlu_dist tolerance in Petsc? Appreciate any help in advance! -- Best regards, Feng -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Tue Jan 6 22:05:49 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 6 Jan 2015 22:05:49 -0600 Subject: [petsc-users] How to specify superlu_dist tolerance in Petsc In-Reply-To: References: Message-ID: What do you mean by tolerance? SuperLU_DIST is a direct solver and as such doesn't have the concept of convergence criteria. If there is a SuperLU_DIST parameter you wish to set let us know the name of the parameter and we'll try to add support for setting it. Barry > On Jan 6, 2015, at 9:58 PM, Sharp Stone wrote: > > Hi all, > > I wonder if it's possible for users to specify superlu_dist tolerance in Petsc? > > Appreciate any help in advance! > > -- > Best regards, > > Feng From gilles.steiner at epfl.ch Thu Jan 8 06:21:33 2015 From: gilles.steiner at epfl.ch (Gilles Steiner) Date: Thu, 08 Jan 2015 13:21:33 +0100 Subject: [petsc-users] Trying to apply FieldSplitPC by reading bloc matrix In-Reply-To: References: <549432B2.6080309@epfl.ch> Message-ID: <54AE764D.9070501@epfl.ch> Hello again. Thank you all for the answers. Here is an update on this subject. First, some answers to the comments/questions received : Answer to Jed Brown : "What FE discretization? We don't recommend using files as part of your workflow, but if you're just experimenting, you could start with src/ksp/ksp/examples/tests/ex11.c which solves a Q1-P0 Stokes problem From Underworld by reading the blocks in as matrices. So start there and let us know how it goes." I tried several FE discretizations (P1-P1-stabilized, P2-P1, P1Bubble-P1) on tetrahedral meshes of a cube (Driven cavity). Thanks for the reference to ex11.c, but do you have any suggestion of options to apply on this to have a good behaviour of the solver ? I compiled the example (src/ksp/ksp/examples/tests/ex11.c) and downloaded the input file from http://ftp.mcs.anl.gov/pub/petsc/matrices/underworld32.gz but the convergence of the solver is a bit disappointing with the default options (simply running with mpirun -np 1 ex11 -f underworld32.gz) : [0] lnu = 2046 | lnp = 1024 [0] s_u = 0 | e_u = 2046 [0] s_p = 0 | e_p = 1024 [0] is_u (offset) = 0 [0] is_p (offset) = 2046 Residual norms for fc_ solve. 0 KSP preconditioned resid norm 1.901623820248e+11 true resid norm 3.163503865730e-01 ||r(i)||/||b|| 1.000000000000e+00 1 KSP preconditioned resid norm 1.232616307278e+11 true resid norm 3.110902550317e-01 ||r(i)||/||b|| 9.833724510397e-01 2 KSP preconditioned resid norm 8.842498650573e+10 true resid norm 3.121703549116e-01 ||r(i)||/||b|| 9.867867028497e-01 3 KSP preconditioned resid norm 6.376643354056e+10 true resid norm 3.216506148074e-01 ||r(i)||/||b|| 1.016754296689e+00 4 KSP preconditioned resid norm 4.507200049791e+10 true resid norm 3.453307829735e-01 ||r(i)||/||b|| 1.091608537971e+00 5 KSP preconditioned resid norm 3.165593374571e+10 true resid norm 3.787554909641e-01 ||r(i)||/||b|| 1.197265775671e+00 6 KSP preconditioned resid norm 1.886092467773e+10 true resid norm 4.169668186513e-01 ||r(i)||/||b|| 1.318053766800e+00 7 KSP preconditioned resid norm 1.022004643856e+10 true resid norm 4.423235667291e-01 ||r(i)||/||b|| 1.398207764248e+00 8 KSP preconditioned resid norm 5.318995340694e+09 true resid norm 4.558356174770e-01 ||r(i)||/||b|| 1.440920058341e+00 9 KSP preconditioned resid norm 3.160919062173e+09 true resid norm 4.608182603598e-01 ||r(i)||/||b|| 1.456670451242e+00 10 KSP preconditioned resid norm 2.172582250050e+09 true resid norm 4.643714263977e-01 ||r(i)||/||b|| 1.467902193603e+00 ... 184 KSP preconditioned resid norm 1.890479367808e+06 true resid norm 3.557809738610e-01 ||r(i)||/||b|| 1.124642134044e+00 -- velocity vector values -- Min(u) = -0.000000 [loc=1994] Max(u) = 0.000000 [loc=1310] Norm(u) = 0.000000 Sum(u) = 0.000000 -- pressure vector values -- Min(p) = -4.877385 [loc=1015] Max(p) = 4.616608 [loc=4] Norm(p) = 88.261241 Sum(p) = 0.000000 -- Full vector values -- Min(u,p) = -4.877385 [loc=3061] Max(u,p) = 4.616608 [loc=2050] Norm(u,p) = 88.261241 Sum(u,p) = 0.000000 The only modification I have done to the code is to add the line : KSPMonitorSet(ksp_A, KSPMonitorTrueResidualNorm, PETSC_NULL, PETSC_NULL); to log the convergence. Answer to Barry Smith and Matthew Knepley : "In both cases the preconditioned residual is decreasing nicely but the unpreconditioned residual is not decreasing, so something is wrong even in the sequential case! > 14 KSP preconditioned resid norm 5.169032607321e-10 true resid norm 9.990557312817e-03 ||r(i)||/||b|| 4.162732213674e-04 So you need to go back to the sequential case and see what is going on. Don't even touch the parallel case until the true residual is converging properly for the sequential. First try running with -ksp_pc_side right and watch the residuals. Next run with direct solvers everywhere you can and see what happens." I guess I figured out the issue here. I tried to speedup iterations by adding the options -fieldsplit_0_ksp_max_it and -fieldsplit_1_ksp_max_it as suggested in src/snes/examples/tutorials/ex70.c (they are acting on rtol instead of max_it). But doing this seems to cause the wrong convergence behaviour. example with max_it=100 : 0 KSP preconditioned resid norm 6.492190058577e+02 true resid norm 1.100000000000e+01 ||r(i)||/||b|| 1.000000000000e+00 1 KSP preconditioned resid norm 1.969844390083e-02 true resid norm 1.509247865473e-05 ||r(i)||/||b|| 1.372043514066e-06 2 KSP preconditioned resid norm 4.926131518900e-07 true resid norm 7.062431971029e-09 ||r(i)||/||b|| 6.420392700936e-10 3 KSP preconditioned resid norm 8.183544025740e-12 true resid norm 6.418682323277e-09 ||r(i)||/||b|| 5.835165748434e-10 same with max_it=5 : 0 KSP preconditioned resid norm 6.191842548447e+02 true resid norm 1.100000000000e+01 ||r(i)||/||b|| 1.000000000000e+00 1 KSP preconditioned resid norm 5.474611327659e+01 true resid norm 3.793016384570e-01 ||r(i)||/||b|| 3.448196713245e-02 2 KSP preconditioned resid norm 9.064410031719e+00 true resid norm 5.519394994263e-02 ||r(i)||/||b|| 5.017631812966e-03 3 KSP preconditioned resid norm 2.162169261727e+00 true resid norm 4.136759289559e-02 ||r(i)||/||b|| 3.760690263235e-03 4 KSP preconditioned resid norm 4.487680249963e-01 true resid norm 9.486438220687e-03 ||r(i)||/||b|| 8.624034746079e-04 5 KSP preconditioned resid norm 1.100928562187e-01 true resid norm 1.199868960902e-02 ||r(i)||/||b|| 1.090789964456e-03 6 KSP preconditioned resid norm 2.826378652048e-02 true resid norm 1.176242279335e-02 ||r(i)||/||b|| 1.069311163032e-03 7 KSP preconditioned resid norm 5.075277611809e-03 true resid norm 1.191372816799e-02 ||r(i)||/||b|| 1.083066197090e-03 8 KSP preconditioned resid norm 1.288581278231e-03 true resid norm 1.191807770501e-02 ||r(i)||/||b|| 1.083461609546e-03 9 KSP preconditioned resid norm 3.446344125585e-04 true resid norm 1.190778433764e-02 ||r(i)||/||b|| 1.082525848877e-03 10 KSP preconditioned resid norm 7.282719316035e-05 true resid norm 1.191201986724e-02 ||r(i)||/||b|| 1.082910897022e-03 11 KSP preconditioned resid norm 1.714618056930e-05 true resid norm 1.191095763273e-02 ||r(i)||/||b|| 1.082814330249e-03 12 KSP preconditioned resid norm 4.317573472482e-06 true resid norm 1.191112698437e-02 ||r(i)||/||b|| 1.082829725851e-03 13 KSP preconditioned resid norm 9.546213335221e-07 true resid norm 1.191112173116e-02 ||r(i)||/||b|| 1.082829248287e-03 14 KSP preconditioned resid norm 2.155641210237e-07 true resid norm 1.191111695140e-02 ||r(i)||/||b|| 1.082828813763e-03 15 KSP preconditioned resid norm 5.936176282735e-08 true resid norm 1.191111896030e-02 ||r(i)||/||b|| 1.082828996391e-03 16 KSP preconditioned resid norm 1.362639176327e-08 true resid norm 1.191111833902e-02 ||r(i)||/||b|| 1.082828939911e-03 17 KSP preconditioned resid norm 3.042659891281e-09 true resid norm 1.191111844668e-02 ||r(i)||/||b|| 1.082828949699e-03 18 KSP preconditioned resid norm 8.958920024015e-10 true resid norm 1.191111844183e-02 ||r(i)||/||b|| 1.082828949257e-03 19 KSP preconditioned resid norm 2.059234060666e-10 true resid norm 1.191111843406e-02 ||r(i)||/||b|| 1.082828948551e-03 I will do more tests with this but if someone has some clue on how to correctly run the ex11 it would be of great help. Thanks again, Gilles On 12/20/2014 02:29 AM, Matthew Knepley wrote: > > On Dec 19, 2014 6:14 AM, "Gilles Steiner" > wrote: > > > > Hello Petsc Users, > > > > I have an issue trying to use FiledSplitPC in parallel. > > > > My goal : I want to get a linear system from petsc binary files and > solve this in parallel with the FieldSplitPC. > > > > The problem I want to solve is an FE approximation of the Stokes > equations. > > > > Skipping the details, my code looks like : > > > > // Reading the four blocs UU, UP, PU and PP > > for(int i=0; i < 4; ++i) > > { > > string name = matrix + to_string(i) + ".petscbin"; > > PetscViewer PETSC_matreader; > > PetscViewerBinaryOpen(PETSC_COMM_WORLD, name.c_str(), > FILE_MODE_READ, &PETSC_matreader); > > MatCreate(PETSC_COMM_WORLD,&PETSC_subA[i]); > > MatLoad(PETSC_subA[i],PETSC_matreader); > > PetscViewerDestroy(&PETSC_matreader); > > } > > > > // Reading the RHS vector and duplicating it to create the solution > vector > > PetscViewerBinaryOpen(PETSC_COMM_WORLD, rhs.c_str(), FILE_MODE_READ, > &PETSC_vecreader); > > VecCreate(PETSC_COMM_WORLD,&PETSC_rhs); > > VecLoad(PETSC_rhs,PETSC_vecreader); > > PetscViewerDestroy(&PETSC_vecreader); > > VecDuplicate(PETSC_rhs,&PETSC_sol); > > > > // Create global matrixwith MatCreateNest > > MatCreateNest(PETSC_COMM_WORLD, 2, NULL, 2, NULL, PETSC_subA, &PETSC_A); > > MatNestGetISs(PETSC_A, PETSC_isg, NULL); > > > > // Setting up the ksp and precond > > KSPCreate(PETSC_COMM_WORLD,&PETSC_ksp); > > KSPSetOperators(PETSC_ksp,PETSC_A,PETSC_A); > > KSPSetFromOptions(PETSC_ksp); > > > > KSPGetPC(PETSC_ksp, &PETSC_pc); > > PCSetType(PETSC_pc, PCFIELDSPLIT); > > PCFieldSplitSetIS(PETSC_pc, "0", PETSC_isg[0]); > > PCFieldSplitSetIS(PETSC_pc, "1", PETSC_isg[1]); > > PCSetFromOptions(PETSC_pc); > > > > // Solving the system and writing back the solution in rhs file > > KSPSolve(PETSC_ksp,PETSC_rhs,PETSC_sol); > > > > PetscViewer PETSC_vecwriter; > > PetscViewerBinaryOpen(PETSC_COMM_WORLD, rhs.c_str(), > FILE_MODE_WRITE, &PETSC_vecwriter); > > VecView(PETSC_sol,PETSC_vecwriter); > > PetscViewerDestroy(&PETSC_vecwriter); > > > > When I run it with 1 proc, everything works fine and I get the > correct solution : > > > > When you get this behavior with true residuals, it very often arises > from failure to account for a pressure null space. Do you have one? > > Matt > > 0 KSP preconditioned resid norm 1.271697253018e+03 true resid norm > 2.400000000000e+01 ||r(i)||/||b|| 1.000000000000e+00 > > 1 KSP preconditioned resid norm 5.009545069728e+01 true resid norm > 9.166803391041e-02 ||r(i)||/||b|| 3.819501412934e-03 > > 2 KSP preconditioned resid norm 6.460631387766e+00 true resid norm > 4.995542253831e-02 ||r(i)||/||b|| 2.081475939096e-03 > > 3 KSP preconditioned resid norm 1.155895209298e+00 true resid norm > 1.515734830704e-02 ||r(i)||/||b|| 6.315561794600e-04 > > 4 KSP preconditioned resid norm 7.407384739634e-02 true resid norm > 9.992802256200e-03 ||r(i)||/||b|| 4.163667606750e-04 > > 5 KSP preconditioned resid norm 1.574456882990e-02 true resid norm > 9.994876664681e-03 ||r(i)||/||b|| 4.164531943617e-04 > > 6 KSP preconditioned resid norm 2.383022349902e-03 true resid norm > 9.990760645581e-03 ||r(i)||/||b|| 4.162816935659e-04 > > 7 KSP preconditioned resid norm 6.175379834254e-04 true resid norm > 9.990821066459e-03 ||r(i)||/||b|| 4.162842111025e-04 > > 8 KSP preconditioned resid norm 6.867982689960e-05 true resid norm > 9.990532094790e-03 ||r(i)||/||b|| 4.162721706163e-04 > > 9 KSP preconditioned resid norm 1.041091257246e-05 true resid norm > 9.990558069113e-03 ||r(i)||/||b|| 4.162732528797e-04 > > 10 KSP preconditioned resid norm 1.447793722489e-06 true resid norm > 9.990557786778e-03 ||r(i)||/||b|| 4.162732411158e-04 > > 11 KSP preconditioned resid norm 2.139317335854e-07 true resid norm > 9.990557262754e-03 ||r(i)||/||b|| 4.162732192814e-04 > > 12 KSP preconditioned resid norm 4.383129810322e-08 true resid norm > 9.990557306920e-03 ||r(i)||/||b|| 4.162732211217e-04 > > 13 KSP preconditioned resid norm 3.351461304399e-09 true resid norm > 9.990557311707e-03 ||r(i)||/||b|| 4.162732213211e-04 > > 14 KSP preconditioned resid norm 5.169032607321e-10 true resid norm > 9.990557312817e-03 ||r(i)||/||b|| 4.162732213674e-04 > > > > [14:49:10::INFO ] System Solved. Final tolerance reached is > 5.16903e-10 in 14 iterations. > > > > But if I do it with 2 procs, the resolution seems fine but the > solution is wrong : > > 0 KSP preconditioned resid norm 1.247694088756e+03 true resid norm > 2.400000000000e+01 ||r(i)||/||b|| 1.000000000000e+00 > > 1 KSP preconditioned resid norm 4.481954484303e+01 true resid norm > 5.277507840772e-01 ||r(i)||/||b|| 2.198961600321e-02 > > 2 KSP preconditioned resid norm 1.110647693456e+01 true resid norm > 4.005558168981e-02 ||r(i)||/||b|| 1.668982570409e-03 > > 3 KSP preconditioned resid norm 1.220368027409e+00 true resid norm > 1.877650834971e-02 ||r(i)||/||b|| 7.823545145714e-04 > > 4 KSP preconditioned resid norm 2.834261749922e-01 true resid norm > 1.613967205264e-02 ||r(i)||/||b|| 6.724863355265e-04 > > 5 KSP preconditioned resid norm 4.215090288154e-02 true resid norm > 1.562561614611e-02 ||r(i)||/||b|| 6.510673394212e-04 > > 6 KSP preconditioned resid norm 1.209476134754e-02 true resid norm > 1.563808960492e-02 ||r(i)||/||b|| 6.515870668718e-04 > > 7 KSP preconditioned resid norm 2.038835108629e-03 true resid norm > 1.564163643064e-02 ||r(i)||/||b|| 6.517348512765e-04 > > 8 KSP preconditioned resid norm 1.928844666836e-04 true resid norm > 1.564072761376e-02 ||r(i)||/||b|| 6.516969839065e-04 > > 9 KSP preconditioned resid norm 3.138911950605e-05 true resid norm > 1.564047323377e-02 ||r(i)||/||b|| 6.516863847403e-04 > > 10 KSP preconditioned resid norm 4.950062975470e-06 true resid norm > 1.564048216528e-02 ||r(i)||/||b|| 6.516867568865e-04 > > 11 KSP preconditioned resid norm 7.677242244159e-07 true resid norm > 1.564049253364e-02 ||r(i)||/||b|| 6.516871889019e-04 > > 12 KSP preconditioned resid norm 1.870521888617e-07 true resid norm > 1.564049269566e-02 ||r(i)||/||b|| 6.516871956526e-04 > > 13 KSP preconditioned resid norm 3.077235724319e-08 true resid norm > 1.564049264800e-02 ||r(i)||/||b|| 6.516871936666e-04 > > 14 KSP preconditioned resid norm 6.584409191524e-09 true resid norm > 1.564049264183e-02 ||r(i)||/||b|| 6.516871934095e-04 > > 15 KSP preconditioned resid norm 1.091619359913e-09 true resid norm > 1.564049263170e-02 ||r(i)||/||b|| 6.516871929874e-04 > > > > [15:10:58::INFO ] System Solved. Final tolerance reached is > 1.09162e-09 in 15 iterations. > > > > Any idea of what is wrong with this ? Is it the code or the base > concept ? > > > > Thank you. > > Gilles > > > -- ------------------------------------------------------------------------- | STEINER Gilles ========================================================================= | PostDoc @ EPFL | Engineer @ Ycoor Systems SA ------------------------------------------------------------------------- | | EPFL | Ycoor Systems SA | Unit | SB / MATHICSE / GR-PI | - | Office | MA C2 643 | - | Tel | +41 21 693 42 46 | +41 43 535 09 30 | @ | gilles.steiner at epfl.ch | steiner at ycoorsystems.com | Www | http://mathicse.epfl.ch/asn/ | http://www.ycoorsystems.com/ | Address | EPFL SB MATHICSE GR-PI | Wallisellenstrasse 333 | | Station 8 | CH-8050 Z?rich | | CH-1015 Lausanne | ------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From natacha.bereux at gmail.com Thu Jan 8 06:43:24 2015 From: natacha.bereux at gmail.com (Natacha BEREUX) Date: Thu, 8 Jan 2015 13:43:24 +0100 Subject: [petsc-users] Least Square solver LSQR In-Reply-To: References: Message-ID: Thanks a lot for your answer Best regards Natacha On Tue, Jan 6, 2015 at 6:52 PM, Hong wrote: > Natacha: > I can repeat the error with your ex1f.F. > > The lsqr solver in PETSc was contributed by a user a decade ago. I'll read > the original algorithm and investigate it. > > I'll let you know the result. > > Hong > > Dear PETSc users, >> I am trying to solve an over determined linear system of equations Ax =b >> with the least square solver LSQR. >> The matrix A is rectangular : it has m rows and n columns with m>n. >> I set the preconditioner to "PCNONE" (following for instance post >> https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2012-May/013591.html) >> >> Matrix A has the form : >> A(1:n,1:n) = Identity(n) >> A(n+1:m, 1:n) = 0. >> >> I define a vector u of size n and set u(1:n) to 1.0 >> >> The right hand side b= Au. >> >> The (fortran) test program is attached (it's >> petsc-3.5.2/src/ksp/ksp/examples/tutorials/ex1f.F slightly modified) >> >> The size of matrix A is defined at runtime >> >> The solver ends OK with m=10, n=2 but goes wrong with m=10, n=3 (KSP >> Converged reason = -5) >> >> The output is shown below: >> >> First run with n=2 columns >> ==================== >> ./ex1f -ksp_type lsqr -vec_type seq -ksp_monitor -m 10 -n 2 >> >> 0 KSP Residual norm 1.414213562373e+00 >> 1 KSP Residual norm 3.790370795009e-16 >> KSP Object: 1 MPI processes >> type: lsqr >> maximum iterations=10000, initial guess is zero >> tolerances: relative=1e-07, absolute=1e-50, divergence=10000 >> left preconditioning >> using UNPRECONDITIONED norm type for convergence test >> PC Object: 1 MPI processes >> type: none >> linear system matrix = precond matrix: >> Mat Object: 1 MPI processes >> type: seqaij >> rows=10, cols=2 >> total: nonzeros=2, allocated nonzeros=50 >> total number of mallocs used during MatSetValues calls =0 >> using I-node routines: found 4 nodes, limit used is 5 >> KSP Converged Reason 2 >> Norm of error < 1.e-12,Iterations = 1 >> >> Second run, with n=3 >> ================ >> ./ex1f -ksp_type lsqr -vec_type seq -ksp_monitor -m 10 -n 3 >> >> 0 KSP Residual norm 1.732050807569e+00 >> KSP Object: 1 MPI processes >> type: lsqr >> maximum iterations=10000, initial guess is zero >> tolerances: relative=1e-07, absolute=1e-50, divergence=10000 >> left preconditioning >> using UNPRECONDITIONED norm type for convergence test >> PC Object: 1 MPI processes >> type: none >> linear system matrix = precond matrix: >> Mat Object: 1 MPI processes >> type: seqaij >> rows=10, cols=3 >> total: nonzeros=3, allocated nonzeros=50 >> total number of mallocs used during MatSetValues calls =0 >> using I-node routines: found 5 nodes, limit used is 5 >> KSP Converged Reason -5 >> Norm of error = 0.1732E+01, Iterations = 0 >> >> >> I am using version 3.5.2 of PETSc library >> >> I am probably doing something wrong, but I don't understand what the >> problem is. >> Does anyone have an idea of what is going on ? >> Best regards >> Natacha >> >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From juanlu001 at gmail.com Thu Jan 8 14:32:22 2015 From: juanlu001 at gmail.com (Juan Luis Cano) Date: Thu, 08 Jan 2015 21:32:22 +0100 Subject: [petsc-users] Libraries destination directory is non-standard Message-ID: <54AEE956.2020206@gmail.com> Hello all, I am trying to build a conda package of PETSc 3.4 using its Python build system so anybody can install it in the Anaconda Python distribution. I need PETSc as a dependency for FEniCS. The problem is that the required shared libraries (also those corresponding to external packages such as UMFPACK) are installed in $PREFIX/lib/python2.7/site-packages/petsc/lib. The build process goes perfectly fine but when packaging this into a tarball these libs won't be found by any package as they are not in $PREFIX/lib. Here is the build script I am using: https://github.com/Juanlu001/conda-recipes/blob/juanlu001/fenics/petsc/build.sh I tried to change the destination using `--prefix` in PETSC_CONFIGURE_OPTIONS and after `setup.py install`, but neither worked. Changing LD_LIBRARY_PATH seems dangerous to me and creating symbolic links three levels higher seems dirty. If the python version changes, or "lib64" is added somewhere, this will surely break... Does anybody have a suggestion on how to do this? Thanks in advance, regards, Juan Luis From balay at mcs.anl.gov Thu Jan 8 14:46:43 2015 From: balay at mcs.anl.gov (Satish Balay) Date: Thu, 8 Jan 2015 14:46:43 -0600 Subject: [petsc-users] Libraries destination directory is non-standard In-Reply-To: <54AEE956.2020206@gmail.com> References: <54AEE956.2020206@gmail.com> Message-ID: For one - I think each external package should be packaged separately - and packagers should not rely on --download-package functionality. Secondly - petsc/umfpack etc libs will get installed in $PREFIX/lib/python2.7/site-packages/petsc/lib only if petsc is configured with the option: --prefix=$PREFIX/lib/python2.7/site-packages/petsc/lib Perhaps there is an error here? You can check [or send us] configure.log created by PETSc. [presumably you are expecting --prefix=$PREFIX as the location to install PETSc/umfpack.] Satish On Thu, 8 Jan 2015, Juan Luis Cano wrote: > Hello all, > > I am trying to build a conda package of PETSc 3.4 using its Python build > system so anybody can install it in the Anaconda Python distribution. I need > PETSc as a dependency for FEniCS. > > The problem is that the required shared libraries (also those corresponding to > external packages such as UMFPACK) are installed in > $PREFIX/lib/python2.7/site-packages/petsc/lib. The build process goes > perfectly fine but when packaging this into a tarball these libs won't be > found by any package as they are not in $PREFIX/lib. Here is the build script > I am using: > > https://github.com/Juanlu001/conda-recipes/blob/juanlu001/fenics/petsc/build.sh > > I tried to change the destination using `--prefix` in PETSC_CONFIGURE_OPTIONS > and after `setup.py install`, but neither worked. Changing LD_LIBRARY_PATH > seems dangerous to me and creating symbolic links three levels higher seems > dirty. If the python version changes, or "lib64" is added somewhere, this will > surely break... Does anybody have a suggestion on how to do this? > > Thanks in advance, regards, > > Juan Luis > From bsmith at mcs.anl.gov Thu Jan 8 17:58:09 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 8 Jan 2015 17:58:09 -0600 Subject: [petsc-users] Libraries destination directory is non-standard In-Reply-To: <54AEE956.2020206@gmail.com> References: <54AEE956.2020206@gmail.com> Message-ID: Juan Luis, We are very interested in making it easy for you to get this installer to suit your needs. The particular problem you report is due to the fact that PETSc's setup.py has the lines class cmd_install(_install): def initialize_options(self): _install.initialize_options(self) self.optimize = 1 def run(self): root_dir = self.install_platlib dest_dir = os.path.join(root_dir, 'petsc') that is it sets the dest_dir to be the usual install directory appended with a 'petsc'. I don't know why we adopted this extra name spacing. 1) As a quick and dirty fix you can edit the setup.py and set dest_dir directly to root_dir. 2) For the longer term we'd like to make it trivial for things work as you desire. We've revamped our installation process in the developer version of PETSc http://www.mcs.anl.gov/petsc/developers/index.html (git branch barry/namespace-install) and would be happy to work with you to get that version to to have the support you require. I'm guessing that we could add an optional argument to our setup.py that allows you to bypass the extra 'petsc' in the installation directory and we'd be happy to add that. Please let us know your thoughts, Barry > On Jan 8, 2015, at 2:32 PM, Juan Luis Cano wrote: > > Hello all, > > I am trying to build a conda package of PETSc 3.4 using its Python build system so anybody can install it in the Anaconda Python distribution. I need PETSc as a dependency for FEniCS. > > The problem is that the required shared libraries (also those corresponding to external packages such as UMFPACK) are installed in $PREFIX/lib/python2.7/site-packages/petsc/lib. The build process goes perfectly fine but when packaging this into a tarball these libs won't be found by any package as they are not in $PREFIX/lib. Here is the build script I am using: > > https://github.com/Juanlu001/conda-recipes/blob/juanlu001/fenics/petsc/build.sh > > I tried to change the destination using `--prefix` in PETSC_CONFIGURE_OPTIONS and after `setup.py install`, but neither worked. Changing LD_LIBRARY_PATH seems dangerous to me and creating symbolic links three levels higher seems dirty. If the python version changes, or "lib64" is added somewhere, this will surely break... Does anybody have a suggestion on how to do this? > > Thanks in advance, regards, > > Juan Luis From serge.van.criekingen at u-picardie.fr Fri Jan 9 08:47:56 2015 From: serge.van.criekingen at u-picardie.fr (Serge Van Criekingen) Date: Fri, 09 Jan 2015 15:47:56 +0100 Subject: [petsc-users] petsc4py: Mat().setSizes() Message-ID: <54AFEA1C.6060006@u-picardie.fr> Hi, Using petsc4py, I wish to control the distribution of matrix rows/columns among the processors. I found out how to do this for vectors in the archives: https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2013-February/016358.html But how can I do this with matrices? In other words, how is the "MatSetSizes" PETSc routine interfaced in petsc4py? To take an example, how can I specify the local number of rows/columns when running this minimal code in parallel: mpi_rank = PETSc.COMM_WORLD.getRank() M = PETSc.Mat().create(comm=PETSc.COMM_WORLD) M.setType('aij') M.setSizes((8,8),bsize=1) M.setUp() PETSc.Sys.syncPrint("rank: ",mpi_rank," M.sizes: ",M.sizes) PETSc.Sys.syncFlush() Thanks a lot, Serge From juanlu001 at gmail.com Fri Jan 9 11:51:14 2015 From: juanlu001 at gmail.com (Juan Luis Cano) Date: Fri, 09 Jan 2015 18:51:14 +0100 Subject: [petsc-users] Libraries destination directory is non-standard In-Reply-To: References: <54AEE956.2020206@gmail.com> Message-ID: <54B01512.3030404@gmail.com> Hello Satish, I reply you inline: On 2015-01-08 21:46, Satish Balay wrote: > For one - I think each external package should be packaged separately > - and packagers should not rely on --download-package functionality. Fair point. Doing it this way was just easy, but you are right I should decouple the external packages. That is unrelated to my problem though. > Secondly - petsc/umfpack etc libs will get installed in > $PREFIX/lib/python2.7/site-packages/petsc/lib only if petsc is > configured with the option: > > --prefix=$PREFIX/lib/python2.7/site-packages/petsc/lib > > Perhaps there is an error here? You can check [or send us] > configure.log created by PETSc. Actually this is unsurprising to me, because all Python modules (i.e. those installed via 'python setup.py install') go to $PREFIX/lib/python2.7/site-packages, and I didn't expect petsc to be an exception. After reading your reply I inspected the resulting files and probably PETSc is not meant to be there, which makes me wonder if I should use the Python installer in the first place. The 'setup.py' way is mentioned nowhere in the docs... I just switched to traditional './configure && make' and now the libraries are where I wanted. I had to specify PETSC_DIR though when building petsc4py but that is fine. I should probably take the same path with slepc. Problem solved! But what is the status of the setup.py installation procedure then? Answering Barry too: On 2015-01-09 00:58, Barry Smith wrote: > 2) For the longer term we'd like to make it trivial for things work as you desire. We've revamped our installation process in the developer version of PETSc http://www.mcs.anl.gov/petsc/developers/index.html (git branch barry/namespace-install) and would be happy to work with you to get that version to to have the support you require. I'm guessing that we could add an optional argument to our setup.py that allows you to bypass the extra 'petsc' in the installation directory and we'd be happy to add that. Thanks for your support. Perhaps this is not needed anymore given the above, but what are the changes that you introduced specifically? As there is no readme it is difficult to me to figure it out, as I am not familiarized with PETSc source code... Juan Luis From knepley at gmail.com Fri Jan 9 12:26:02 2015 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 9 Jan 2015 12:26:02 -0600 Subject: [petsc-users] petsc4py: Mat().setSizes() In-Reply-To: <54AFEA1C.6060006@u-picardie.fr> References: <54AFEA1C.6060006@u-picardie.fr> Message-ID: On Fri, Jan 9, 2015 at 8:47 AM, Serge Van Criekingen < serge.van.criekingen at u-picardie.fr> wrote: > Hi, > > Using petsc4py, I wish to control the distribution of matrix rows/columns > among the processors. > I found out how to do this for vectors in the archives: > https://lists.mcs.anl.gov/mailman/htdig/petsc-users/ > 2013-February/016358.html > But how can I do this with matrices? In other words, how is the > "MatSetSizes" PETSc routine interfaced in petsc4py? > > To take an example, how can I specify the local number of rows/columns > when running this minimal code in parallel: > > mpi_rank = PETSc.COMM_WORLD.getRank() > M = PETSc.Mat().create(comm=PETSc.COMM_WORLD) > M.setType('aij') > M.setSizes((8,8),bsize=1) > For example M.setSizes(((locSize, PETSC_DETERMINE), (locSize, PETSC_DETERMINE)), bsize=1) Thanks, Matt > M.setUp() > PETSc.Sys.syncPrint("rank: ",mpi_rank," M.sizes: ",M.sizes) > PETSc.Sys.syncFlush() > > Thanks a lot, > Serge > > > > -- 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 bsmith at mcs.anl.gov Fri Jan 9 23:45:25 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 9 Jan 2015 23:45:25 -0600 Subject: [petsc-users] Libraries destination directory is non-standard In-Reply-To: <54B01512.3030404@gmail.com> References: <54AEE956.2020206@gmail.com> <54B01512.3030404@gmail.com> Message-ID: Juan Luis, The intention of the setup.py is so that people can do things like $ sudo pip install https://bitbucket.org/petsc/petsc/get/master.tar.gz#egg=petsc-master 100% |################################| 13.3MB 881kB/s Installing collected packages: petsc-master Running setup.py install for petsc-master PETSc: configure configure options: PETSC_ARCH=macosx-10.10-intel-python --with-shared-libraries=1 --with-debugging=0 --with-c2html=0 --with-sowing=0 --with-fc=0 --with-cxx=0 --with-mpi=0 ... --destDir=/Library/Python/2.7/site-packages/petsc --prefix=/Library/Python/2.7/site-packages/petsc *** Using PETSC_DIR=/private/tmp/pip-build-z0Odnn/petsc-master PETSC_ARCH=macosx-10.10-intel-python *** *** Installing PETSc at prefix location: /Library/Python/2.7/site-packages/petsc *** ==================================== Install complete. Now to check if the libraries are working do (in current directory): make PETSC_DIR=/Library/Python/2.7/site-packages/petsc PETSC_ARCH="" test ==================================== Successfully installed petsc-master $ sudo PETSC_DIR=/Library/Python/2.7/site-packages/petsc PETSC_ARCH="" pip install https://bitbucket.org/petsc/petsc4py/get/master.tar.gz#egg=petsc4py-master Collecting petsc4py-master from https://bitbucket.org/petsc/petsc4py/get/master.tar.gz#egg=petsc4py-master Downloading https://bitbucket.org/petsc/petsc4py/get/master.tar.gz (216kB) 100% |################################| 217kB 467kB/s Requirement already satisfied (use --upgrade to upgrade): numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from petsc4py-master) Requirement already satisfied (use --upgrade to upgrade): Cython>=0.15 in /Library/Python/2.7/site-packages/Cython-0.21.2-py2.7-macosx-10.10-intel.egg (from petsc4py-master) Installing collected packages: petsc4py-master Running setup.py install for petsc4py-master cythonizing 'petsc4py.PETSc.pyx' -> 'petsc4py.PETSc.c' cythonizing 'libpetsc4py/libpetsc4py.pyx' -> 'libpetsc4py/libpetsc4py.c' PETSC_DIR: /Library/Python/2.7/site-packages/petsc .... removing /tmp/tmpwZjccQ.py Successfully installed petsc4py-master ~/Src $ python Python 2.7.6 (default, Sep 9 2014, 15:04:36) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import petsc4py >>> petsc4py.init() That is the setup is so that users can easily install PETSc for use from petsc4py and then easily install petsc4py without ever needing to directly worry about configure, make, etc etc .... themselves. Make sense? (Also I think it should be fine to use --download-suitesparse options etc with the setup.py though I have not tested it.) Barry I'll check with Lisandro about eliminating the need for that PETSC_DIR=/Library/Python/2.7/site-packages/petsc PETSC_ARCH="" since petsc4py should automatically check if PETSc libs are install for python and use them; > On Jan 9, 2015, at 11:51 AM, Juan Luis Cano wrote: > > Hello Satish, I reply you inline: > > On 2015-01-08 21:46, Satish Balay wrote: >> For one - I think each external package should be packaged separately >> - and packagers should not rely on --download-package functionality. > > Fair point. Doing it this way was just easy, but you are right I should decouple the external packages. That is unrelated to my problem though. > >> Secondly - petsc/umfpack etc libs will get installed in >> $PREFIX/lib/python2.7/site-packages/petsc/lib only if petsc is >> configured with the option: >> >> --prefix=$PREFIX/lib/python2.7/site-packages/petsc/lib >> >> Perhaps there is an error here? You can check [or send us] >> configure.log created by PETSc. > > Actually this is unsurprising to me, because all Python modules (i.e. those installed via 'python setup.py install') go to $PREFIX/lib/python2.7/site-packages, and I didn't expect petsc to be an exception. > > After reading your reply I inspected the resulting files and probably PETSc is not meant to be there, which makes me wonder if I should use the Python installer in the first place. The 'setup.py' way is mentioned nowhere in the docs... > > I just switched to traditional './configure && make' and now the libraries are where I wanted. I had to specify PETSC_DIR though when building petsc4py but that is fine. I should probably take the same path with slepc. > > Problem solved! But what is the status of the setup.py installation procedure then? > > Answering Barry too: > > On 2015-01-09 00:58, Barry Smith wrote: >> 2) For the longer term we'd like to make it trivial for things work as you desire. We've revamped our installation process in the developer version of PETSc http://www.mcs.anl.gov/petsc/developers/index.html (git branch barry/namespace-install) and would be happy to work with you to get that version to to have the support you require. I'm guessing that we could add an optional argument to our setup.py that allows you to bypass the extra 'petsc' in the installation directory and we'd be happy to add that. > > Thanks for your support. Perhaps this is not needed anymore given the above, but what are the changes that you introduced specifically? As there is no readme it is difficult to me to figure it out, as I am not familiarized with PETSc source code... > > Juan Luis From juanlu001 at gmail.com Sat Jan 10 04:36:28 2015 From: juanlu001 at gmail.com (Juan Luis Cano) Date: Sat, 10 Jan 2015 11:36:28 +0100 Subject: [petsc-users] Libraries destination directory is non-standard In-Reply-To: References: <54AEE956.2020206@gmail.com> <54B01512.3030404@gmail.com> Message-ID: <54B100AC.70502@gmail.com> On 2015-01-10 06:45, Barry Smith wrote: > Juan Luis, > > The intention of the setup.py is so that people can do things like > > $ sudo pip install https://bitbucket.org/petsc/petsc/get/master.tar.gz#egg=petsc-master > > [...] > That is the setup is so that users can easily install PETSc for use from petsc4py and then easily install petsc4py without ever needing to directly worry about configure, make, etc etc .... themselves. > > Make sense? Hello Barry, thanks for your remarks. It totally makes sense! I lost sight of this fact for a moment. I agree pip installing PETSc must be very useful for the major bulk of users. Regards, Juan Luis > (Also I think it should be fine to use --download-suitesparse options etc with the setup.py though I have not tested it.) > > Barry > > I'll check with Lisandro about eliminating the need for that PETSC_DIR=/Library/Python/2.7/site-packages/petsc PETSC_ARCH="" > since petsc4py should automatically check if PETSc libs are install for python and use them; > > > >> On Jan 9, 2015, at 11:51 AM, Juan Luis Cano wrote: >> >> Hello Satish, I reply you inline: >> >> On 2015-01-08 21:46, Satish Balay wrote: >>> For one - I think each external package should be packaged separately >>> - and packagers should not rely on --download-package functionality. >> Fair point. Doing it this way was just easy, but you are right I should decouple the external packages. That is unrelated to my problem though. >> >>> Secondly - petsc/umfpack etc libs will get installed in >>> $PREFIX/lib/python2.7/site-packages/petsc/lib only if petsc is >>> configured with the option: >>> >>> --prefix=$PREFIX/lib/python2.7/site-packages/petsc/lib >>> >>> Perhaps there is an error here? You can check [or send us] >>> configure.log created by PETSc. >> Actually this is unsurprising to me, because all Python modules (i.e. those installed via 'python setup.py install') go to $PREFIX/lib/python2.7/site-packages, and I didn't expect petsc to be an exception. >> >> After reading your reply I inspected the resulting files and probably PETSc is not meant to be there, which makes me wonder if I should use the Python installer in the first place. The 'setup.py' way is mentioned nowhere in the docs... >> >> I just switched to traditional './configure && make' and now the libraries are where I wanted. I had to specify PETSC_DIR though when building petsc4py but that is fine. I should probably take the same path with slepc. >> >> Problem solved! But what is the status of the setup.py installation procedure then? >> >> Answering Barry too: >> >> On 2015-01-09 00:58, Barry Smith wrote: >>> 2) For the longer term we'd like to make it trivial for things work as you desire. We've revamped our installation process in the developer version of PETSc http://www.mcs.anl.gov/petsc/developers/index.html (git branch barry/namespace-install) and would be happy to work with you to get that version to to have the support you require. I'm guessing that we could add an optional argument to our setup.py that allows you to bypass the extra 'petsc' in the installation directory and we'd be happy to add that. >> Thanks for your support. Perhaps this is not needed anymore given the above, but what are the changes that you introduced specifically? As there is no readme it is difficult to me to figure it out, as I am not familiarized with PETSc source code... >> >> Juan Luis From u.tabak at tudelft.nl Sat Jan 10 10:10:42 2015 From: u.tabak at tudelft.nl (Umut Tabak) Date: Sat, 10 Jan 2015 17:10:42 +0100 Subject: [petsc-users] An advice on a linear system solution Message-ID: <54B14F02.7020407@tudelft.nl> Dear all, For an eigenvalue solver, I was brainstorming on some ideas to solve some linear systems of the form: [A B] x1 = b1 [B C] x2 = b2 Where A and C are symmetric sparse but indefinite matrices due to some shift operations. Namely, A = K-\sigmaM and C = D/(\sigma)-E, where (K, M) and (D, E) are sparse symmetric stiffness and mass matrix pairs of the structural and fluid domains, respectively. However, B blocks are rather sparse coupling blocks and I was wondering if I can use this property in order to solve this system with the independent factorzations of A and C blocks either directly or iteratively. Iterative path is more difficult I believe since the matrices are indefinite. I am open to any useful ideas that can make it work or suggestions to kill this idea quickly. Best regards and happy new year to all PETSc'ers. Umut From dalcinl at gmail.com Sun Jan 11 11:41:36 2015 From: dalcinl at gmail.com (Lisandro Dalcin) Date: Sun, 11 Jan 2015 20:41:36 +0300 Subject: [petsc-users] Libraries destination directory is non-standard In-Reply-To: <54AEE956.2020206@gmail.com> References: <54AEE956.2020206@gmail.com> Message-ID: On 8 January 2015 at 23:32, Juan Luis Cano wrote: > Hello all, > > I am trying to build a conda package of PETSc 3.4 using its Python build > system so anybody can install it in the Anaconda Python distribution. I need > PETSc as a dependency for FEniCS. > Nice to know! I was thinking about doing it myself. You may find interesting my mpich and openmpi packages (newer versions than the available in Anaconda) to depend on https://binstar.org/mpi4py, I still have to put the recipes in github repo. > The problem is that the required shared libraries (also those corresponding > to external packages such as UMFPACK) are installed in > $PREFIX/lib/python2.7/site-packages/petsc/lib. The build process goes > perfectly fine but when packaging this into a tarball these libs won't be > found by any package as they are not in $PREFIX/lib. Here is the build > script I am using: > Are you using pip to create/build the conda recipes? I really advice against that. You should create a petsc package that is independent of a Python runtime (of course, you still need Python to run configure), this way you can install in the standard $PREFIX location. Why do you say things are installed in site-packages? Who is installing there FEniCS ? Please note/remember that conda is not only for Python stuff, but for any other Python-independent package that install under a $PREFIX tree. > https://github.com/Juanlu001/conda-recipes/blob/juanlu001/fenics/petsc/build.sh > * Please remember to add the md5 hash under the source section. * python should not be a runtime dependency of the petsc package > I tried to change the destination using `--prefix` in > PETSC_CONFIGURE_OPTIONS and after `setup.py install`, but neither worked. > Changing LD_LIBRARY_PATH seems dangerous to me and creating symbolic links > three levels higher seems dirty. If the python version changes, or "lib64" > is added somewhere, this will surely break... Does anybody have a suggestion > on how to do this? > Knowing the full stack of conda packages you depend on would help to figure out your issue. -- Lisandro Dalcin ============ Research Scientist Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) Numerical Porous Media Center (NumPor) King Abdullah University of Science and Technology (KAUST) http://numpor.kaust.edu.sa/ 4700 King Abdullah University of Science and Technology al-Khawarizmi Bldg (Bldg 1), Office # 4332 Thuwal 23955-6900, Kingdom of Saudi Arabia http://www.kaust.edu.sa Office Phone: +966 12 808-0459 From juanlu001 at gmail.com Sun Jan 11 14:31:30 2015 From: juanlu001 at gmail.com (Juan Luis Cano) Date: Sun, 11 Jan 2015 21:31:30 +0100 Subject: [petsc-users] Libraries destination directory is non-standard In-Reply-To: References: <54AEE956.2020206@gmail.com> Message-ID: <54B2DDA2.6070701@gmail.com> On 2015-01-11 18:41, Lisandro Dalcin wrote: > On 8 January 2015 at 23:32, Juan Luis Cano wrote: >> Hello all, >> >> I am trying to build a conda package of PETSc 3.4 using its Python build >> system so anybody can install it in the Anaconda Python distribution. I need >> PETSc as a dependency for FEniCS. >> > Nice to know! I was thinking about doing it myself. You may find > interesting my mpich and openmpi packages (newer versions than the > available in Anaconda) to depend on https://binstar.org/mpi4py, I > still have to put the recipes in github repo. > >> The problem is that the required shared libraries (also those corresponding >> to external packages such as UMFPACK) are installed in >> $PREFIX/lib/python2.7/site-packages/petsc/lib. The build process goes >> perfectly fine but when packaging this into a tarball these libs won't be >> found by any package as they are not in $PREFIX/lib. Here is the build >> script I am using: >> > Are you using pip to create/build the conda recipes? I really advice > against that. You should create a petsc package that is independent of > a Python runtime (of course, you still need Python to run configure), > this way you can install in the standard $PREFIX location. Why do you > say things are installed in site-packages? Who is installing there > FEniCS ? ?Hola Lisandro! Thanks for your answer. At first I used 'conda skeleton pypi' to create the packages, but the setup.py procedure installs in site-packages and it didn't seem appropriate, so I finally arranged the build script as you say. > Please note/remember that conda is not only for Python stuff, but for > any other Python-independent package that install under a $PREFIX > tree. I am aware! Actually if you see my binstar you will see boost and eigen3 there. >> https://github.com/Juanlu001/conda-recipes/blob/juanlu001/fenics/petsc/build.sh >> > * Please remember to add the md5 hash under the source section. > * python should not be a runtime dependency of the petsc package You are right, I wanted to do it the quick 'n' dirty way so I didn't write the hashes. This evening I achieved the result I wanted so I will polish the recipes. >> I tried to change the destination using `--prefix` in >> PETSC_CONFIGURE_OPTIONS and after `setup.py install`, but neither worked. >> Changing LD_LIBRARY_PATH seems dangerous to me and creating symbolic links >> three levels higher seems dirty. If the python version changes, or "lib64" >> is added somewhere, this will surely break... Does anybody have a suggestion >> on how to do this? >> > Knowing the full stack of conda packages you depend on would help to > figure out your issue. As I said, fortunately this is not an issue anymore since I am not using 'setup.py install'. The configure && make procedure is much more suitable. Regards, Juan Luis From jychang48 at gmail.com Sun Jan 11 22:05:05 2015 From: jychang48 at gmail.com (Justin Chang) Date: Sun, 11 Jan 2015 22:05:05 -0600 Subject: [petsc-users] Segmentation Violation for SNES ex12 Message-ID: Hi all, Our research group recently got access to a relatively new HPC cluster (with SLURM scheduler) and I am trying to run some test examples with it on multiple processors. When I run SNES ex12 serially it works. However when i run it on two processes, I get the following error: [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind [0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors [0]PETSC ERROR: likely location of problem given in stack below [0]PETSC ERROR: --------------------- Stack Frames ------------------------------------ [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, [0]PETSC ERROR: INSTEAD the line number of the start of the function [0]PETSC ERROR: is given. [0]PETSC ERROR: [0] DMLabelMakeInvalid_Private line 81 /home/jchang23/petsc/src/dm/impls/plex/plexlabel.c [0]PETSC ERROR: [0] DMLabelSetValue line 466 /home/jchang23/petsc/src/dm/impls/plex/plexlabel.c [0]PETSC ERROR: [0] DMPlexLabelComplete line 72 /home/jchang23/petsc/src/dm/impls/plex/plexsubmesh.c [0]PETSC ERROR: [0] DMCreateDefaultSection_Plex line 5368 /home/jchang23/petsc/src/dm/impls/plex/plex.c [0]PETSC ERROR: [0] DMGetDefaultSection line 2974 /home/jchang23/petsc/src/dm/interface/dm.c [0]PETSC ERROR: [0] DMGetDefaultGlobalSection line 3129 /home/jchang23/petsc/src/dm/interface/dm.c [0]PETSC ERROR: [0] DMCreateGlobalVector_Section_Private line 12 /home/jchang23/petsc/src/dm/interface/dmi.c [0]PETSC ERROR: [0] DMCreateGlobalVector_Plex line 1152 /home/jchang23/petsc/src/dm/impls/plex/plexcreate.c [0]PETSC ERROR: [0] DMCreateGlobalVector line 683 /home/jchang23/petsc/src/dm/interface/dm.c [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Signal received [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Development GIT revision: v3.5.2-1351-g37b8796 GIT Date: 2015-01-11 11:57:24 -0600 [0]PETSC ERROR: ./petsc/src/snes/examples/tutorials/ex12 on a arch-linux2-c-opt named compute-0-0.local by jchang23 Sun Jan 11 21:55:42 2015 [0]PETSC ERROR: Configure options --download-fblaslapack --download-hdf5 --download-metis --download-parmetis --with-c=gcc --with-cmake=cmake --with-debugging=1 --with-fc-gfortran --with-mpi-dir=/share/apps/openmpi-1.8.3/ CPPFLAGS=-I/share/apps/openmpi-1.8.3/include LDFLAGS=-L/share/apps/openmpi-1.8.3/lib PETSC_ARCH=arch-linux2-c-opt download-chaco --download-triangle [0]PETSC ERROR: #1 User provided function() line 0 in unknown file [1]PETSC ERROR: ------------------------------------------------------------------------ [1]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [1]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [1]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind [1]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors [1]PETSC ERROR: likely location of problem given in stack below [1]PETSC ERROR: --------------------- Stack Frames ------------------------------------ [1]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, [1]PETSC ERROR: INSTEAD the line number of the start of the function [1]PETSC ERROR: is given. [1]PETSC ERROR: [1] DMLabelMakeInvalid_Private line 81 /home/jchang23/petsc/src/dm/impls/plex/plexlabel.c [1]PETSC ERROR: [1] DMLabelSetValue line 466 /home/jchang23/petsc/src/dm/impls/plex/plexlabel.c [1]PETSC ERROR: [1] DMPlexLabelComplete line 72 /home/jchang23/petsc/src/dm/impls/plex/plexsubmesh.c [1]PETSC ERROR: [1] DMCreateDefaultSection_Plex line 5368 /home/jchang23/petsc/src/dm/impls/plex/plex.c [1]PETSC ERROR: [1] DMGetDefaultSection line 2974 /home/jchang23/petsc/src/dm/interface/dm.c [1]PETSC ERROR: [1] DMGetDefaultGlobalSection line 3129 /home/jchang23/petsc/src/dm/interface/dm.c [1]PETSC ERROR: [1] DMCreateGlobalVector_Section_Private line 12 /home/jchang23/petsc/src/dm/interface/dmi.c [1]PETSC ERROR: [1] DMCreateGlobalVector_Plex line 1152 /home/jchang23/petsc/src/dm/impls/plex/plexcreate.c [1]PETSC ERROR: [1] DMCreateGlobalVector line 683 /home/jchang23/petsc/src/dm/interface/dm.c [1]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [1]PETSC ERROR: Signal received [1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [1]PETSC ERROR: Petsc Development GIT revision: v3.5.2-1351-g37b8796 GIT Date: 2015-01-11 11:57:24 -0600 [1]PETSC ERROR: ./petsc/src/snes/examples/tutorials/ex12 on a arch-linux2-c-opt named compute-2-7.local by jchang23 Sun Jan 11 21:55:42 2015 [1]PETSC ERROR: Configure options --download-fblaslapack --download-hdf5 --download-metis --download-parmetis --with-c=gcc --with-cmake=cmake --with-debugging=1 --with-fc-gfortran --with-mpi-dir=/share/apps/openmpi-1.8.3/ CPPFLAGS=-I/share/apps/openmpi-1.8.3/include LDFLAGS=-L/share/apps/openmpi-1.8.3/lib PETSC_ARCH=arch-linux2-c-opt download-chaco --download-triangle [1]PETSC ERROR: #1 User provided function() line 0 in unknown file -------------------------------------------------------------------------- I have no idea what this means. Here is the script file used to run the problem with: #!/bin/bash #SBATCH -J test #SBATCH -o test.txt #SBATCH -N 2 mpirun -np 2 ./ex12 -run_type full -refinement_limit 0.00015625 -interpolate 1 -petscspace_order 2 -pc_type gamg -ksp_rtol 1.0e-10 -ksp_monitor_short -ksp_converged_reason -snes_monitor_short -snes_converged_reason -petscpartitioner_type parmetis --- Any help appreciated it, thanks Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: From cjm2176 at columbia.edu Mon Jan 12 00:03:09 2015 From: cjm2176 at columbia.edu (Colin McAuliffe) Date: Mon, 12 Jan 2015 01:03:09 -0500 Subject: [petsc-users] Recursive field split with MatNest Message-ID: Dear all, I have a four field problem with dof structure stored in a DM shell. The matrix is a MatNest. This works fine except for when I try to group fields. For example the following commands -ksp_type gmres -pc_type fieldsplit -pc_fieldsplit_type multiplicative -pc_fieldsplit_0_fields 0,1 -fieldsplit_0_ksp_type preonly -fieldsplit_0_pc_type lu -pc_fieldsplit_1_fields 2,3 -fieldsplit_1_ksp_type preonly -fieldsplit_1_pc_type ilu results in the following error [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Arguments are incompatible [0]PETSC ERROR: Could not find index set [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 [0]PETSC ERROR: /Users/Christina/Desktop/COLIN/Work/feapver83/ver83/parfeap/feap on a gnu-dbg named new-host.home by christina Mon Jan 12 00:36:52 2015 [0]PETSC ERROR: Configure options --with-debugging=1 --with-shared-libraries=0 --with-mpi-dir=/usr/local --with-parmetis-dir=/usr/local --with-metis-dir=/usr/local --with-hypre-dir=/usr/local --download-suitesparse --with-external-packages-dir=/usr/local [0]PETSC ERROR: #1 MatNestFindIS() line 310 in /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/impls/nest/matnest.c [0]PETSC ERROR: #2 MatNestFindSubMat() line 371 in /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/impls/nest/matnest.c [0]PETSC ERROR: #3 MatGetSubMatrix_Nest() line 387 in /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/impls/nest/matnest.c [0]PETSC ERROR: #4 MatGetSubMatrix() line 7345 in /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/interface/matrix.c [0]PETSC ERROR: #5 PCSetUp_FieldSplit() line 559 in /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/pc/impls/fieldsplit/fieldsplit.c [0]PETSC ERROR: #6 PCSetUp() line 902 in /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/pc/interface/precon.c [0]PETSC ERROR: #7 KSPSetUp() line 305 in /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: #8 KSPSolve() line 417 in /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c My guess is that petsc is expecting a MatNest corresponding to the outer field groupings instead of individual submatrices. Is it possible to resolve this, preferably from the command line? I should also mention that grouping and recursive field split works fine with the same DM shell and a MATAIJ, however a significant amount of time is spent copying the submatrices and I'd prefer to avoid that. Thanks and all the best, Colin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jed at jedbrown.org Mon Jan 12 00:15:40 2015 From: jed at jedbrown.org (Jed Brown) Date: Sun, 11 Jan 2015 23:15:40 -0700 Subject: [petsc-users] Recursive field split with MatNest In-Reply-To: References: Message-ID: <87egr0a5ir.fsf@jedbrown.org> Colin McAuliffe writes: > Dear all, I have a four field problem with dof structure stored in a DM > shell. The matrix is a MatNest. This works fine except for when I try to > group fields. Colin, MatGetSubMatrix_Nest does not implement the case of unions of index sets. The relevant comparison code is in the private function MatNestFindIS(), just before the line on which your error message was generated. It's possible to make this function check whether the given index set is a union of basic index sets constituting the MatNest. But checking for equality with every subset is not scalable in the number of blocks, so we'd need something like an ISSubset() function. If you just want to get your work done, I recommending not using MatNest. If you want to contribute an interesting feature to PETSc, we can offer guidance on the implementation. > For example the following commands > > -ksp_type gmres > -pc_type fieldsplit > -pc_fieldsplit_type multiplicative > -pc_fieldsplit_0_fields 0,1 > -fieldsplit_0_ksp_type preonly > -fieldsplit_0_pc_type lu > -pc_fieldsplit_1_fields 2,3 > -fieldsplit_1_ksp_type preonly > -fieldsplit_1_pc_type ilu > > results in the following error > > [0]PETSC ERROR: --------------------- Error Message > -------------------------------------------------------------- > [0]PETSC ERROR: Arguments are incompatible > [0]PETSC ERROR: Could not find index set > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for > trouble shooting. > [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 > [0]PETSC ERROR: > /Users/Christina/Desktop/COLIN/Work/feapver83/ver83/parfeap/feap on a > gnu-dbg named new-host.home by christina Mon Jan 12 00:36:52 2015 > [0]PETSC ERROR: Configure options --with-debugging=1 > --with-shared-libraries=0 --with-mpi-dir=/usr/local > --with-parmetis-dir=/usr/local --with-metis-dir=/usr/local > --with-hypre-dir=/usr/local --download-suitesparse > --with-external-packages-dir=/usr/local > [0]PETSC ERROR: #1 MatNestFindIS() line 310 in > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/impls/nest/matnest.c > [0]PETSC ERROR: #2 MatNestFindSubMat() line 371 in > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/impls/nest/matnest.c > [0]PETSC ERROR: #3 MatGetSubMatrix_Nest() line 387 in > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/impls/nest/matnest.c > [0]PETSC ERROR: #4 MatGetSubMatrix() line 7345 in > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/interface/matrix.c > [0]PETSC ERROR: #5 PCSetUp_FieldSplit() line 559 in > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/pc/impls/fieldsplit/fieldsplit.c > [0]PETSC ERROR: #6 PCSetUp() line 902 in > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/pc/interface/precon.c > [0]PETSC ERROR: #7 KSPSetUp() line 305 in > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c > [0]PETSC ERROR: #8 KSPSolve() line 417 in > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c > > My guess is that petsc is expecting a MatNest corresponding to the outer > field groupings instead of individual submatrices. Is it possible to > resolve this, preferably from the command line? > > I should also mention that grouping and recursive field split works fine > with the same DM shell and a MATAIJ, however a significant amount of time > is spent copying the submatrices and I'd prefer to avoid that. > > Thanks and all the best, > Colin -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From lawrence.mitchell at imperial.ac.uk Mon Jan 12 04:08:42 2015 From: lawrence.mitchell at imperial.ac.uk (Lawrence Mitchell) Date: Mon, 12 Jan 2015 10:08:42 +0000 Subject: [petsc-users] Confusion with MatGetLocalSubMatrix In-Reply-To: <3561DF00-A718-4464-B880-52D91E77BE6C@imperial.ac.uk> References: <33DAE0D3-4F42-47E2-B8F0-5364AA00F51D@imperial.ac.uk> <87tx0rimwp.fsf@jedbrown.org> <0B2304C7-7802-40A2-8765-7209EF93A6E3@imperial.ac.uk> <3561DF00-A718-4464-B880-52D91E77BE6C@imperial.ac.uk> Message-ID: Hi folks, On 19 Dec 2014, at 18:29, Lawrence Mitchell wrote: > > On 19 Dec 2014, at 18:19, Lawrence Mitchell wrote: > >> ... >> >>>> Calling MatGetLocalSubMatrix results in an error: >>>> >>>> [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- >>>> [0]PETSC ERROR: Petsc has generated inconsistent data >>>> [0]PETSC ERROR: Blocksize of localtoglobalmapping 1 must match that of layout 2 >>> >>> Hmm, I'm concerned that this might not work right after some recent >>> changes to ISLocalToGlobalMapping. Can you reproduce this with some >>> code I can run? > ... > > Here's one that doesn't try to destroy sections that don't exist, and endeavours to print block sizes of all the sub matrices. I expect to see (2, 2), (2, 1), (1, 2) and (1, 1) I think. Any suggestions as to where to start looking to fix the problem this code demonstrates? I'd like to be able to use MatGetLocalSubMatrix with ISes with block sizes > 1. Cheers, Lawrence > Cheers, > > Lawrence > > #include > > int main(int argc, char **argv) > { > PetscErrorCode ierr; > DM v; > DM p; > DM pack; > PetscInt rbs, cbs; > PetscInt srbs, scbs; > PetscInt i, j; > Mat mat; > Mat submat; > IS *ises; > > MPI_Comm c; > PetscInitialize(&argc, &argv, NULL, NULL); > > c = PETSC_COMM_WORLD; > ierr = DMDACreate1d(c, DM_BOUNDARY_NONE, 10, 2, 1, NULL, &v); CHKERRQ(ierr); > ierr = DMDACreate1d(c, DM_BOUNDARY_NONE, 10, 1, 1, NULL, &p); CHKERRQ(ierr); > ierr = DMSetFromOptions(v); CHKERRQ(ierr); > ierr = DMSetFromOptions(p); CHKERRQ(ierr); > > > ierr = DMCreateMatrix(v, &mat); CHKERRQ(ierr); > > ierr = MatGetBlockSizes(mat, &rbs, &cbs); CHKERRQ(ierr); > > ierr = PetscPrintf(c, "Global Mat block size (%d, %d)\n", rbs, cbs); CHKERRQ(ierr); > ierr = MatDestroy(&mat); CHKERRQ(ierr); > > ierr = DMCompositeCreate(c, &pack); CHKERRQ(ierr); > > ierr = DMCompositeAddDM(pack, v); CHKERRQ(ierr); > ierr = DMCompositeAddDM(pack, p); CHKERRQ(ierr); > ierr = DMSetFromOptions(pack); CHKERRQ(ierr); > > ierr = DMCompositeGetLocalISs(pack, &ises); CHKERRQ(ierr); > > ierr = DMCreateMatrix(pack, &mat); CHKERRQ(ierr); > > ierr = MatGetBlockSizes(mat, &rbs, &cbs); CHKERRQ(ierr); > > ierr = PetscPrintf(c, "Global Mat block size (%d, %d)\n", rbs, cbs); CHKERRQ(ierr); > > for (i=0; i < 2; i++ ) { > for (j=0; j < 2; j++ ) { > ierr = MatGetLocalSubMatrix(mat, ises[i], ises[j], &submat); CHKERRQ(ierr); > ierr = MatGetBlockSizes(submat, &srbs, &scbs); CHKERRQ(ierr); > ierr = PetscPrintf(c, "Local (%d, %d) block has block size (%d, %d)\n", i, j, srbs, scbs); CHKERRQ(ierr); > ierr = MatDestroy(&submat); CHKERRQ(ierr); > } > } > ierr = MatDestroy(&mat); CHKERRQ(ierr); > > ierr = DMDestroy(&pack); CHKERRQ(ierr); > ierr = DMDestroy(&v); CHKERRQ(ierr); > ierr = DMDestroy(&p); CHKERRQ(ierr); > > ierr = ISDestroy(&(ises[0])); CHKERRQ(ierr); > ierr = ISDestroy(&(ises[1])); CHKERRQ(ierr); > ierr = PetscFree(ises); CHKERRQ(ierr); > > PetscFinalize(); > > return 0; > } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: Message signed with OpenPGP using GPGMail URL: From marco.cisternino at optimad.it Mon Jan 12 07:59:57 2015 From: marco.cisternino at optimad.it (Marco Cisternino) Date: Mon, 12 Jan 2015 14:59:57 +0100 (CET) Subject: [petsc-users] template function as argument to MatShellSetOperation In-Reply-To: <783394195.3951860.1421071017680.JavaMail.root@optimad.it> Message-ID: <1314668673.3952367.1421071197018.JavaMail.root@optimad.it> Hi PETSc users, I'm trying to set my matrix multiplication with MatShellSetOperation. The question is: is it possible to pass a c++ template function as my matrix multiplication to MatShellSetOperation? And if yes, how? Thanks for any suggestions. Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Mon Jan 12 09:29:11 2015 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 12 Jan 2015 09:29:11 -0600 Subject: [petsc-users] An advice on a linear system solution In-Reply-To: <54B14F02.7020407@tudelft.nl> References: <54B14F02.7020407@tudelft.nl> Message-ID: On Sat, Jan 10, 2015 at 10:10 AM, Umut Tabak wrote: > Dear all, > > For an eigenvalue solver, I was brainstorming on some ideas to solve some > linear systems of the form: > > [A B] x1 = b1 > [B C] x2 = b2 > > Where A and C are symmetric sparse but indefinite matrices due to some > shift operations. Namely, A = K-\sigmaM and > C = D/(\sigma)-E, where (K, M) and (D, E) are sparse symmetric stiffness > and mass matrix pairs of the structural and fluid domains, respectively. > > However, B blocks are rather sparse coupling blocks and I was wondering if > I can use this property in order to solve this system with the independent > factorzations of A and C blocks either directly or iteratively. Iterative > path is more difficult I believe since the matrices are indefinite. > > I am open to any useful ideas that can make it work or suggestions to kill > this idea quickly. > Fieldsplit block preconditioners can be used on this type of matrix, but success obviously depends on the analytic character of the operators. In particular, if we assume that we have great PCs for the diagonal, then B is the most important variable, and we need to know what the Schur complement B^T A^{-1} B or equiv B^T C^{-1} B looks like. Thanks, Matt > Best regards and happy new year to all PETSc'ers. > > Umut > -- 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 12 09:40:43 2015 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 12 Jan 2015 09:40:43 -0600 Subject: [petsc-users] template function as argument to MatShellSetOperation In-Reply-To: <1314668673.3952367.1421071197018.JavaMail.root@optimad.it> References: <783394195.3951860.1421071017680.JavaMail.root@optimad.it> <1314668673.3952367.1421071197018.JavaMail.root@optimad.it> Message-ID: On Mon, Jan 12, 2015 at 7:59 AM, Marco Cisternino < marco.cisternino at optimad.it> wrote: > Hi PETSc users, > I'm trying to set my matrix multiplication with MatShellSetOperation. > The question is: is it possible to pass a c++ template function as my > matrix multiplication to MatShellSetOperation? > No. You will need to write a C wrapper. Thanks, Matt > And if yes, how? > Thanks for any suggestions. > > Marco > > -- 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 jed at jedbrown.org Mon Jan 12 09:51:12 2015 From: jed at jedbrown.org (Jed Brown) Date: Mon, 12 Jan 2015 08:51:12 -0700 Subject: [petsc-users] An advice on a linear system solution In-Reply-To: References: <54B14F02.7020407@tudelft.nl> Message-ID: <871tn09evj.fsf@jedbrown.org> Matthew Knepley writes: > Fieldsplit block preconditioners can be used on this type of matrix, but > success obviously depends on the > analytic character of the operators. In particular, if we assume that we > have great PCs for the diagonal, > then B is the most important variable, and we need to know what the Schur > complement > > B^T A^{-1} B or equiv B^T C^{-1} B Matt means D - B^T A^{-1} B or A - B C^{-1} B^T -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From cjm2176 at columbia.edu Mon Jan 12 10:23:30 2015 From: cjm2176 at columbia.edu (Colin McAuliffe) Date: Mon, 12 Jan 2015 11:23:30 -0500 Subject: [petsc-users] Recursive field split with MatNest In-Reply-To: <87egr0a5ir.fsf@jedbrown.org> References: <87egr0a5ir.fsf@jedbrown.org> Message-ID: I'd be interested in implementing this, I think I should have some time to spend on it in a few weeks. I suppose the ISSubset function should determine which ISs were used to make up a third IS? Can this be done by having ISSum attach a list of pointers to the constituent ISs to the summed IS for retrieval by ISSubset? thanks Colin On Mon, Jan 12, 2015 at 1:15 AM, Jed Brown wrote: > Colin McAuliffe writes: > > > Dear all, I have a four field problem with dof structure stored in a DM > > shell. The matrix is a MatNest. This works fine except for when I try to > > group fields. > > Colin, MatGetSubMatrix_Nest does not implement the case of unions of > index sets. The relevant comparison code is in the private function > MatNestFindIS(), just before the line on which your error message was > generated. It's possible to make this function check whether the given > index set is a union of basic index sets constituting the MatNest. But > checking for equality with every subset is not scalable in the number of > blocks, so we'd need something like an ISSubset() function. > > If you just want to get your work done, I recommending not using > MatNest. If you want to contribute an interesting feature to PETSc, we > can offer guidance on the implementation. > > > For example the following commands > > > > -ksp_type gmres > > -pc_type fieldsplit > > -pc_fieldsplit_type multiplicative > > -pc_fieldsplit_0_fields 0,1 > > -fieldsplit_0_ksp_type preonly > > -fieldsplit_0_pc_type lu > > -pc_fieldsplit_1_fields 2,3 > > -fieldsplit_1_ksp_type preonly > > -fieldsplit_1_pc_type ilu > > > > results in the following error > > > > [0]PETSC ERROR: --------------------- Error Message > > -------------------------------------------------------------- > > [0]PETSC ERROR: Arguments are incompatible > > [0]PETSC ERROR: Could not find index set > > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html > for > > trouble shooting. > > [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 > > [0]PETSC ERROR: > > /Users/Christina/Desktop/COLIN/Work/feapver83/ver83/parfeap/feap on a > > gnu-dbg named new-host.home by christina Mon Jan 12 00:36:52 2015 > > [0]PETSC ERROR: Configure options --with-debugging=1 > > --with-shared-libraries=0 --with-mpi-dir=/usr/local > > --with-parmetis-dir=/usr/local --with-metis-dir=/usr/local > > --with-hypre-dir=/usr/local --download-suitesparse > > --with-external-packages-dir=/usr/local > > [0]PETSC ERROR: #1 MatNestFindIS() line 310 in > > > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/impls/nest/matnest.c > > [0]PETSC ERROR: #2 MatNestFindSubMat() line 371 in > > > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/impls/nest/matnest.c > > [0]PETSC ERROR: #3 MatGetSubMatrix_Nest() line 387 in > > > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/impls/nest/matnest.c > > [0]PETSC ERROR: #4 MatGetSubMatrix() line 7345 in > > > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/mat/interface/matrix.c > > [0]PETSC ERROR: #5 PCSetUp_FieldSplit() line 559 in > > > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/pc/impls/fieldsplit/fieldsplit.c > > [0]PETSC ERROR: #6 PCSetUp() line 902 in > > > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/pc/interface/precon.c > > [0]PETSC ERROR: #7 KSPSetUp() line 305 in > > > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c > > [0]PETSC ERROR: #8 KSPSolve() line 417 in > > > /Users/Christina/Desktop/COLIN/Work/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c > > > > My guess is that petsc is expecting a MatNest corresponding to the outer > > field groupings instead of individual submatrices. Is it possible to > > resolve this, preferably from the command line? > > > > I should also mention that grouping and recursive field split works fine > > with the same DM shell and a MATAIJ, however a significant amount of time > > is spent copying the submatrices and I'd prefer to avoid that. > > > > Thanks and all the best, > > Colin > -------------- next part -------------- An HTML attachment was scrubbed... URL: From u.tabak at tudelft.nl Mon Jan 12 10:57:27 2015 From: u.tabak at tudelft.nl (Umut Tabak) Date: Mon, 12 Jan 2015 17:57:27 +0100 Subject: [petsc-users] An advice on a linear system solution In-Reply-To: References: <54B14F02.7020407@tudelft.nl> Message-ID: <54B3FCF7.3060601@tudelft.nl> On 01/12/2015 04:29 PM, Matthew Knepley wrote: > Fieldsplit block preconditioners can be used on this type of matrix, > but success obviously depends on the > analytic character of the operators. In particular, if we assume that > we have great PCs for the diagonal, > then B is the most important variable, and we need to know what the > Schur complement Dear Matt, Thanks, I have a bit of difficult time understanding what you mean by ?great PCs? for the diagonal? Could you please rephrase it? Thanks in advance. Umut From knepley at gmail.com Mon Jan 12 10:58:58 2015 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 12 Jan 2015 10:58:58 -0600 Subject: [petsc-users] An advice on a linear system solution In-Reply-To: <54B3FCF7.3060601@tudelft.nl> References: <54B14F02.7020407@tudelft.nl> <54B3FCF7.3060601@tudelft.nl> Message-ID: On Mon, Jan 12, 2015 at 10:57 AM, Umut Tabak wrote: > On 01/12/2015 04:29 PM, Matthew Knepley wrote: > >> Fieldsplit block preconditioners can be used on this type of matrix, but >> success obviously depends on the >> analytic character of the operators. In particular, if we assume that we >> have great PCs for the diagonal, >> then B is the most important variable, and we need to know what the Schur >> complement >> > Dear Matt, > Thanks, I have a bit of difficult time understanding what you mean by > ?great PCs? for the diagonal? Could you please rephrase it? > My impression was that you knew how to solve the diagonal blocks, but not the full system. Thanks, Matt > Thanks in advance. > Umut > -- 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 u.tabak at tudelft.nl Mon Jan 12 11:02:02 2015 From: u.tabak at tudelft.nl (Umut Tabak) Date: Mon, 12 Jan 2015 18:02:02 +0100 Subject: [petsc-users] An advice on a linear system solution In-Reply-To: References: <54B14F02.7020407@tudelft.nl> <54B3FCF7.3060601@tudelft.nl> Message-ID: <54B3FE0A.5090207@tudelft.nl> On 01/12/2015 05:58 PM, Matthew Knepley wrote: > On Mon, Jan 12, 2015 at 10:57 AM, Umut Tabak > wrote: > > On 01/12/2015 04:29 PM, Matthew Knepley wrote: > > Fieldsplit block preconditioners can be used on this type of > matrix, but success obviously depends on the > analytic character of the operators. In particular, if we > assume that we have great PCs for the diagonal, > then B is the most important variable, and we need to know > what the Schur complement > > Dear Matt, > Thanks, I have a bit of difficult time understanding what you mean > by ?great PCs? for the diagonal? Could you please rephrase it? > > > My impression was that you knew how to solve the diagonal blocks, but > not the full system. Thx for the swift reply, well, you mean directly or iteratively? I looked a bit more but I am not sure if that is possible iteratively or not, I guess it is not since the character of the blocks on the diagonal are not well suited to iterative solution techniques. Maybe I should look into field split documentation once more. Thx, Umut -------------- next part -------------- An HTML attachment was scrubbed... URL: From jed at jedbrown.org Mon Jan 12 11:05:33 2015 From: jed at jedbrown.org (Jed Brown) Date: Mon, 12 Jan 2015 10:05:33 -0700 Subject: [petsc-users] An advice on a linear system solution In-Reply-To: <54B3FE0A.5090207@tudelft.nl> References: <54B14F02.7020407@tudelft.nl> <54B3FCF7.3060601@tudelft.nl> <54B3FE0A.5090207@tudelft.nl> Message-ID: <87y4p87wv6.fsf@jedbrown.org> Umut Tabak writes: > Thx for the swift reply, well, you mean directly or iteratively? I > looked a bit more but I am not sure if that is possible iteratively or > not, I guess it is not since the character of the blocks on the diagonal > are not well suited to iterative solution techniques. Maybe I should > look into field split documentation once more. The first step to using fieldsplit is developing a good solver for (one of) the diagonal blocks. If you don't have that yet, consult the literature and run experiments. Good luck. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From jed at jedbrown.org Mon Jan 12 11:15:00 2015 From: jed at jedbrown.org (Jed Brown) Date: Mon, 12 Jan 2015 10:15:00 -0700 Subject: [petsc-users] Recursive field split with MatNest In-Reply-To: References: <87egr0a5ir.fsf@jedbrown.org> Message-ID: <87vbkb9azv.fsf@jedbrown.org> Colin McAuliffe writes: > I'd be interested in implementing this, I think I should have some time to > spend on it in a few weeks. I suppose the ISSubset function should > determine which ISs were used to make up a third IS? Can this be done by > having ISSum attach a list of pointers to the constituent ISs to the summed > IS for retrieval by ISSubset? It could and that would probably be fairly harmless in terms of peak memory usage. An alternative would be to compute a cryptographic hash of the index sets and only store that. This would allow comparison without needing to flatten the index sets to arrays of integers (see current implementation of ISEqual). -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From knepley at gmail.com Mon Jan 12 11:18:58 2015 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 12 Jan 2015 11:18:58 -0600 Subject: [petsc-users] Recursive field split with MatNest In-Reply-To: <87vbkb9azv.fsf@jedbrown.org> References: <87egr0a5ir.fsf@jedbrown.org> <87vbkb9azv.fsf@jedbrown.org> Message-ID: On Mon, Jan 12, 2015 at 11:15 AM, Jed Brown wrote: > Colin McAuliffe writes: > > > I'd be interested in implementing this, I think I should have some time > to > > spend on it in a few weeks. I suppose the ISSubset function should > > determine which ISs were used to make up a third IS? Can this be done by > > having ISSum attach a list of pointers to the constituent ISs to the > summed > > IS for retrieval by ISSubset? > > It could and that would probably be fairly harmless in terms of peak > memory usage. An alternative would be to compute a cryptographic hash > of the index sets and only store that. This would allow comparison > without needing to flatten the index sets to arrays of integers (see > current implementation of ISEqual). > I don't like this business of ISes holding pointers to other ISes. This fundamentally changes the model. The hashing sounds workable. 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jed at jedbrown.org Mon Jan 12 11:29:21 2015 From: jed at jedbrown.org (Jed Brown) Date: Mon, 12 Jan 2015 10:29:21 -0700 Subject: [petsc-users] Recursive field split with MatNest In-Reply-To: References: <87egr0a5ir.fsf@jedbrown.org> <87vbkb9azv.fsf@jedbrown.org> Message-ID: <87r3uz9aby.fsf@jedbrown.org> Matthew Knepley writes: > I don't like this business of ISes holding pointers to other ISes. This > fundamentally > changes the model. The hashing sounds workable. ISs are immutable and a reference would probably be held anyway, so I don't think it's evil. We also have to think about recursive composition and I'd rather not have to walk a subset DAG. If we hash, the IS would just store a list of "known subset hashes" with the semantic (A ? B).known_subset_hashes = A.known_subset_hashes ? B.known_subset_hashes ? [hash(A)] ? [hash(B)] -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From cjm2176 at columbia.edu Mon Jan 12 20:39:38 2015 From: cjm2176 at columbia.edu (Colin McAuliffe) Date: Mon, 12 Jan 2015 21:39:38 -0500 Subject: [petsc-users] Recursive field split with MatNest In-Reply-To: <87r3uz9aby.fsf@jedbrown.org> References: <87egr0a5ir.fsf@jedbrown.org> <87vbkb9azv.fsf@jedbrown.org> <87r3uz9aby.fsf@jedbrown.org> Message-ID: Thanks for the comments Jed and Matt, I'll defer to your judgement regarding the implementation that is the least intrusive. I'll take a look at this later on when I have time. Colin On Mon, Jan 12, 2015 at 12:29 PM, Jed Brown wrote: > Matthew Knepley writes: > > I don't like this business of ISes holding pointers to other ISes. This > > fundamentally > > changes the model. The hashing sounds workable. > > ISs are immutable and a reference would probably be held anyway, so I > don't think it's evil. > > We also have to think about recursive composition and I'd rather not > have to walk a subset DAG. If we hash, the IS would just store a list > of "known subset hashes" with the semantic > > (A ? B).known_subset_hashes = > A.known_subset_hashes ? B.known_subset_hashes ? [hash(A)] ? [hash(B)] > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Jan 13 12:25:12 2015 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 13 Jan 2015 12:25:12 -0600 Subject: [petsc-users] Segmentation Violation for SNES ex12 In-Reply-To: References: Message-ID: On Sun, Jan 11, 2015 at 10:05 PM, Justin Chang wrote: > Hi all, > > Our research group recently got access to a relatively new HPC cluster > (with SLURM scheduler) and I am trying to run some test examples with it on > multiple processors. When I run SNES ex12 serially it works. However when i > run it on two processes, I get the following error: > Yes, this was a bug in the big refactoring push that just went in. We did not catch it somehow in the tests. I have pushed a fix, and now it works for me. It is in next. Thanks, Matt > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, > probably memory access out of range > [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger > [0]PETSC ERROR: or see > http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind > [0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS > X to find memory corruption errors > [0]PETSC ERROR: likely location of problem given in stack below > [0]PETSC ERROR: --------------------- Stack Frames > ------------------------------------ > [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not > available, > [0]PETSC ERROR: INSTEAD the line number of the start of the function > [0]PETSC ERROR: is given. > [0]PETSC ERROR: [0] DMLabelMakeInvalid_Private line 81 > /home/jchang23/petsc/src/dm/impls/plex/plexlabel.c > [0]PETSC ERROR: [0] DMLabelSetValue line 466 > /home/jchang23/petsc/src/dm/impls/plex/plexlabel.c > [0]PETSC ERROR: [0] DMPlexLabelComplete line 72 > /home/jchang23/petsc/src/dm/impls/plex/plexsubmesh.c > [0]PETSC ERROR: [0] DMCreateDefaultSection_Plex line 5368 > /home/jchang23/petsc/src/dm/impls/plex/plex.c > [0]PETSC ERROR: [0] DMGetDefaultSection line 2974 > /home/jchang23/petsc/src/dm/interface/dm.c > [0]PETSC ERROR: [0] DMGetDefaultGlobalSection line 3129 > /home/jchang23/petsc/src/dm/interface/dm.c > [0]PETSC ERROR: [0] DMCreateGlobalVector_Section_Private line 12 > /home/jchang23/petsc/src/dm/interface/dmi.c > [0]PETSC ERROR: [0] DMCreateGlobalVector_Plex line 1152 > /home/jchang23/petsc/src/dm/impls/plex/plexcreate.c > [0]PETSC ERROR: [0] DMCreateGlobalVector line 683 > /home/jchang23/petsc/src/dm/interface/dm.c > [0]PETSC ERROR: --------------------- Error Message > -------------------------------------------------------------- > [0]PETSC ERROR: Signal received > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html > for trouble shooting. > [0]PETSC ERROR: Petsc Development GIT revision: v3.5.2-1351-g37b8796 GIT > Date: 2015-01-11 11:57:24 -0600 > [0]PETSC ERROR: ./petsc/src/snes/examples/tutorials/ex12 on a > arch-linux2-c-opt named compute-0-0.local by jchang23 Sun Jan 11 21:55:42 > 2015 > [0]PETSC ERROR: Configure options --download-fblaslapack --download-hdf5 > --download-metis --download-parmetis --with-c=gcc --with-cmake=cmake > --with-debugging=1 --with-fc-gfortran > --with-mpi-dir=/share/apps/openmpi-1.8.3/ > CPPFLAGS=-I/share/apps/openmpi-1.8.3/include > LDFLAGS=-L/share/apps/openmpi-1.8.3/lib PETSC_ARCH=arch-linux2-c-opt > download-chaco --download-triangle > [0]PETSC ERROR: #1 User provided function() line 0 in unknown file > [1]PETSC ERROR: > ------------------------------------------------------------------------ > [1]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, > probably memory access out of range > [1]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger > [1]PETSC ERROR: or see > http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind > [1]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS > X to find memory corruption errors > [1]PETSC ERROR: likely location of problem given in stack below > [1]PETSC ERROR: --------------------- Stack Frames > ------------------------------------ > [1]PETSC ERROR: Note: The EXACT line numbers in the stack are not > available, > [1]PETSC ERROR: INSTEAD the line number of the start of the function > [1]PETSC ERROR: is given. > [1]PETSC ERROR: [1] DMLabelMakeInvalid_Private line 81 > /home/jchang23/petsc/src/dm/impls/plex/plexlabel.c > [1]PETSC ERROR: [1] DMLabelSetValue line 466 > /home/jchang23/petsc/src/dm/impls/plex/plexlabel.c > [1]PETSC ERROR: [1] DMPlexLabelComplete line 72 > /home/jchang23/petsc/src/dm/impls/plex/plexsubmesh.c > [1]PETSC ERROR: [1] DMCreateDefaultSection_Plex line 5368 > /home/jchang23/petsc/src/dm/impls/plex/plex.c > [1]PETSC ERROR: [1] DMGetDefaultSection line 2974 > /home/jchang23/petsc/src/dm/interface/dm.c > [1]PETSC ERROR: [1] DMGetDefaultGlobalSection line 3129 > /home/jchang23/petsc/src/dm/interface/dm.c > [1]PETSC ERROR: [1] DMCreateGlobalVector_Section_Private line 12 > /home/jchang23/petsc/src/dm/interface/dmi.c > [1]PETSC ERROR: [1] DMCreateGlobalVector_Plex line 1152 > /home/jchang23/petsc/src/dm/impls/plex/plexcreate.c > [1]PETSC ERROR: [1] DMCreateGlobalVector line 683 > /home/jchang23/petsc/src/dm/interface/dm.c > [1]PETSC ERROR: --------------------- Error Message > -------------------------------------------------------------- > [1]PETSC ERROR: Signal received > [1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html > for trouble shooting. > [1]PETSC ERROR: Petsc Development GIT revision: v3.5.2-1351-g37b8796 GIT > Date: 2015-01-11 11:57:24 -0600 > [1]PETSC ERROR: ./petsc/src/snes/examples/tutorials/ex12 on a > arch-linux2-c-opt named compute-2-7.local by jchang23 Sun Jan 11 21:55:42 > 2015 > [1]PETSC ERROR: Configure options --download-fblaslapack --download-hdf5 > --download-metis --download-parmetis --with-c=gcc --with-cmake=cmake > --with-debugging=1 --with-fc-gfortran > --with-mpi-dir=/share/apps/openmpi-1.8.3/ > CPPFLAGS=-I/share/apps/openmpi-1.8.3/include > LDFLAGS=-L/share/apps/openmpi-1.8.3/lib PETSC_ARCH=arch-linux2-c-opt > download-chaco --download-triangle > [1]PETSC ERROR: #1 User provided function() line 0 in unknown file > -------------------------------------------------------------------------- > > I have no idea what this means. Here is the script file used to run the > problem with: > > #!/bin/bash > #SBATCH -J test > #SBATCH -o test.txt > #SBATCH -N 2 > > mpirun -np 2 ./ex12 -run_type full -refinement_limit 0.00015625 > -interpolate 1 -petscspace_order 2 -pc_type gamg -ksp_rtol 1.0e-10 > -ksp_monitor_short -ksp_converged_reason -snes_monitor_short > -snes_converged_reason -petscpartitioner_type parmetis > > --- > > Any help appreciated it, thanks > > Justin > > -- 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 siddhesh4godbole at gmail.com Wed Jan 14 00:29:45 2015 From: siddhesh4godbole at gmail.com (siddhesh godbole) Date: Wed, 14 Jan 2015 11:59:45 +0530 Subject: [petsc-users] error Message-ID: hello, i am not able to initiate multiple processes through mpiexec , when i do that, i get following error on example problems in ksp iitm at iitm:~/Downloads/petsc-3.5.2/src/ksp/ksp/examples/tutorials$ mpiexec -n 3 ex1 [proxy:0:0 at iitm] HYDU_create_process (./utils/launch/launch.c:75): execvp error on file ex1 (No such file or directory) [proxy:0:0 at iitm] HYDU_create_process (./utils/launch/launch.c:75): execvp error on file ex1 (No such file or directory) [proxy:0:0 at iitm] HYDU_create_process (./utils/launch/launch.c:75): execvp error on file ex1 (No such file or directory) =================================================================================== = BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES = EXIT CODE: 255 = CLEANING UP REMAINING PROCESSES = YOU CAN IGNORE THE BELOW CLEANUP MESSAGES =================================================================================== kindly help me out. sincerely *Siddhesh M Godbole* 5th year Dual Degree, Civil Eng & Applied Mech. IIT Madras -------------- next part -------------- An HTML attachment was scrubbed... URL: From jed at jedbrown.org Wed Jan 14 00:32:31 2015 From: jed at jedbrown.org (Jed Brown) Date: Tue, 13 Jan 2015 23:32:31 -0700 Subject: [petsc-users] error In-Reply-To: References: Message-ID: <87ppahoosg.fsf@jedbrown.org> siddhesh godbole writes: > hello, > > i am not able to initiate multiple processes through mpiexec , when i do > that, i get following error on example problems in ksp > > iitm at iitm:~/Downloads/petsc-3.5.2/src/ksp/ksp/examples/tutorials$ mpiexec > -n 3 ex1 Assuming ex1 does indeed exist and mpiexec is a viable way to run jobs on this machine (and comes from the correct MPI installation), use mpiexec -n 3 ./ex1 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From knepley at gmail.com Wed Jan 14 06:30:26 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 14 Jan 2015 06:30:26 -0600 Subject: [petsc-users] error In-Reply-To: <87ppahoosg.fsf@jedbrown.org> References: <87ppahoosg.fsf@jedbrown.org> Message-ID: On Wed, Jan 14, 2015 at 12:32 AM, Jed Brown wrote: > siddhesh godbole writes: > > > hello, > > > > i am not able to initiate multiple processes through mpiexec , when i do > > that, i get following error on example problems in ksp > > > > iitm at iitm:~/Downloads/petsc-3.5.2/src/ksp/ksp/examples/tutorials$ > mpiexec > > -n 3 ex1 > > Assuming ex1 does indeed exist and mpiexec is a viable way to run jobs > on this machine (and comes from the correct MPI installation), use > > mpiexec -n 3 ./ex1 > You are missing ex1. You probably have to make it first make ex1 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From siddhesh4godbole at gmail.com Wed Jan 14 08:53:19 2015 From: siddhesh4godbole at gmail.com (siddhesh godbole) Date: Wed, 14 Jan 2015 20:23:19 +0530 Subject: [petsc-users] error In-Reply-To: References: <87ppahoosg.fsf@jedbrown.org> Message-ID: Thanks a lot ..some novice mistake by me! Thanks for clarifying.. On Jan 14, 2015 6:00 PM, "Matthew Knepley" wrote: > On Wed, Jan 14, 2015 at 12:32 AM, Jed Brown wrote: > >> siddhesh godbole writes: >> >> > hello, >> > >> > i am not able to initiate multiple processes through mpiexec , when i do >> > that, i get following error on example problems in ksp >> > >> > iitm at iitm:~/Downloads/petsc-3.5.2/src/ksp/ksp/examples/tutorials$ >> mpiexec >> > -n 3 ex1 >> >> Assuming ex1 does indeed exist and mpiexec is a viable way to run jobs >> on this machine (and comes from the correct MPI installation), use >> >> mpiexec -n 3 ./ex1 >> > > You are missing ex1. You probably have to make it first > > make ex1 > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ling.zou at inl.gov Fri Jan 16 14:36:33 2015 From: ling.zou at inl.gov (Zou (Non-US), Ling) Date: Fri, 16 Jan 2015 13:36:33 -0700 Subject: [petsc-users] A question on "-pc_factor_mat_ordering_type" Message-ID: Hi All, I found many available options for PCILU on this webpage: http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCILU.html There is an option named -pc_factor_mat_ordering_type, with possible values such as . I wonder if anyone has brief descriptions for these values. Best, Ling -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Fri Jan 16 15:30:56 2015 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 16 Jan 2015 15:30:56 -0600 Subject: [petsc-users] A question on "-pc_factor_mat_ordering_type" In-Reply-To: References: Message-ID: On Fri, Jan 16, 2015 at 2:36 PM, Zou (Non-US), Ling wrote: > Hi All, > > I found many available options for PCILU on this webpage: > > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCILU.html > > There is an option named -pc_factor_mat_ordering_type, with possible > values such as . I wonder if anyone has brief > descriptions for these values. > Here are the names: http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/MatOrderings/MatGetOrdering.html Thanks, Matt > Best, > > Ling > -- 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 ling.zou at inl.gov Fri Jan 16 16:18:18 2015 From: ling.zou at inl.gov (Zou (Non-US), Ling) Date: Fri, 16 Jan 2015 15:18:18 -0700 Subject: [petsc-users] A question on "-pc_factor_mat_ordering_type" In-Reply-To: References: Message-ID: Thank you Matt for the link. Ling On Fri, Jan 16, 2015 at 2:30 PM, Matthew Knepley wrote: > On Fri, Jan 16, 2015 at 2:36 PM, Zou (Non-US), Ling > wrote: > >> Hi All, >> >> I found many available options for PCILU on this webpage: >> >> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCILU.html >> >> There is an option named -pc_factor_mat_ordering_type, with possible >> values such as . I wonder if anyone has brief >> descriptions for these values. >> > > Here are the names: > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/MatOrderings/MatGetOrdering.html > > Thanks, > > Matt > > >> Best, >> >> Ling >> > > > > -- > 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 orzgodlo at gmail.com Sat Jan 17 04:07:40 2015 From: orzgodlo at gmail.com (Jerry) Date: Sat, 17 Jan 2015 02:07:40 -0800 Subject: [petsc-users] WHY "C++ error! MPI_Finalize() could not be located!"? Thanks. Message-ID: Hi, all. I am trying to configure&compile petsc. However, during configuring, I got the following error (C++ error! MPI_Finalize() could not be located!). I am also copying the last few lines in configure.log. But I am sure mpi.h is under the folder I specified (--with-mpi-include=/usr/include/mpi ) Any idea about the problem? Thanks. $$ ./configure --prefix=~/local --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --with-mpi-include=/usr/include/mpi --with-mpi-lib=/usr/lib/libmpi.so =============================================================================== Configuring PETSc to compile on your system =============================================================================== TESTING: CxxMPICheck from config.packages.MPI(config/BuildSystem/config/packages******************************************************************************* UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): ------------------------------------------------------------------------------- C++ error! MPI_Finalize() could not be located! ******************************************************************************* =========== Last few lines from configure.log ================ ******************************************************************************* File "./config/configure.py", line 272, in petsc_configure framework.configure(out = sys.stdout) File "/home/delia/workspace/programs/petsc/config/BuildSystem/config/framework.py", line 941, in configure child.configure() File "/home/delia/workspace/programs/petsc/config/BuildSystem/config/package.py", line 606, in configure self.executeTest(self.configureLibrary) File "/home/delia/workspace/programs/petsc/config/BuildSystem/config/base.py", line 126, in executeTest ret = test(*args,**kargs) File "/home/delia/workspace/programs/petsc/config/BuildSystem/config/packages/MPI.py", line 660, in CxxMPICheck raise RuntimeError('C++ error! MPI_Finalize() could not be located!') ================================================================================ Finishing Configure Run at Sat Jan 17 01:34:31 2015 ================================================================================ Jerry -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Sat Jan 17 06:52:16 2015 From: knepley at gmail.com (Matthew Knepley) Date: Sat, 17 Jan 2015 06:52:16 -0600 Subject: [petsc-users] WHY "C++ error! MPI_Finalize() could not be located!"? Thanks. In-Reply-To: References: Message-ID: Send the whole configure.log Thanks, Matt On Sat, Jan 17, 2015 at 4:07 AM, Jerry wrote: > Hi, all. > > I am trying to configure&compile petsc. However, during configuring, I got > the following error (C++ error! MPI_Finalize() could not be located!). I am > also copying the last few lines in configure.log. > > But I am sure mpi.h is under the folder I specified > (--with-mpi-include=/usr/include/mpi ) > > Any idea about the problem? Thanks. > > > $$ ./configure --prefix=~/local --with-cc=gcc --with-cxx=g++ > --with-fc=gfortran --with-mpi-include=/usr/include/mpi > --with-mpi-lib=/usr/lib/libmpi.so > > > =============================================================================== > Configuring PETSc to compile on your > system > > =============================================================================== > TESTING: CxxMPICheck from > config.packages.MPI(config/BuildSystem/config/packages******************************************************************************* > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for > details): > > ------------------------------------------------------------------------------- > C++ error! MPI_Finalize() could not be located! > > ******************************************************************************* > > > > =========== Last few lines from configure.log ================ > > > > ******************************************************************************* > File "./config/configure.py", line 272, in petsc_configure > framework.configure(out = sys.stdout) > File > "/home/delia/workspace/programs/petsc/config/BuildSystem/config/framework.py", > line 941, in configure > child.configure() > File > "/home/delia/workspace/programs/petsc/config/BuildSystem/config/package.py", > line 606, in configure > self.executeTest(self.configureLibrary) > File > "/home/delia/workspace/programs/petsc/config/BuildSystem/config/base.py", > line 126, in executeTest > ret = test(*args,**kargs) > File > "/home/delia/workspace/programs/petsc/config/BuildSystem/config/packages/MPI.py", > line 660, in CxxMPICheck > raise RuntimeError('C++ error! MPI_Finalize() could not be located!') > > ================================================================================ > Finishing Configure Run at Sat Jan 17 01:34:31 2015 > > ================================================================================ > > > Jerry > -- 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 orzgodlo at gmail.com Sat Jan 17 13:18:44 2015 From: orzgodlo at gmail.com (Jerry) Date: Sat, 17 Jan 2015 11:18:44 -0800 Subject: [petsc-users] WHY "C++ error! MPI_Finalize() could not be located!"? Thanks. In-Reply-To: References: Message-ID: Hi, Matthew. Please find attached the configure log. Thanks. -Jerry 2015-01-17 4:52 GMT-08:00 Matthew Knepley : > Send the whole configure.log > > Thanks, > > Matt > > On Sat, Jan 17, 2015 at 4:07 AM, Jerry wrote: > >> Hi, all. >> >> I am trying to configure&compile petsc. However, during configuring, I >> got the following error (C++ error! MPI_Finalize() could not be located!). >> I am also copying the last few lines in configure.log. >> >> But I am sure mpi.h is under the folder I specified >> (--with-mpi-include=/usr/include/mpi ) >> >> Any idea about the problem? Thanks. >> >> >> $$ ./configure --prefix=~/local --with-cc=gcc --with-cxx=g++ >> --with-fc=gfortran --with-mpi-include=/usr/include/mpi >> --with-mpi-lib=/usr/lib/libmpi.so >> >> >> =============================================================================== >> Configuring PETSc to compile on your >> system >> >> =============================================================================== >> TESTING: CxxMPICheck from >> config.packages.MPI(config/BuildSystem/config/packages******************************************************************************* >> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for >> details): >> >> ------------------------------------------------------------------------------- >> C++ error! MPI_Finalize() could not be located! >> >> ******************************************************************************* >> >> >> >> =========== Last few lines from configure.log ================ >> >> >> >> ******************************************************************************* >> File "./config/configure.py", line 272, in petsc_configure >> framework.configure(out = sys.stdout) >> File >> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/framework.py", >> line 941, in configure >> child.configure() >> File >> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/package.py", >> line 606, in configure >> self.executeTest(self.configureLibrary) >> File >> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/base.py", >> line 126, in executeTest >> ret = test(*args,**kargs) >> File >> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/packages/MPI.py", >> line 660, in CxxMPICheck >> raise RuntimeError('C++ error! MPI_Finalize() could not be located!') >> >> ================================================================================ >> Finishing Configure Run at Sat Jan 17 01:34:31 2015 >> >> ================================================================================ >> >> >> Jerry >> > > > > -- > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: configure.log Type: text/x-log Size: 1180644 bytes Desc: not available URL: From knepley at gmail.com Sat Jan 17 13:29:13 2015 From: knepley at gmail.com (Matthew Knepley) Date: Sat, 17 Jan 2015 13:29:13 -0600 Subject: [petsc-users] WHY "C++ error! MPI_Finalize() could not be located!"? Thanks. In-Reply-To: References: Message-ID: On Sat, Jan 17, 2015 at 1:18 PM, Jerry wrote: > Hi, Matthew. > > Please find attached the configure log. Thanks. > There are problems with C++ and this MPI install: Executing: g++ -o /tmp/petsc-FhcRYT/config.libraries/conftest -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g -O0 /tmp/petsc-FhcRYT/config.libraries/conftest.o -Wl,-rpath,/usr/lib -L/usr/lib -lmpi -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -ldl -lgcc_s -ldl Possible ERROR while running linker: exit code 256 stderr: /tmp/petsc-FhcRYT/config.libraries/conftest.o: In function `MPI::Intracomm::Intracomm()': /usr/include/mpi/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference to `MPI::Comm::Comm()' /tmp/petsc-FhcRYT/config.libraries/conftest.o: In function `MPI::Intracomm::Intracomm(ompi_communicator_t*)': /usr/include/mpi/openmpi/ompi/mpi/cxx/intracomm_inln.h:23: undefined reference to `MPI::Comm::Comm()' /tmp/petsc-FhcRYT/config.libraries/conftest.o: In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)': /usr/include/mpi/openmpi/ompi/mpi/cxx/op_inln.h:122: undefined reference to `ompi_mpi_cxx_op_intercept' /tmp/petsc-FhcRYT/config.libraries/conftest.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()' /tmp/petsc-FhcRYT/config.libraries/conftest.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()' collect2: error: ld returned 1 exit status If you are using your own installation of MPI, it is best to use its compiler wrappers: --with-cc=/usr/bin/mpicc --with-cxx=/usr/bin/mpicxx instead of the MPI flags (since it looks like you missed a library). Also, do you really need to build PETSc with C++? If not, leave it out using --with-cxx=0 Thanks, Matt > -Jerry > > 2015-01-17 4:52 GMT-08:00 Matthew Knepley : > >> Send the whole configure.log >> >> Thanks, >> >> Matt >> >> On Sat, Jan 17, 2015 at 4:07 AM, Jerry wrote: >> >>> Hi, all. >>> >>> I am trying to configure&compile petsc. However, during configuring, I >>> got the following error (C++ error! MPI_Finalize() could not be located!). >>> I am also copying the last few lines in configure.log. >>> >>> But I am sure mpi.h is under the folder I specified >>> (--with-mpi-include=/usr/include/mpi ) >>> >>> Any idea about the problem? Thanks. >>> >>> >>> $$ ./configure --prefix=~/local --with-cc=gcc --with-cxx=g++ >>> --with-fc=gfortran --with-mpi-include=/usr/include/mpi >>> --with-mpi-lib=/usr/lib/libmpi.so >>> >>> >>> =============================================================================== >>> Configuring PETSc to compile on your >>> system >>> >>> =============================================================================== >>> TESTING: CxxMPICheck from >>> config.packages.MPI(config/BuildSystem/config/packages******************************************************************************* >>> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log >>> for details): >>> >>> ------------------------------------------------------------------------------- >>> C++ error! MPI_Finalize() could not be located! >>> >>> ******************************************************************************* >>> >>> >>> >>> =========== Last few lines from configure.log ================ >>> >>> >>> >>> ******************************************************************************* >>> File "./config/configure.py", line 272, in petsc_configure >>> framework.configure(out = sys.stdout) >>> File >>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/framework.py", >>> line 941, in configure >>> child.configure() >>> File >>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/package.py", >>> line 606, in configure >>> self.executeTest(self.configureLibrary) >>> File >>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/base.py", >>> line 126, in executeTest >>> ret = test(*args,**kargs) >>> File >>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/packages/MPI.py", >>> line 660, in CxxMPICheck >>> raise RuntimeError('C++ error! MPI_Finalize() could not be located!') >>> >>> ================================================================================ >>> Finishing Configure Run at Sat Jan 17 01:34:31 2015 >>> >>> ================================================================================ >>> >>> >>> Jerry >>> >> >> >> >> -- >> 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 cjm2176 at columbia.edu Sat Jan 17 14:05:19 2015 From: cjm2176 at columbia.edu (Colin McAuliffe) Date: Sat, 17 Jan 2015 15:05:19 -0500 Subject: [petsc-users] Recursive field split with MatNest In-Reply-To: References: <87egr0a5ir.fsf@jedbrown.org> <87vbkb9azv.fsf@jedbrown.org> <87r3uz9aby.fsf@jedbrown.org> Message-ID: A few other questions on this: since each field has a name, can this be used as an identifier for the ISes instead of the hash? I'm brushing up on hashes but also trying to think of simpler alternatives that work. Next, since MatNestFindSubMat returns a Mat and not a list of Mats, will it be necessary to create a mat nest for the case of a submatrix that is made up of several other submatrices? Thanks, Colin On Mon, Jan 12, 2015 at 9:39 PM, Colin McAuliffe wrote: > Thanks for the comments Jed and Matt, I'll defer to your judgement > regarding the implementation that is the least intrusive. I'll take a look > at this later on when I have time. > Colin > > On Mon, Jan 12, 2015 at 12:29 PM, Jed Brown wrote: > >> Matthew Knepley writes: >> > I don't like this business of ISes holding pointers to other ISes. This >> > fundamentally >> > changes the model. The hashing sounds workable. >> >> ISs are immutable and a reference would probably be held anyway, so I >> don't think it's evil. >> >> We also have to think about recursive composition and I'd rather not >> have to walk a subset DAG. If we hash, the IS would just store a list >> of "known subset hashes" with the semantic >> >> (A ? B).known_subset_hashes = >> A.known_subset_hashes ? B.known_subset_hashes ? [hash(A)] ? >> [hash(B)] >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From souza.michael at gmail.com Sat Jan 17 14:29:26 2015 From: souza.michael at gmail.com (Michael Souza) Date: Sat, 17 Jan 2015 17:29:26 -0300 Subject: [petsc-users] Wrong variable name in MatView with PETSC_VIEWER_ASCII_MATLAB Message-ID: The name of variable created by MatView using PETSC_VIEWER_ASCII_MATLAB is not the expected one. More clearly, the name of variable is "zzz" no matter what you set by calling PetscObjectSetName. The code below reproduces the unexpected behaviour. There, I create a diagonal MATMPIAIJ matrix and I set its name to "A", but the name of created variable in MATLAB's script is "zzz". I also would like to point that there is no need to print the line "zzz = [m n];" once its value will not be used and it will produce an warning at Matlab's editor. So I think it could be removed. Note: This strange behaviour doesn't occur with MATSEQAIJ matrices. Cheers, Michael Souza ---------------------------------------------------------- int main(int argc, char **args) { PetscErrorCode ierr; Mat A; PetscInt i, N = 3; ierr = PetscInitialize(&argc, &args, (char *) 0, help);CHKERRQ(ierr); // matrix creation and setup ierr = MatCreate(PETSC_COMM_WORLD, &A);CHKERRQ(ierr); ierr = MatSetType(A, MATMPIAIJ);CHKERRQ(ierr); ierr = MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, N, N);CHKERRQ(ierr); ierr = MatSetUp(A);CHKERRQ(ierr); for (i = 0; i < N; i++) { ierr = MatSetValue(A, i, i, 1.0, INSERT_VALUES);CHKERRQ(ierr); } ierr = MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); ierr = MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); // matlab viewer ierr = PetscViewerSetFormat(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); ierr = PetscObjectSetName((PetscObject) A, "A");CHKERRQ(ierr); ierr = MatView(A, PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr); // free memory ierr = MatDestroy(&A);CHKERRQ(ierr); ierr = PetscFinalize();CHKERRQ(ierr); return EXIT_SUCCESSSS; } ---------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From souza.michael at gmail.com Sat Jan 17 15:42:28 2015 From: souza.michael at gmail.com (Michael Souza) Date: Sat, 17 Jan 2015 18:42:28 -0300 Subject: [petsc-users] PCJacobi applied to incompatible vector Message-ID: I'm not sure if this is a bug, but the PCJACOBI can be applied in a vector with size different from its operators. In the code below, I define a PCJACOBI for a matrix A with size equal to 20 and I apply it in a 30 length vector x. Is this just an unforeseen mistake (unexpected application)? If it isn't, what exactly does PCJACOBI do in this situation? Cheers, Michael ------------------------------------------------------------------------------------- int main(int argc, char **args){ PetscErrorCode ierr; PC pc; KSP ksp; MPI_Comm comm; Mat A; PetscInt i, na=20, nx=30; Vec x, y; ierr = PetscInitialize(&argc, &args, (char *) 0, help); CHKERRQ(ierr); // matrix creation and setup ierr = MatCreate(PETSC_COMM_WORLD, &A); CHKERRQ(ierr); ierr = MatSetType(A, MATMPIAIJ); CHKERRQ(ierr); ierr = MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, na, na); CHKERRQ(ierr); ierr = MatSetUp(A); CHKERRQ(ierr); for (i = 0; i < na; i++) { if(i > 0) ierr = MatSetValue(A, i, (i - 1), 1.0, INSERT_VALUES); CHKERRQ(ierr); if(i < (na-1)) ierr = MatSetValue(A, i, i+1, 1.0, INSERT_VALUES); CHKERRQ(ierr); ierr = MatSetValue(A, i, i, -2.0, INSERT_VALUES); CHKERRQ(ierr); } ierr = MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY); CHKERRQ(ierr); ierr = MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY); CHKERRQ(ierr); // vector creation and setup ierr = VecCreate(PETSC_COMM_WORLD, &x); CHKERRQ(ierr); ierr = VecSetSizes(x,PETSC_DECIDE,nx);CHKERRQ(ierr); ierr = VecSetFromOptions(x);CHKERRQ(ierr); ierr = VecSet(x,1.0);CHKERRQ(ierr); ierr = VecDuplicate(x,&y);CHKERRQ(ierr); // set KSP ierr = PetscObjectGetComm((PetscObject) A, &comm); CHKERRQ(ierr); ierr = KSPCreate(comm, &ksp); CHKERRQ(ierr); ierr = KSPSetType(ksp, KSPPREONLY); CHKERRQ(ierr); ierr = KSPSetOperators(ksp, A, A); CHKERRQ(ierr); ierr = KSPGetPC(ksp, &pc); CHKERRQ(ierr); ierr = PCSetType(pc, PCBJACOBI); CHKERRQ(ierr); ierr = PCSetUp(pc); CHKERRQ(ierr); { // setup the SubKSP PetscInt nlocal, dummy; KSP *subksp; PC subpc; ierr = PCBJacobiGetSubKSP(pc, &nlocal, &dummy, &subksp); CHKERRQ(ierr); ierr = KSPSetType(*subksp, KSPPREONLY); CHKERRQ(ierr); ierr = KSPGetPC(*subksp, &subpc); CHKERRQ(ierr); ierr = PCSetType(subpc, PCILU); CHKERRQ(ierr); ierr = PCFactorSetLevels(subpc, 1); CHKERRQ(ierr); ierr = PCSetFromOptions(subpc); CHKERRQ(ierr); ierr = PCSetUp(subpc); CHKERRQ(ierr); } // solve ierr = VecView(x,PETSC_VIEWER_STDOUT_WORLD); ierr = KSPSolve(ksp,x,y); CHKERRQ(ierr); ierr = VecView(y,PETSC_VIEWER_STDOUT_WORLD); CHKERRQ(ierr); // destroy objects ierr = MatDestroy(&A); CHKERRQ(ierr); ierr = VecDestroy(&x); CHKERRQ(ierr); ierr = VecDestroy(&y); CHKERRQ(ierr); ierr = KSPDestroy(&ksp); CHKERRQ(ierr); return EXIT_SUCCESS; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Sat Jan 17 15:46:36 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 17 Jan 2015 15:46:36 -0600 Subject: [petsc-users] Wrong variable name in MatView with PETSC_VIEWER_ASCII_MATLAB In-Reply-To: References: Message-ID: <544C82EB-60CF-4A23-811A-065AB96BAB7F@mcs.anl.gov> Michael, Thanks for reporting this. I have fixed it in out maint and master branch and it will be fixed in our next patch update. I've also attached a patch file that you can use to update your copy of PETSc. -------------- next part -------------- A non-text attachment was scrubbed... Name: fix-matview-matlab-name.patch Type: application/octet-stream Size: 5080 bytes Desc: not available URL: -------------- next part -------------- Note 1: The reason for the zzz = zeros(3,3); is that for large matrices in Matlab it is (was?) much better to allocate a array of the correct final size before actually providing the entries in the matrix, otherwise Matlab would slowly dynamically keep increasing the size of the matrix as it found more entries in the matrix you provided. This is why we have this line. zzz = zeros(3,3); zzz = [ 1 1 1.0000000000000000e+00 2 2 1.0000000000000000e+00 3 3 1.0000000000000000e+00 ]; A = spconvert(zzz); Note: 2 If the matrix is large at all you do not want to save as an ASII matlab file. Instead save using the binary viewer and use the PETSc Matlab script PetscBinaryRead() to read it into Matlab. This will be much much faster for large matrices. For tiny matrices using the ASCII viewer is fine. Thanks Barry > On Jan 17, 2015, at 2:29 PM, Michael Souza wrote: > > The name of variable created by MatView using PETSC_VIEWER_ASCII_MATLAB is not the expected one. More clearly, the name of variable is "zzz" no matter what you set by calling PetscObjectSetName. > > The code below reproduces the unexpected behaviour. There, I create a diagonal MATMPIAIJ matrix and I set its name to "A", but the name of created variable in MATLAB's script is "zzz". > > I also would like to point that there is no need to print the line "zzz = [m n];" once its value will not be used and it will produce an warning at Matlab's editor. So I think it could be removed. > > Note: This strange behaviour doesn't occur with MATSEQAIJ matrices. > > Cheers, > Michael Souza > ---------------------------------------------------------- > int main(int argc, char **args) { > PetscErrorCode ierr; > Mat A; > PetscInt i, N = 3; > > ierr = PetscInitialize(&argc, &args, (char *) 0, help);CHKERRQ(ierr); > > // matrix creation and setup > ierr = MatCreate(PETSC_COMM_WORLD, &A);CHKERRQ(ierr); > ierr = MatSetType(A, MATMPIAIJ);CHKERRQ(ierr); > ierr = MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, N, N);CHKERRQ(ierr); > ierr = MatSetUp(A);CHKERRQ(ierr); > for (i = 0; i < N; i++) { > ierr = MatSetValue(A, i, i, 1.0, INSERT_VALUES);CHKERRQ(ierr); > } > ierr = MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); > ierr = MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); > > // matlab viewer > ierr = PetscViewerSetFormat(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); > ierr = PetscObjectSetName((PetscObject) A, "A");CHKERRQ(ierr); > ierr = MatView(A, PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr); > > // free memory > ierr = MatDestroy(&A);CHKERRQ(ierr); > > ierr = PetscFinalize();CHKERRQ(ierr); > > return EXIT_SUCCESSSS; > } > ---------------------------------------------------------- > From dave.mayhem23 at gmail.com Sat Jan 17 16:13:49 2015 From: dave.mayhem23 at gmail.com (Dave May) Date: Sat, 17 Jan 2015 23:13:49 +0100 Subject: [petsc-users] PCJacobi applied to incompatible vector In-Reply-To: References: Message-ID: Many of the Mat-Vec operations will check that the local and global sizes of the matrix and vector are compatible, for example MatMult. If you changed your outer KSP type to anything other than PREONLY, an error about the mismatched sizes would get thrown. It seems that none of the methods being called from within PCSetUp_BJACOBI perform such a check (which is a bit of a surprise). I cannot tell you exactly what the result of calling PCApply() with BJACOBI will be in the case when the local/global sizes of x,y are larger than the those for the operator. (I would guess that the "extra" entries might be ignored by PCApply_BJACOBI, but without going through the function in detail this really is a guess). The call to PCApply() does not check that the local/global sizes of the input and output vectors are compatible with the sizes associated with the preconditioned operator. It seems neither does PCSetUp(). Shouldn't PCSetUp() perform such a check to detect this error early on and to not have the in-built assumption that a method called within PCSetUp_XXX() will in fact catch the error?? Cheers, Dave On 17 January 2015 at 22:42, Michael Souza wrote: > I'm not sure if this is a bug, but the PCJACOBI can be applied in a vector > with size different from its operators. > In the code below, I define a PCJACOBI for a matrix A with size equal to > 20 and I apply it in a 30 length vector x. > > Is this just an unforeseen mistake (unexpected application)? If it isn't, > what exactly does PCJACOBI do in this situation? > > Cheers, > Michael > > > ------------------------------------------------------------------------------------- > int main(int argc, char **args){ > PetscErrorCode ierr; > PC pc; > KSP ksp; > MPI_Comm comm; > Mat A; > PetscInt i, na=20, nx=30; > Vec x, y; > > ierr = PetscInitialize(&argc, &args, (char *) 0, help); CHKERRQ(ierr); > > // matrix creation and setup > ierr = MatCreate(PETSC_COMM_WORLD, &A); CHKERRQ(ierr); > ierr = MatSetType(A, MATMPIAIJ); CHKERRQ(ierr); > ierr = MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, na, na); > CHKERRQ(ierr); > ierr = MatSetUp(A); CHKERRQ(ierr); > for (i = 0; i < na; i++) { > if(i > 0) > ierr = MatSetValue(A, i, (i - 1), 1.0, INSERT_VALUES); > CHKERRQ(ierr); > if(i < (na-1)) > ierr = MatSetValue(A, i, i+1, 1.0, INSERT_VALUES); > CHKERRQ(ierr); > ierr = MatSetValue(A, i, i, -2.0, INSERT_VALUES); CHKERRQ(ierr); > } > ierr = MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY); CHKERRQ(ierr); > ierr = MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY); CHKERRQ(ierr); > > // vector creation and setup > ierr = VecCreate(PETSC_COMM_WORLD, &x); CHKERRQ(ierr); > ierr = VecSetSizes(x,PETSC_DECIDE,nx);CHKERRQ(ierr); > ierr = VecSetFromOptions(x);CHKERRQ(ierr); > ierr = VecSet(x,1.0);CHKERRQ(ierr); > ierr = VecDuplicate(x,&y);CHKERRQ(ierr); > > // set KSP > ierr = PetscObjectGetComm((PetscObject) A, &comm); CHKERRQ(ierr); > ierr = KSPCreate(comm, &ksp); CHKERRQ(ierr); > ierr = KSPSetType(ksp, KSPPREONLY); CHKERRQ(ierr); > ierr = KSPSetOperators(ksp, A, A); CHKERRQ(ierr); > ierr = KSPGetPC(ksp, &pc); CHKERRQ(ierr); > ierr = PCSetType(pc, PCBJACOBI); CHKERRQ(ierr); > ierr = PCSetUp(pc); CHKERRQ(ierr); > { // setup the SubKSP > PetscInt nlocal, dummy; > KSP *subksp; > PC subpc; > ierr = PCBJacobiGetSubKSP(pc, &nlocal, &dummy, &subksp); > CHKERRQ(ierr); > ierr = KSPSetType(*subksp, KSPPREONLY); CHKERRQ(ierr); > ierr = KSPGetPC(*subksp, &subpc); CHKERRQ(ierr); > ierr = PCSetType(subpc, PCILU); CHKERRQ(ierr); > ierr = PCFactorSetLevels(subpc, 1); CHKERRQ(ierr); > ierr = PCSetFromOptions(subpc); CHKERRQ(ierr); > ierr = PCSetUp(subpc); CHKERRQ(ierr); > } > > // solve > ierr = VecView(x,PETSC_VIEWER_STDOUT_WORLD); > ierr = KSPSolve(ksp,x,y); CHKERRQ(ierr); > ierr = VecView(y,PETSC_VIEWER_STDOUT_WORLD); CHKERRQ(ierr); > > // destroy objects > ierr = MatDestroy(&A); CHKERRQ(ierr); > ierr = VecDestroy(&x); CHKERRQ(ierr); > ierr = VecDestroy(&y); CHKERRQ(ierr); > ierr = KSPDestroy(&ksp); CHKERRQ(ierr); > > return EXIT_SUCCESS; > } > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Sat Jan 17 16:56:18 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 17 Jan 2015 16:56:18 -0600 Subject: [petsc-users] Wrong variable name in MatView with PETSC_VIEWER_ASCII_MATLAB In-Reply-To: <544C82EB-60CF-4A23-811A-065AB96BAB7F@mcs.anl.gov> References: <544C82EB-60CF-4A23-811A-065AB96BAB7F@mcs.anl.gov> Message-ID: So it turns out my fix broke something else (I should have done more testing). I've attached the patch to the patch I provided for you. Apply this after the you apply the patch I previously sent you -------------- next part -------------- A non-text attachment was scrubbed... Name: fix-fix-matview-matlab-name.patch Type: application/octet-stream Size: 3623 bytes Desc: not available URL: -------------- next part -------------- Or better start using the copy of the PETSc in the repository: http://www.mcs.anl.gov/petsc/developers/index.html the branch maint corresponds to the last release plus some additional fixes. The branch master corresponds to the development copy that we are currently adding features to. Barry > On Jan 17, 2015, at 3:46 PM, Barry Smith wrote: > > > Michael, > > Thanks for reporting this. I have fixed it in out maint and master branch and it will be fixed in our next patch update. I've also attached a patch file that you can use to update your copy of PETSc. > > > Note 1: The reason for the zzz = zeros(3,3); is that for large matrices in Matlab it is (was?) much better to allocate a array of the correct final size before actually providing the entries in the matrix, otherwise Matlab would slowly dynamically keep increasing the size of the matrix as it found more entries in the matrix you provided. This is why we have this line. > > zzz = zeros(3,3); > zzz = [ > 1 1 1.0000000000000000e+00 > 2 2 1.0000000000000000e+00 > 3 3 1.0000000000000000e+00 > ]; > A = spconvert(zzz); > > Note: 2 If the matrix is large at all you do not want to save as an ASII matlab file. Instead save using the binary viewer and use the PETSc Matlab script PetscBinaryRead() to read it into Matlab. This will be much much faster for large matrices. For tiny matrices using the ASCII viewer is fine. > > Thanks > Barry > > > >> On Jan 17, 2015, at 2:29 PM, Michael Souza wrote: >> >> The name of variable created by MatView using PETSC_VIEWER_ASCII_MATLAB is not the expected one. More clearly, the name of variable is "zzz" no matter what you set by calling PetscObjectSetName. >> >> The code below reproduces the unexpected behaviour. There, I create a diagonal MATMPIAIJ matrix and I set its name to "A", but the name of created variable in MATLAB's script is "zzz". >> >> I also would like to point that there is no need to print the line "zzz = [m n];" once its value will not be used and it will produce an warning at Matlab's editor. So I think it could be removed. >> >> Note: This strange behaviour doesn't occur with MATSEQAIJ matrices. >> >> Cheers, >> Michael Souza >> ---------------------------------------------------------- >> int main(int argc, char **args) { >> PetscErrorCode ierr; >> Mat A; >> PetscInt i, N = 3; >> >> ierr = PetscInitialize(&argc, &args, (char *) 0, help);CHKERRQ(ierr); >> >> // matrix creation and setup >> ierr = MatCreate(PETSC_COMM_WORLD, &A);CHKERRQ(ierr); >> ierr = MatSetType(A, MATMPIAIJ);CHKERRQ(ierr); >> ierr = MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, N, N);CHKERRQ(ierr); >> ierr = MatSetUp(A);CHKERRQ(ierr); >> for (i = 0; i < N; i++) { >> ierr = MatSetValue(A, i, i, 1.0, INSERT_VALUES);CHKERRQ(ierr); >> } >> ierr = MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); >> ierr = MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); >> >> // matlab viewer >> ierr = PetscViewerSetFormat(PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); >> ierr = PetscObjectSetName((PetscObject) A, "A");CHKERRQ(ierr); >> ierr = MatView(A, PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr); >> >> // free memory >> ierr = MatDestroy(&A);CHKERRQ(ierr); >> >> ierr = PetscFinalize();CHKERRQ(ierr); >> >> return EXIT_SUCCESSSS; >> } >> ---------------------------------------------------------- >> > From bsmith at mcs.anl.gov Sat Jan 17 17:21:29 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sat, 17 Jan 2015 17:21:29 -0600 Subject: [petsc-users] PCJacobi applied to incompatible vector In-Reply-To: References: Message-ID: As Dave points out the error is not detected because of a confluence of options you happen to be using; normally a MatMult() in the Krylov methods triggers an error but in your choices there is no MatMult(). The reason PCSetUp() and PCSetUp_BJacobi() cannot detect the problem is because they may not yet have available the vector that you pass into KSPSolve() hence cannot detect the size difference. I have added an error check in PCApply() to make sure the sizes of the objects passed in are correct; it is in the branch barry/fix-bjacobi-vector-lengths and next (I learned my lesson and did not stick it immediately into next and master :-(). I've also attached the patch file. Thanks Barry [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Nonconforming object sizes [0]PETSC ERROR: Preconditioner number of local rows 20 does not equal resulting vector number of rows 30 [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Release Version 3.5.2, unknown [0]PETSC ERROR: ./ex1 on a arch-maint named Barrys-MacBook-Pro-3.local by barrysmith Sat Jan 17 17:15:12 2015 [0]PETSC ERROR: Configure options --download-mpich --with-fc=0 --with-cxx=0 --download-sowing=0 [0]PETSC ERROR: #1 PCApply() line 439 in /Users/barrysmith/Src/petsc/src/ksp/pc/interface/precon.c [0]PETSC ERROR: #2 KSP_PCApply() line 230 in /Users/barrysmith/Src/petsc/include/petsc-private/kspimpl.h [0]PETSC ERROR: #3 KSPSolve_PREONLY() line 26 in /Users/barrysmith/Src/petsc/src/ksp/ksp/impls/preonly/preonly.c [0]PETSC ERROR: #4 KSPSolve() line 460 in /Users/barrysmith/Src/petsc/src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: #5 main() line 59 in /Users/barrysmith/Src/petsc/test-dir/ex1.c [0]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint at mcs.anl.gov---------- -------------- next part -------------- A non-text attachment was scrubbed... Name: fix-bjacobi-vector-lengths.patch Type: application/octet-stream Size: 1269 bytes Desc: not available URL: -------------- next part -------------- > On Jan 17, 2015, at 4:13 PM, Dave May wrote: > > Many of the Mat-Vec operations will check that the local and global sizes of the matrix and vector are compatible, for example MatMult. If you changed your outer KSP type to anything other than PREONLY, an error about the mismatched sizes would get thrown. > > It seems that none of the methods being called from within PCSetUp_BJACOBI perform such a check (which is a bit of a surprise). I cannot tell you exactly what the result of calling PCApply() with BJACOBI will be in the case when the local/global sizes of x,y are larger than the those for the operator. (I would guess that the "extra" entries might be ignored by PCApply_BJACOBI, but without going through the function in detail this really is a guess). > > The call to PCApply() does not check that the local/global sizes of the input and output vectors are compatible with the sizes associated with the preconditioned operator. It seems neither does PCSetUp(). > > Shouldn't PCSetUp() perform such a check to detect this error early on and to not have the in-built assumption that a method called within PCSetUp_XXX() will in fact catch the error?? > > > Cheers, > Dave > > > > On 17 January 2015 at 22:42, Michael Souza wrote: > I'm not sure if this is a bug, but the PCJACOBI can be applied in a vector with size different from its operators. > In the code below, I define a PCJACOBI for a matrix A with size equal to 20 and I apply it in a 30 length vector x. > > Is this just an unforeseen mistake (unexpected application)? If it isn't, what exactly does PCJACOBI do in this situation? > > Cheers, > Michael > > ------------------------------------------------------------------------------------- > int main(int argc, char **args){ > PetscErrorCode ierr; > PC pc; > KSP ksp; > MPI_Comm comm; > Mat A; > PetscInt i, na=20, nx=30; > Vec x, y; > > ierr = PetscInitialize(&argc, &args, (char *) 0, help); CHKERRQ(ierr); > > // matrix creation and setup > ierr = MatCreate(PETSC_COMM_WORLD, &A); CHKERRQ(ierr); > ierr = MatSetType(A, MATMPIAIJ); CHKERRQ(ierr); > ierr = MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, na, na); CHKERRQ(ierr); > ierr = MatSetUp(A); CHKERRQ(ierr); > for (i = 0; i < na; i++) { > if(i > 0) > ierr = MatSetValue(A, i, (i - 1), 1.0, INSERT_VALUES); CHKERRQ(ierr); > if(i < (na-1)) > ierr = MatSetValue(A, i, i+1, 1.0, INSERT_VALUES); CHKERRQ(ierr); > ierr = MatSetValue(A, i, i, -2.0, INSERT_VALUES); CHKERRQ(ierr); > } > ierr = MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY); CHKERRQ(ierr); > ierr = MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY); CHKERRQ(ierr); > > // vector creation and setup > ierr = VecCreate(PETSC_COMM_WORLD, &x); CHKERRQ(ierr); > ierr = VecSetSizes(x,PETSC_DECIDE,nx);CHKERRQ(ierr); > ierr = VecSetFromOptions(x);CHKERRQ(ierr); > ierr = VecSet(x,1.0);CHKERRQ(ierr); > ierr = VecDuplicate(x,&y);CHKERRQ(ierr); > > // set KSP > ierr = PetscObjectGetComm((PetscObject) A, &comm); CHKERRQ(ierr); > ierr = KSPCreate(comm, &ksp); CHKERRQ(ierr); > ierr = KSPSetType(ksp, KSPPREONLY); CHKERRQ(ierr); > ierr = KSPSetOperators(ksp, A, A); CHKERRQ(ierr); > ierr = KSPGetPC(ksp, &pc); CHKERRQ(ierr); > ierr = PCSetType(pc, PCBJACOBI); CHKERRQ(ierr); > ierr = PCSetUp(pc); CHKERRQ(ierr); > { // setup the SubKSP > PetscInt nlocal, dummy; > KSP *subksp; > PC subpc; > ierr = PCBJacobiGetSubKSP(pc, &nlocal, &dummy, &subksp); CHKERRQ(ierr); > ierr = KSPSetType(*subksp, KSPPREONLY); CHKERRQ(ierr); > ierr = KSPGetPC(*subksp, &subpc); CHKERRQ(ierr); > ierr = PCSetType(subpc, PCILU); CHKERRQ(ierr); > ierr = PCFactorSetLevels(subpc, 1); CHKERRQ(ierr); > ierr = PCSetFromOptions(subpc); CHKERRQ(ierr); > ierr = PCSetUp(subpc); CHKERRQ(ierr); > } > > // solve > ierr = VecView(x,PETSC_VIEWER_STDOUT_WORLD); > ierr = KSPSolve(ksp,x,y); CHKERRQ(ierr); > ierr = VecView(y,PETSC_VIEWER_STDOUT_WORLD); CHKERRQ(ierr); > > // destroy objects > ierr = MatDestroy(&A); CHKERRQ(ierr); > ierr = VecDestroy(&x); CHKERRQ(ierr); > ierr = VecDestroy(&y); CHKERRQ(ierr); > ierr = KSPDestroy(&ksp); CHKERRQ(ierr); > > return EXIT_SUCCESS; > } > From orzgodlo at gmail.com Sun Jan 18 03:28:04 2015 From: orzgodlo at gmail.com (Jerry) Date: Sun, 18 Jan 2015 01:28:04 -0800 Subject: [petsc-users] WHY "C++ error! MPI_Finalize() could not be located!"? Thanks. In-Reply-To: References: Message-ID: Thanks, Matthew. I thought "--with-cc" "--with-cxx " "--with-fc" are all needed, according to the following webpage http://www.mcs.anl.gov/petsc/documentation/installation.html Now, I configured as follows, and then compile. It seems ok. ./configure --prefix=/usr/local --with-cc=gcc --with-cxx=0 --with-fc=0 --with-mpi-include=/usr/include/mpi --with-mpi-lib=/usr/lib/libmpi.so 2015-01-17 11:29 GMT-08:00 Matthew Knepley : > On Sat, Jan 17, 2015 at 1:18 PM, Jerry wrote: > >> Hi, Matthew. >> >> Please find attached the configure log. Thanks. >> > > There are problems with C++ and this MPI install: > > Executing: g++ -o /tmp/petsc-FhcRYT/config.libraries/conftest -Wall > -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g -O0 > /tmp/petsc-FhcRYT/config.libraries/conftest.o -Wl,-rpath,/usr/lib > -L/usr/lib -lmpi -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/4.8 > -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -Wl,-rpath,/usr/lib/x86_64-linux-gnu > -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/lib/x86_64-linux-gnu > -L/lib/x86_64-linux-gnu -Wl,-rpath,/usr/lib/x86_64-linux-gnu > -L/usr/lib/x86_64-linux-gnu -ldl -lgcc_s -ldl > Possible ERROR while running linker: exit code 256 > stderr: > /tmp/petsc-FhcRYT/config.libraries/conftest.o: In function > `MPI::Intracomm::Intracomm()': > /usr/include/mpi/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference > to `MPI::Comm::Comm()' > /tmp/petsc-FhcRYT/config.libraries/conftest.o: In function > `MPI::Intracomm::Intracomm(ompi_communicator_t*)': > /usr/include/mpi/openmpi/ompi/mpi/cxx/intracomm_inln.h:23: undefined > reference to `MPI::Comm::Comm()' > /tmp/petsc-FhcRYT/config.libraries/conftest.o: In function > `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), > bool)': > /usr/include/mpi/openmpi/ompi/mpi/cxx/op_inln.h:122: undefined reference > to `ompi_mpi_cxx_op_intercept' > /tmp/petsc-FhcRYT/config.libraries/conftest.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): > undefined reference to `MPI::Win::Free()' > /tmp/petsc-FhcRYT/config.libraries/conftest.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): > undefined reference to `MPI::Datatype::Free()' > collect2: error: ld returned 1 exit status > > If you are using your own installation of MPI, it is best to use its > compiler wrappers: > > --with-cc=/usr/bin/mpicc --with-cxx=/usr/bin/mpicxx > > instead of the MPI flags (since it looks like you missed a library). Also, > do you really > need to build PETSc with C++? If not, leave it out using > > --with-cxx=0 > > Thanks, > > Matt > > >> -Jerry >> >> 2015-01-17 4:52 GMT-08:00 Matthew Knepley : >> >>> Send the whole configure.log >>> >>> Thanks, >>> >>> Matt >>> >>> On Sat, Jan 17, 2015 at 4:07 AM, Jerry wrote: >>> >>>> Hi, all. >>>> >>>> I am trying to configure&compile petsc. However, during configuring, I >>>> got the following error (C++ error! MPI_Finalize() could not be located!). >>>> I am also copying the last few lines in configure.log. >>>> >>>> But I am sure mpi.h is under the folder I specified >>>> (--with-mpi-include=/usr/include/mpi ) >>>> >>>> Any idea about the problem? Thanks. >>>> >>>> >>>> $$ ./configure --prefix=~/local --with-cc=gcc --with-cxx=g++ >>>> --with-fc=gfortran --with-mpi-include=/usr/include/mpi >>>> --with-mpi-lib=/usr/lib/libmpi.so >>>> >>>> >>>> =============================================================================== >>>> Configuring PETSc to compile on your >>>> system >>>> >>>> =============================================================================== >>>> TESTING: CxxMPICheck from >>>> config.packages.MPI(config/BuildSystem/config/packages******************************************************************************* >>>> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log >>>> for details): >>>> >>>> ------------------------------------------------------------------------------- >>>> C++ error! MPI_Finalize() could not be located! >>>> >>>> ******************************************************************************* >>>> >>>> >>>> >>>> =========== Last few lines from configure.log ================ >>>> >>>> >>>> >>>> ******************************************************************************* >>>> File "./config/configure.py", line 272, in petsc_configure >>>> framework.configure(out = sys.stdout) >>>> File >>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/framework.py", >>>> line 941, in configure >>>> child.configure() >>>> File >>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/package.py", >>>> line 606, in configure >>>> self.executeTest(self.configureLibrary) >>>> File >>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/base.py", >>>> line 126, in executeTest >>>> ret = test(*args,**kargs) >>>> File >>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/packages/MPI.py", >>>> line 660, in CxxMPICheck >>>> raise RuntimeError('C++ error! MPI_Finalize() could not be >>>> located!') >>>> >>>> ================================================================================ >>>> Finishing Configure Run at Sat Jan 17 01:34:31 2015 >>>> >>>> ================================================================================ >>>> >>>> >>>> Jerry >>>> >>> >>> >>> >>> -- >>> 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 Sun Jan 18 04:32:55 2015 From: knepley at gmail.com (Matthew Knepley) Date: Sun, 18 Jan 2015 04:32:55 -0600 Subject: [petsc-users] WHY "C++ error! MPI_Finalize() could not be located!"? Thanks. In-Reply-To: References: Message-ID: On Sun, Jan 18, 2015 at 3:28 AM, Jerry wrote: > Thanks, Matthew. > > I thought "--with-cc" "--with-cxx " "--with-fc" are all needed, according > to the following webpage > http://www.mcs.anl.gov/petsc/documentation/installation.html > Only if you want to turn on those features. I'll see if we can clarify that. Glad it works. Thanks, Matt > > Now, I configured as follows, and then compile. It seems ok. > > ./configure --prefix=/usr/local --with-cc=gcc --with-cxx=0 --with-fc=0 > --with-mpi-include=/usr/include/mpi --with-mpi-lib=/usr/lib/libmpi.so > > > 2015-01-17 11:29 GMT-08:00 Matthew Knepley : > >> On Sat, Jan 17, 2015 at 1:18 PM, Jerry wrote: >> >>> Hi, Matthew. >>> >>> Please find attached the configure log. Thanks. >>> >> >> There are problems with C++ and this MPI install: >> >> Executing: g++ -o /tmp/petsc-FhcRYT/config.libraries/conftest -Wall >> -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g -O0 >> /tmp/petsc-FhcRYT/config.libraries/conftest.o -Wl,-rpath,/usr/lib >> -L/usr/lib -lmpi -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/4.8 >> -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -Wl,-rpath,/usr/lib/x86_64-linux-gnu >> -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/lib/x86_64-linux-gnu >> -L/lib/x86_64-linux-gnu -Wl,-rpath,/usr/lib/x86_64-linux-gnu >> -L/usr/lib/x86_64-linux-gnu -ldl -lgcc_s -ldl >> Possible ERROR while running linker: exit code 256 >> stderr: >> /tmp/petsc-FhcRYT/config.libraries/conftest.o: In function >> `MPI::Intracomm::Intracomm()': >> /usr/include/mpi/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference >> to `MPI::Comm::Comm()' >> /tmp/petsc-FhcRYT/config.libraries/conftest.o: In function >> `MPI::Intracomm::Intracomm(ompi_communicator_t*)': >> /usr/include/mpi/openmpi/ompi/mpi/cxx/intracomm_inln.h:23: undefined >> reference to `MPI::Comm::Comm()' >> /tmp/petsc-FhcRYT/config.libraries/conftest.o: In function >> `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), >> bool)': >> /usr/include/mpi/openmpi/ompi/mpi/cxx/op_inln.h:122: undefined reference >> to `ompi_mpi_cxx_op_intercept' >> /tmp/petsc-FhcRYT/config.libraries/conftest.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): >> undefined reference to `MPI::Win::Free()' >> /tmp/petsc-FhcRYT/config.libraries/conftest.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): >> undefined reference to `MPI::Datatype::Free()' >> collect2: error: ld returned 1 exit status >> >> If you are using your own installation of MPI, it is best to use its >> compiler wrappers: >> >> --with-cc=/usr/bin/mpicc --with-cxx=/usr/bin/mpicxx >> >> instead of the MPI flags (since it looks like you missed a library). >> Also, do you really >> need to build PETSc with C++? If not, leave it out using >> >> --with-cxx=0 >> >> Thanks, >> >> Matt >> >> >>> -Jerry >>> >>> 2015-01-17 4:52 GMT-08:00 Matthew Knepley : >>> >>>> Send the whole configure.log >>>> >>>> Thanks, >>>> >>>> Matt >>>> >>>> On Sat, Jan 17, 2015 at 4:07 AM, Jerry wrote: >>>> >>>>> Hi, all. >>>>> >>>>> I am trying to configure&compile petsc. However, during configuring, I >>>>> got the following error (C++ error! MPI_Finalize() could not be located!). >>>>> I am also copying the last few lines in configure.log. >>>>> >>>>> But I am sure mpi.h is under the folder I specified >>>>> (--with-mpi-include=/usr/include/mpi ) >>>>> >>>>> Any idea about the problem? Thanks. >>>>> >>>>> >>>>> $$ ./configure --prefix=~/local --with-cc=gcc --with-cxx=g++ >>>>> --with-fc=gfortran --with-mpi-include=/usr/include/mpi >>>>> --with-mpi-lib=/usr/lib/libmpi.so >>>>> >>>>> >>>>> =============================================================================== >>>>> Configuring PETSc to compile on your >>>>> system >>>>> >>>>> =============================================================================== >>>>> TESTING: CxxMPICheck from >>>>> config.packages.MPI(config/BuildSystem/config/packages******************************************************************************* >>>>> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log >>>>> for details): >>>>> >>>>> ------------------------------------------------------------------------------- >>>>> C++ error! MPI_Finalize() could not be located! >>>>> >>>>> ******************************************************************************* >>>>> >>>>> >>>>> >>>>> =========== Last few lines from configure.log ================ >>>>> >>>>> >>>>> >>>>> ******************************************************************************* >>>>> File "./config/configure.py", line 272, in petsc_configure >>>>> framework.configure(out = sys.stdout) >>>>> File >>>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/framework.py", >>>>> line 941, in configure >>>>> child.configure() >>>>> File >>>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/package.py", >>>>> line 606, in configure >>>>> self.executeTest(self.configureLibrary) >>>>> File >>>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/base.py", >>>>> line 126, in executeTest >>>>> ret = test(*args,**kargs) >>>>> File >>>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/packages/MPI.py", >>>>> line 660, in CxxMPICheck >>>>> raise RuntimeError('C++ error! MPI_Finalize() could not be >>>>> located!') >>>>> >>>>> ================================================================================ >>>>> Finishing Configure Run at Sat Jan 17 01:34:31 2015 >>>>> >>>>> ================================================================================ >>>>> >>>>> >>>>> Jerry >>>>> >>>> >>>> >>>> >>>> -- >>>> 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 souza.michael at gmail.com Sun Jan 18 06:21:22 2015 From: souza.michael at gmail.com (Michael Souza) Date: Sun, 18 Jan 2015 09:21:22 -0300 Subject: [petsc-users] PCJacobi applied to incompatible vector In-Reply-To: References: Message-ID: ?Thank you for that fast and complete answer. s?b, 17 de jan de 2015 21:21, Barry Smith escreveu: > > As Dave points out the error is not detected because of a confluence of > options you happen to be using; normally a MatMult() in the Krylov methods > triggers an error but in your choices there is no MatMult(). The reason > PCSetUp() and PCSetUp_BJacobi() cannot detect the problem is because they > may not yet have available the vector that you pass into KSPSolve() hence > cannot detect the size difference. > > I have added an error check in PCApply() to make sure the sizes of the > objects passed in are correct; it is in the branch barry/fix-bjacobi-vector- > lengths and next (I learned my lesson and did not stick it immediately > into next and master :-(). I've also attached the patch file. > > Thanks > > Barry > > [0]PETSC ERROR: --------------------- Error Message > -------------------------------------------------------------- > [0]PETSC ERROR: Nonconforming object sizes > [0]PETSC ERROR: Preconditioner number of local rows 20 does not equal > resulting vector number of rows 30 > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html > for trouble shooting. > [0]PETSC ERROR: Petsc Release Version 3.5.2, unknown > [0]PETSC ERROR: ./ex1 on a arch-maint named Barrys-MacBook-Pro-3.local by > barrysmith Sat Jan 17 17:15:12 2015 > [0]PETSC ERROR: Configure options --download-mpich --with-fc=0 > --with-cxx=0 --download-sowing=0 > [0]PETSC ERROR: #1 PCApply() line 439 in /Users/barrysmith/Src/petsc/sr > c/ksp/pc/interface/precon.c > [0]PETSC ERROR: #2 KSP_PCApply() line 230 in /Users/barrysmith/Src/petsc/ > include/petsc-private/kspimpl.h > [0]PETSC ERROR: #3 KSPSolve_PREONLY() line 26 in > /Users/barrysmith/Src/petsc/src/ksp/ksp/impls/preonly/preonly.c > [0]PETSC ERROR: #4 KSPSolve() line 460 in /Users/barrysmith/Src/petsc/sr > c/ksp/ksp/interface/itfunc.c > [0]PETSC ERROR: #5 main() line 59 in /Users/barrysmith/Src/petsc/te > st-dir/ex1.c > [0]PETSC ERROR: ----------------End of Error Message -------send entire > error message to petsc-maint at mcs.anl.gov---------- > > > On Jan 17, 2015, at 4:13 PM, Dave May wrote: > > > > Many of the Mat-Vec operations will check that the local and global > sizes of the matrix and vector are compatible, for example MatMult. If you > changed your outer KSP type to anything other than PREONLY, an error about > the mismatched sizes would get thrown. > > > > It seems that none of the methods being called from within > PCSetUp_BJACOBI perform such a check (which is a bit of a surprise). I > cannot tell you exactly what the result of calling PCApply() with BJACOBI > will be in the case when the local/global sizes of x,y are larger than the > those for the operator. (I would guess that the "extra" entries might be > ignored by PCApply_BJACOBI, but without going through the function in > detail this really is a guess). > > > > The call to PCApply() does not check that the local/global sizes of the > input and output vectors are compatible with the sizes associated with the > preconditioned operator. It seems neither does PCSetUp(). > > > > Shouldn't PCSetUp() perform such a check to detect this error early on > and to not have the in-built assumption that a method called within > PCSetUp_XXX() will in fact catch the error?? > > > > > > Cheers, > > Dave > > > > > > > > On 17 January 2015 at 22:42, Michael Souza > wrote: > > I'm not sure if this is a bug, but the PCJACOBI can be applied in a > vector with size different from its operators. > > In the code below, I define a PCJACOBI for a matrix A with size equal to > 20 and I apply it in a 30 length vector x. > > > > Is this just an unforeseen mistake (unexpected application)? If it > isn't, what exactly does PCJACOBI do in this situation? > > > > Cheers, > > Michael > > > > ------------------------------------------------------------ > ------------------------- > > int main(int argc, char **args){ > > PetscErrorCode ierr; > > PC pc; > > KSP ksp; > > MPI_Comm comm; > > Mat A; > > PetscInt i, na=20, nx=30; > > Vec x, y; > > > > ierr = PetscInitialize(&argc, &args, (char *) 0, help); > CHKERRQ(ierr); > > > > // matrix creation and setup > > ierr = MatCreate(PETSC_COMM_WORLD, &A); CHKERRQ(ierr); > > ierr = MatSetType(A, MATMPIAIJ); CHKERRQ(ierr); > > ierr = MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, na, na); > CHKERRQ(ierr); > > ierr = MatSetUp(A); CHKERRQ(ierr); > > for (i = 0; i < na; i++) { > > if(i > 0) > > ierr = MatSetValue(A, i, (i - 1), 1.0, INSERT_VALUES); > CHKERRQ(ierr); > > if(i < (na-1)) > > ierr = MatSetValue(A, i, i+1, 1.0, INSERT_VALUES); > CHKERRQ(ierr); > > ierr = MatSetValue(A, i, i, -2.0, INSERT_VALUES); CHKERRQ(ierr); > > } > > ierr = MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY); CHKERRQ(ierr); > > ierr = MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY); CHKERRQ(ierr); > > > > // vector creation and setup > > ierr = VecCreate(PETSC_COMM_WORLD, &x); CHKERRQ(ierr); > > ierr = VecSetSizes(x,PETSC_DECIDE,nx);CHKERRQ(ierr); > > ierr = VecSetFromOptions(x);CHKERRQ(ierr); > > ierr = VecSet(x,1.0);CHKERRQ(ierr); > > ierr = VecDuplicate(x,&y);CHKERRQ(ierr); > > > > // set KSP > > ierr = PetscObjectGetComm((PetscObject) A, &comm); CHKERRQ(ierr); > > ierr = KSPCreate(comm, &ksp); CHKERRQ(ierr); > > ierr = KSPSetType(ksp, KSPPREONLY); CHKERRQ(ierr); > > ierr = KSPSetOperators(ksp, A, A); CHKERRQ(ierr); > > ierr = KSPGetPC(ksp, &pc); CHKERRQ(ierr); > > ierr = PCSetType(pc, PCBJACOBI); CHKERRQ(ierr); > > ierr = PCSetUp(pc); CHKERRQ(ierr); > > { // setup the SubKSP > > PetscInt nlocal, dummy; > > KSP *subksp; > > PC subpc; > > ierr = PCBJacobiGetSubKSP(pc, &nlocal, &dummy, &subksp); > CHKERRQ(ierr); > > ierr = KSPSetType(*subksp, KSPPREONLY); CHKERRQ(ierr); > > ierr = KSPGetPC(*subksp, &subpc); CHKERRQ(ierr); > > ierr = PCSetType(subpc, PCILU); CHKERRQ(ierr); > > ierr = PCFactorSetLevels(subpc, 1); CHKERRQ(ierr); > > ierr = PCSetFromOptions(subpc); CHKERRQ(ierr); > > ierr = PCSetUp(subpc); CHKERRQ(ierr); > > } > > > > // solve > > ierr = VecView(x,PETSC_VIEWER_STDOUT_WORLD); > > ierr = KSPSolve(ksp,x,y); CHKERRQ(ierr); > > ierr = VecView(y,PETSC_VIEWER_STDOUT_WORLD); CHKERRQ(ierr); > > > > // destroy objects > > ierr = MatDestroy(&A); CHKERRQ(ierr); > > ierr = VecDestroy(&x); CHKERRQ(ierr); > > ierr = VecDestroy(&y); CHKERRQ(ierr); > > ierr = KSPDestroy(&ksp); CHKERRQ(ierr); > > > > return EXIT_SUCCESS; > > } > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From souza.michael at gmail.com Sun Jan 18 06:59:05 2015 From: souza.michael at gmail.com (Michael Souza) Date: Sun, 18 Jan 2015 09:59:05 -0300 Subject: [petsc-users] Wrong variable name in MatView with PETSC_VIEWER_ASCII_MATLAB In-Reply-To: References: <544C82EB-60CF-4A23-811A-065AB96BAB7F@mcs.anl.gov> Message-ID: ??Barry, You are right about the importance of preallocation at MATLAB, but unfortunately this code doesn't do it.? When the variable zzz is instantiated by zzz = zeros(m,n), MATLAB creates a zero dense matrix whose memory size is m*n*sizeof(doubles). However, the next code line is zzz = [i j x] which releases the previously preallocated space and creates a new one whose size is equal to the triple of the size of i (= sum of the sizes of i, j, and x). And the last line, A = spconvert(zzz), finally creates a new sparse matrix whose memory is not associated to the one of zzz. So, there is no preallocation. I tested two codes to illustrate this. The first code uses the supposed preallocation and the second one doesn't do it. As you can see from the figure below (the same figure follows attached), the second version is much more faster. Cheers, Michael On Sat, Jan 17, 2015 at 7:56 PM, Barry Smith wrote: > > So it turns out my fix broke something else (I should have done more > testing). I've attached the patch to the patch I provided for you. Apply > this after the you apply the patch I previously sent you > Or better start using the copy of the PETSc in the repository: > http://www.mcs.anl.gov/petsc/developers/index.html the branch maint > corresponds to the last release plus some additional fixes. The branch > master corresponds to the development copy that we are currently adding > features to. > > Barry > > > On Jan 17, 2015, at 3:46 PM, Barry Smith wrote: > > > > > > Michael, > > > > Thanks for reporting this. I have fixed it in out maint and master > branch and it will be fixed in our next patch update. I've also attached a > patch file that you can use to update your copy of PETSc. > > > > > > Note 1: The reason for the zzz = zeros(3,3); is that for large matrices > in Matlab it is (was?) much better to allocate a array of the correct final > size before actually providing the entries in the matrix, otherwise Matlab > would slowly dynamically keep increasing the size of the matrix as it found > more entries in the matrix you provided. This is why we have this line. > > > > zzz = zeros(3,3); > > zzz = [ > > 1 1 1.0000000000000000e+00 > > 2 2 1.0000000000000000e+00 > > 3 3 1.0000000000000000e+00 > > ]; > > A = spconvert(zzz); > > > > Note: 2 If the matrix is large at all you do not want to save as an ASII > matlab file. Instead save using the binary viewer and use the PETSc Matlab > script PetscBinaryRead() to read it into Matlab. This will be much much > faster for large matrices. For tiny matrices using the ASCII viewer is fine. > > > > Thanks > > Barry > > > > > > > >> On Jan 17, 2015, at 2:29 PM, Michael Souza > wrote: > >> > >> The name of variable created by MatView using PETSC_VIEWER_ASCII_MATLAB > is not the expected one. More clearly, the name of variable is "zzz" no > matter what you set by calling PetscObjectSetName. > >> > >> The code below reproduces the unexpected behaviour. There, I create a > diagonal MATMPIAIJ matrix and I set its name to "A", but the name of > created variable in MATLAB's script is "zzz". > >> > >> I also would like to point that there is no need to print the line "zzz > = [m n];" once its value will not be used and it will produce an warning at > Matlab's editor. So I think it could be removed. > >> > >> Note: This strange behaviour doesn't occur with MATSEQAIJ matrices. > >> > >> Cheers, > >> Michael Souza > >> ---------------------------------------------------------- > >> int main(int argc, char **args) { > >> PetscErrorCode ierr; > >> Mat A; > >> PetscInt i, N = 3; > >> > >> ierr = PetscInitialize(&argc, &args, (char *) 0, help);CHKERRQ(ierr); > >> > >> // matrix creation and setup > >> ierr = MatCreate(PETSC_COMM_WORLD, &A);CHKERRQ(ierr); > >> ierr = MatSetType(A, MATMPIAIJ);CHKERRQ(ierr); > >> ierr = MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, N, > N);CHKERRQ(ierr); > >> ierr = MatSetUp(A);CHKERRQ(ierr); > >> for (i = 0; i < N; i++) { > >> ierr = MatSetValue(A, i, i, 1.0, INSERT_VALUES);CHKERRQ(ierr); > >> } > >> ierr = MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); > >> ierr = MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); > >> > >> // matlab viewer > >> ierr = PetscViewerSetFormat(PETSC_VIEWER_STDOUT_WORLD, > PETSC_VIEWER_ASCII_MATLAB);CHKERRQ(ierr); > >> ierr = PetscObjectSetName((PetscObject) A, "A");CHKERRQ(ierr); > >> ierr = MatView(A, PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr); > >> > >> // free memory > >> ierr = MatDestroy(&A);CHKERRQ(ierr); > >> > >> ierr = PetscFinalize();CHKERRQ(ierr); > >> > >> return EXIT_SUCCESSSS; > >> } > >> ---------------------------------------------------------- > >> > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: prealloc.jpg Type: image/jpeg Size: 24381 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: prealloc.jpg Type: image/jpeg Size: 24381 bytes Desc: not available URL: From davydden at gmail.com Sun Jan 18 07:14:48 2015 From: davydden at gmail.com (Denis Davydov) Date: Sun, 18 Jan 2015 14:14:48 +0100 Subject: [petsc-users] set shift while not setting target Message-ID: Dear all, What is the expected behaviour when a user set shift value via STSetShift() with shift or shift-and-invert transformations, but ignores setting target via EPSSetTarget ? From the Table 2.2 (chapter 2.3), it seems that Target are used only in conjunction with EPS_TARGET_XXX of EPSWhich. Even though it is written in chapter 3.3 that "In all transformations except STSHIFT, there is a direct connection between the target ? (described in ?2.3) and the shift ?, as will be discussed below.? it does not look like the absence of EPSSetTarget call would affect solution with ST objects. At least that is my experience so far at least with Slepc 3.5.3. p.s. Of course, there is a logical connecting, namely one obtains eigenvalues near the shift value. p.p.s. I am solving GHEP for EPS_SMALLEST_REAL. Kind regards, Denis From jroman at dsic.upv.es Sun Jan 18 10:49:49 2015 From: jroman at dsic.upv.es (Jose E. Roman) Date: Sun, 18 Jan 2015 17:49:49 +0100 Subject: [petsc-users] set shift while not setting target In-Reply-To: References: Message-ID: El 18/01/2015, a las 14:14, Denis Davydov escribi?: > Dear all, > > What is the expected behaviour when a user set shift value via STSetShift() with shift or shift-and-invert transformations, > but ignores setting target via EPSSetTarget ? > > From the Table 2.2 (chapter 2.3), it seems that Target are used only in conjunction with EPS_TARGET_XXX of EPSWhich. > Even though it is written in chapter 3.3 that "In all transformations except STSHIFT, there is a direct connection between the target ? (described in ?2.3) and the shift ?, as will be discussed below.? > it does not look like the absence of EPSSetTarget call would affect solution with ST objects. > At least that is my experience so far at least with Slepc 3.5.3. > > p.s. Of course, there is a logical connecting, namely one obtains eigenvalues near the shift value. > p.p.s. I am solving GHEP for EPS_SMALLEST_REAL. > > Kind regards, > Denis > STSetShift() is a remnant of the old interface, before the target was introduced. The intended usage for the application is to use a target (set with EPSSetTarget) in combination with EPS_TARGET_XXX. STSetShift() could be used for the case that the target coincides with an eigenvalue (to avoid solving a singular system). When you set the target in shift-and-invert, two things happen: (1) the shift is set to the target and (2) eigenvalue approximations are sorted with respect to the target. The latter may be important for convergence. So it is recommended to set the target, not the shift. For STSHIFT, the shift is irrelevant because Krylov subspaces are shift invariant. But non-Krylov solvers may depend on the shift. For a GHEP, if you know where your eigenvalues are, use shift-and-invert with a target and EPS_TARGET_XXX. Jose From davydden at gmail.com Sun Jan 18 11:23:09 2015 From: davydden at gmail.com (Denis Davydov) Date: Sun, 18 Jan 2015 18:23:09 +0100 Subject: [petsc-users] set shift while not setting target In-Reply-To: References: Message-ID: > On 18 Jan 2015, at 17:49, Jose E. Roman wrote: > > STSetShift() is a remnant of the old interface, before the target was introduced. The intended usage for the application is to use a target (set with EPSSetTarget) in combination with EPS_TARGET_XXX. STSetShift() could be used for the case that the target coincides with an eigenvalue (to avoid solving a singular system). > > When you set the target in shift-and-invert, two things happen: (1) the shift is set to the target and (2) eigenvalue approximations are sorted with respect to the target. The latter may be important for convergence. So it is recommended to set the target, not the shift. > > For STSHIFT, the shift is irrelevant because Krylov subspaces are shift invariant. But non-Krylov solvers may depend on the shift. > > For a GHEP, if you know where your eigenvalues are, use shift-and-invert with a target and EPS_TARGET_XXX. Thanks for your detailed explanation! I will give it a try the way you suggested. Kind regards, Denis. From balay at mcs.anl.gov Sun Jan 18 11:49:07 2015 From: balay at mcs.anl.gov (Satish Balay) Date: Sun, 18 Jan 2015 11:49:07 -0600 Subject: [petsc-users] WHY "C++ error! MPI_Finalize() could not be located!"? Thanks. In-Reply-To: References: Message-ID: On Sun, 18 Jan 2015, Matthew Knepley wrote: > On Sun, Jan 18, 2015 at 3:28 AM, Jerry wrote: > > > Thanks, Matthew. > > > > I thought "--with-cc" "--with-cxx " "--with-fc" are all needed, according > > to the following webpage > > http://www.mcs.anl.gov/petsc/documentation/installation.html > > > > Only if you want to turn on those features. I'll see if we can clarify that. The 3 reasons for c++ is: - some externalpackages [hypre, openmpi etc..] require a c++ compiler. - some user codes might be c++ - so to use PETSc from user c++ code - its best to configure PETSc with a c++ compiler [eventhough the PETSc build is C] - to build PETSc using --with-clanguage=cxx. [This should mostly be unnecessary as the equivalent functionality is present in c build of PETSc] There is always a priority order [for info] in installation instructions. --with-cxx is partly explained in the example usages section as: >>>>>> Same as above - but do not have a fortran compiler [and want to use PETSc from C only]. ./configure --with-cc=gcc --with-cxx=0 --with-fc=0 --download-f2cblaslapack --download-mpich <<<<< The first instruction list: ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich Alternatively - we could change it to: ./configure --with-cc=gcc --with-cxx=0 --with-fc=gfortran --download-fblaslapack --download-mpich [this default is bad for PETSc users who use it from c++] I wanted to avoid specifying: ./configure --with-cc=gcc --with-fc=gfortran --download-fblaslapack --download-mpich [i.e no mention of --with-cxx] - as configure picks up a random c++ compiler in this mode - and can result in broken builds. Satish From balay at mcs.anl.gov Sun Jan 18 11:54:29 2015 From: balay at mcs.anl.gov (Satish Balay) Date: Sun, 18 Jan 2015 11:54:29 -0600 Subject: [petsc-users] WHY "C++ error! MPI_Finalize() could not be located!"? Thanks. In-Reply-To: References: Message-ID: BTW: Does your MPI install not provide mpicc,mpicxx,mpif90 compilers? Satish On Sun, 18 Jan 2015, Jerry wrote: > Now, I configured as follows, and then compile. It seems ok. > > ./configure --prefix=/usr/local --with-cc=gcc --with-cxx=0 --with-fc=0 > --with-mpi-include=/usr/include/mpi --with-mpi-lib=/usr/lib/libmpi.so > > 2015-01-17 11:29 GMT-08:00 Matthew Knepley : > > > If you are using your own installation of MPI, it is best to use its > > compiler wrappers: > > > > --with-cc=/usr/bin/mpicc --with-cxx=/usr/bin/mpicxx From jdong217 at gmail.com Sun Jan 18 14:45:36 2015 From: jdong217 at gmail.com (Justin Dong) Date: Sun, 18 Jan 2015 15:45:36 -0500 Subject: [petsc-users] PETSc 3.5.2 on Mac OS X Yosemite, configuring gives C preprocessor error Message-ID: Hi all, I just updated to OS X Yosemite. I have the latest XCode and also reinstalled command line developer tools. When I try to install PETSc, I get the following error: ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --with-debugging=0 =============================================================================== Configuring PETSc to compile on your system =============================================================================== TESTING: checkCPreprocessor from config.setCompilers(config/BuildSystem/config/setCompilers.py:568) ******************************************************************************* UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): ------------------------------------------------------------------------------- Cannot find a C preprocessor ******************************************************************************* Can someone explain to me what's going on here? Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Sun Jan 18 14:48:23 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Sun, 18 Jan 2015 14:48:23 -0600 Subject: [petsc-users] PETSc 3.5.2 on Mac OS X Yosemite, configuring gives C preprocessor error In-Reply-To: References: Message-ID: We need configure.log You do not need --download-blaslapack Apple always has them Suggest just running without passing the compiler names also. Barry > On Jan 18, 2015, at 2:45 PM, Justin Dong wrote: > > Hi all, > > I just updated to OS X Yosemite. I have the latest XCode and also reinstalled command line developer tools. > > When I try to install PETSc, I get the following error: > > ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --with-debugging=0 > > =============================================================================== > > Configuring PETSc to compile on your system > > =============================================================================== > > TESTING: checkCPreprocessor from config.setCompilers(config/BuildSystem/config/setCompilers.py:568) ******************************************************************************* > > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): > > ------------------------------------------------------------------------------- > > Cannot find a C preprocessor > > ******************************************************************************* > > > > Can someone explain to me what's going on here? > > > > Thanks, > > Justin > From jdong217 at gmail.com Sun Jan 18 14:50:53 2015 From: jdong217 at gmail.com (Justin Dong) Date: Sun, 18 Jan 2015 15:50:53 -0500 Subject: [petsc-users] PETSc 3.5.2 on Mac OS X Yosemite, configuring gives C preprocessor error In-Reply-To: References: Message-ID: Sorry, configure.log is attached below. On Sun, Jan 18, 2015 at 3:48 PM, Barry Smith wrote: > > We need configure.log > > You do not need --download-blaslapack Apple always has them > > Suggest just running without passing the compiler names also. > > Barry > > > On Jan 18, 2015, at 2:45 PM, Justin Dong wrote: > > > > Hi all, > > > > I just updated to OS X Yosemite. I have the latest XCode and also > reinstalled command line developer tools. > > > > When I try to install PETSc, I get the following error: > > > > ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran > --download-fblaslapack --download-mpich --with-debugging=0 > > > > > =============================================================================== > > > > Configuring PETSc to compile on your system > > > > > =============================================================================== > > > > TESTING: checkCPreprocessor from > config.setCompilers(config/BuildSystem/config/setCompilers.py:568) > > ******************************************************************************* > > > > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log > for details): > > > > > ------------------------------------------------------------------------------- > > > > Cannot find a C preprocessor > > > > > ******************************************************************************* > > > > > > > > Can someone explain to me what's going on here? > > > > > > > > Thanks, > > > > Justin > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: configure.log Type: application/octet-stream Size: 159556 bytes Desc: not available URL: From balay at mcs.anl.gov Sun Jan 18 15:03:38 2015 From: balay at mcs.anl.gov (Satish Balay) Date: Sun, 18 Jan 2015 15:03:38 -0600 Subject: [petsc-users] PETSc 3.5.2 on Mac OS X Yosemite, configuring gives C preprocessor error In-Reply-To: References: Message-ID: >>>>>>>>>> Checking for program /usr/local/bin/gcc...found Executing: gcc -c -o /var/folders/_v/0817pkss07z1y_v4bzw9ssy80000gn/T/petsc-y_tzNl/config.setCompilers/conftest.o -I/var/folders/_v/0817pkss07z1y_v4bzw9ssy80000gn/T/petsc-y_tzNl/config.setCompilers /var/folders/_v/0817pkss07z1y_v4bzw9ssy80000gn/T/petsc-y_tzNl/config.setCompilers/conftest.c Possible ERROR while running compiler: stderr: gcc: warning: couldn?t understand kern.osversion ?14.0.0 <<<<<<<<< You have broken gcc in your PATH. [it broke due to Yosemite upgrade]. Is this homewrew or something else? You should delete your /usr/local and reinstall whatever you need in there. However wrt PETSc - you can use: ./configure --with-cc=/usr/bin/clang --with-cxx=/usr/bin/clang++ --with-fc=0 --download-mpich --with-debugging=0 However if you need gfortran - you would have to do the 'reinstall /usr/local' stuff for that. Satish On Sun, 18 Jan 2015, Justin Dong wrote: > Sorry, configure.log is attached below. > > On Sun, Jan 18, 2015 at 3:48 PM, Barry Smith wrote: > > > > > We need configure.log > > > > You do not need --download-blaslapack Apple always has them > > > > Suggest just running without passing the compiler names also. > > > > Barry > > > > > On Jan 18, 2015, at 2:45 PM, Justin Dong wrote: > > > > > > Hi all, > > > > > > I just updated to OS X Yosemite. I have the latest XCode and also > > reinstalled command line developer tools. > > > > > > When I try to install PETSc, I get the following error: > > > > > > ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran > > --download-fblaslapack --download-mpich --with-debugging=0 > > > > > > > > =============================================================================== > > > > > > Configuring PETSc to compile on your system > > > > > > > > =============================================================================== > > > > > > TESTING: checkCPreprocessor from > > config.setCompilers(config/BuildSystem/config/setCompilers.py:568) > > > > ******************************************************************************* > > > > > > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log > > for details): > > > > > > > > ------------------------------------------------------------------------------- > > > > > > Cannot find a C preprocessor > > > > > > > > ******************************************************************************* > > > > > > > > > > > > Can someone explain to me what's going on here? > > > > > > > > > > > > Thanks, > > > > > > Justin > > > > > > > > From patrick.sanan at gmail.com Mon Jan 19 01:52:17 2015 From: patrick.sanan at gmail.com (Patrick Sanan) Date: Mon, 19 Jan 2015 08:52:17 +0100 Subject: [petsc-users] PETSc 3.5.2 on Mac OS X Yosemite, configuring gives C preprocessor error In-Reply-To: References: Message-ID: <54BCB7B1.1060506@gmail.com> On 18/01/15 09:48 PM, Barry Smith wrote: > We need configure.log > > You do not need --download-blaslapack Apple always has them As of OS X 10.9 the BLAS Apple provided was known to have bugs. I only noticed any issue (If I remember correctly, "make test" failed) when configuring in single precision. However, this might be a reason to have petsc download BLAS/Lapack despite the libraries being available in Apple's framework. > > Suggest just running without passing the compiler names also. > > Barry > >> On Jan 18, 2015, at 2:45 PM, Justin Dong wrote: >> >> Hi all, >> >> I just updated to OS X Yosemite. I have the latest XCode and also reinstalled command line developer tools. >> >> When I try to install PETSc, I get the following error: >> >> ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --with-debugging=0 >> >> =============================================================================== >> >> Configuring PETSc to compile on your system >> >> =============================================================================== >> >> TESTING: checkCPreprocessor from config.setCompilers(config/BuildSystem/config/setCompilers.py:568) ******************************************************************************* >> >> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): >> >> ------------------------------------------------------------------------------- >> >> Cannot find a C preprocessor >> >> ******************************************************************************* >> >> >> >> Can someone explain to me what's going on here? >> >> >> >> Thanks, >> >> Justin >> From marco.cisternino at optimad.it Mon Jan 19 09:28:44 2015 From: marco.cisternino at optimad.it (Marco Cisternino) Date: Mon, 19 Jan 2015 16:28:44 +0100 (CET) Subject: [petsc-users] customized MatMult In-Reply-To: <1885139906.4953854.1421680551278.JavaMail.root@optimad.it> Message-ID: <441767716.4957710.1421681324152.JavaMail.root@optimad.it> Good morning, I'm writing my MatMult function, but I don't know how to treat the ghost elements of the result vec. Let's say myMatMult(A,x,y). First question is: if I use my MatMult in a KSP to solve a linear system, do I have to update ghost elements in the result vec of MatMult?? Consider that any time the code enters myMatMult the vec x is copied in my container and the ghost of my container are updated. I made computation for matrix-vector and I copied the results in vec y, without considering ghost elements of y. Second question: if I have to, how? Let's say I state: ierr = myMatMult(A,x,y) ; and x has been built out of myMatMult with VecGhostCreate. How do I update ghost elements of y in myMatMult? VecGhostUpdateBegin/VecGhostUpdateEnd in myMatMult? Any hints would be appreciated. Thanks for you advices in advance. Bests, Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Mon Jan 19 09:40:28 2015 From: knepley at gmail.com (Matthew Knepley) Date: Mon, 19 Jan 2015 09:40:28 -0600 Subject: [petsc-users] customized MatMult In-Reply-To: <441767716.4957710.1421681324152.JavaMail.root@optimad.it> References: <1885139906.4953854.1421680551278.JavaMail.root@optimad.it> <441767716.4957710.1421681324152.JavaMail.root@optimad.it> Message-ID: On Mon, Jan 19, 2015 at 9:28 AM, Marco Cisternino < marco.cisternino at optimad.it> wrote: > Good morning, > I'm writing my MatMult function, but I don't know how to treat the ghost > elements of the result vec. Let's say myMatMult(A,x,y). > > First question is: if I use my MatMult in a KSP to solve a linear system, > do I have to update ghost elements in the result vec of MatMult?? Consider > that any time the code enters myMatMult the vec x is copied in my container > and the ghost of my container are updated. I made computation for > matrix-vector and I copied the results in vec y, without considering ghost > elements of y. > > Second question: if I have to, how? > Let's say I state: > ierr = myMatMult(A,x,y); > and x has been built out of myMatMult with VecGhostCreate. > How do I update ghost elements of y in myMatMult? > VecGhostUpdateBegin/VecGhostUpdateEnd in myMatMult? > > Any hints would be appreciated. > There is some confusion here about the spaces that Vecs represent. Vecs in the solver are globally assembled vectors, which come from the "global" space. Vecs used in calculated integrals, differences, etc. for assembly often have ghost entries. We will say that these come from the "local" space. MatMult takes in a global Vec x and returns a global Vec y. Hopefully that is clear, Matt > Thanks for you advices in advance. > > Bests, > > Marco > -- 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 marco.cisternino at optimad.it Mon Jan 19 10:09:20 2015 From: marco.cisternino at optimad.it (Marco Cisternino) Date: Mon, 19 Jan 2015 17:09:20 +0100 (CET) Subject: [petsc-users] customized MatMult In-Reply-To: Message-ID: <1896197762.4969953.1421683760749.JavaMail.root@optimad.it> Thank you Matthew, If I have understood: - I have to pass to myMatMult global vecs. And Vec created with VecGhostCreate are global, right? - In myMatMult I use VecGetArray, I store my result in the associated c-array, I call VecRestoreArray and the global vec is done! Right? - If I re-use VecGetArray/VecRestore array, ghosted location s in the c-array are updated, right? I'm sorry about confusion and thanks, again. Marco -- ----------------------------------------------- Marco Cisternino, PhD Software Developer OPTIMAD Engineering s.r.l. Via Giacinto Collegno 18 10143 Torino - Italy www.optimad.it marco.cisternino at optimad.it +39 011 19719782 ----------------------------------------------- ----- Messaggio originale ----- Da: "Matthew Knepley" A: "Marco Cisternino" Cc: petsc-users at mcs.anl.gov Inviato: Luned?, 19 gennaio 2015 16:40:28 Oggetto: Re: [petsc-users] customized MatMult On Mon, Jan 19, 2015 at 9:28 AM, Marco Cisternino < marco.cisternino at optimad.it > wrote: Good morning, I'm writing my MatMult function, but I don't know how to treat the ghost elements of the result vec. Let's say myMatMult(A,x,y). First question is: if I use my MatMult in a KSP to solve a linear system, do I have to update ghost elements in the result vec of MatMult?? Consider that any time the code enters myMatMult the vec x is copied in my container and the ghost of my container are updated. I made computation for matrix-vector and I copied the results in vec y, without considering ghost elements of y. Second question: if I have to, how? Let's say I state: ierr = myMatMult(A,x,y); and x has been built out of myMatMult with VecGhostCreate. How do I update ghost elements of y in myMatMult? VecGhostUpdateBegin/VecGhostUpdateEnd in myMatMult? Any hints would be appreciated. There is some confusion here about the spaces that Vecs represent. Vecs in the solver are globally assembled vectors, which come from the "global" space. Vecs used in calculated integrals, differences, etc. for assembly often have ghost entries. We will say that these come from the "local" space. MatMult takes in a global Vec x and returns a global Vec y. Hopefully that is clear, Matt
Thanks for you advices in advance. Bests, Marco
-- 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 bsmith at mcs.anl.gov Mon Jan 19 10:31:10 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 19 Jan 2015 10:31:10 -0600 Subject: [petsc-users] PETSc 3.5.2 on Mac OS X Yosemite, configuring gives C preprocessor error In-Reply-To: <54BCB7B1.1060506@gmail.com> References: <54BCB7B1.1060506@gmail.com> Message-ID: <56B189D6-3CF0-4053-9B95-31FB96EB6492@mcs.anl.gov> > On Jan 19, 2015, at 1:52 AM, Patrick Sanan wrote: > > > On 18/01/15 09:48 PM, Barry Smith wrote: >> We need configure.log >> >> You do not need --download-blaslapack Apple always has them > As of OS X 10.9 the BLAS Apple provided was known to have bugs. I only noticed any issue (If I remember correctly, "make test" failed) when configuring in single precision. Oh yeah. This is fixed in the commit https://bitbucket.org/petsc/petsc/commits/49b12944db1ca4c5c9e2e375d4aaed26e21ebbe9 Barry > However, this might be a reason to have petsc download BLAS/Lapack despite the libraries being available in Apple's framework. >> >> Suggest just running without passing the compiler names also. >> >> Barry >> >>> On Jan 18, 2015, at 2:45 PM, Justin Dong wrote: >>> >>> Hi all, >>> >>> I just updated to OS X Yosemite. I have the latest XCode and also reinstalled command line developer tools. >>> >>> When I try to install PETSc, I get the following error: >>> >>> ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --with-debugging=0 >>> >>> =============================================================================== >>> >>> Configuring PETSc to compile on your system >>> >>> =============================================================================== >>> >>> TESTING: checkCPreprocessor from config.setCompilers(config/BuildSystem/config/setCompilers.py:568) ******************************************************************************* >>> >>> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): >>> >>> ------------------------------------------------------------------------------- >>> >>> Cannot find a C preprocessor >>> >>> ******************************************************************************* >>> >>> >>> >>> Can someone explain to me what's going on here? >>> >>> >>> >>> Thanks, >>> >>> Justin >>> > From bsmith at mcs.anl.gov Mon Jan 19 10:38:34 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 19 Jan 2015 10:38:34 -0600 Subject: [petsc-users] customized MatMult In-Reply-To: <1896197762.4969953.1421683760749.JavaMail.root@optimad.it> References: <1896197762.4969953.1421683760749.JavaMail.root@optimad.it> Message-ID: <6CB05534-E196-4C9A-A193-B3438D922888@mcs.anl.gov> > On Jan 19, 2015, at 10:09 AM, Marco Cisternino wrote: > > Thank you Matthew, > If I have understood: > - I have to pass to myMatMult global vecs. And Vec created with VecGhostCreate are global, right? > - In myMatMult I use VecGetArray, I store my result in the associated c-array, I call VecRestoreArray and the global vec is done! Right? > - If I re-use VecGetArray/VecRestore array, ghosted locations in the c-array are updated, right? VecGet/RestoreArray() does not trigger updating ghost points. You need to use VecGhostUpdateBegin/End() see the manual page to update the ghost points. barry > I'm sorry about confusion and thanks, again. > > Marco > > > > -- > ----------------------------------------------- > Marco Cisternino, PhD > Software Developer > OPTIMAD Engineering s.r.l. > Via Giacinto Collegno 18 > 10143 Torino - Italy > www.optimad.it > marco.cisternino at optimad.it > +39 011 19719782 > ----------------------------------------------- > > Da: "Matthew Knepley" > A: "Marco Cisternino" > Cc: petsc-users at mcs.anl.gov > Inviato: Luned?, 19 gennaio 2015 16:40:28 > Oggetto: Re: [petsc-users] customized MatMult > > On Mon, Jan 19, 2015 at 9:28 AM, Marco Cisternino wrote: > Good morning, > I'm writing my MatMult function, but I don't know how to treat the ghost elements of the result vec. Let's say myMatMult(A,x,y). > > First question is: if I use my MatMult in a KSP to solve a linear system, do I have to update ghost elements in the result vec of MatMult?? Consider that any time the code enters myMatMult the vec x is copied in my container and the ghost of my container are updated. I made computation for matrix-vector and I copied the results in vec y, without considering ghost elements of y. > > Second question: if I have to, how? > Let's say I state: > ierr = myMatMult(A,x,y); > and x has been built out of myMatMult with VecGhostCreate. > How do I update ghost elements of y in myMatMult? VecGhostUpdateBegin/VecGhostUpdateEnd in myMatMult? > > Any hints would be appreciated. > > There is some confusion here about the spaces that Vecs represent. Vecs in the solver are globally > assembled vectors, which come from the "global" space. Vecs used in calculated integrals, differences, > etc. for assembly often have ghost entries. We will say that these come from the "local" space. > > MatMult takes in a global Vec x and returns a global Vec y. > > Hopefully that is clear, > > Matt > > Thanks for you advices in advance. > > Bests, > > Marco > > > > -- > 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 marco.cisternino at optimad.it Mon Jan 19 10:58:22 2015 From: marco.cisternino at optimad.it (Marco Cisternino) Date: Mon, 19 Jan 2015 17:58:22 +0100 (CET) Subject: [petsc-users] customized MatMult In-Reply-To: <6CB05534-E196-4C9A-A193-B3438D922888@mcs.anl.gov> Message-ID: <1955887077.4978382.1421686702229.JavaMail.root@optimad.it> Understood! Thanks, Marco ----- Messaggio originale ----- Da: "Barry Smith" A: "Marco Cisternino" Cc: "Matthew Knepley" , petsc-users at mcs.anl.gov Inviato: Luned?, 19 gennaio 2015 17:38:34 Oggetto: Re: [petsc-users] customized MatMult > On Jan 19, 2015, at 10:09 AM, Marco Cisternino wrote: > > Thank you Matthew, > If I have understood: > - I have to pass to myMatMult global vecs. And Vec created with VecGhostCreate are global, right? > - In myMatMult I use VecGetArray, I store my result in the associated c-array, I call VecRestoreArray and the global vec is done! Right? > - If I re-use VecGetArray/VecRestore array, ghosted locations in the c-array are updated, right? VecGet/RestoreArray() does not trigger updating ghost points. You need to use VecGhostUpdateBegin/End() see the manual page to update the ghost points. barry > I'm sorry about confusion and thanks, again. > > Marco > > > > -- > ----------------------------------------------- > Marco Cisternino, PhD > Software Developer > OPTIMAD Engineering s.r.l. > Via Giacinto Collegno 18 > 10143 Torino - Italy > www.optimad.it > marco.cisternino at optimad.it > +39 011 19719782 > ----------------------------------------------- > > Da: "Matthew Knepley" > A: "Marco Cisternino" > Cc: petsc-users at mcs.anl.gov > Inviato: Luned?, 19 gennaio 2015 16:40:28 > Oggetto: Re: [petsc-users] customized MatMult > > On Mon, Jan 19, 2015 at 9:28 AM, Marco Cisternino wrote: > Good morning, > I'm writing my MatMult function, but I don't know how to treat the ghost elements of the result vec. Let's say myMatMult(A,x,y). > > First question is: if I use my MatMult in a KSP to solve a linear system, do I have to update ghost elements in the result vec of MatMult?? Consider that any time the code enters myMatMult the vec x is copied in my container and the ghost of my container are updated. I made computation for matrix-vector and I copied the results in vec y, without considering ghost elements of y. > > Second question: if I have to, how? > Let's say I state: > ierr = myMatMult(A,x,y); > and x has been built out of myMatMult with VecGhostCreate. > How do I update ghost elements of y in myMatMult? VecGhostUpdateBegin/VecGhostUpdateEnd in myMatMult? > > Any hints would be appreciated. > > There is some confusion here about the spaces that Vecs represent. Vecs in the solver are globally > assembled vectors, which come from the "global" space. Vecs used in calculated integrals, differences, > etc. for assembly often have ghost entries. We will say that these come from the "local" space. > > MatMult takes in a global Vec x and returns a global Vec y. > > Hopefully that is clear, > > Matt > > Thanks for you advices in advance. > > Bests, > > Marco > > > > -- > 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 jychang48 at gmail.com Tue Jan 20 03:06:45 2015 From: jychang48 at gmail.com (Justin Chang) Date: Tue, 20 Jan 2015 03:06:45 -0600 Subject: [petsc-users] Refinement, interpolation, and auxiliary data Message-ID: Hi all, I have a few simple questions regarding DMPlex mesh refinement, interpolation, and auxiliary data: 1) What exactly does DMPlexSetRefinementUniform do? Is it relevant only for the DMPlexCreateBoxMesh() function? 2) When I interpolate a given DMPlex mesh, what becomes of the "boundary" edge/face labels and/or IDs? That is, say if I had a 2D simplex element on the boundary domain and two of its vertices are assigned different marker ID's and/or labels, what will become of those intermediate mesh point(s) become? 3) If I have highly heterogeneous diffusivity or permeability (e.g., random permeability or a marmousi data set) that need to be read in as auxiliary coefficients, would I need to manually interpolate the data for the intermediate mesh points before I project the field into the FE space, or does PETSc have an ability somewhere to automatically interpolate these values for you? Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Jan 20 05:45:16 2015 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 20 Jan 2015 05:45:16 -0600 Subject: [petsc-users] Refinement, interpolation, and auxiliary data In-Reply-To: References: Message-ID: On Tue, Jan 20, 2015 at 3:06 AM, Justin Chang wrote: > Hi all, > > I have a few simple questions regarding DMPlex mesh refinement, > interpolation, and auxiliary data: > > 1) What exactly does DMPlexSetRefinementUniform do? Is it relevant only > for the DMPlexCreateBoxMesh() function? > Plex supports two types of refinement now. First, you can call a mesh generator for refinement, like Triangle or TetGen. Second, you can uniformly refine cells, although I have only coded this for simplices and tensor products. The uniform refinement works on any mesh, not just the builtin ones. > 2) When I interpolate a given DMPlex mesh, what becomes of the "boundary" > edge/face labels and/or IDs? That is, say if I had a 2D simplex element on > the boundary domain and two of its vertices are assigned different marker > ID's and/or labels, what will become of those intermediate mesh point(s) > become? > I do not mark them. That is up to the application, since there is no way to do it generically. What I do in my simple code is to use MarkBoundaryFaces() and LabelComplete(). For complex things, I use the ExodusII format for marking faces. > 3) If I have highly heterogeneous diffusivity or permeability (e.g., > random permeability or a marmousi > data set) that need > to be read in as auxiliary coefficients, would I need to manually > interpolate the data for the intermediate mesh points before I project the > field into the FE space, or does PETSc have an ability somewhere to > automatically interpolate these values for you? > You have to explain more about what this data means. Is it cell-wise data? If so, why do you need to interpolate? Shouldn't it just be in P0? If not, you can project the P0 data into any other space using either ProjectFunction() or a slightly modified version of DMPlexComputeInterpolatorFEM(). Thanks, Matt > Thanks, > Justin > -- 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 ckhuangf at gmail.com Tue Jan 20 11:25:13 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Tue, 20 Jan 2015 11:25:13 -0600 Subject: [petsc-users] Output matrix in CSR format Message-ID: Hi, I am trying to output the matrix but when I looked at PetscViewerSetFormat It doesn't seem to provide ways to output matrix in CSR format. Am I looking at the right place? Thanks, Kan -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Tue Jan 20 11:28:53 2015 From: knepley at gmail.com (Matthew Knepley) Date: Tue, 20 Jan 2015 11:28:53 -0600 Subject: [petsc-users] Output matrix in CSR format In-Reply-To: References: Message-ID: On Tue, Jan 20, 2015 at 11:25 AM, Chung-Kan Huang wrote: > Hi, > > I am trying to output the matrix but when I looked at > PetscViewerSetFormat It doesn't seem to provide ways to output matrix in > CSR format. > > Am I looking at the right place? > We don't have an ASCII format for CSR since it does not make much sense. ASCII is for readability. The binary format is CSR. Thanks, Matt > > Thanks, > > Kan > -- > > *Cheers* > -- 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 jed at jedbrown.org Tue Jan 20 11:31:57 2015 From: jed at jedbrown.org (Jed Brown) Date: Tue, 20 Jan 2015 10:31:57 -0700 Subject: [petsc-users] Output matrix in CSR format In-Reply-To: References: Message-ID: <87lhkx9x4i.fsf@jedbrown.org> Chung-Kan Huang writes: > Hi, > > I am trying to output the matrix but when I looked at > PetscViewerSetFormat It doesn't seem to provide ways to output matrix in > CSR format. > > Am I looking at the right place? It is a (binary) CSR format. There is no standard "CSR file format". The closest might be MatrixMarket, which is a profoundly terrible format. You can read the PETSc binary format using the Python or MATLAB/Octave scripts distributed with PETSc. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From bsmith at mcs.anl.gov Tue Jan 20 11:45:38 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 20 Jan 2015 11:45:38 -0600 Subject: [petsc-users] Output matrix in CSR format In-Reply-To: References: Message-ID: <78234ADC-BA27-440A-8F59-47D2A5AE2D9F@mcs.anl.gov> > On Jan 20, 2015, at 11:25 AM, Chung-Kan Huang wrote: > > Hi, > > I am trying to output the matrix but when I looked at > PetscViewerSetFormat It doesn't seem to provide ways to output matrix in CSR format. You can use PETSC_VIEWER_ASCII_MATRIXMARKET we don't recommend it but some people do use this format. Barry > > Am I looking at the right place? > > Thanks, > > Kan > -- > Cheers > From jed at jedbrown.org Tue Jan 20 12:03:11 2015 From: jed at jedbrown.org (Jed Brown) Date: Tue, 20 Jan 2015 11:03:11 -0700 Subject: [petsc-users] Output matrix in CSR format In-Reply-To: References: <87lhkx9x4i.fsf@jedbrown.org> <87iog19wtq.fsf@jedbrown.org> Message-ID: <87d2699vog.fsf@jedbrown.org> Please always use "reply-all" so that your messages go to the list. This is standard mailing list etiquette. It is important to preserve threading for people who find this discussion later and so that we do not waste our time re-answering the same questions that have already been answered in private side-conversations. You'll likely get an answer faster that way too. Chung-Kan Huang writes: > You meant MatView right? Yes. > > So it will work if I do, > > PetscViewerBinaryOpen > > (PETSC_COMM_WORLD > > ,filename,FILE_MODE_WRITE,&viewer); > MatView > > (mat,PETSC_VIEWER_STDOUT_WORLD > > ); PetscViewerBinaryOpen(comm,filename,FILE_MODE_WRITE,&viewer); MatView(mat,viewer); PetscViewerDestroy(&viewer); -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From ckhuangf at gmail.com Tue Jan 20 16:33:21 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Tue, 20 Jan 2015 16:33:21 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ Message-ID: Hi, Does PETSc provide means for conversion between AIJ & BAIJ. My matrix is created as AIJ because it makes life easy for most part of the applications but some part of applications actually get some benefits with BAIJ. So I wonder if a matrix can exist as two idenfities and I can use either format depend on which one is more convenient at run time. So in my case the block size is fixed and identical for all blocks. *Thanks,* *Kan* -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Tue Jan 20 16:39:02 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 20 Jan 2015 16:39:02 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: Message-ID: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> You can do a MatConvert() (requires another copy of the matrix) for the parts that benefit from BAIJ. Barry > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang wrote: > > Hi, > > Does PETSc provide means for conversion between AIJ & BAIJ. > > My matrix is created as AIJ because it makes life easy for most part of the applications but some part of applications actually get some benefits with BAIJ. So I wonder if a matrix can exist as two idenfities and I can use either format depend on which one is more convenient at run time. > > So in my case the block size is fixed and identical for all blocks. > > > Thanks, > > > Kan From jed at jedbrown.org Tue Jan 20 16:41:27 2015 From: jed at jedbrown.org (Jed Brown) Date: Tue, 20 Jan 2015 15:41:27 -0700 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: Message-ID: <87h9vl8488.fsf@jedbrown.org> Chung-Kan Huang writes: > Hi, > > Does PETSc provide means for conversion between AIJ & BAIJ. Did you try MatConvert? > My matrix is created as AIJ because it makes life easy for most part of the > applications Why does the assembly code know what format it is assembling? All the same MatSetValues should work after MatSetType(A,MATBAIJ). > but some part of applications actually get some benefits with BAIJ. > So I wonder if a matrix can exist as two idenfities and I can use > either format depend on which one is more convenient at run time. Yes, it's idiomatic to set a prefix and call MatSetFromOptions, then use -yourprefix_mat_type baij at run-time. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From jychang48 at gmail.com Tue Jan 20 17:06:15 2015 From: jychang48 at gmail.com (Justin Chang) Date: Tue, 20 Jan 2015 17:06:15 -0600 Subject: [petsc-users] Refinement, interpolation, and auxiliary data In-Reply-To: References: Message-ID: Matt, 1) I am not sure if I fully understand the difference between those two types of refinement you just described. If I understand this correctly, in the first method, Triangle and TetGen will refine the mesh based on the refinement limit (largest allowable cell size) but doesn't necessarily have to uniformly refine the mesh, meaning the box/cube mesh could end up looking very distorted and unstructured with various element sizes. And in the second method, it ensures that all elements/cells are refined the same number of times no matter how what method was used to create the DMPlex mesh. Or am I missing something? 2) Okay that makes sense. 3) Generally speaking the data would be cell-wise, but hypothetically what if I had to work with data that's defined at the cell vertices? Data like the Marmousi set (btw the link I proved was sort of broken, here is another link to it) is pointwise, but i am sure it could be preprocessed and interpolated to cell-centered data. When I see your run examples in builder.py for SNES ex12, you have the flag "-mat_petscspace_order 1" even when -petscspace_order is 2. So I guess my question is does the order of the material/auxiliary FE necessarily have to match that of the trial function FE? Thanks, Justin On Tue, Jan 20, 2015 at 5:45 AM, Matthew Knepley wrote: > On Tue, Jan 20, 2015 at 3:06 AM, Justin Chang wrote: > >> Hi all, >> >> I have a few simple questions regarding DMPlex mesh refinement, >> interpolation, and auxiliary data: >> >> 1) What exactly does DMPlexSetRefinementUniform do? Is it relevant only >> for the DMPlexCreateBoxMesh() function? >> > > Plex supports two types of refinement now. First, you can call a mesh > generator for refinement, like Triangle or TetGen. Second, > you can uniformly refine cells, although I have only coded this for > simplices and tensor products. The uniform refinement works > on any mesh, not just the builtin ones. > > >> 2) When I interpolate a given DMPlex mesh, what becomes of the "boundary" >> edge/face labels and/or IDs? That is, say if I had a 2D simplex element on >> the boundary domain and two of its vertices are assigned different marker >> ID's and/or labels, what will become of those intermediate mesh point(s) >> become? >> > > I do not mark them. That is up to the application, since there is no way > to do it generically. What I do in my simple code is to use > MarkBoundaryFaces() and LabelComplete(). For complex things, I use the > ExodusII format for marking faces. > > >> 3) If I have highly heterogeneous diffusivity or permeability (e.g., >> random permeability or a marmousi >> data set) that need >> to be read in as auxiliary coefficients, would I need to manually >> interpolate the data for the intermediate mesh points before I project the >> field into the FE space, or does PETSc have an ability somewhere to >> automatically interpolate these values for you? >> > > You have to explain more about what this data means. Is it cell-wise data? > If so, why do you need to interpolate? > Shouldn't it just be in P0? If not, you can project the P0 data into any > other space using either ProjectFunction() > or a slightly modified version of DMPlexComputeInterpolatorFEM(). > > Thanks, > > Matt > > >> Thanks, >> Justin >> > > > > -- > 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 jorgekva at stud.ntnu.no Wed Jan 21 06:25:17 2015 From: jorgekva at stud.ntnu.no (=?UTF-8?B?SsO4cmdlbiBLdmFsc3Zpaw==?=) Date: Wed, 21 Jan 2015 13:25:17 +0100 Subject: [petsc-users] MatEqual and explicit zero behaviour Message-ID: <54BF9AAD.50107@stud.ntnu.no> Hi, I was unable to find this in the PETSc docs nor any relevant example through search engines. I have two matrices, A and B. A: PetscScalar values[] = { 10.0, 0, 0, 0, 0, 5.72, 0.2, 0, 0, 0, 0, 0, 0, 0, 4.2, 0, 0, 0, 0, 0, 0, 3.4, 0, 0, 0, 0, 3.14, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; And an array [0..6] passed to both row and columns in my MatSetValues call. err = MatSetValues( A, 6, indices, 6, indices, values, INSERT_VALUES ); B is constructed from CSR: PetscInt csr_rows[] = { 0, 2, 3, 4, 5, 6, 6 }; PetscInt csr_cols[] = { 0, 5, 0, 2, 3, 2 }; PetscScalar csr_vals[] = { 10.0, 5.72, 0.2, 4.2, 3.4, 3.14 }; for( int i = 0; i < rows - 1; ++i ) { PetscInt row_entries = csr_rows[ i + 1 ] - csr_rows[ i ]; PetscInt row_index[] = { i }; PetscInt offset = csr_rows[ i ]; err = MatSetValues( A, 1, row_index, row_entries, csr_cols + offset, csr_vals + offset, INSERT_VALUES ); } Printing them with PetscView gives: A: Matrix Object: 1 MPI processes type: seqaij row 0: (0, 10) (1, 0) (2, 0) (3, 0) (4, 0) (5, 5.72) row 1: (0, 0.2) (1, 0) (2, 0) (3, 0) (4, 0) (5, 0) row 2: (0, 0) (1, 0) (2, 4.2) (3, 0) (4, 0) (5, 0) row 3: (0, 0) (1, 0) (2, 0) (3, 3.4) (4, 0) (5, 0) row 4: (0, 0) (1, 0) (2, 3.14) (3, 0) (4, 0) (5, 0) row 5: (0, 0) (1, 0) (2, 0) (3, 0) (4, 0) (5, 0) B: Matrix Object: 1 MPI processes type: seqaij row 0: (0, 10) (5, 5.72) row 1: (0, 0.2) row 2: (2, 4.2) row 3: (3, 3.4) row 4: (2, 3.14) row 5: Which, as far as I can tell, are identical matrices. But here's the problem. When I compare them with MatEqual it gives me false, which I did not expect. Is there some undocumented behaviour regarding explicit and implicit zeroes, and is this intentional? Is it not possible to compare matrices with different structures? Thanks From knepley at gmail.com Wed Jan 21 06:38:24 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 21 Jan 2015 06:38:24 -0600 Subject: [petsc-users] MatEqual and explicit zero behaviour In-Reply-To: <54BF9AAD.50107@stud.ntnu.no> References: <54BF9AAD.50107@stud.ntnu.no> Message-ID: On Wed, Jan 21, 2015 at 6:25 AM, J?rgen Kvalsvik wrote: > Hi, > > I was unable to find this in the PETSc docs nor any relevant example > through search engines. > > I have two matrices, A and B. > Equality here also incorporates the sparsity pattern, so that two matrices with a different sparsity pattern are not identical. Thanks, Matt > A: > PetscScalar values[] = { > 10.0, 0, 0, 0, 0, 5.72, > 0.2, 0, 0, 0, 0, 0, > 0, 0, 4.2, 0, 0, 0, > 0, 0, 0, 3.4, 0, 0, > 0, 0, 3.14, 0, 0, 0, > 0, 0, 0, 0, 0, 0 }; > > And an array [0..6] passed to both row and columns in my MatSetValues call. > err = MatSetValues( A, > 6, indices, > 6, indices, > values, INSERT_VALUES ); > > B is constructed from CSR: > PetscInt csr_rows[] = { 0, 2, 3, 4, 5, 6, 6 }; > PetscInt csr_cols[] = { 0, 5, 0, 2, 3, 2 }; > PetscScalar csr_vals[] = { 10.0, 5.72, 0.2, 4.2, 3.4, 3.14 }; > > for( int i = 0; i < rows - 1; ++i ) { > PetscInt row_entries = csr_rows[ i + 1 ] - csr_rows[ i ]; > > PetscInt row_index[] = { i }; > PetscInt offset = csr_rows[ i ]; > > err = MatSetValues( A, > 1, row_index, > row_entries, csr_cols + offset, > csr_vals + offset, INSERT_VALUES ); > } > > Printing them with PetscView gives: > > A: > Matrix Object: 1 MPI processes > type: seqaij > row 0: (0, 10) (1, 0) (2, 0) (3, 0) (4, 0) (5, 5.72) > row 1: (0, 0.2) (1, 0) (2, 0) (3, 0) (4, 0) (5, 0) > row 2: (0, 0) (1, 0) (2, 4.2) (3, 0) (4, 0) (5, 0) > row 3: (0, 0) (1, 0) (2, 0) (3, 3.4) (4, 0) (5, 0) > row 4: (0, 0) (1, 0) (2, 3.14) (3, 0) (4, 0) (5, 0) > row 5: (0, 0) (1, 0) (2, 0) (3, 0) (4, 0) (5, 0) > > B: > Matrix Object: 1 MPI processes > type: seqaij > row 0: (0, 10) (5, 5.72) > row 1: (0, 0.2) > row 2: (2, 4.2) > row 3: (3, 3.4) > row 4: (2, 3.14) > row 5: > > Which, as far as I can tell, are identical matrices. > > But here's the problem. When I compare them with MatEqual it gives me > false, which I did not expect. Is there some undocumented behaviour > regarding explicit and implicit zeroes, and is this intentional? Is it not > possible to compare matrices with different structures? > > Thanks > -- 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 21 06:49:42 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 21 Jan 2015 06:49:42 -0600 Subject: [petsc-users] Refinement, interpolation, and auxiliary data In-Reply-To: References: Message-ID: On Tue, Jan 20, 2015 at 5:06 PM, Justin Chang wrote: > Matt, > > 1) I am not sure if I fully understand the difference between those two > types of refinement you just described. If I understand this correctly, in > the first method, Triangle and TetGen will refine the mesh based on the > refinement limit (largest allowable cell size) but doesn't necessarily > have to uniformly refine the mesh, meaning the box/cube mesh could end up > looking very distorted and unstructured with various element sizes. And in > the second method, it ensures that all elements/cells are refined the same > number of times no matter how what method was used to create the DMPlex > mesh. Or am I missing something? > Yes, that is right. > 2) Okay that makes sense. > > 3) Generally speaking the data would be cell-wise, but hypothetically what > if I had to work with data that's defined at the cell vertices? Data like > the Marmousi set (btw the link I proved was sort of broken, here is another > link > > to it) is pointwise, but i am sure it could be preprocessed and > interpolated to cell-centered data. When I see your run examples in > builder.py for SNES ex12, you have the flag "-mat_petscspace_order 1" even > when -petscspace_order is 2. So I guess my question is does the order of > the material/auxiliary FE necessarily have to match that of the trial > function FE? > No, its does not. As you noted, there are tests for ex12 that have different orders for the coefficient and the solution. This month is completely busy for me, but I think I will have time to meet in Feb. Thanks, Matt > Thanks, > Justin > > On Tue, Jan 20, 2015 at 5:45 AM, Matthew Knepley > wrote: > >> On Tue, Jan 20, 2015 at 3:06 AM, Justin Chang >> wrote: >> >>> Hi all, >>> >>> I have a few simple questions regarding DMPlex mesh refinement, >>> interpolation, and auxiliary data: >>> >>> 1) What exactly does DMPlexSetRefinementUniform do? Is it relevant only >>> for the DMPlexCreateBoxMesh() function? >>> >> >> Plex supports two types of refinement now. First, you can call a mesh >> generator for refinement, like Triangle or TetGen. Second, >> you can uniformly refine cells, although I have only coded this for >> simplices and tensor products. The uniform refinement works >> on any mesh, not just the builtin ones. >> >> >>> 2) When I interpolate a given DMPlex mesh, what becomes of the >>> "boundary" edge/face labels and/or IDs? That is, say if I had a 2D simplex >>> element on the boundary domain and two of its vertices are assigned >>> different marker ID's and/or labels, what will become of those intermediate >>> mesh point(s) become? >>> >> >> I do not mark them. That is up to the application, since there is no way >> to do it generically. What I do in my simple code is to use >> MarkBoundaryFaces() and LabelComplete(). For complex things, I use the >> ExodusII format for marking faces. >> >> >>> 3) If I have highly heterogeneous diffusivity or permeability (e.g., >>> random permeability or a marmousi >>> data set) that >>> need to be read in as auxiliary coefficients, would I need to manually >>> interpolate the data for the intermediate mesh points before I project the >>> field into the FE space, or does PETSc have an ability somewhere to >>> automatically interpolate these values for you? >>> >> >> You have to explain more about what this data means. Is it cell-wise >> data? If so, why do you need to interpolate? >> Shouldn't it just be in P0? If not, you can project the P0 data into any >> other space using either ProjectFunction() >> or a slightly modified version of DMPlexComputeInterpolatorFEM(). >> >> Thanks, >> >> Matt >> >> >>> Thanks, >>> Justin >>> >> >> >> >> -- >> 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 siddhesh4godbole at gmail.com Wed Jan 21 09:51:34 2015 From: siddhesh4godbole at gmail.com (siddhesh godbole) Date: Wed, 21 Jan 2015 21:21:34 +0530 Subject: [petsc-users] Monte carlo for eigenvalue problem in paralle Message-ID: Hello, I want to execute Monte Carlo simulations for eigenvalue problem in parallel with PETSC. i am using LAPACKsygvx function to compute all the eigenvalues. Now the problem i am facing is that, i think LAPACKsygvx requires Matrices to be declared as MATSEQDENSE, and this sequential type is not allowing me to execute this program on multiple processors. How should i go about this problem? can i use different communicators or something? Please help! *Siddhesh M Godbole* 5th year Dual Degree, Civil Eng & Applied Mech. IIT Madras -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Jan 21 09:53:20 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 21 Jan 2015 09:53:20 -0600 Subject: [petsc-users] Monte carlo for eigenvalue problem in paralle In-Reply-To: References: Message-ID: On Wed, Jan 21, 2015 at 9:51 AM, siddhesh godbole < siddhesh4godbole at gmail.com> wrote: > Hello, > > I want to execute Monte Carlo simulations for eigenvalue problem in > parallel with PETSC. i am using LAPACKsygvx function to compute all the > eigenvalues. Now the problem i am facing is that, i think LAPACKsygvx > requires Matrices to be declared as MATSEQDENSE, and this sequential type > is not allowing me to execute this program on multiple processors. > > How should i go about this problem? can i use different communicators or > something? Please help! > Do you need all the eigenvalues? If so, you can try to use Elemental, with the development version of PETSc. Thanks, Matt > > *Siddhesh M Godbole* > > 5th year Dual Degree, > Civil Eng & Applied Mech. > IIT Madras > -- 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 siddhesh4godbole at gmail.com Wed Jan 21 09:54:55 2015 From: siddhesh4godbole at gmail.com (siddhesh godbole) Date: Wed, 21 Jan 2015 21:24:55 +0530 Subject: [petsc-users] Monte carlo for eigenvalue problem in paralle In-Reply-To: References: Message-ID: oh yes i need all the eigenvalues. Thanks Matt i'll go through that! *Siddhesh M Godbole* 5th year Dual Degree, Civil Eng & Applied Mech. IIT Madras On Wed, Jan 21, 2015 at 9:23 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 9:51 AM, siddhesh godbole < > siddhesh4godbole at gmail.com> wrote: > >> Hello, >> >> I want to execute Monte Carlo simulations for eigenvalue problem in >> parallel with PETSC. i am using LAPACKsygvx function to compute all the >> eigenvalues. Now the problem i am facing is that, i think LAPACKsygvx >> requires Matrices to be declared as MATSEQDENSE, and this sequential type >> is not allowing me to execute this program on multiple processors. >> >> How should i go about this problem? can i use different communicators or >> something? Please help! >> > > Do you need all the eigenvalues? If so, you can try to use Elemental, with > the development version of PETSc. > > Thanks, > > Matt > > >> >> *Siddhesh M Godbole* >> >> 5th year Dual Degree, >> Civil Eng & Applied Mech. >> IIT Madras >> > > > > -- > 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 lb2653 at columbia.edu Wed Jan 21 09:55:33 2015 From: lb2653 at columbia.edu (Luc Berger-Vergiat) Date: Wed, 21 Jan 2015 10:55:33 -0500 Subject: [petsc-users] Monte carlo for eigenvalue problem in paralle In-Reply-To: References: Message-ID: <54BFCBF5.6010000@columbi.edu> You can also look into SLEPc to compute eigenvalues in parallel for the global system. SLEPc is based on PETSc so it should not be too hard to use in your code. Best, Luc On 01/21/2015 10:53 AM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 9:51 AM, siddhesh godbole > > wrote: > > Hello, > > I want to execute Monte Carlo simulations for eigenvalue problem > in parallel with PETSC. i am using LAPACKsygvx function to compute > all the eigenvalues. Now the problem i am facing is that, i think > LAPACKsygvx requires Matrices to be declared as MATSEQDENSE, and > this sequential type is not allowing me to execute this program on > multiple processors. > > How should i go about this problem? can i use different > communicators or something? Please help! > > > Do you need all the eigenvalues? If so, you can try to use Elemental, > with the development version of PETSc. > > Thanks, > > Matt > > > *Siddhesh M Godbole* > > 5th year Dual Degree, > Civil Eng & Applied Mech. > IIT Madras > > > > > -- > 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 Wed Jan 21 10:41:54 2015 From: hzhang at mcs.anl.gov (Hong) Date: Wed, 21 Jan 2015 10:41:54 -0600 Subject: [petsc-users] Monte carlo for eigenvalue problem in paralle In-Reply-To: <54BFCBF5.6010000@columbi.edu> References: <54BFCBF5.6010000@columbi.edu> Message-ID: Luc, SLEPc is for eigenvalue problems with sparse matrices; it interfaces to LAPACK for sequential dense problems. I'm adding MatElementalHermitianGenDefiniteEig() into PETSc/Elemental interface for a petsc user (see https://bitbucket.org/petsc/petsc/branch/hzhang/elemental-matconvert). You may take a look at Elemental and check which eigenvalue routine would work for your problem. We may add it to the interface if it does not take much of effort. Hong On Wed, Jan 21, 2015 at 9:55 AM, Luc Berger-Vergiat wrote: > You can also look into SLEPc to compute eigenvalues in parallel for the > global system. > SLEPc is based on PETSc so it should not be too hard to use in your code. > > Best, > Luc > > On 01/21/2015 10:53 AM, Matthew Knepley wrote: > > On Wed, Jan 21, 2015 at 9:51 AM, siddhesh godbole < > siddhesh4godbole at gmail.com> wrote: > >> Hello, >> >> I want to execute Monte Carlo simulations for eigenvalue problem in >> parallel with PETSC. i am using LAPACKsygvx function to compute all the >> eigenvalues. Now the problem i am facing is that, i think LAPACKsygvx >> requires Matrices to be declared as MATSEQDENSE, and this sequential type >> is not allowing me to execute this program on multiple processors. >> >> How should i go about this problem? can i use different communicators >> or something? Please help! >> > > Do you need all the eigenvalues? If so, you can try to use Elemental, > with the development version of PETSc. > > Thanks, > > Matt > > >> >> *Siddhesh M Godbole* >> >> 5th year Dual Degree, >> Civil Eng & Applied Mech. >> IIT Madras >> > > > > -- > 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 grischa.jacobs at email.de Wed Jan 21 12:43:40 2015 From: grischa.jacobs at email.de (Grischa Jacobs) Date: Wed, 21 Jan 2015 19:43:40 +0100 Subject: [petsc-users] Get a single value from a global Vec in petsc Message-ID: An HTML attachment was scrubbed... URL: From ckhuangf at gmail.com Wed Jan 21 12:56:06 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Wed, 21 Jan 2015 12:56:06 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: Hi, So if I do Mat A, AB; MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); MatSetBlockSize(AB, bs) I can create AB as a BAIJ with block size of bs from A which is a AIJ matrix. So from this point I can use both A and AB and they will mean the same matrix. Am I right? At the end of the program do I only destory one of them or both? Do I need to worry about anything in terms of memory penalty? Thanks, Kan On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: > > You can do a MatConvert() (requires another copy of the matrix) for the > parts that benefit from BAIJ. > > Barry > > > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang wrote: > > > > Hi, > > > > Does PETSc provide means for conversion between AIJ & BAIJ. > > > > My matrix is created as AIJ because it makes life easy for most part of > the applications but some part of applications actually get some benefits > with BAIJ. So I wonder if a matrix can exist as two idenfities and I can > use either format depend on which one is more convenient at run time. > > > > So in my case the block size is fixed and identical for all blocks. > > > > > > Thanks, > > > > > > Kan > > -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Jan 21 13:17:14 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 21 Jan 2015 13:17:14 -0600 Subject: [petsc-users] Get a single value from a global Vec in petsc In-Reply-To: References: Message-ID: > On Jan 21, 2015, at 12:43 PM, Grischa Jacobs wrote: > > Hi, > > I don't understand the concept with local and global vec's in petsc when it come to DMDAVecGetArray and VecGetValues. I'm creating some DMDA Vec in parallel which works well. Now I want to access certain non local values of my Vec without receiving the whole global array (will not fit into my main memory) on each processor. > > Is there something I'm getting wrong? In the documentation of VecGetValues it is written "Gets values from certain locations of a vector. Currently can only get values on the same processor". You want to use VecScatterCreate() to create a scatter that provides for each process the values that it wants. Once you have obtained the values locally then you use VecGetArray() on that process to access the values you want. Barry > > thx, Pete > From bsmith at mcs.anl.gov Wed Jan 21 13:19:55 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 21 Jan 2015 13:19:55 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: > On Jan 21, 2015, at 12:56 PM, Chung-Kan Huang wrote: > > Hi, > > So if I do > You need to set the block size on the original matrix before you convert. > Mat A, AB; > MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); > MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); > MatSetBlockSize(AB, bs) > I can create AB as a BAIJ with block size of bs from A which is a AIJ matrix. > > So from this point I can use both A and AB and they will mean the same matrix. Am I right? They will have the same values but be different matrices and use different memory. > > At the end of the program do I only destory one of them or both? Both > > Do I need to worry about anything in terms of memory penalty? It uses roughly twice as much memory. > > > Thanks, > > Kan > > > On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: > > You can do a MatConvert() (requires another copy of the matrix) for the parts that benefit from BAIJ. > > Barry > > > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang wrote: > > > > Hi, > > > > Does PETSc provide means for conversion between AIJ & BAIJ. > > > > My matrix is created as AIJ because it makes life easy for most part of the applications but some part of applications actually get some benefits with BAIJ. So I wonder if a matrix can exist as two idenfities and I can use either format depend on which one is more convenient at run time. > > > > So in my case the block size is fixed and identical for all blocks. > > > > > > Thanks, > > > > > > Kan > > > > > -- > Cheers > From knepley at gmail.com Wed Jan 21 13:20:20 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 21 Jan 2015 13:20:20 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang wrote: > Hi, > > So if I do > > Mat A, AB; > MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); > MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); > MatSetBlockSize(AB, bs) > I can create AB as a BAIJ with block size of bs from A which is a AIJ > matrix. > > So from this point I can use both A and AB and they will mean the same > matrix. Am I right? > Yes > At the end of the program do I only destory one of them or both? > Both > Do I need to worry about anything in terms of memory penalty? > It is twice the memory. Its another matrix. Did you catch when Jed said you could jsut create the BAIJ up front? Thanks, Matt > > Thanks, > > Kan > > > On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: > >> >> You can do a MatConvert() (requires another copy of the matrix) for the >> parts that benefit from BAIJ. >> >> Barry >> >> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang >> wrote: >> > >> > Hi, >> > >> > Does PETSc provide means for conversion between AIJ & BAIJ. >> > >> > My matrix is created as AIJ because it makes life easy for most part of >> the applications but some part of applications actually get some benefits >> with BAIJ. So I wonder if a matrix can exist as two idenfities and I can >> use either format depend on which one is more convenient at run time. >> > >> > So in my case the block size is fixed and identical for all blocks. >> > >> > >> > Thanks, >> > >> > >> > Kan >> >> > > > -- > > *Cheers* > -- 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 ckhuangf at gmail.com Wed Jan 21 13:40:08 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Wed, 21 Jan 2015 13:40:08 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: Then A & AB are not longer the same matrix. They become complete two individuals aren't they? If I do whatever to AB after AB is created the A is still the same old A and not going to be affected by the operations I do to AB. What I am really looking for is a way to create two interfaces (one as AIJ and one as BAIJ) but they both refer to the same matrix. Thanks, Kan On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang > wrote: > >> Hi, >> >> So if I do >> >> Mat A, AB; >> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >> MatSetBlockSize(AB, bs) >> I can create AB as a BAIJ with block size of bs from A which is a AIJ >> matrix. >> >> So from this point I can use both A and AB and they will mean the same >> matrix. Am I right? >> > > Yes > > >> At the end of the program do I only destory one of them or both? >> > > Both > > >> Do I need to worry about anything in terms of memory penalty? >> > > It is twice the memory. Its another matrix. > > Did you catch when Jed said you could jsut create the BAIJ up front? > > Thanks, > > Matt > > >> >> Thanks, >> >> Kan >> >> >> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: >> >>> >>> You can do a MatConvert() (requires another copy of the matrix) for >>> the parts that benefit from BAIJ. >>> >>> Barry >>> >>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang >>> wrote: >>> > >>> > Hi, >>> > >>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>> > >>> > My matrix is created as AIJ because it makes life easy for most part >>> of the applications but some part of applications actually get some >>> benefits with BAIJ. So I wonder if a matrix can exist as two idenfities >>> and I can use either format depend on which one is more convenient at run >>> time. >>> > >>> > So in my case the block size is fixed and identical for all blocks. >>> > >>> > >>> > Thanks, >>> > >>> > >>> > Kan >>> >>> >> >> >> -- >> >> *Cheers* >> > > > > -- > 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 > -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Jan 21 13:44:18 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 21 Jan 2015 13:44:18 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang wrote: > Then A & AB are not longer the same matrix. They become complete two > individuals aren't they? > If I do whatever to AB after AB is created the A is still the same old A > and not going to be affected by the operations I do to AB. > Yes. > > What I am really looking for is a way to create two interfaces (one as AIJ > and one as BAIJ) but they both refer to the same matrix. > Why would you ever want this? Why not just using BAIJ? Thanks, Matt > Thanks, > > Kan > On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley > wrote: > >> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang >> wrote: >> >>> Hi, >>> >>> So if I do >>> >>> Mat A, AB; >>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>> MatSetBlockSize(AB, bs) >>> I can create AB as a BAIJ with block size of bs from A which is a AIJ >>> matrix. >>> >>> So from this point I can use both A and AB and they will mean the same >>> matrix. Am I right? >>> >> >> Yes >> >> >>> At the end of the program do I only destory one of them or both? >>> >> >> Both >> >> >>> Do I need to worry about anything in terms of memory penalty? >>> >> >> It is twice the memory. Its another matrix. >> >> Did you catch when Jed said you could jsut create the BAIJ up front? >> >> Thanks, >> >> Matt >> >> >>> >>> Thanks, >>> >>> Kan >>> >>> >>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: >>> >>>> >>>> You can do a MatConvert() (requires another copy of the matrix) for >>>> the parts that benefit from BAIJ. >>>> >>>> Barry >>>> >>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang >>>> wrote: >>>> > >>>> > Hi, >>>> > >>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>> > >>>> > My matrix is created as AIJ because it makes life easy for most part >>>> of the applications but some part of applications actually get some >>>> benefits with BAIJ. So I wonder if a matrix can exist as two idenfities >>>> and I can use either format depend on which one is more convenient at run >>>> time. >>>> > >>>> > So in my case the block size is fixed and identical for all blocks. >>>> > >>>> > >>>> > Thanks, >>>> > >>>> > >>>> > Kan >>>> >>>> >>> >>> >>> -- >>> >>> *Cheers* >>> >> >> >> >> -- >> 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 >> > > > > -- > > *Cheers* > -- 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 ckhuangf at gmail.com Wed Jan 21 13:55:34 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Wed, 21 Jan 2015 13:55:34 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang > wrote: > >> Then A & AB are not longer the same matrix. They become complete two >> individuals aren't they? >> If I do whatever to AB after AB is created the A is still the same old A >> and not going to be affected by the operations I do to AB. >> > > Yes. > > >> >> What I am really looking for is a way to create two interfaces (one as >> AIJ and one as BAIJ) but they both refer to the same matrix. >> > > Why would you ever want this? Why not just using BAIJ? > As I mentioned in the beginning. There are parts of the code gets benifit when AIJ is used and the other part gets benifit if BAIJ is used. For instance, I'd like to use MatSetValuesBlocked but I also want to use ilu constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ behaves funny sometimes. Thanks, Kan > > Thanks, > > Matt > > >> Thanks, >> >> Kan >> On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley >> wrote: >> >>> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang >>> wrote: >>> >>>> Hi, >>>> >>>> So if I do >>>> >>>> Mat A, AB; >>>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>>> MatSetBlockSize(AB, bs) >>>> I can create AB as a BAIJ with block size of bs from A which is a AIJ >>>> matrix. >>>> >>>> So from this point I can use both A and AB and they will mean the same >>>> matrix. Am I right? >>>> >>> >>> Yes >>> >>> >>>> At the end of the program do I only destory one of them or both? >>>> >>> >>> Both >>> >>> >>>> Do I need to worry about anything in terms of memory penalty? >>>> >>> >>> It is twice the memory. Its another matrix. >>> >>> Did you catch when Jed said you could jsut create the BAIJ up front? >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> >>>> Thanks, >>>> >>>> Kan >>>> >>>> >>>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith >>>> wrote: >>>> >>>>> >>>>> You can do a MatConvert() (requires another copy of the matrix) for >>>>> the parts that benefit from BAIJ. >>>>> >>>>> Barry >>>>> >>>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang >>>>> wrote: >>>>> > >>>>> > Hi, >>>>> > >>>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>>> > >>>>> > My matrix is created as AIJ because it makes life easy for most part >>>>> of the applications but some part of applications actually get some >>>>> benefits with BAIJ. So I wonder if a matrix can exist as two idenfities >>>>> and I can use either format depend on which one is more convenient at run >>>>> time. >>>>> > >>>>> > So in my case the block size is fixed and identical for all blocks. >>>>> > >>>>> > >>>>> > Thanks, >>>>> > >>>>> > >>>>> > Kan >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> *Cheers* >>>> >>> >>> >>> >>> -- >>> 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 >>> >> >> >> >> -- >> >> *Cheers* >> > > > > -- > 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 > -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Jan 21 14:01:05 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 21 Jan 2015 14:01:05 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang wrote: > > On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley > wrote: > >> On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang >> wrote: >> >>> Then A & AB are not longer the same matrix. They become complete two >>> individuals aren't they? >>> If I do whatever to AB after AB is created the A is still the same old A >>> and not going to be affected by the operations I do to AB. >>> >> >> Yes. >> >> >>> >>> What I am really looking for is a way to create two interfaces (one as >>> AIJ and one as BAIJ) but they both refer to the same matrix. >>> >> >> Why would you ever want this? Why not just using BAIJ? >> > As I mentioned in the beginning. There are parts of the code gets benifit > when AIJ is used and the other part gets benifit if BAIJ is used. > > For instance, > > I'd like to use MatSetValuesBlocked but I also want to use ilu constructed > by AIJ instead of BAIJ (our experience found ilu from BAIJ behaves funny > sometimes. > If the blocks truly are dense, then ILU(0) is identical on both. Matt > Thanks, > > Kan > >> >> Thanks, >> >> Matt >> >> >>> Thanks, >>> >>> Kan >>> On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley >>> wrote: >>> >>>> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> So if I do >>>>> >>>>> Mat A, AB; >>>>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>>>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>>>> MatSetBlockSize(AB, bs) >>>>> I can create AB as a BAIJ with block size of bs from A which is a AIJ >>>>> matrix. >>>>> >>>>> So from this point I can use both A and AB and they will mean the same >>>>> matrix. Am I right? >>>>> >>>> >>>> Yes >>>> >>>> >>>>> At the end of the program do I only destory one of them or both? >>>>> >>>> >>>> Both >>>> >>>> >>>>> Do I need to worry about anything in terms of memory penalty? >>>>> >>>> >>>> It is twice the memory. Its another matrix. >>>> >>>> Did you catch when Jed said you could jsut create the BAIJ up front? >>>> >>>> Thanks, >>>> >>>> Matt >>>> >>>> >>>>> >>>>> Thanks, >>>>> >>>>> Kan >>>>> >>>>> >>>>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith >>>>> wrote: >>>>> >>>>>> >>>>>> You can do a MatConvert() (requires another copy of the matrix) for >>>>>> the parts that benefit from BAIJ. >>>>>> >>>>>> Barry >>>>>> >>>>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang >>>>>> wrote: >>>>>> > >>>>>> > Hi, >>>>>> > >>>>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>>>> > >>>>>> > My matrix is created as AIJ because it makes life easy for most >>>>>> part of the applications but some part of applications actually get some >>>>>> benefits with BAIJ. So I wonder if a matrix can exist as two idenfities >>>>>> and I can use either format depend on which one is more convenient at run >>>>>> time. >>>>>> > >>>>>> > So in my case the block size is fixed and identical for all blocks. >>>>>> > >>>>>> > >>>>>> > Thanks, >>>>>> > >>>>>> > >>>>>> > Kan >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> *Cheers* >>>>> >>>> >>>> >>>> >>>> -- >>>> 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 >>>> >>> >>> >>> >>> -- >>> >>> *Cheers* >>> >> >> >> >> -- >> 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 >> > > > > -- > > *Cheers* > -- 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 ckhuangf at gmail.com Wed Jan 21 14:07:03 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Wed, 21 Jan 2015 14:07:03 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang > wrote: > >> >> On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley >> wrote: >> >>> On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang >>> wrote: >>> >>>> Then A & AB are not longer the same matrix. They become complete two >>>> individuals aren't they? >>>> If I do whatever to AB after AB is created the A is still the same old >>>> A and not going to be affected by the operations I do to AB. >>>> >>> >>> Yes. >>> >>> >>>> >>>> What I am really looking for is a way to create two interfaces (one as >>>> AIJ and one as BAIJ) but they both refer to the same matrix. >>>> >>> >>> Why would you ever want this? Why not just using BAIJ? >>> >> As I mentioned in the beginning. There are parts of the code gets >> benifit when AIJ is used and the other part gets benifit if BAIJ is used. >> >> For instance, >> >> I'd like to use MatSetValuesBlocked but I also want to use ilu >> constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ >> behaves funny sometimes. >> > > If the blocks truly are dense, then ILU(0) is identical on both. > Unfortunately the life is not that easy. The blocks are spares and we found ILU(1) works better for our case. And besides that is not the only reason I want to have AIJ & BAIJ interfaces, we have some code management issue and I am looking for short cut to unite them. So go back to the original question the short answer is no way? Thanks, Kan > > Matt > > >> Thanks, >> >> Kan >> >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> Thanks, >>>> >>>> Kan >>>> On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley >>>> wrote: >>>> >>>>> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang >>>>> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> So if I do >>>>>> >>>>>> Mat A, AB; >>>>>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>>>>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>>>>> MatSetBlockSize(AB, bs) >>>>>> I can create AB as a BAIJ with block size of bs from A which is a AIJ >>>>>> matrix. >>>>>> >>>>>> So from this point I can use both A and AB and they will mean the >>>>>> same matrix. Am I right? >>>>>> >>>>> >>>>> Yes >>>>> >>>>> >>>>>> At the end of the program do I only destory one of them or both? >>>>>> >>>>> >>>>> Both >>>>> >>>>> >>>>>> Do I need to worry about anything in terms of memory penalty? >>>>>> >>>>> >>>>> It is twice the memory. Its another matrix. >>>>> >>>>> Did you catch when Jed said you could jsut create the BAIJ up front? >>>>> >>>>> Thanks, >>>>> >>>>> Matt >>>>> >>>>> >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Kan >>>>>> >>>>>> >>>>>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith >>>>>> wrote: >>>>>> >>>>>>> >>>>>>> You can do a MatConvert() (requires another copy of the matrix) >>>>>>> for the parts that benefit from BAIJ. >>>>>>> >>>>>>> Barry >>>>>>> >>>>>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang >>>>>>> wrote: >>>>>>> > >>>>>>> > Hi, >>>>>>> > >>>>>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>>>>> > >>>>>>> > My matrix is created as AIJ because it makes life easy for most >>>>>>> part of the applications but some part of applications actually get some >>>>>>> benefits with BAIJ. So I wonder if a matrix can exist as two idenfities >>>>>>> and I can use either format depend on which one is more convenient at run >>>>>>> time. >>>>>>> > >>>>>>> > So in my case the block size is fixed and identical for all blocks. >>>>>>> > >>>>>>> > >>>>>>> > Thanks, >>>>>>> > >>>>>>> > >>>>>>> > Kan >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> *Cheers* >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> 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 >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> *Cheers* >>>> >>> >>> >>> >>> -- >>> 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 >>> >> >> >> >> -- >> >> *Cheers* >> > > > > -- > 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 > -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Jan 21 14:15:05 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 21 Jan 2015 14:15:05 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang wrote: > > On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley > wrote: > >> On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang >> wrote: >> >>> >>> On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley >>> wrote: >>> >>>> On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang >>>> wrote: >>>> >>>>> Then A & AB are not longer the same matrix. They become complete two >>>>> individuals aren't they? >>>>> If I do whatever to AB after AB is created the A is still the same old >>>>> A and not going to be affected by the operations I do to AB. >>>>> >>>> >>>> Yes. >>>> >>>> >>>>> >>>>> What I am really looking for is a way to create two interfaces (one as >>>>> AIJ and one as BAIJ) but they both refer to the same matrix. >>>>> >>>> >>>> Why would you ever want this? Why not just using BAIJ? >>>> >>> As I mentioned in the beginning. There are parts of the code gets >>> benifit when AIJ is used and the other part gets benifit if BAIJ is used. >>> >>> For instance, >>> >>> I'd like to use MatSetValuesBlocked but I also want to use ilu >>> constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ >>> behaves funny sometimes. >>> >> >> If the blocks truly are dense, then ILU(0) is identical on both. >> > > Unfortunately the life is not that easy. The blocks are spares and we > found ILU(1) works better for our case. > And besides that is not the only reason I want to have AIJ & BAIJ > interfaces, we have some code management issue and I am looking for short > cut to unite them. > > So go back to the original question the short answer is no way? > Yes, it would not make sense. What problem are you using ILU(1) for? Thanks, Matt > Thanks, > > Kan > >> >> Matt >> >> >>> Thanks, >>> >>> Kan >>> >>>> >>>> Thanks, >>>> >>>> Matt >>>> >>>> >>>>> Thanks, >>>>> >>>>> Kan >>>>> On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley >>>>> wrote: >>>>> >>>>>> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang >>>>> > wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> So if I do >>>>>>> >>>>>>> Mat A, AB; >>>>>>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>>>>>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>>>>>> MatSetBlockSize(AB, bs) >>>>>>> I can create AB as a BAIJ with block size of bs from A which is a >>>>>>> AIJ matrix. >>>>>>> >>>>>>> So from this point I can use both A and AB and they will mean the >>>>>>> same matrix. Am I right? >>>>>>> >>>>>> >>>>>> Yes >>>>>> >>>>>> >>>>>>> At the end of the program do I only destory one of them or both? >>>>>>> >>>>>> >>>>>> Both >>>>>> >>>>>> >>>>>>> Do I need to worry about anything in terms of memory penalty? >>>>>>> >>>>>> >>>>>> It is twice the memory. Its another matrix. >>>>>> >>>>>> Did you catch when Jed said you could jsut create the BAIJ up front? >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Matt >>>>>> >>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Kan >>>>>>> >>>>>>> >>>>>>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith >>>>>>> wrote: >>>>>>> >>>>>>>> >>>>>>>> You can do a MatConvert() (requires another copy of the matrix) >>>>>>>> for the parts that benefit from BAIJ. >>>>>>>> >>>>>>>> Barry >>>>>>>> >>>>>>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang >>>>>>>> wrote: >>>>>>>> > >>>>>>>> > Hi, >>>>>>>> > >>>>>>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>>>>>> > >>>>>>>> > My matrix is created as AIJ because it makes life easy for most >>>>>>>> part of the applications but some part of applications actually get some >>>>>>>> benefits with BAIJ. So I wonder if a matrix can exist as two idenfities >>>>>>>> and I can use either format depend on which one is more convenient at run >>>>>>>> time. >>>>>>>> > >>>>>>>> > So in my case the block size is fixed and identical for all >>>>>>>> blocks. >>>>>>>> > >>>>>>>> > >>>>>>>> > Thanks, >>>>>>>> > >>>>>>>> > >>>>>>>> > Kan >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> *Cheers* >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> 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 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> *Cheers* >>>>> >>>> >>>> >>>> >>>> -- >>>> 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 >>>> >>> >>> >>> >>> -- >>> >>> *Cheers* >>> >> >> >> >> -- >> 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 >> > > > > -- > > *Cheers* > -- 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 bsmith at mcs.anl.gov Wed Jan 21 14:19:48 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 21 Jan 2015 14:19:48 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: MatSetValuesBlocked works fine for AIJ matrices. Just set the block size > On Jan 21, 2015, at 1:55 PM, Chung-Kan Huang wrote: > > > On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang wrote: > Then A & AB are not longer the same matrix. They become complete two individuals aren't they? > If I do whatever to AB after AB is created the A is still the same old A and not going to be affected by the operations I do to AB. > > Yes. > > > What I am really looking for is a way to create two interfaces (one as AIJ and one as BAIJ) but they both refer to the same matrix. > > Why would you ever want this? Why not just using BAIJ? > As I mentioned in the beginning. There are parts of the code gets benifit when AIJ is used and the other part gets benifit if BAIJ is used. > > For instance, > > I'd like to use MatSetValuesBlocked but I also want to use ilu constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ behaves funny sometimes. > > Thanks, > > Kan > > Thanks, > > Matt > > Thanks, > > Kan > On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang wrote: > Hi, > > So if I do > > Mat A, AB; > MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); > MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); > MatSetBlockSize(AB, bs) > I can create AB as a BAIJ with block size of bs from A which is a AIJ matrix. > > So from this point I can use both A and AB and they will mean the same matrix. Am I right? > > Yes > > At the end of the program do I only destory one of them or both? > > Both > > Do I need to worry about anything in terms of memory penalty? > > It is twice the memory. Its another matrix. > > Did you catch when Jed said you could jsut create the BAIJ up front? > > Thanks, > > Matt > > > Thanks, > > Kan > > > On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: > > You can do a MatConvert() (requires another copy of the matrix) for the parts that benefit from BAIJ. > > Barry > > > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang wrote: > > > > Hi, > > > > Does PETSc provide means for conversion between AIJ & BAIJ. > > > > My matrix is created as AIJ because it makes life easy for most part of the applications but some part of applications actually get some benefits with BAIJ. So I wonder if a matrix can exist as two idenfities and I can use either format depend on which one is more convenient at run time. > > > > So in my case the block size is fixed and identical for all blocks. > > > > > > Thanks, > > > > > > Kan > > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > From ckhuangf at gmail.com Wed Jan 21 14:29:35 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Wed, 21 Jan 2015 14:29:35 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang > wrote: > >> >> On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley >> wrote: >> >>> On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang >>> wrote: >>> >>>> >>>> On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley >>>> wrote: >>>> >>>>> On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang >>>>> wrote: >>>>> >>>>>> Then A & AB are not longer the same matrix. They become complete two >>>>>> individuals aren't they? >>>>>> If I do whatever to AB after AB is created the A is still the same >>>>>> old A and not going to be affected by the operations I do to AB. >>>>>> >>>>> >>>>> Yes. >>>>> >>>>> >>>>>> >>>>>> What I am really looking for is a way to create two interfaces (one >>>>>> as AIJ and one as BAIJ) but they both refer to the same matrix. >>>>>> >>>>> >>>>> Why would you ever want this? Why not just using BAIJ? >>>>> >>>> As I mentioned in the beginning. There are parts of the code gets >>>> benifit when AIJ is used and the other part gets benifit if BAIJ is used. >>>> >>>> For instance, >>>> >>>> I'd like to use MatSetValuesBlocked but I also want to use ilu >>>> constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ >>>> behaves funny sometimes. >>>> >>> >>> If the blocks truly are dense, then ILU(0) is identical on both. >>> >> >> Unfortunately the life is not that easy. The blocks are spares and we >> found ILU(1) works better for our case. >> And besides that is not the only reason I want to have AIJ & BAIJ >> interfaces, we have some code management issue and I am looking for short >> cut to unite them. >> >> So go back to the original question the short answer is no way? >> > > Yes, it would not make sense. > > What problem are you using ILU(1) for? > I am using it for flow simulation for reservoir problems. Some issues we found is that 1) for a * x = 0 it doesn't return x = 0 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found latter one is better. I could not find anything wrong with my BAIJ version though. However, experiences suggested that BAIJ's ILU(1) should be better. Thanks, Kan > > Thanks, > > Matt > > >> Thanks, >> >> Kan >> >>> >>> Matt >>> >>> >>>> Thanks, >>>> >>>> Kan >>>> >>>>> >>>>> Thanks, >>>>> >>>>> Matt >>>>> >>>>> >>>>>> Thanks, >>>>>> >>>>>> Kan >>>>>> On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley >>>>>> wrote: >>>>>> >>>>>>> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang < >>>>>>> ckhuangf at gmail.com> wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> So if I do >>>>>>>> >>>>>>>> Mat A, AB; >>>>>>>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>>>>>>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>>>>>>> MatSetBlockSize(AB, bs) >>>>>>>> I can create AB as a BAIJ with block size of bs from A which is a >>>>>>>> AIJ matrix. >>>>>>>> >>>>>>>> So from this point I can use both A and AB and they will mean the >>>>>>>> same matrix. Am I right? >>>>>>>> >>>>>>> >>>>>>> Yes >>>>>>> >>>>>>> >>>>>>>> At the end of the program do I only destory one of them or both? >>>>>>>> >>>>>>> >>>>>>> Both >>>>>>> >>>>>>> >>>>>>>> Do I need to worry about anything in terms of memory penalty? >>>>>>>> >>>>>>> >>>>>>> It is twice the memory. Its another matrix. >>>>>>> >>>>>>> Did you catch when Jed said you could jsut create the BAIJ up front? >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Kan >>>>>>>> >>>>>>>> >>>>>>>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith >>>>>>>> wrote: >>>>>>>> >>>>>>>>> >>>>>>>>> You can do a MatConvert() (requires another copy of the matrix) >>>>>>>>> for the parts that benefit from BAIJ. >>>>>>>>> >>>>>>>>> Barry >>>>>>>>> >>>>>>>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang >>>>>>>>> wrote: >>>>>>>>> > >>>>>>>>> > Hi, >>>>>>>>> > >>>>>>>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>>>>>>> > >>>>>>>>> > My matrix is created as AIJ because it makes life easy for most >>>>>>>>> part of the applications but some part of applications actually get some >>>>>>>>> benefits with BAIJ. So I wonder if a matrix can exist as two idenfities >>>>>>>>> and I can use either format depend on which one is more convenient at run >>>>>>>>> time. >>>>>>>>> > >>>>>>>>> > So in my case the block size is fixed and identical for all >>>>>>>>> blocks. >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > Thanks, >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > Kan >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> *Cheers* >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> 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 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> *Cheers* >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> 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 >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> *Cheers* >>>> >>> >>> >>> >>> -- >>> 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 >>> >> >> >> >> -- >> >> *Cheers* >> > > > > -- > 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 > -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Jan 21 14:35:39 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 21 Jan 2015 14:35:39 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: <5F3A53A0-99BE-4D78-BC1C-6402FA094D2A@mcs.anl.gov> You should likely just use AIJ. It's main gain is for MatSolve() anyways which you aren't using. As I noted you can use MatSetValuesBlock() with AIJ. Barry > On Jan 21, 2015, at 2:29 PM, Chung-Kan Huang wrote: > > > On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang wrote: > > On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang wrote: > > On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang wrote: > Then A & AB are not longer the same matrix. They become complete two individuals aren't they? > If I do whatever to AB after AB is created the A is still the same old A and not going to be affected by the operations I do to AB. > > Yes. > > > What I am really looking for is a way to create two interfaces (one as AIJ and one as BAIJ) but they both refer to the same matrix. > > Why would you ever want this? Why not just using BAIJ? > As I mentioned in the beginning. There are parts of the code gets benifit when AIJ is used and the other part gets benifit if BAIJ is used. > > For instance, > > I'd like to use MatSetValuesBlocked but I also want to use ilu constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ behaves funny sometimes. > > If the blocks truly are dense, then ILU(0) is identical on both. > > Unfortunately the life is not that easy. The blocks are spares and we found ILU(1) works better for our case. > And besides that is not the only reason I want to have AIJ & BAIJ interfaces, we have some code management issue and I am looking for short cut to unite them. > > So go back to the original question the short answer is no way? > > Yes, it would not make sense. > > What problem are you using ILU(1) for? > > I am using it for flow simulation for reservoir problems. > > Some issues we found is that > 1) for a * x = 0 it doesn't return x = 0 > 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found latter one is better. I could not find anything wrong with my BAIJ version though. However, experiences suggested that BAIJ's ILU(1) should be better. > > > Thanks, > > Kan > > Thanks, > > Matt > > Thanks, > > Kan > > Matt > > Thanks, > > Kan > > Thanks, > > Matt > > Thanks, > > Kan > On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang wrote: > Hi, > > So if I do > > Mat A, AB; > MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); > MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); > MatSetBlockSize(AB, bs) > I can create AB as a BAIJ with block size of bs from A which is a AIJ matrix. > > So from this point I can use both A and AB and they will mean the same matrix. Am I right? > > Yes > > At the end of the program do I only destory one of them or both? > > Both > > Do I need to worry about anything in terms of memory penalty? > > It is twice the memory. Its another matrix. > > Did you catch when Jed said you could jsut create the BAIJ up front? > > Thanks, > > Matt > > > Thanks, > > Kan > > > On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: > > You can do a MatConvert() (requires another copy of the matrix) for the parts that benefit from BAIJ. > > Barry > > > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang wrote: > > > > Hi, > > > > Does PETSc provide means for conversion between AIJ & BAIJ. > > > > My matrix is created as AIJ because it makes life easy for most part of the applications but some part of applications actually get some benefits with BAIJ. So I wonder if a matrix can exist as two idenfities and I can use either format depend on which one is more convenient at run time. > > > > So in my case the block size is fixed and identical for all blocks. > > > > > > Thanks, > > > > > > Kan > > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > From knepley at gmail.com Wed Jan 21 14:36:05 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 21 Jan 2015 14:36:05 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 2:29 PM, Chung-Kan Huang wrote: > > On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley > wrote: > >> On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang >> wrote: >> >>> >>> On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley >>> wrote: >>> >>>> On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang >>>> wrote: >>>> >>>>> >>>>> On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley >>>>> wrote: >>>>> >>>>>> On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang >>>>>> wrote: >>>>>> >>>>>>> Then A & AB are not longer the same matrix. They become complete >>>>>>> two individuals aren't they? >>>>>>> If I do whatever to AB after AB is created the A is still the same >>>>>>> old A and not going to be affected by the operations I do to AB. >>>>>>> >>>>>> >>>>>> Yes. >>>>>> >>>>>> >>>>>>> >>>>>>> What I am really looking for is a way to create two interfaces (one >>>>>>> as AIJ and one as BAIJ) but they both refer to the same matrix. >>>>>>> >>>>>> >>>>>> Why would you ever want this? Why not just using BAIJ? >>>>>> >>>>> As I mentioned in the beginning. There are parts of the code gets >>>>> benifit when AIJ is used and the other part gets benifit if BAIJ is used. >>>>> >>>>> For instance, >>>>> >>>>> I'd like to use MatSetValuesBlocked but I also want to use ilu >>>>> constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ >>>>> behaves funny sometimes. >>>>> >>>> >>>> If the blocks truly are dense, then ILU(0) is identical on both. >>>> >>> >>> Unfortunately the life is not that easy. The blocks are spares and we >>> found ILU(1) works better for our case. >>> And besides that is not the only reason I want to have AIJ & BAIJ >>> interfaces, we have some code management issue and I am looking for short >>> cut to unite them. >>> >>> So go back to the original question the short answer is no way? >>> >> >> Yes, it would not make sense. >> >> What problem are you using ILU(1) for? >> > > I am using it for flow simulation for reservoir problems. > Have you considered trying algebraic multigrid? > Some issues we found is that > 1) for a * x = 0 it doesn't return x = 0 > This is impossible. There must be a bug in the code. Thanks, Matt > 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found > latter one is better. I could not find anything wrong with my BAIJ version > though. However, experiences suggested that BAIJ's ILU(1) should be better. > > > Thanks, > > Kan > >> >> Thanks, >> >> Matt >> >> >>> Thanks, >>> >>> Kan >>> >>>> >>>> Matt >>>> >>>> >>>>> Thanks, >>>>> >>>>> Kan >>>>> >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Matt >>>>>> >>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Kan >>>>>>> On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley >>>>>>> wrote: >>>>>>> >>>>>>>> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang < >>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> So if I do >>>>>>>>> >>>>>>>>> Mat A, AB; >>>>>>>>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>>>>>>>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>>>>>>>> MatSetBlockSize(AB, bs) >>>>>>>>> I can create AB as a BAIJ with block size of bs from A which is a >>>>>>>>> AIJ matrix. >>>>>>>>> >>>>>>>>> So from this point I can use both A and AB and they will mean the >>>>>>>>> same matrix. Am I right? >>>>>>>>> >>>>>>>> >>>>>>>> Yes >>>>>>>> >>>>>>>> >>>>>>>>> At the end of the program do I only destory one of them or both? >>>>>>>>> >>>>>>>> >>>>>>>> Both >>>>>>>> >>>>>>>> >>>>>>>>> Do I need to worry about anything in terms of memory penalty? >>>>>>>>> >>>>>>>> >>>>>>>> It is twice the memory. Its another matrix. >>>>>>>> >>>>>>>> Did you catch when Jed said you could jsut create the BAIJ up front? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Matt >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> >>>>>>>>> Kan >>>>>>>>> >>>>>>>>> >>>>>>>>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> >>>>>>>>>> You can do a MatConvert() (requires another copy of the matrix) >>>>>>>>>> for the parts that benefit from BAIJ. >>>>>>>>>> >>>>>>>>>> Barry >>>>>>>>>> >>>>>>>>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang < >>>>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>>>> > >>>>>>>>>> > Hi, >>>>>>>>>> > >>>>>>>>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>>>>>>>> > >>>>>>>>>> > My matrix is created as AIJ because it makes life easy for most >>>>>>>>>> part of the applications but some part of applications actually get some >>>>>>>>>> benefits with BAIJ. So I wonder if a matrix can exist as two idenfities >>>>>>>>>> and I can use either format depend on which one is more convenient at run >>>>>>>>>> time. >>>>>>>>>> > >>>>>>>>>> > So in my case the block size is fixed and identical for all >>>>>>>>>> blocks. >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > Thanks, >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > Kan >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> >>>>>>>>> *Cheers* >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> 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 >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> *Cheers* >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> 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 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> *Cheers* >>>>> >>>> >>>> >>>> >>>> -- >>>> 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 >>>> >>> >>> >>> >>> -- >>> >>> *Cheers* >>> >> >> >> >> -- >> 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 >> > > > > -- > > *Cheers* > -- 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 ckhuangf at gmail.com Wed Jan 21 14:55:47 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Wed, 21 Jan 2015 14:55:47 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 2:36 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 2:29 PM, Chung-Kan Huang > wrote: > >> >> On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley >> wrote: >> >>> On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang >>> wrote: >>> >>>> >>>> On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley >>>> wrote: >>>> >>>>> On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang >>>>> wrote: >>>>> >>>>>> >>>>>> On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley >>>>>> wrote: >>>>>> >>>>>>> On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang >>>>>> > wrote: >>>>>>> >>>>>>>> Then A & AB are not longer the same matrix. They become complete >>>>>>>> two individuals aren't they? >>>>>>>> If I do whatever to AB after AB is created the A is still the same >>>>>>>> old A and not going to be affected by the operations I do to AB. >>>>>>>> >>>>>>> >>>>>>> Yes. >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> What I am really looking for is a way to create two interfaces (one >>>>>>>> as AIJ and one as BAIJ) but they both refer to the same matrix. >>>>>>>> >>>>>>> >>>>>>> Why would you ever want this? Why not just using BAIJ? >>>>>>> >>>>>> As I mentioned in the beginning. There are parts of the code gets >>>>>> benifit when AIJ is used and the other part gets benifit if BAIJ is used. >>>>>> >>>>>> For instance, >>>>>> >>>>>> I'd like to use MatSetValuesBlocked but I also want to use ilu >>>>>> constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ >>>>>> behaves funny sometimes. >>>>>> >>>>> >>>>> If the blocks truly are dense, then ILU(0) is identical on both. >>>>> >>>> >>>> Unfortunately the life is not that easy. The blocks are spares and we >>>> found ILU(1) works better for our case. >>>> And besides that is not the only reason I want to have AIJ & BAIJ >>>> interfaces, we have some code management issue and I am looking for short >>>> cut to unite them. >>>> >>>> So go back to the original question the short answer is no way? >>>> >>> >>> Yes, it would not make sense. >>> >>> What problem are you using ILU(1) for? >>> >> >> I am using it for flow simulation for reservoir problems. >> > > Have you considered trying algebraic multigrid? > > >> Some issues we found is that >> 1) for a * x = 0 it doesn't return x = 0 >> > > This is impossible. There must be a bug in the code. > That was found in an old version of PETSc. It has been very carefully checked. Right now I have A matrix create as AIJ so I guess I can MatConvert it to BAIJ after it is assembled and solved it with ILU(1) which will be using block ilu and see what happens.. Thanks, Kan > > Thanks, > > Matt > > >> 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found >> latter one is better. I could not find anything wrong with my BAIJ version >> though. However, experiences suggested that BAIJ's ILU(1) should be better. >> >> >> Thanks, >> >> Kan >> >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> Thanks, >>>> >>>> Kan >>>> >>>>> >>>>> Matt >>>>> >>>>> >>>>>> Thanks, >>>>>> >>>>>> Kan >>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Kan >>>>>>>> On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley >>>>>>> > wrote: >>>>>>>> >>>>>>>>> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang < >>>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> So if I do >>>>>>>>>> >>>>>>>>>> Mat A, AB; >>>>>>>>>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>>>>>>>>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>>>>>>>>> MatSetBlockSize(AB, bs) >>>>>>>>>> I can create AB as a BAIJ with block size of bs from A which is a >>>>>>>>>> AIJ matrix. >>>>>>>>>> >>>>>>>>>> So from this point I can use both A and AB and they will mean the >>>>>>>>>> same matrix. Am I right? >>>>>>>>>> >>>>>>>>> >>>>>>>>> Yes >>>>>>>>> >>>>>>>>> >>>>>>>>>> At the end of the program do I only destory one of them or both? >>>>>>>>>> >>>>>>>>> >>>>>>>>> Both >>>>>>>>> >>>>>>>>> >>>>>>>>>> Do I need to worry about anything in terms of memory penalty? >>>>>>>>>> >>>>>>>>> >>>>>>>>> It is twice the memory. Its another matrix. >>>>>>>>> >>>>>>>>> Did you catch when Jed said you could jsut create the BAIJ up >>>>>>>>> front? >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> >>>>>>>>> Matt >>>>>>>>> >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> >>>>>>>>>> Kan >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> You can do a MatConvert() (requires another copy of the >>>>>>>>>>> matrix) for the parts that benefit from BAIJ. >>>>>>>>>>> >>>>>>>>>>> Barry >>>>>>>>>>> >>>>>>>>>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang < >>>>>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>>>>> > >>>>>>>>>>> > Hi, >>>>>>>>>>> > >>>>>>>>>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>>>>>>>>> > >>>>>>>>>>> > My matrix is created as AIJ because it makes life easy for >>>>>>>>>>> most part of the applications but some part of applications actually get >>>>>>>>>>> some benefits with BAIJ. So I wonder if a matrix can exist as two >>>>>>>>>>> idenfities and I can use either format depend on which one is more >>>>>>>>>>> convenient at run time. >>>>>>>>>>> > >>>>>>>>>>> > So in my case the block size is fixed and identical for all >>>>>>>>>>> blocks. >>>>>>>>>>> > >>>>>>>>>>> > >>>>>>>>>>> > Thanks, >>>>>>>>>>> > >>>>>>>>>>> > >>>>>>>>>>> > Kan >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> >>>>>>>>>> *Cheers* >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> 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 >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> *Cheers* >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> 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 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> *Cheers* >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> 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 >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> *Cheers* >>>> >>> >>> >>> >>> -- >>> 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 >>> >> >> >> >> -- >> >> *Cheers* >> > > > > -- > 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 > -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ckhuangf at gmail.com Wed Jan 21 14:58:20 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Wed, 21 Jan 2015 14:58:20 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: <5F3A53A0-99BE-4D78-BC1C-6402FA094D2A@mcs.anl.gov> References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> <5F3A53A0-99BE-4D78-BC1C-6402FA094D2A@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 2:35 PM, Barry Smith wrote: > > You should likely just use AIJ. It's main gain is for MatSolve() anyways > which you aren't using. As I noted you can use MatSetValuesBlock() with AIJ. > I thought MatSetValuesBlock can only work for BAIJ. So I can assign a block size to my AIJ matrix with MatSetBlockSize and then I can use MatSetValuesBlock afterward?? Thanks, Kan > > Barry > > > On Jan 21, 2015, at 2:29 PM, Chung-Kan Huang wrote: > > > > > > On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley > wrote: > > On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang > wrote: > > > > On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley > wrote: > > On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang > wrote: > > > > On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley > wrote: > > On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang > wrote: > > Then A & AB are not longer the same matrix. They become complete two > individuals aren't they? > > If I do whatever to AB after AB is created the A is still the same old A > and not going to be affected by the operations I do to AB. > > > > Yes. > > > > > > What I am really looking for is a way to create two interfaces (one as > AIJ and one as BAIJ) but they both refer to the same matrix. > > > > Why would you ever want this? Why not just using BAIJ? > > As I mentioned in the beginning. There are parts of the code gets > benifit when AIJ is used and the other part gets benifit if BAIJ is used. > > > > For instance, > > > > I'd like to use MatSetValuesBlocked but I also want to use ilu > constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ > behaves funny sometimes. > > > > If the blocks truly are dense, then ILU(0) is identical on both. > > > > Unfortunately the life is not that easy. The blocks are spares and we > found ILU(1) works better for our case. > > And besides that is not the only reason I want to have AIJ & BAIJ > interfaces, we have some code management issue and I am looking for short > cut to unite them. > > > > So go back to the original question the short answer is no way? > > > > Yes, it would not make sense. > > > > What problem are you using ILU(1) for? > > > > I am using it for flow simulation for reservoir problems. > > > > Some issues we found is that > > 1) for a * x = 0 it doesn't return x = 0 > > 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found > latter one is better. I could not find anything wrong with my BAIJ version > though. However, experiences suggested that BAIJ's ILU(1) should be better. > > > > > > Thanks, > > > > Kan > > > > Thanks, > > > > Matt > > > > Thanks, > > > > Kan > > > > Matt > > > > Thanks, > > > > Kan > > > > Thanks, > > > > Matt > > > > Thanks, > > > > Kan > > On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley > wrote: > > On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang > wrote: > > Hi, > > > > So if I do > > > > Mat A, AB; > > MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); > > MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); > > MatSetBlockSize(AB, bs) > > I can create AB as a BAIJ with block size of bs from A which is a AIJ > matrix. > > > > So from this point I can use both A and AB and they will mean the same > matrix. Am I right? > > > > Yes > > > > At the end of the program do I only destory one of them or both? > > > > Both > > > > Do I need to worry about anything in terms of memory penalty? > > > > It is twice the memory. Its another matrix. > > > > Did you catch when Jed said you could jsut create the BAIJ up front? > > > > Thanks, > > > > Matt > > > > > > Thanks, > > > > Kan > > > > > > On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: > > > > You can do a MatConvert() (requires another copy of the matrix) for > the parts that benefit from BAIJ. > > > > Barry > > > > > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang > wrote: > > > > > > Hi, > > > > > > Does PETSc provide means for conversion between AIJ & BAIJ. > > > > > > My matrix is created as AIJ because it makes life easy for most part > of the applications but some part of applications actually get some > benefits with BAIJ. So I wonder if a matrix can exist as two idenfities > and I can use either format depend on which one is more convenient at run > time. > > > > > > So in my case the block size is fixed and identical for all blocks. > > > > > > > > > Thanks, > > > > > > > > > Kan > > > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Jan 21 15:04:25 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 21 Jan 2015 15:04:25 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> <5F3A53A0-99BE-4D78-BC1C-6402FA094D2A@mcs.anl.gov> Message-ID: > On Jan 21, 2015, at 2:58 PM, Chung-Kan Huang wrote: > > > On Wed, Jan 21, 2015 at 2:35 PM, Barry Smith wrote: > > You should likely just use AIJ. It's main gain is for MatSolve() anyways which you aren't using. As I noted you can use MatSetValuesBlock() with AIJ. > > > I thought MatSetValuesBlock can only work for BAIJ. > So I can assign a block size to my AIJ matrix with MatSetBlockSize and then I can use MatSetValuesBlock afterward?? Yes > > Thanks, > > Kan > > Barry > > > On Jan 21, 2015, at 2:29 PM, Chung-Kan Huang wrote: > > > > > > On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley wrote: > > On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang wrote: > > > > On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley wrote: > > On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang wrote: > > > > On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley wrote: > > On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang wrote: > > Then A & AB are not longer the same matrix. They become complete two individuals aren't they? > > If I do whatever to AB after AB is created the A is still the same old A and not going to be affected by the operations I do to AB. > > > > Yes. > > > > > > What I am really looking for is a way to create two interfaces (one as AIJ and one as BAIJ) but they both refer to the same matrix. > > > > Why would you ever want this? Why not just using BAIJ? > > As I mentioned in the beginning. There are parts of the code gets benifit when AIJ is used and the other part gets benifit if BAIJ is used. > > > > For instance, > > > > I'd like to use MatSetValuesBlocked but I also want to use ilu constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ behaves funny sometimes. > > > > If the blocks truly are dense, then ILU(0) is identical on both. > > > > Unfortunately the life is not that easy. The blocks are spares and we found ILU(1) works better for our case. > > And besides that is not the only reason I want to have AIJ & BAIJ interfaces, we have some code management issue and I am looking for short cut to unite them. > > > > So go back to the original question the short answer is no way? > > > > Yes, it would not make sense. > > > > What problem are you using ILU(1) for? > > > > I am using it for flow simulation for reservoir problems. > > > > Some issues we found is that > > 1) for a * x = 0 it doesn't return x = 0 > > 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found latter one is better. I could not find anything wrong with my BAIJ version though. However, experiences suggested that BAIJ's ILU(1) should be better. > > > > > > Thanks, > > > > Kan > > > > Thanks, > > > > Matt > > > > Thanks, > > > > Kan > > > > Matt > > > > Thanks, > > > > Kan > > > > Thanks, > > > > Matt > > > > Thanks, > > > > Kan > > On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley wrote: > > On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang wrote: > > Hi, > > > > So if I do > > > > Mat A, AB; > > MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); > > MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); > > MatSetBlockSize(AB, bs) > > I can create AB as a BAIJ with block size of bs from A which is a AIJ matrix. > > > > So from this point I can use both A and AB and they will mean the same matrix. Am I right? > > > > Yes > > > > At the end of the program do I only destory one of them or both? > > > > Both > > > > Do I need to worry about anything in terms of memory penalty? > > > > It is twice the memory. Its another matrix. > > > > Did you catch when Jed said you could jsut create the BAIJ up front? > > > > Thanks, > > > > Matt > > > > > > Thanks, > > > > Kan > > > > > > On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: > > > > You can do a MatConvert() (requires another copy of the matrix) for the parts that benefit from BAIJ. > > > > Barry > > > > > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang wrote: > > > > > > Hi, > > > > > > Does PETSc provide means for conversion between AIJ & BAIJ. > > > > > > My matrix is created as AIJ because it makes life easy for most part of the applications but some part of applications actually get some benefits with BAIJ. So I wonder if a matrix can exist as two idenfities and I can use either format depend on which one is more convenient at run time. > > > > > > So in my case the block size is fixed and identical for all blocks. > > > > > > > > > Thanks, > > > > > > > > > Kan > > > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > -- > Cheers > From ckhuangf at gmail.com Wed Jan 21 15:16:40 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Wed, 21 Jan 2015 15:16:40 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 2:36 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 2:29 PM, Chung-Kan Huang > wrote: > >> >> On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley >> wrote: >> >>> On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang >>> wrote: >>> >>>> >>>> On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley >>>> wrote: >>>> >>>>> On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang >>>>> wrote: >>>>> >>>>>> >>>>>> On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley >>>>>> wrote: >>>>>> >>>>>>> On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang >>>>>> > wrote: >>>>>>> >>>>>>>> Then A & AB are not longer the same matrix. They become complete >>>>>>>> two individuals aren't they? >>>>>>>> If I do whatever to AB after AB is created the A is still the same >>>>>>>> old A and not going to be affected by the operations I do to AB. >>>>>>>> >>>>>>> >>>>>>> Yes. >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> What I am really looking for is a way to create two interfaces (one >>>>>>>> as AIJ and one as BAIJ) but they both refer to the same matrix. >>>>>>>> >>>>>>> >>>>>>> Why would you ever want this? Why not just using BAIJ? >>>>>>> >>>>>> As I mentioned in the beginning. There are parts of the code gets >>>>>> benifit when AIJ is used and the other part gets benifit if BAIJ is used. >>>>>> >>>>>> For instance, >>>>>> >>>>>> I'd like to use MatSetValuesBlocked but I also want to use ilu >>>>>> constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ >>>>>> behaves funny sometimes. >>>>>> >>>>> >>>>> If the blocks truly are dense, then ILU(0) is identical on both. >>>>> >>>> >>>> Unfortunately the life is not that easy. The blocks are spares and we >>>> found ILU(1) works better for our case. >>>> And besides that is not the only reason I want to have AIJ & BAIJ >>>> interfaces, we have some code management issue and I am looking for short >>>> cut to unite them. >>>> >>>> So go back to the original question the short answer is no way? >>>> >>> >>> Yes, it would not make sense. >>> >>> What problem are you using ILU(1) for? >>> >> >> I am using it for flow simulation for reservoir problems. >> > > Have you considered trying algebraic multigrid? > I am solving PDE fully implicitly and as far as I know algebraic multigrid only good for pressure equations I will need 2 stages PC while AMG is for pressure stage but I will still need something like ILU for second stage. > > >> Some issues we found is that >> 1) for a * x = 0 it doesn't return x = 0 >> > > This is impossible. There must be a bug in the code. > > Thanks, > > Matt > > >> 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found >> latter one is better. I could not find anything wrong with my BAIJ version >> though. However, experiences suggested that BAIJ's ILU(1) should be better. >> >> >> Thanks, >> >> Kan >> >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> Thanks, >>>> >>>> Kan >>>> >>>>> >>>>> Matt >>>>> >>>>> >>>>>> Thanks, >>>>>> >>>>>> Kan >>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Kan >>>>>>>> On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley >>>>>>> > wrote: >>>>>>>> >>>>>>>>> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang < >>>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> So if I do >>>>>>>>>> >>>>>>>>>> Mat A, AB; >>>>>>>>>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>>>>>>>>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>>>>>>>>> MatSetBlockSize(AB, bs) >>>>>>>>>> I can create AB as a BAIJ with block size of bs from A which is a >>>>>>>>>> AIJ matrix. >>>>>>>>>> >>>>>>>>>> So from this point I can use both A and AB and they will mean the >>>>>>>>>> same matrix. Am I right? >>>>>>>>>> >>>>>>>>> >>>>>>>>> Yes >>>>>>>>> >>>>>>>>> >>>>>>>>>> At the end of the program do I only destory one of them or both? >>>>>>>>>> >>>>>>>>> >>>>>>>>> Both >>>>>>>>> >>>>>>>>> >>>>>>>>>> Do I need to worry about anything in terms of memory penalty? >>>>>>>>>> >>>>>>>>> >>>>>>>>> It is twice the memory. Its another matrix. >>>>>>>>> >>>>>>>>> Did you catch when Jed said you could jsut create the BAIJ up >>>>>>>>> front? >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> >>>>>>>>> Matt >>>>>>>>> >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> >>>>>>>>>> Kan >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> You can do a MatConvert() (requires another copy of the >>>>>>>>>>> matrix) for the parts that benefit from BAIJ. >>>>>>>>>>> >>>>>>>>>>> Barry >>>>>>>>>>> >>>>>>>>>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang < >>>>>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>>>>> > >>>>>>>>>>> > Hi, >>>>>>>>>>> > >>>>>>>>>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>>>>>>>>> > >>>>>>>>>>> > My matrix is created as AIJ because it makes life easy for >>>>>>>>>>> most part of the applications but some part of applications actually get >>>>>>>>>>> some benefits with BAIJ. So I wonder if a matrix can exist as two >>>>>>>>>>> idenfities and I can use either format depend on which one is more >>>>>>>>>>> convenient at run time. >>>>>>>>>>> > >>>>>>>>>>> > So in my case the block size is fixed and identical for all >>>>>>>>>>> blocks. >>>>>>>>>>> > >>>>>>>>>>> > >>>>>>>>>>> > Thanks, >>>>>>>>>>> > >>>>>>>>>>> > >>>>>>>>>>> > Kan >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> >>>>>>>>>> *Cheers* >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> 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 >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> *Cheers* >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> 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 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> *Cheers* >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> 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 >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> *Cheers* >>>> >>> >>> >>> >>> -- >>> 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 >>> >> >> >> >> -- >> >> *Cheers* >> > > > > -- > 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 > -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Jan 21 16:03:14 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 21 Jan 2015 16:03:14 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 3:16 PM, Chung-Kan Huang wrote: > > On Wed, Jan 21, 2015 at 2:36 PM, Matthew Knepley > wrote: > >> On Wed, Jan 21, 2015 at 2:29 PM, Chung-Kan Huang >> wrote: >> >>> >>> On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley >>> wrote: >>> >>>> On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang >>>> wrote: >>>> >>>>> >>>>> On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley >>>>> wrote: >>>>> >>>>>> On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang >>>>>> wrote: >>>>>> >>>>>>> >>>>>>> On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley >>>>>>> wrote: >>>>>>> >>>>>>>> On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang < >>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>> >>>>>>>>> Then A & AB are not longer the same matrix. They become complete >>>>>>>>> two individuals aren't they? >>>>>>>>> If I do whatever to AB after AB is created the A is still the same >>>>>>>>> old A and not going to be affected by the operations I do to AB. >>>>>>>>> >>>>>>>> >>>>>>>> Yes. >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> What I am really looking for is a way to create two interfaces >>>>>>>>> (one as AIJ and one as BAIJ) but they both refer to the same matrix. >>>>>>>>> >>>>>>>> >>>>>>>> Why would you ever want this? Why not just using BAIJ? >>>>>>>> >>>>>>> As I mentioned in the beginning. There are parts of the code gets >>>>>>> benifit when AIJ is used and the other part gets benifit if BAIJ is used. >>>>>>> >>>>>>> For instance, >>>>>>> >>>>>>> I'd like to use MatSetValuesBlocked but I also want to use ilu >>>>>>> constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ >>>>>>> behaves funny sometimes. >>>>>>> >>>>>> >>>>>> If the blocks truly are dense, then ILU(0) is identical on both. >>>>>> >>>>> >>>>> Unfortunately the life is not that easy. The blocks are spares and we >>>>> found ILU(1) works better for our case. >>>>> And besides that is not the only reason I want to have AIJ & BAIJ >>>>> interfaces, we have some code management issue and I am looking for short >>>>> cut to unite them. >>>>> >>>>> So go back to the original question the short answer is no way? >>>>> >>>> >>>> Yes, it would not make sense. >>>> >>>> What problem are you using ILU(1) for? >>>> >>> >>> I am using it for flow simulation for reservoir problems. >>> >> >> Have you considered trying algebraic multigrid? >> > > I am solving PDE fully implicitly and as far as I know algebraic multigrid > only good for pressure equations > I will need 2 stages PC while AMG is for pressure stage but I will still > need something like ILU for second stage. > So you are using a mixed-formulation of Darcy? What equations do you have? Thanks, MAtt > >> >>> Some issues we found is that >>> 1) for a * x = 0 it doesn't return x = 0 >>> >> >> This is impossible. There must be a bug in the code. >> >> Thanks, >> >> Matt >> >> >>> 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found >>> latter one is better. I could not find anything wrong with my BAIJ version >>> though. However, experiences suggested that BAIJ's ILU(1) should be better. >>> >>> >>> Thanks, >>> >>> Kan >>> >>>> >>>> Thanks, >>>> >>>> Matt >>>> >>>> >>>>> Thanks, >>>>> >>>>> Kan >>>>> >>>>>> >>>>>> Matt >>>>>> >>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Kan >>>>>>> >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Matt >>>>>>>> >>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> >>>>>>>>> Kan >>>>>>>>> On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley < >>>>>>>>> knepley at gmail.com> wrote: >>>>>>>>> >>>>>>>>>> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang < >>>>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>>>> >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> So if I do >>>>>>>>>>> >>>>>>>>>>> Mat A, AB; >>>>>>>>>>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>>>>>>>>>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>>>>>>>>>> MatSetBlockSize(AB, bs) >>>>>>>>>>> I can create AB as a BAIJ with block size of bs from A which is >>>>>>>>>>> a AIJ matrix. >>>>>>>>>>> >>>>>>>>>>> So from this point I can use both A and AB and they will mean >>>>>>>>>>> the same matrix. Am I right? >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Yes >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> At the end of the program do I only destory one of them or both? >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Both >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> Do I need to worry about anything in terms of memory penalty? >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> It is twice the memory. Its another matrix. >>>>>>>>>> >>>>>>>>>> Did you catch when Jed said you could jsut create the BAIJ up >>>>>>>>>> front? >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> >>>>>>>>>> Matt >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Thanks, >>>>>>>>>>> >>>>>>>>>>> Kan >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith >>>>>>>>>> > wrote: >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> You can do a MatConvert() (requires another copy of the >>>>>>>>>>>> matrix) for the parts that benefit from BAIJ. >>>>>>>>>>>> >>>>>>>>>>>> Barry >>>>>>>>>>>> >>>>>>>>>>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang < >>>>>>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>>>>>> > >>>>>>>>>>>> > Hi, >>>>>>>>>>>> > >>>>>>>>>>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>>>>>>>>>> > >>>>>>>>>>>> > My matrix is created as AIJ because it makes life easy for >>>>>>>>>>>> most part of the applications but some part of applications actually get >>>>>>>>>>>> some benefits with BAIJ. So I wonder if a matrix can exist as two >>>>>>>>>>>> idenfities and I can use either format depend on which one is more >>>>>>>>>>>> convenient at run time. >>>>>>>>>>>> > >>>>>>>>>>>> > So in my case the block size is fixed and identical for all >>>>>>>>>>>> blocks. >>>>>>>>>>>> > >>>>>>>>>>>> > >>>>>>>>>>>> > Thanks, >>>>>>>>>>>> > >>>>>>>>>>>> > >>>>>>>>>>>> > Kan >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> >>>>>>>>>>> *Cheers* >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> 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 >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> >>>>>>>>> *Cheers* >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> 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 >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> *Cheers* >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> 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 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> *Cheers* >>>>> >>>> >>>> >>>> >>>> -- >>>> 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 >>>> >>> >>> >>> >>> -- >>> >>> *Cheers* >>> >> >> >> >> -- >> 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 >> > > > > -- > > *Cheers* > -- 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 ckhuangf at gmail.com Wed Jan 21 16:21:34 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Wed, 21 Jan 2015 16:21:34 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: On Wed, Jan 21, 2015 at 4:03 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 3:16 PM, Chung-Kan Huang > wrote: > >> >> On Wed, Jan 21, 2015 at 2:36 PM, Matthew Knepley >> wrote: >> >>> On Wed, Jan 21, 2015 at 2:29 PM, Chung-Kan Huang >>> wrote: >>> >>>> >>>> On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley >>>> wrote: >>>> >>>>> On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang >>>>> wrote: >>>>> >>>>>> >>>>>> On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley >>>>>> wrote: >>>>>> >>>>>>> On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang >>>>>> > wrote: >>>>>>> >>>>>>>> >>>>>>>> On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley >>>>>>> > wrote: >>>>>>>> >>>>>>>>> On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang < >>>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>>> >>>>>>>>>> Then A & AB are not longer the same matrix. They become complete >>>>>>>>>> two individuals aren't they? >>>>>>>>>> If I do whatever to AB after AB is created the A is still the >>>>>>>>>> same old A and not going to be affected by the operations I do to AB. >>>>>>>>>> >>>>>>>>> >>>>>>>>> Yes. >>>>>>>>> >>>>>>>>> >>>>>>>>>> >>>>>>>>>> What I am really looking for is a way to create two interfaces >>>>>>>>>> (one as AIJ and one as BAIJ) but they both refer to the same matrix. >>>>>>>>>> >>>>>>>>> >>>>>>>>> Why would you ever want this? Why not just using BAIJ? >>>>>>>>> >>>>>>>> As I mentioned in the beginning. There are parts of the code gets >>>>>>>> benifit when AIJ is used and the other part gets benifit if BAIJ is used. >>>>>>>> >>>>>>>> For instance, >>>>>>>> >>>>>>>> I'd like to use MatSetValuesBlocked but I also want to use ilu >>>>>>>> constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ >>>>>>>> behaves funny sometimes. >>>>>>>> >>>>>>> >>>>>>> If the blocks truly are dense, then ILU(0) is identical on both. >>>>>>> >>>>>> >>>>>> Unfortunately the life is not that easy. The blocks are spares and >>>>>> we found ILU(1) works better for our case. >>>>>> And besides that is not the only reason I want to have AIJ & BAIJ >>>>>> interfaces, we have some code management issue and I am looking for short >>>>>> cut to unite them. >>>>>> >>>>>> So go back to the original question the short answer is no way? >>>>>> >>>>> >>>>> Yes, it would not make sense. >>>>> >>>>> What problem are you using ILU(1) for? >>>>> >>>> >>>> I am using it for flow simulation for reservoir problems. >>>> >>> >>> Have you considered trying algebraic multigrid? >>> >> >> I am solving PDE fully implicitly and as far as I know algebraic >> multigrid only good for pressure equations >> I will need 2 stages PC while AMG is for pressure stage but I will still >> need something like ILU for second stage. >> > > So you are using a mixed-formulation of Darcy? What equations do you have? > After some steps of reduction, the system equation solved in linear solver is basically the convervations of masses and energy. Together I am solving the equations with natrual variables (pressure, temperature, saturations and molar fractions) . It might have variable block size depend on local state and physics that considered. For instant, I can skip mass transfer if it is impermeable to fluid locally but I still need to solve for conduction in energy balance equations. I might also have some zones do not have some components so I can skip them as well. Ideally I should have used variable size of block but I used the same size anyway in my previous BAIJ configuration as you pointed out some optimization can be done with the same size blocked matrix. I switched to AIJ for reason related to ILU that I explained already. I didn't see the same problem in AIJ. I am looking for room to improve linear solver performance in all aspects including CPU time to assemble the matrix and also good PC that are provided by PETSc. Currently I am using AIJ + ILU(1) + overlay(1) +BCGS. I am not so happy about scalbility but that is not in the scope of the problem I brought initially. But I am interested if you have any good suggestions that I should test. Thanks, Kan > > Thanks, > > MAtt > > >> >>> >>>> Some issues we found is that >>>> 1) for a * x = 0 it doesn't return x = 0 >>>> >>> >>> This is impossible. There must be a bug in the code. >>> >>> Thanks, >>> >>> Matt >>> >>> >>>> 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found >>>> latter one is better. I could not find anything wrong with my BAIJ version >>>> though. However, experiences suggested that BAIJ's ILU(1) should be better. >>>> >>>> >>>> Thanks, >>>> >>>> Kan >>>> >>>>> >>>>> Thanks, >>>>> >>>>> Matt >>>>> >>>>> >>>>>> Thanks, >>>>>> >>>>>> Kan >>>>>> >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Kan >>>>>>>> >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> >>>>>>>>> Matt >>>>>>>>> >>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> >>>>>>>>>> Kan >>>>>>>>>> On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley < >>>>>>>>>> knepley at gmail.com> wrote: >>>>>>>>>> >>>>>>>>>>> On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang < >>>>>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi, >>>>>>>>>>>> >>>>>>>>>>>> So if I do >>>>>>>>>>>> >>>>>>>>>>>> Mat A, AB; >>>>>>>>>>>> MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); >>>>>>>>>>>> MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); >>>>>>>>>>>> MatSetBlockSize(AB, bs) >>>>>>>>>>>> I can create AB as a BAIJ with block size of bs from A which is >>>>>>>>>>>> a AIJ matrix. >>>>>>>>>>>> >>>>>>>>>>>> So from this point I can use both A and AB and they will mean >>>>>>>>>>>> the same matrix. Am I right? >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Yes >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> At the end of the program do I only destory one of them or both? >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Both >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> Do I need to worry about anything in terms of memory penalty? >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> It is twice the memory. Its another matrix. >>>>>>>>>>> >>>>>>>>>>> Did you catch when Jed said you could jsut create the BAIJ up >>>>>>>>>>> front? >>>>>>>>>>> >>>>>>>>>>> Thanks, >>>>>>>>>>> >>>>>>>>>>> Matt >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Thanks, >>>>>>>>>>>> >>>>>>>>>>>> Kan >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith < >>>>>>>>>>>> bsmith at mcs.anl.gov> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> You can do a MatConvert() (requires another copy of the >>>>>>>>>>>>> matrix) for the parts that benefit from BAIJ. >>>>>>>>>>>>> >>>>>>>>>>>>> Barry >>>>>>>>>>>>> >>>>>>>>>>>>> > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang < >>>>>>>>>>>>> ckhuangf at gmail.com> wrote: >>>>>>>>>>>>> > >>>>>>>>>>>>> > Hi, >>>>>>>>>>>>> > >>>>>>>>>>>>> > Does PETSc provide means for conversion between AIJ & BAIJ. >>>>>>>>>>>>> > >>>>>>>>>>>>> > My matrix is created as AIJ because it makes life easy for >>>>>>>>>>>>> most part of the applications but some part of applications actually get >>>>>>>>>>>>> some benefits with BAIJ. So I wonder if a matrix can exist as two >>>>>>>>>>>>> idenfities and I can use either format depend on which one is more >>>>>>>>>>>>> convenient at run time. >>>>>>>>>>>>> > >>>>>>>>>>>>> > So in my case the block size is fixed and identical for all >>>>>>>>>>>>> blocks. >>>>>>>>>>>>> > >>>>>>>>>>>>> > >>>>>>>>>>>>> > Thanks, >>>>>>>>>>>>> > >>>>>>>>>>>>> > >>>>>>>>>>>>> > Kan >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>>> >>>>>>>>>>>> *Cheers* >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> 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 >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> >>>>>>>>>> *Cheers* >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> 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 >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> *Cheers* >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> 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 >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> *Cheers* >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> 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 >>>>> >>>> >>>> >>>> >>>> -- >>>> >>>> *Cheers* >>>> >>> >>> >>> >>> -- >>> 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 >>> >> >> >> >> -- >> >> *Cheers* >> > > > > -- > 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 > -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Jan 21 16:44:49 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 21 Jan 2015 16:44:49 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: Since you have various "physics" in the same matrix you can use the PCFIELDSPLIT preconditioner to tack each of the physics separately and then combine them together within the same overall preconditioner. For example the pressure subproblem inside the large matrix should likely be solved with PCGAMG while the other parts not. Take a look at the manual page. Loosely speaking PCFIELDSPLIT is kind of like using an operator splitting only within the preconditioner. Barry > On Jan 21, 2015, at 4:21 PM, Chung-Kan Huang wrote: > > > On Wed, Jan 21, 2015 at 4:03 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 3:16 PM, Chung-Kan Huang wrote: > > On Wed, Jan 21, 2015 at 2:36 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 2:29 PM, Chung-Kan Huang wrote: > > On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang wrote: > > On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang wrote: > > On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang wrote: > Then A & AB are not longer the same matrix. They become complete two individuals aren't they? > If I do whatever to AB after AB is created the A is still the same old A and not going to be affected by the operations I do to AB. > > Yes. > > > What I am really looking for is a way to create two interfaces (one as AIJ and one as BAIJ) but they both refer to the same matrix. > > Why would you ever want this? Why not just using BAIJ? > As I mentioned in the beginning. There are parts of the code gets benifit when AIJ is used and the other part gets benifit if BAIJ is used. > > For instance, > > I'd like to use MatSetValuesBlocked but I also want to use ilu constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ behaves funny sometimes. > > If the blocks truly are dense, then ILU(0) is identical on both. > > Unfortunately the life is not that easy. The blocks are spares and we found ILU(1) works better for our case. > And besides that is not the only reason I want to have AIJ & BAIJ interfaces, we have some code management issue and I am looking for short cut to unite them. > > So go back to the original question the short answer is no way? > > Yes, it would not make sense. > > What problem are you using ILU(1) for? > > I am using it for flow simulation for reservoir problems. > > Have you considered trying algebraic multigrid? > > I am solving PDE fully implicitly and as far as I know algebraic multigrid only good for pressure equations > I will need 2 stages PC while AMG is for pressure stage but I will still need something like ILU for second stage. > > So you are using a mixed-formulation of Darcy? What equations do you have? > After some steps of reduction, the system equation solved in linear solver is basically the convervations of masses and energy. > Together I am solving the equations with natrual variables (pressure, temperature, saturations and molar fractions) . > > It might have variable block size depend on local state and physics that considered. For instant, I can skip mass transfer if it is impermeable to fluid locally but I still need to solve for conduction in energy balance equations. I might also have some zones do not have some components so I can skip them as well. Ideally I should have used variable size of block but I used the same size anyway in my previous BAIJ configuration as you pointed out some optimization can be done with the same size blocked matrix. > > I switched to AIJ for reason related to ILU that I explained already. I didn't see the same problem in AIJ. > > I am looking for room to improve linear solver performance in all aspects including CPU time to assemble the matrix and also good PC that are provided by PETSc. > Currently I am using AIJ + ILU(1) + overlay(1) +BCGS. I am not so happy about scalbility but that is not in the scope of the problem I brought initially. But I am interested if you have any good suggestions that I should test. > > Thanks, > > Kan > > Thanks, > > MAtt > > > Some issues we found is that > 1) for a * x = 0 it doesn't return x = 0 > > This is impossible. There must be a bug in the code. > > Thanks, > > Matt > > 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found latter one is better. I could not find anything wrong with my BAIJ version though. However, experiences suggested that BAIJ's ILU(1) should be better. > > > Thanks, > > Kan > > Thanks, > > Matt > > Thanks, > > Kan > > Matt > > Thanks, > > Kan > > Thanks, > > Matt > > Thanks, > > Kan > On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley wrote: > On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang wrote: > Hi, > > So if I do > > Mat A, AB; > MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); > MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); > MatSetBlockSize(AB, bs) > I can create AB as a BAIJ with block size of bs from A which is a AIJ matrix. > > So from this point I can use both A and AB and they will mean the same matrix. Am I right? > > Yes > > At the end of the program do I only destory one of them or both? > > Both > > Do I need to worry about anything in terms of memory penalty? > > It is twice the memory. Its another matrix. > > Did you catch when Jed said you could jsut create the BAIJ up front? > > Thanks, > > Matt > > > Thanks, > > Kan > > > On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: > > You can do a MatConvert() (requires another copy of the matrix) for the parts that benefit from BAIJ. > > Barry > > > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang wrote: > > > > Hi, > > > > Does PETSc provide means for conversion between AIJ & BAIJ. > > > > My matrix is created as AIJ because it makes life easy for most part of the applications but some part of applications actually get some benefits with BAIJ. So I wonder if a matrix can exist as two idenfities and I can use either format depend on which one is more convenient at run time. > > > > So in my case the block size is fixed and identical for all blocks. > > > > > > Thanks, > > > > > > Kan > > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > > > > > -- > 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 > > > > -- > Cheers > From ckhuangf at gmail.com Wed Jan 21 17:04:54 2015 From: ckhuangf at gmail.com (Chung-Kan Huang) Date: Wed, 21 Jan 2015 17:04:54 -0600 Subject: [petsc-users] Conversion between AIJ & BAIJ In-Reply-To: References: <8554EE49-730B-414C-9FB3-1EE63E3CCD1B@mcs.anl.gov> Message-ID: Thanks, I will definitely take a look. Kan On Wed, Jan 21, 2015 at 4:44 PM, Barry Smith wrote: > > Since you have various "physics" in the same matrix you can use the > PCFIELDSPLIT preconditioner to tack each of the physics separately and then > combine them together within the same overall preconditioner. For example > the pressure subproblem inside the large matrix should likely be solved > with PCGAMG while the other parts not. Take a look at the manual page. > Loosely speaking PCFIELDSPLIT is kind of like using an operator splitting > only within the preconditioner. > > Barry > > > On Jan 21, 2015, at 4:21 PM, Chung-Kan Huang wrote: > > > > > > On Wed, Jan 21, 2015 at 4:03 PM, Matthew Knepley > wrote: > > On Wed, Jan 21, 2015 at 3:16 PM, Chung-Kan Huang > wrote: > > > > On Wed, Jan 21, 2015 at 2:36 PM, Matthew Knepley > wrote: > > On Wed, Jan 21, 2015 at 2:29 PM, Chung-Kan Huang > wrote: > > > > On Wed, Jan 21, 2015 at 2:15 PM, Matthew Knepley > wrote: > > On Wed, Jan 21, 2015 at 2:07 PM, Chung-Kan Huang > wrote: > > > > On Wed, Jan 21, 2015 at 2:01 PM, Matthew Knepley > wrote: > > On Wed, Jan 21, 2015 at 1:55 PM, Chung-Kan Huang > wrote: > > > > On Wed, Jan 21, 2015 at 1:44 PM, Matthew Knepley > wrote: > > On Wed, Jan 21, 2015 at 1:40 PM, Chung-Kan Huang > wrote: > > Then A & AB are not longer the same matrix. They become complete two > individuals aren't they? > > If I do whatever to AB after AB is created the A is still the same old A > and not going to be affected by the operations I do to AB. > > > > Yes. > > > > > > What I am really looking for is a way to create two interfaces (one as > AIJ and one as BAIJ) but they both refer to the same matrix. > > > > Why would you ever want this? Why not just using BAIJ? > > As I mentioned in the beginning. There are parts of the code gets > benifit when AIJ is used and the other part gets benifit if BAIJ is used. > > > > For instance, > > > > I'd like to use MatSetValuesBlocked but I also want to use ilu > constructed by AIJ instead of BAIJ (our experience found ilu from BAIJ > behaves funny sometimes. > > > > If the blocks truly are dense, then ILU(0) is identical on both. > > > > Unfortunately the life is not that easy. The blocks are spares and we > found ILU(1) works better for our case. > > And besides that is not the only reason I want to have AIJ & BAIJ > interfaces, we have some code management issue and I am looking for short > cut to unite them. > > > > So go back to the original question the short answer is no way? > > > > Yes, it would not make sense. > > > > What problem are you using ILU(1) for? > > > > I am using it for flow simulation for reservoir problems. > > > > Have you considered trying algebraic multigrid? > > > > I am solving PDE fully implicitly and as far as I know algebraic > multigrid only good for pressure equations > > I will need 2 stages PC while AMG is for pressure stage but I will still > need something like ILU for second stage. > > > > So you are using a mixed-formulation of Darcy? What equations do you > have? > > After some steps of reduction, the system equation solved in linear > solver is basically the convervations of masses and energy. > > Together I am solving the equations with natrual variables (pressure, > temperature, saturations and molar fractions) . > > > > It might have variable block size depend on local state and physics that > considered. For instant, I can skip mass transfer if it is impermeable to > fluid locally but I still need to solve for conduction in energy balance > equations. I might also have some zones do not have some components so I > can skip them as well. Ideally I should have used variable size of block > but I used the same size anyway in my previous BAIJ configuration as you > pointed out some optimization can be done with the same size blocked matrix. > > > > I switched to AIJ for reason related to ILU that I explained already. I > didn't see the same problem in AIJ. > > > > I am looking for room to improve linear solver performance in all > aspects including CPU time to assemble the matrix and also good PC that are > provided by PETSc. > > Currently I am using AIJ + ILU(1) + overlay(1) +BCGS. I am not so happy > about scalbility but that is not in the scope of the problem I brought > initially. But I am interested if you have any good suggestions that I > should test. > > > > Thanks, > > > > Kan > > > > Thanks, > > > > MAtt > > > > > > Some issues we found is that > > 1) for a * x = 0 it doesn't return x = 0 > > > > This is impossible. There must be a bug in the code. > > > > Thanks, > > > > Matt > > > > 2) After compared ILU(1) with BAIJ against with ILU(1) with AIJ I found > latter one is better. I could not find anything wrong with my BAIJ version > though. However, experiences suggested that BAIJ's ILU(1) should be better. > > > > > > Thanks, > > > > Kan > > > > Thanks, > > > > Matt > > > > Thanks, > > > > Kan > > > > Matt > > > > Thanks, > > > > Kan > > > > Thanks, > > > > Matt > > > > Thanks, > > > > Kan > > On Wed, Jan 21, 2015 at 1:20 PM, Matthew Knepley > wrote: > > On Wed, Jan 21, 2015 at 12:56 PM, Chung-Kan Huang > wrote: > > Hi, > > > > So if I do > > > > Mat A, AB; > > MatCreateAIJ(comm,m,n,M,N,d_nz, d_nnz,o_nz, o_nnz, &A); > > MatConvert(A, MATBAIJ, MAT_INITAL_MATRIX, &AB); > > MatSetBlockSize(AB, bs) > > I can create AB as a BAIJ with block size of bs from A which is a AIJ > matrix. > > > > So from this point I can use both A and AB and they will mean the same > matrix. Am I right? > > > > Yes > > > > At the end of the program do I only destory one of them or both? > > > > Both > > > > Do I need to worry about anything in terms of memory penalty? > > > > It is twice the memory. Its another matrix. > > > > Did you catch when Jed said you could jsut create the BAIJ up front? > > > > Thanks, > > > > Matt > > > > > > Thanks, > > > > Kan > > > > > > On Tue, Jan 20, 2015 at 4:39 PM, Barry Smith wrote: > > > > You can do a MatConvert() (requires another copy of the matrix) for > the parts that benefit from BAIJ. > > > > Barry > > > > > On Jan 20, 2015, at 4:33 PM, Chung-Kan Huang > wrote: > > > > > > Hi, > > > > > > Does PETSc provide means for conversion between AIJ & BAIJ. > > > > > > My matrix is created as AIJ because it makes life easy for most part > of the applications but some part of applications actually get some > benefits with BAIJ. So I wonder if a matrix can exist as two idenfities > and I can use either format depend on which one is more convenient at run > time. > > > > > > So in my case the block size is fixed and identical for all blocks. > > > > > > > > > Thanks, > > > > > > > > > Kan > > > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > > > > > > > -- > > 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 > > > > > > > > -- > > Cheers > > > > -- *Cheers* -------------- next part -------------- An HTML attachment was scrubbed... URL: From orxan.shibli at gmail.com Wed Jan 21 17:06:14 2015 From: orxan.shibli at gmail.com (Orxan Shibliyev) Date: Wed, 21 Jan 2015 16:06:14 -0700 Subject: [petsc-users] Matrix is missing diagonal entry Message-ID: I am solving Ax=b with KSP. I set the matrix (A) so that from first row to a certain row (row N) I used negative indices (see below). I got an error indicating that the matrix is missing diagonal entry at 0 (zero). Does this mean that negative indexing is not working so that the row zero points to the actual first row which has negative index? Should not the rows with negative indices be ignored? In case, I checked the first row without negative index (row N) and its diagonal entry is not zero anyway. A = | negative index | | " | | " | | " | | non-zero value | --> row N | non-zero value | | " | | ... | -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Wed Jan 21 17:35:26 2015 From: knepley at gmail.com (Matthew Knepley) Date: Wed, 21 Jan 2015 17:35:26 -0600 Subject: [petsc-users] Matrix is missing diagonal entry In-Reply-To: References: Message-ID: On Wed, Jan 21, 2015 at 5:06 PM, Orxan Shibliyev wrote: > I am solving Ax=b with KSP. I set the matrix (A) so that from first row to > a certain row (row N) I used negative indices (see below). I got an error > indicating that the matrix is > What do you mean by this? Matrix rows are always refered to by non-negative, contiguous integers. Thanks, Matt > missing diagonal entry at 0 (zero). Does this mean that negative indexing > is not working so that the row zero points to the actual first row which > has negative index? Should not the rows with negative indices be ignored? > In case, I checked the first row without negative index (row N) and its > diagonal entry is not zero anyway. > > A = > | negative index | > | " | > | " | > | " | > | non-zero value | --> row N > | non-zero value | > | " | > | ... | > -- 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 antoine.deblois at aero.bombardier.com Thu Jan 22 09:17:43 2015 From: antoine.deblois at aero.bombardier.com (Antoine De Blois) Date: Thu, 22 Jan 2015 15:17:43 +0000 Subject: [petsc-users] MatAssemblyBegin and dapl MPI fabric Message-ID: <22B78B7D747CBF4FA36FCD2C6EC7AF5EBA9928F7@MTLWAEXCH004.ca.aero.bombardier.net> Hi Everyone, I get a strange error during a call to MatAssemblyBegin. The error message is triggered by Intel MPI, as shown below. The error does not always occurs, which is even more strange. [333:node1179] unexpected disconnect completion event from [163:node1254] Assertion failed in file ../../dapl_conn_rc.c at line 1128: 0 All ranks output the same error message with their own node number. I did a bit of research and some say that MPICH2 solves this issue. Since our group is keen in using Intel MPI, I would like to solves this issue at the root. A few important points: ? At the moment, we are assembling the matrix with a single MatAssembleBegin/End and MAT_FINAL_ASSEMBLY after doing MatSetValuesBlocked. Can it be due to memory overflow in the buffers? ? We are using -genv I_MPI_FABRICS shm:dapl in the submission script ? I tried using -malloc_log and -log_summary, but the crash prevents writing the log ouput Has anyone of you already faced this issue? Any suggestion is welcome, Best regards, Antoine DeBlois Antoine DeBlois Specialiste ingenierie, MDO lead / Engineering Specialist, MDO lead A?ronautique / Aerospace 514-855-5001, x 50862 antoine.deblois at aero.bombardier.com 2351 Blvd Alfred-Nobel Montreal, Qc H4S 1A9 [Description?: Description?: http://signatures.ca.aero.bombardier.net/eom_logo_164x39_fr.jpg] CONFIDENTIALITY NOTICE - This communication may contain privileged or confidential information. If you are not the intended recipient or received this communication by error, please notify the sender and delete the message without copying -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 4648 bytes Desc: image001.jpg URL: From bsmith at mcs.anl.gov Thu Jan 22 10:11:49 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 22 Jan 2015 10:11:49 -0600 Subject: [petsc-users] MatAssemblyBegin and dapl MPI fabric In-Reply-To: <22B78B7D747CBF4FA36FCD2C6EC7AF5EBA9928F7@MTLWAEXCH004.ca.aero.bombardier.net> References: <22B78B7D747CBF4FA36FCD2C6EC7AF5EBA9928F7@MTLWAEXCH004.ca.aero.bombardier.net> Message-ID: <06C34FDF-3253-475A-9281-3B9759F5BE5A@mcs.anl.gov> Can you run with valgrind to determine if there is memory corruption? http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind Also check with Intel for any MPI updates. You can also try to call MatAssemblyBegin/End(mat,MAT_FLUSH_ASSEMBLY) several times during the generation of the matrix entries (this will make the messages smaller). Warning: all processes have to call MatAssemblyBegin/End(mat,MAT_FLUSH_ASSEMBLY) the same number of times. If this "solves" the problem then we know it is an issue with the MPI buffers. Barry > On Jan 22, 2015, at 9:17 AM, Antoine De Blois wrote: > > Hi Everyone, > > I get a strange error during a call to MatAssemblyBegin. The error message is triggered by Intel MPI, as shown below. The error does not always occurs, which is even more strange. > [333:node1179] unexpected disconnect completion event from [163:node1254] > Assertion failed in file ../../dapl_conn_rc.c at line 1128: 0 > > All ranks output the same error message with their own node number. I did a bit of research and some say that MPICH2 solves this issue. Since our group is keen in using Intel MPI, I would like to solves this issue at the root. > > A few important points: > ? At the moment, we are assembling the matrix with a single MatAssembleBegin/End and MAT_FINAL_ASSEMBLY after doing MatSetValuesBlocked. Can it be due to memory overflow in the buffers? > ? We are using -genv I_MPI_FABRICS shm:dapl in the submission script > ? I tried using ?malloc_log and ?log_summary, but the crash prevents writing the log ouput > > Has anyone of you already faced this issue? > Any suggestion is welcome, > Best regards, > Antoine DeBlois > > Antoine DeBlois > Specialiste ingenierie, MDO lead / Engineering Specialist, MDO lead > A?ronautique / Aerospace > 514-855-5001, x 50862 > antoine.deblois at aero.bombardier.com > > 2351 Blvd Alfred-Nobel > Montreal, Qc > H4S 1A9 > > > CONFIDENTIALITY NOTICE - This communication may contain privileged or confidential information. > If you are not the intended recipient or received this communication by error, please notify the sender > and delete the message without copying From Carol.Brickley at awe.co.uk Thu Jan 22 11:27:34 2015 From: Carol.Brickley at awe.co.uk (Carol.Brickley at awe.co.uk) Date: Thu, 22 Jan 2015 17:27:34 +0000 Subject: [petsc-users] VecGetArray issue Message-ID: <201501221727.t0MHReJ3002359@msw2.awe.co.uk> All, When I use VecGetArray it only seems to return half of the array? I am using it: VecGetArray (ptr->sol_x_loc, sol_v, iss, err) And sol_v only seems to come back with half the vector? I am using a F90 interface to the Petsc 3.4.3 routines. Carol Dr Carol Brickley BSc,PhD,ARCS,DIC,MBCS Senior Software Engineer Applied Computer Science DS+T, AWE Aldermaston Reading Berkshire RG7 4PR Direct: 0118 9855035 ___________________________________________________ ____________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Thu Jan 22 11:40:22 2015 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 22 Jan 2015 11:40:22 -0600 Subject: [petsc-users] VecGetArray issue In-Reply-To: <201501221727.t0MHReJ3002359@msw2.awe.co.uk> References: <201501221727.t0MHReJ3002359@msw2.awe.co.uk> Message-ID: On Thu, Jan 22, 2015 at 11:27 AM, wrote: > All, > > > > When I use VecGetArray it only seems to return half of the array? I am > using it: > > > > VecGetArray (ptr->sol_x_loc, sol_v, iss, err) > > > > And sol_v only seems to come back with half the vector? > > > > I am using a F90 interface to the Petsc 3.4.3 routines. > Note that VecGetArray only gives you the local values. Are you running in parallel? Thanks, Matt > > > Carol > > > > > > *Dr Carol Brickley * > > *BSc,PhD,ARCS,DIC,MBCS* > > > > *Senior Software Engineer* > > *Applied Computer Science* > > *DS+T,* > > *AWE* > > *Aldermaston* > > *Reading* > > *Berkshire* > > *RG7 4PR* > > > > *Direct: 0118 9855035* > > > > ___________________________________________________ > ____________________________ The information in this email and in any > attachment(s) is commercial in confidence. If you are not the named > addressee(s) or if you receive this email in error then any distribution, > copying or use of this communication or the information in it is strictly > prohibited. Please notify us immediately by email at admin.internet(at) > awe.co.uk, and then delete this message from your computer. While > attachments are virus checked, AWE plc does not accept any liability in > respect of any virus which is not detected. AWE Plc Registered in England > and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR > -- 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 lb2653 at columbia.edu Thu Jan 22 12:08:13 2015 From: lb2653 at columbia.edu (Luc Berger-Vergiat) Date: Thu, 22 Jan 2015 13:08:13 -0500 Subject: [petsc-users] Testing DMPlex new functionalities Message-ID: <54C13C8D.5080709@columbi.edu> Hi all, I'm trying to test some functionalities in DMPlex, specifically I want to do a 2d fem simulation using a mesh generated by GMSH. At this point I am trying to understand how Dirichlet BC can be applied. Can you explain to me what arguments I have to pass to: DMPlexAddBoundary()? I am attaching a little bit of c code and my mesh.geo and mesh.msh so that you understand the context. The BCs I want to apply are displacement of 0.2 in the y direction if y==1.0 0.0 in the x direction if y==0.0 -- Best, Luc -------------- next part -------------- A non-text attachment was scrubbed... Name: elast1.c Type: text/x-csrc Size: 1204 bytes Desc: not available URL: -------------- next part -------------- // Gmsh project created on Wed May 29 23:30:10 2013 // Light Options General.Light0X = -0.70; General.Light0Y = -0.70; General.Light0Z = 0; // Mesh Options Mesh.RecombineAll=1; Mesh.Algorithm=8; Mesh.SubdivisionAlgorithm=1; Mesh.ColorCarousel=0; Mesh.Smoothing = 10; // Elliptic smoother // Parameters pw = 1.0E-5; // Plate width xx = 100; nn = xx/2+1; // Number of nodes on each side of the square pr = 1.0; // Progression of element sizes cl1 = 0.2; // Mesh size - Not used in structured // Nodes // 4---3 // | | // 1---2 Point(1) = {0, 0, 0, cl1}; Point(2) = {1, 0, 0, cl1}; Point(3) = {1, 1, 0, cl1}; Point(4) = {0, 1, 0, cl1}; // Exterior sides of the Square // 4--iii--3 // | | // iv ii // | | // 1-- i --2 Line(1) = {1, 2}; Line(2) = {2, 3}; Line(3) = {3, 4}; Line(4) = {4, 1}; // Surface Line Loop(6) = { 1, 2, 3, 4}; Ruled Surface(7) = {6}; // Physical Surface Physical Surface(1) = {7}; Physical Line(10) = {1}; Physical Line(11) = {2}; Physical Line(12) = {3}; Physical Line(13) = {4}; #Physical Line("bottom") = {1}; #Physical Line("right") = {2}; #Physical Line("left") = {3}; #Physical Line("top") = {4}; -------------- next part -------------- A non-text attachment was scrubbed... Name: square.msh Type: model/mesh Size: 11040 bytes Desc: not available URL: From fd.kong at siat.ac.cn Thu Jan 22 15:57:05 2015 From: fd.kong at siat.ac.cn (Fande Kong) Date: Thu, 22 Jan 2015 14:57:05 -0700 Subject: [petsc-users] PetscKernel_A_gets_inverse_A_4 Message-ID: Hi all, I want to get the inverse of 4X4 matrix, and I found a function PetscKernel_A_gets_inverse_A_4 which possibly reaches my purpose. But there is a extra parameter 'shift'. What value should I use for the parameter 'shift'? Fande, -------------- next part -------------- An HTML attachment was scrubbed... URL: From jed at jedbrown.org Thu Jan 22 16:00:35 2015 From: jed at jedbrown.org (Jed Brown) Date: Thu, 22 Jan 2015 15:00:35 -0700 Subject: [petsc-users] PetscKernel_A_gets_inverse_A_4 In-Reply-To: References: Message-ID: <87bnlq5vcs.fsf@jedbrown.org> Fande Kong writes: > Hi all, > > I want to get the inverse of 4X4 matrix, and I found a function > PetscKernel_A_gets_inverse_A_4 which possibly reaches my purpose. But there > is a extra parameter 'shift'. What value should I use for the parameter > 'shift'? 0 if your matrix is nonsingular. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From knepley at gmail.com Thu Jan 22 16:12:02 2015 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 22 Jan 2015 16:12:02 -0600 Subject: [petsc-users] Testing DMPlex new functionalities In-Reply-To: <54C13C8D.5080709@columbi.edu> References: <54C13C8D.5080709@columbi.edu> Message-ID: On Thu, Jan 22, 2015 at 12:08 PM, Luc Berger-Vergiat wrote: > Hi all, > I'm trying to test some functionalities in DMPlex, specifically I want to > do a 2d fem simulation using a mesh generated by GMSH. > At this point I am trying to understand how Dirichlet BC can be applied. > > Can you explain to me what arguments I have to pass to: > DMPlexAddBoundary()? > ierr = DMPlexAddBoundary(dm, PETSC_TRUE,"wall","marker",(void (*)())top_displacement,1,&id,user) PETSC_TRUE means that these unknowns will be eliminated from the global system "wall" is the name of the BC "marker" is the name of the DMLabel that you want to use to identify the mesh points 1 is the number of label IDs that identify constrained mesh points id is the label ID which identifies constrained mesh points top_displacement is the function used to set boundary values > I am attaching a little bit of c code and my mesh.geo and mesh.msh so that > you understand the context. > The BCs I want to apply are displacement of 0.2 in the y direction if > y==1.0 > 0.0 in the x direction if y==0.0 I might do this: void top_displacement(const PetscReal x[], PetscScalar *u, void *ctx) { *u = x[1] < PETSC_MACHINE_EPSILON ? 0.0 : 0.2; } Thanks, Matt > > -- > Best, > Luc > > -- 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 lb2653 at columbia.edu Thu Jan 22 16:31:31 2015 From: lb2653 at columbia.edu (Luc Berger-Vergiat) Date: Thu, 22 Jan 2015 17:31:31 -0500 Subject: [petsc-users] Testing DMPlex new functionalities In-Reply-To: References: <54C13C8D.5080709@columbi.edu> <54C176E9.9060103@columbi.edu> Message-ID: <54C17A43.4050800@columbi.edu> Ok, I think what I will do is the following: void top_bc(const PetscReal x[], PetscScalar *u, void *ctx) { *u = 0.2; } void bottom_bc(const PetscReal x[], PetscScalar *u, void *ctx) { *u = 0.0; } ierr = DMPlexAddBoundary(dm, PETSC_TRUE,"bottom","Face Sets",0,(void (*)())bottom_bc,1,ids[0],&user);CHKERRQ(ierr); ierr = DMPlexAddBoundary(dm, PETSC_TRUE,"top","Face Sets",0,(void (*)())top_bc,1,ids[1],&user);CHKERRQ(ierr); Matt, have you started writing some documentation for these function? If not I could probably get something started since I'm reading them. Another question, how do I explain to my DMPlex that I am solving an elasticity problem and hence my solution field will be a 2 components vector and not a scalar? I haven't seen where you set this info in snes example 12... Best, Luc On 01/22/2015 05:19 PM, Matthew Knepley wrote: > On Thu, Jan 22, 2015 at 4:17 PM, Luc Berger-Vergiat > > wrote: > > Yes you are right, I corrected for the machine epsilon. > I also looked deeper in Petsc's source code and I think I > understand better how you implemented the GMSH reader. > For instance the label I really care about is "Face Sets" since it > detects automatically the BC's for me. > An issue is that "Face Sets" contains 4 strata and I only care > about two of these strata. > How can I get the names of the Strata and how can I loop over the > strata to assign my BCs? > > > Instead of "marker" give "Face Sets" > > Instead of 1, give 2 > > Instead of &id give ids, where PetscInt ids[2] = {stratumValue1, > stratumValue2} > > Thanks, > > Matt > > Best, > Luc > > On 01/22/2015 05:12 PM, Matthew Knepley wrote: >> On Thu, Jan 22, 2015 at 12:08 PM, Luc Berger-Vergiat >> > wrote: >> >> Hi all, >> I'm trying to test some functionalities in DMPlex, >> specifically I want to do a 2d fem simulation using a mesh >> generated by GMSH. >> At this point I am trying to understand how Dirichlet BC can >> be applied. >> >> Can you explain to me what arguments I have to pass to: >> DMPlexAddBoundary()? >> >> >> ierr = DMPlexAddBoundary(dm, PETSC_TRUE,"wall","marker",(void >> (*)())top_displacement,1,&id,user) >> >> PETSC_TRUE means that these unknowns will be eliminated from the >> global system >> >> "wall" is the name of the BC >> >> "marker" is the name of the DMLabel that you want to use to >> identify the mesh points >> >> 1 is the number of label IDs that identify constrained mesh points >> >> id is the label ID which identifies constrained mesh points >> >> top_displacement is the function used to set boundary values >> >> I am attaching a little bit of c code and my mesh.geo and >> mesh.msh so that you understand the context. >> The BCs I want to apply are displacement of 0.2 in the y >> direction if y==1.0 >> 0.0 in the x direction if y==0.0 >> >> >> I might do this: >> >> void top_displacement(const PetscReal x[], PetscScalar *u, void *ctx) >> { >> *u = x[1] < PETSC_MACHINE_EPSILON ? 0.0 : 0.2; >> } >> >> Thanks, >> >> Matt >> >> >> -- >> Best, >> Luc >> >> >> >> >> -- >> 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 Thu Jan 22 16:39:04 2015 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 22 Jan 2015 16:39:04 -0600 Subject: [petsc-users] Testing DMPlex new functionalities In-Reply-To: <54C17A43.4050800@columbi.edu> References: <54C13C8D.5080709@columbi.edu> <54C176E9.9060103@columbi.edu> <54C17A43.4050800@columbi.edu> Message-ID: On Thu, Jan 22, 2015 at 4:31 PM, Luc Berger-Vergiat wrote: > Ok, I think what I will do is the following: > > void top_bc(const PetscReal x[], PetscScalar *u, void *ctx) > { > *u = 0.2; > } > void bottom_bc(const PetscReal x[], PetscScalar *u, void *ctx) > { > *u = 0.0; > } > > > ierr = DMPlexAddBoundary(dm, PETSC_TRUE,"bottom","Face Sets",0,(void > (*)())bottom_bc,1,ids[0],&user);CHKERRQ(ierr); > ierr = DMPlexAddBoundary(dm, PETSC_TRUE,"top","Face Sets",0,(void > (*)())top_bc,1,ids[1],&user);CHKERRQ(ierr); > You need &ids[0] and &ids[1]. > > Matt, have you started writing some documentation for these function? > I thought I had, but I cannot find the branch. > If not I could probably get something started since I'm reading them. > That would be great. > Another question, how do I explain to my DMPlex that I am solving an > elasticity problem and hence my solution field will be a 2 components > vector and not a scalar? I haven't seen where you set this info in snes > example 12... > Yes, ex12 is all scalar. In the call to PetscFECreateDefault() there is a 1, which you would make 'dim'. Thanks, Matt > Best, > Luc > > On 01/22/2015 05:19 PM, Matthew Knepley wrote: > > On Thu, Jan 22, 2015 at 4:17 PM, Luc Berger-Vergiat > wrote: > >> Yes you are right, I corrected for the machine epsilon. >> I also looked deeper in Petsc's source code and I think I understand >> better how you implemented the GMSH reader. >> For instance the label I really care about is "Face Sets" since it >> detects automatically the BC's for me. >> An issue is that "Face Sets" contains 4 strata and I only care about two >> of these strata. >> How can I get the names of the Strata and how can I loop over the strata >> to assign my BCs? >> > > Instead of "marker" give "Face Sets" > > Instead of 1, give 2 > > Instead of &id give ids, where PetscInt ids[2] = {stratumValue1, > stratumValue2} > > Thanks, > > Matt > > >> Best, >> Luc >> >> On 01/22/2015 05:12 PM, Matthew Knepley wrote: >> >> On Thu, Jan 22, 2015 at 12:08 PM, Luc Berger-Vergiat < >> lb2653 at columbia.edu> wrote: >> >>> Hi all, >>> I'm trying to test some functionalities in DMPlex, specifically I want >>> to do a 2d fem simulation using a mesh generated by GMSH. >>> At this point I am trying to understand how Dirichlet BC can be applied. >>> >>> Can you explain to me what arguments I have to pass to: >>> DMPlexAddBoundary()? >>> >> >> ierr = DMPlexAddBoundary(dm, PETSC_TRUE,"wall","marker",(void >> (*)())top_displacement,1,&id,user) >> >> PETSC_TRUE means that these unknowns will be eliminated from the global >> system >> >> "wall" is the name of the BC >> >> "marker" is the name of the DMLabel that you want to use to identify >> the mesh points >> >> 1 is the number of label IDs that identify constrained mesh points >> >> id is the label ID which identifies constrained mesh points >> >> top_displacement is the function used to set boundary values >> >> >>> I am attaching a little bit of c code and my mesh.geo and mesh.msh so >>> that you understand the context. >>> The BCs I want to apply are displacement of 0.2 in the y direction if >>> y==1.0 >>> 0.0 in the x direction if y==0.0 >> >> >> I might do this: >> >> void top_displacement(const PetscReal x[], PetscScalar *u, void *ctx) >> { >> *u = x[1] < PETSC_MACHINE_EPSILON ? 0.0 : 0.2; >> } >> >> Thanks, >> >> Matt >> >> >>> >>> -- >>> Best, >>> Luc >>> >>> >> >> >> -- >> 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 lb2653 at columbia.edu Thu Jan 22 16:48:29 2015 From: lb2653 at columbia.edu (Luc Berger-Vergiat) Date: Thu, 22 Jan 2015 17:48:29 -0500 Subject: [petsc-users] Testing DMPlex new functionalities In-Reply-To: References: <54C13C8D.5080709@columbi.edu> <54C176E9.9060103@columbi.edu> <54C17A43.4050800@columbi.edu> Message-ID: <54C17E3D.7070108@columbi.edu> Yeah I just got the compiler warning for (int) instead of (int *). Final remark of the day, with GMSH you can do the following in the .geo: Physical Line("bottom") = {line_id1}; Physical Line("right") = {line_id2}; Physical Line("left") = {line_id3}; Physical Line("top") = {line_id4}; which in turns will get you something like this in the .msh: $PhysicalNames 4 1 2 "bottom" 1 3 "right" 1 4 "left" 1 5 "top" $EndPhysicalNames It would be cool to catch these in order to define multiple label names to get a Petsc structure that looks like this: Labels: bottom: 1 strata of sizes (12) right: 1 strata of sizes (12) top: 1 strata of sizes (12) left: 1 strata of sizes (12) depth: 3 strata of sizes (169, 312, 144) instead of: Labels: Face Sets: 4 strata of sizes (12, 12, 12, 12) depth: 3 strata of sizes (169, 312, 144) Best, Luc On 01/22/2015 05:39 PM, Matthew Knepley wrote: > On Thu, Jan 22, 2015 at 4:31 PM, Luc Berger-Vergiat > > wrote: > > Ok, I think what I will do is the following: > > void top_bc(const PetscReal x[], PetscScalar *u, void *ctx) > { > *u = 0.2; > } > void bottom_bc(const PetscReal x[], PetscScalar *u, void *ctx) > { > *u = 0.0; > } > > > ierr = DMPlexAddBoundary(dm, PETSC_TRUE,"bottom","Face > Sets",0,(void (*)())bottom_bc,1,ids[0],&user);CHKERRQ(ierr); > > ierr = DMPlexAddBoundary(dm, PETSC_TRUE,"top","Face Sets",0,(void > (*)())top_bc,1,ids[1],&user);CHKERRQ(ierr); > > > You need &ids[0] and &ids[1]. > > > Matt, have you started writing some documentation for these function? > > > I thought I had, but I cannot find the branch. > > If not I could probably get something started since I'm reading them. > > > That would be great. > > Another question, how do I explain to my DMPlex that I am solving > an elasticity problem and hence my solution field will be a 2 > components vector and not a scalar? I haven't seen where you set > this info in snes example 12... > > > Yes, ex12 is all scalar. In the call to PetscFECreateDefault() there > is a 1, which you would make 'dim'. > > Thanks, > > Matt > > Best, > Luc > > On 01/22/2015 05:19 PM, Matthew Knepley wrote: >> On Thu, Jan 22, 2015 at 4:17 PM, Luc Berger-Vergiat >> > wrote: >> >> Yes you are right, I corrected for the machine epsilon. >> I also looked deeper in Petsc's source code and I think I >> understand better how you implemented the GMSH reader. >> For instance the label I really care about is "Face Sets" >> since it detects automatically the BC's for me. >> An issue is that "Face Sets" contains 4 strata and I only >> care about two of these strata. >> How can I get the names of the Strata and how can I loop over >> the strata to assign my BCs? >> >> >> Instead of "marker" give "Face Sets" >> >> Instead of 1, give 2 >> >> Instead of &id give ids, where PetscInt ids[2] = {stratumValue1, >> stratumValue2} >> >> Thanks, >> >> Matt >> >> Best, >> Luc >> >> On 01/22/2015 05:12 PM, Matthew Knepley wrote: >>> On Thu, Jan 22, 2015 at 12:08 PM, Luc Berger-Vergiat >>> > wrote: >>> >>> Hi all, >>> I'm trying to test some functionalities in DMPlex, >>> specifically I want to do a 2d fem simulation using a >>> mesh generated by GMSH. >>> At this point I am trying to understand how Dirichlet BC >>> can be applied. >>> >>> Can you explain to me what arguments I have to pass to: >>> DMPlexAddBoundary()? >>> >>> >>> ierr = DMPlexAddBoundary(dm, >>> PETSC_TRUE,"wall","marker",(void >>> (*)())top_displacement,1,&id,user) >>> >>> PETSC_TRUE means that these unknowns will be eliminated from >>> the global system >>> >>> "wall" is the name of the BC >>> >>> "marker" is the name of the DMLabel that you want to use to >>> identify the mesh points >>> >>> 1 is the number of label IDs that identify constrained mesh >>> points >>> >>> id is the label ID which identifies constrained mesh points >>> >>> top_displacement is the function used to set boundary values >>> >>> I am attaching a little bit of c code and my mesh.geo >>> and mesh.msh so that you understand the context. >>> The BCs I want to apply are displacement of 0.2 in the y >>> direction if y==1.0 >>> 0.0 in the x direction if y==0.0 >>> >>> >>> I might do this: >>> >>> void top_displacement(const PetscReal x[], PetscScalar *u, >>> void *ctx) >>> { >>> *u = x[1] < PETSC_MACHINE_EPSILON ? 0.0 : 0.2; >>> } >>> >>> Thanks, >>> >>> Matt >>> >>> >>> -- >>> Best, >>> Luc >>> >>> >>> >>> >>> -- >>> 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 feraudyh at yahoo.com Fri Jan 23 07:17:12 2015 From: feraudyh at yahoo.com (Henri De Feraudy) Date: Fri, 23 Jan 2015 13:17:12 +0000 (UTC) Subject: [petsc-users] SLEPc on arbitrary sparse matrices Message-ID: <1871333397.135430.1422019032848.JavaMail.yahoo@mail.yahoo.com> By arbitrary I mean no conditions at all like symmetric/hermitian/...but sparse, yes.Can I use Slepc generate the eigenvalues of such matrices?In such a case can I expect to get a speed up with a multi-core machine? I'm a newbie to this field.Henri -------------- next part -------------- An HTML attachment was scrubbed... URL: From jroman at dsic.upv.es Fri Jan 23 08:09:08 2015 From: jroman at dsic.upv.es (Jose E. Roman) Date: Fri, 23 Jan 2015 15:09:08 +0100 Subject: [petsc-users] SLEPc on arbitrary sparse matrices In-Reply-To: <1871333397.135430.1422019032848.JavaMail.yahoo@mail.yahoo.com> References: <1871333397.135430.1422019032848.JavaMail.yahoo@mail.yahoo.com> Message-ID: <7903FF99-B1CC-4D14-BE99-9FFC83370240@dsic.upv.es> El 23/01/2015, a las 14:17, Henri De Feraudy escribi?: > By arbitrary I mean no conditions at all like symmetric/hermitian/... > but sparse, yes. > Can I use Slepc generate the eigenvalues of such matrices? Yes, but if you want to compute all eigenvalues then SLEPc is not what you need. > In such a case can I expect to get a speed up with a multi-core machine? Yes if your hardware provides high per-CPU memory performance, see http://www.mcs.anl.gov/petsc/documentation/faq.html#computers Jose > > I'm a newbie to this field. > Henri > From jychang48 at gmail.com Fri Jan 23 17:26:44 2015 From: jychang48 at gmail.com (Justin Chang) Date: Fri, 23 Jan 2015 17:26:44 -0600 Subject: [petsc-users] Two variants of PETSc, debugging on and off Message-ID: Hi all, How do I make it so that I have two variants of PETSc on your machine, one --with-debugging=0 and the other --with-debugging=1. Because I find it cumbersome when I have to reconfigure each time I want to switch. I see that on the installation page there's a way to install two variants of petsc, one with gnu and the other with intel compilers, so I am wondering if I can do something similar for debugging. Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: From lb2653 at columbia.edu Fri Jan 23 17:32:20 2015 From: lb2653 at columbia.edu (Luc Berger-Vergiat) Date: Fri, 23 Jan 2015 18:32:20 -0500 Subject: [petsc-users] Two variants of PETSc, debugging on and off In-Reply-To: References: Message-ID: <54C2DA04.4070909@columbi.edu> Configure once with $PETSC_ARCH=arch-dbg, --with-debugging=1 and once with $PETSC_ARCH=arch-opt, --with-debugging=0 Then you can switch environment variables approprately Best, Luc On 01/23/2015 06:26 PM, Justin Chang wrote: > Hi all, > > How do I make it so that I have two variants of PETSc on your machine, > one --with-debugging=0 and the other --with-debugging=1. Because I > find it cumbersome when I have to reconfigure each time I want to switch. > > I see that on the installation page there's a way to install two > variants of petsc, one with gnu and the other with intel compilers, so > I am wondering if I can do something similar for debugging. > > Thanks, > Justin From jed at jedbrown.org Fri Jan 23 17:41:47 2015 From: jed at jedbrown.org (Jed Brown) Date: Fri, 23 Jan 2015 16:41:47 -0700 Subject: [petsc-users] Two variants of PETSc, debugging on and off In-Reply-To: <54C2DA04.4070909@columbi.edu> References: <54C2DA04.4070909@columbi.edu> Message-ID: <877fwd2hfo.fsf@jedbrown.org> Luc Berger-Vergiat writes: > Configure once with $PETSC_ARCH=arch-dbg, --with-debugging=1 and once > with $PETSC_ARCH=arch-opt, --with-debugging=0 > > Then you can switch environment variables approprately Note: the environment variables have to influence the way your program is linked. You can't just change PETSC_ARCH at run-time. But we provide the same binary interface (ABI) in debug and optimized mode, so (if you know what you're doing) you can LD_PRELOAD the desired implementation at run-time. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From siddhesh4godbole at gmail.com Sun Jan 25 02:25:38 2015 From: siddhesh4godbole at gmail.com (siddhesh godbole) Date: Sun, 25 Jan 2015 13:55:38 +0530 Subject: [petsc-users] segmentation error Message-ID: Hello; i received the following error [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: *Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range* [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors [0]PETSC ERROR: likely location of problem given in stack below [0]PETSC ERROR: --------------------- Stack Frames ------------------------------------ [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, [0]PETSC ERROR: INSTEAD the line number of the start of the function [0]PETSC ERROR: is given. [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Signal received [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 [0]PETSC ERROR: ./10D on a arch-linux2-c-debug named iitm by iitm Sun Jan 25 13:50:10 2015 [0]PETSC ERROR: Configure options --download-mpich --download-f2cblaslapack=1 [0]PETSC ERROR: #1 User provided function() line 0 in unknown file application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0 [unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0 i dont get it, and this happens just by declaring two extra arrays! when i delete them code runs just fine! where arrays are with 10 elements and all them are zero. *Siddhesh M Godbole* 5th year Dual Degree, Civil Eng & Applied Mech. IIT Madras -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.mayhem23 at gmail.com Sun Jan 25 04:21:26 2015 From: dave.mayhem23 at gmail.com (Dave May) Date: Sun, 25 Jan 2015 11:21:26 +0100 Subject: [petsc-users] segmentation error In-Reply-To: References: Message-ID: This type of bizarre unexplainable behaviour usually indicates memory corruption. For example: an illegal read of write from an array. I suggest you run your code through valgrind to rule this out. Also, I would recommend you modify and annotate your functions to enable petsc to generate a stack trace when segv's occur, i.e., declare them like this #undef __FUNCT__ #define __FUNCT__ "MyFunction" PetscErrorCode MyFunction(void) { PetscFunctionReturn(0); } and call it like this ierr = MyFunction();CHKERRQ(ierr); The CHKERRQ() macro will tell you in which of your functions the segv occurs. It is an additional useful debugging technique to complement using gdb and valgrind. All the error checking macros (CHKERRQ) are compiled out when you configure petsc with --with-debugging=no so there is no performance loss from adding the petsc error checking into your code Cheers Dave On 25 January 2015 at 09:25, siddhesh godbole wrote: > Hello; > > i received the following error > [0]PETSC ERROR: > ------------------------------------------------------------------------ > [0]PETSC ERROR: *Caught signal number 11 SEGV: Segmentation Violation, > probably memory access out of range* > [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger > [0]PETSC ERROR: or see > http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC > ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find > memory corruption errors > [0]PETSC ERROR: likely location of problem given in stack below > [0]PETSC ERROR: --------------------- Stack Frames > ------------------------------------ > [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not > available, > [0]PETSC ERROR: INSTEAD the line number of the start of the function > [0]PETSC ERROR: is given. > [0]PETSC ERROR: --------------------- Error Message > -------------------------------------------------------------- > [0]PETSC ERROR: Signal received > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html > for trouble shooting. > [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 > [0]PETSC ERROR: ./10D on a arch-linux2-c-debug named iitm by iitm Sun Jan > 25 13:50:10 2015 > [0]PETSC ERROR: Configure options --download-mpich > --download-f2cblaslapack=1 > [0]PETSC ERROR: #1 User provided function() line 0 in unknown file > application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0 > [unset]: aborting job: > application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0 > > > > i dont get it, and this happens just by declaring two extra arrays! when i > delete them code runs just fine! where arrays are with 10 elements and all > them are zero. > > > *Siddhesh M Godbole* > > 5th year Dual Degree, > Civil Eng & Applied Mech. > IIT Madras > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jed at jedbrown.org Sun Jan 25 08:10:48 2015 From: jed at jedbrown.org (Jed Brown) Date: Sun, 25 Jan 2015 07:10:48 -0700 Subject: [petsc-users] segmentation error In-Reply-To: References: Message-ID: <87zj97x85z.fsf@jedbrown.org> Dave May writes: > This type of bizarre unexplainable behaviour usually indicates memory > corruption. > For example: an illegal read of write from an array. > I suggest you run your code through valgrind to rule this out. > > Also, I would recommend you modify and annotate your functions to enable > petsc to generate a stack trace when segv's occur, i.e., declare them like > this > > #undef __FUNCT__ > #define __FUNCT__ "MyFunction" > PetscErrorCode MyFunction(void) > { I agree with everything Dave says, but put the following before the first statement in the function. PetscFunctionBeginUser; > PetscFunctionReturn(0); > } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From siddhesh4godbole at gmail.com Sun Jan 25 09:23:12 2015 From: siddhesh4godbole at gmail.com (siddhesh godbole) Date: Sun, 25 Jan 2015 20:53:12 +0530 Subject: [petsc-users] segmentation error In-Reply-To: <87zj97x85z.fsf@jedbrown.org> References: <87zj97x85z.fsf@jedbrown.org> Message-ID: Thanks a lot Dave and Jed! That helped :) On Jan 25, 2015 7:40 PM, "Jed Brown" wrote: > Dave May writes: > > > This type of bizarre unexplainable behaviour usually indicates memory > > corruption. > > For example: an illegal read of write from an array. > > I suggest you run your code through valgrind to rule this out. > > > > Also, I would recommend you modify and annotate your functions to enable > > petsc to generate a stack trace when segv's occur, i.e., declare them > like > > this > > > > #undef __FUNCT__ > > #define __FUNCT__ "MyFunction" > > PetscErrorCode MyFunction(void) > > { > > I agree with everything Dave says, but put the following before the > first statement in the function. > > PetscFunctionBeginUser; > > > PetscFunctionReturn(0); > > } > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kvoronin at labchem.sscc.ru Sun Jan 25 23:02:14 2015 From: kvoronin at labchem.sscc.ru (Kirill Voronin) Date: Mon, 26 Jan 2015 11:02:14 +0600 Subject: [petsc-users] Preconditioned BiCGStab in PETSC, formulas Message-ID: <96a5a8c8bc4da37d03a22173b94d7b88.squirrel@mx.sscc.ru> Hello! I'm solving the system with user-defined preconditioned BiCGStab from PETSc. The question is - how exactly preconditioned BiCGStab looks like (as an algorithm) in PETSC? It can be right or left or some other type of preconditioning. The output of my code shows that during each iteration PCApply (matvec of preconditioner) is called 3 times and looking at Saad's version of nonpreconditioned BiCGStab algorithm it is not that obvious for me where these 3 calls exactly occur. Saad's version: 1.Compute r0 = b - Ax0, r0* - arbitrary. 2.p0 := r0 3.for j = 0, 1 ... till convergence, do 4. alpha_j := (r_j, r0*) / (Ap_j, r0*) 5. s_j := r_j - alpha_j Ap_j 6. omega_j = (As_j, s_j) / (As_j, As_j) 7. x_{j+1} := x_j + alpha_j p_j + omega_j s_j 8. r_{j+1} := s_j - omega_j As_j 9. beta_j := (r_{j+1}, r0*)/(r_j, r0*) * alpha_j/omega_j 10. p_{j+1} := r_{j+1} + beta_j (p_j - omega_j Ap_j) 11. end do (from Saad Y. "Iterative methods for sparce linear systems") Thank you in advance! -- Best regards, Kirill Voronin From bsmith at mcs.anl.gov Mon Jan 26 07:12:56 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Mon, 26 Jan 2015 07:12:56 -0600 Subject: [petsc-users] Preconditioned BiCGStab in PETSC, formulas In-Reply-To: <96a5a8c8bc4da37d03a22173b94d7b88.squirrel@mx.sscc.ru> References: <96a5a8c8bc4da37d03a22173b94d7b88.squirrel@mx.sscc.ru> Message-ID: <07DFD639-9D2F-4280-A9F1-4965C545A7BF@mcs.anl.gov> The source code can be found at src/ksp/ksp/impls/bcgs/bcgs.c or nicely formatted at http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/impls/bcgs/bcgs.c.html#KSPBCGS You can easily find it by typing KSPBCGS into google clicking on the first link and then clicking on where it says Location: There are two KSP_PCApplyBAorAB() apply within the do loop. Depending on left or right preconditioning (it supports both) there is an additional apply before or after the do loop. Barry > On Jan 25, 2015, at 11:02 PM, Kirill Voronin wrote: > > > Hello! > > I'm solving the system with user-defined preconditioned BiCGStab from PETSc. > > The question is - how exactly preconditioned BiCGStab looks like (as an > algorithm) in PETSC? > It can be right or left or some other type of preconditioning. > > The output of my code shows that during each iteration PCApply (matvec of > preconditioner) is called 3 times and looking at Saad's version of > nonpreconditioned BiCGStab algorithm it is not that obvious for me where > these 3 calls exactly occur. > > Saad's version: > > 1.Compute r0 = b - Ax0, r0* - arbitrary. > 2.p0 := r0 > 3.for j = 0, 1 ... till convergence, do > 4. alpha_j := (r_j, r0*) / (Ap_j, r0*) > 5. s_j := r_j - alpha_j Ap_j > 6. omega_j = (As_j, s_j) / (As_j, As_j) > 7. x_{j+1} := x_j + alpha_j p_j + omega_j s_j > 8. r_{j+1} := s_j - omega_j As_j > 9. beta_j := (r_{j+1}, r0*)/(r_j, r0*) * alpha_j/omega_j > 10. p_{j+1} := r_{j+1} + beta_j (p_j - omega_j Ap_j) > 11. end do > > (from Saad Y. "Iterative methods for sparce linear systems") > > Thank you in advance! > > -- > > Best regards, > > Kirill Voronin > From kvoronin at labchem.sscc.ru Mon Jan 26 08:14:21 2015 From: kvoronin at labchem.sscc.ru (Kirill Voronin) Date: Mon, 26 Jan 2015 20:14:21 +0600 Subject: [petsc-users] Preconditioned BiCGStab in PETSC, formulas In-Reply-To: <07DFD639-9D2F-4280-A9F1-4965C545A7BF@mcs.anl.gov> Message-ID: <3ca62e903c044df6268020b82d2deebf.squirrel@mx.sscc.ru> Thank you very much for your answer! But when I am trying to monitor convergence mfor my problem I do see 3 calls of SampleShellPCApply at each iteration step (simply printing out something inside this function). But looking at http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/impls/bcgs/bcgs.c, I see that there should be two for each iteration of do loop. Can this 3-d call happen due to the monitoring routines? Actually I run code with -ksp_monitor_max -ksp_monitor_true_residual and -ksp_monitor, with additional monitor routine which calls KSPBuildResidual() and then computes in NORM_1. Best regards, Kirill Voronin > > The source code can be found at src/ksp/ksp/impls/bcgs/bcgs.c or nicely > formatted at > http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/impls/bcgs/bcgs.c. > html#KSPBCGS You can easily find it by typing KSPBCGS into google > clicking on the first link and then clicking on where it says Location: > > There are two KSP_PCApplyBAorAB() apply within the do loop. Depending on > left or right preconditioning (it supports both) there is an additional > apply before or after the do loop. > > Barry > > > >> On Jan 25, 2015, at 11:02 PM, Kirill Voronin >> wrote: >> >> >> >> Hello! >> >> >> I'm solving the system with user-defined preconditioned BiCGStab from >> PETSc. >> >> >> The question is - how exactly preconditioned BiCGStab looks like (as an >> algorithm) in PETSC? It can be right or left or some other type of >> preconditioning. >> >> The output of my code shows that during each iteration PCApply (matvec >> of preconditioner) is called 3 times and looking at Saad's version of >> nonpreconditioned BiCGStab algorithm it is not that obvious for me >> where these 3 calls exactly occur. >> >> Saad's version: >> >> >> 1.Compute r0 = b - Ax0, r0* - arbitrary. >> 2.p0 := r0 >> 3.for j = 0, 1 ... till convergence, do >> 4. alpha_j := (r_j, r0*) / (Ap_j, r0*) >> 5. s_j := r_j - alpha_j Ap_j >> 6. omega_j = (As_j, s_j) / (As_j, As_j) >> 7. x_{j+1} := x_j + alpha_j p_j + omega_j s_j >> 8. r_{j+1} := s_j - omega_j As_j >> 9. beta_j := (r_{j+1}, r0*)/(r_j, r0*) * alpha_j/omega_j >> 10. p_{j+1} := r_{j+1} + beta_j (p_j - omega_j Ap_j) >> 11. end do >> >> >> (from Saad Y. "Iterative methods for sparce linear systems") >> >> >> Thank you in advance! >> >> >> -- >> >> >> Best regards, >> >> >> Kirill Voronin >> >> > > -- From jed at jedbrown.org Mon Jan 26 08:22:17 2015 From: jed at jedbrown.org (Jed Brown) Date: Mon, 26 Jan 2015 07:22:17 -0700 Subject: [petsc-users] Preconditioned BiCGStab in PETSC, formulas In-Reply-To: <3ca62e903c044df6268020b82d2deebf.squirrel@mx.sscc.ru> References: <3ca62e903c044df6268020b82d2deebf.squirrel@mx.sscc.ru> Message-ID: <87d261y63q.fsf@jedbrown.org> Kirill Voronin writes: > But looking at > http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/impls/bcgs/bcgs.c, > I see that there should be two for each iteration of do loop. > Can this 3-d call happen due to the monitoring routines? Yes, -ksp_monitor_true_residual computes the true residual explicitly instead of via the recurrence. > Actually I run code with -ksp_monitor_max -ksp_monitor_true_residual and > -ksp_monitor, > with additional monitor routine which calls KSPBuildResidual() and then > computes in NORM_1. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: From thronesf at gmail.com Mon Jan 26 14:50:12 2015 From: thronesf at gmail.com (Sharp Stone) Date: Mon, 26 Jan 2015 15:50:12 -0500 Subject: [petsc-users] Samrai's interface to Petsc Message-ID: Hi folks, I'm doing the simulations with Petsc. Now we want to turn to the samrai to the current Petsc code. However, there are few resources, and someone says the samrai's interface to the current Petsc 3.5.2 has been out of date and might not be supported. Is this true? Otherwise, are there any resources or manuals that could instruct us to integrate the Petsc with samrai? Thank you in advance! -- Best regards, Feng -------------- next part -------------- An HTML attachment was scrubbed... URL: From siddhesh4godbole at gmail.com Tue Jan 27 01:52:31 2015 From: siddhesh4godbole at gmail.com (siddhesh godbole) Date: Tue, 27 Jan 2015 13:22:31 +0530 Subject: [petsc-users] how to import an array from matlab? Message-ID: Hello, i am trying to import an array of 10000 elements into petsc. interfacing fails when i try to use launch('./mycode',np,opt) in my matlab due to some incompatibility. Then i tried importing .mat file into petsc and i got stuck. Can you please tell me how can i import an array from matlab into petsc and use it for my calculations? Thanks in advance! *Siddhesh M Godbole* 5th year Dual Degree, Civil Eng & Applied Mech. IIT Madras -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Tue Jan 27 07:24:24 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Tue, 27 Jan 2015 07:24:24 -0600 Subject: [petsc-users] how to import an array from matlab? In-Reply-To: References: Message-ID: <83BBC792-FB0E-4789-A82B-C21FAD3B8613@mcs.anl.gov> Use PetscBinaryWrite.m from MATLAB (documentation at the top of the file) to save the array into a file then in PETSc use VecLoad() to load the matrix. PetscBinaryWrite.m is in $PETSC_DIR/bin/matlab or $PETSC_DIR/share/petsc/matlab depending on your version of PETSc. Barry > On Jan 27, 2015, at 1:52 AM, siddhesh godbole wrote: > > Hello, > i am trying to import an array of 10000 elements into petsc. interfacing fails when i try to use launch('./mycode',np,opt) in my matlab due to some incompatibility. Then i tried importing .mat file into petsc and i got stuck. > Can you please tell me how can i import an array from matlab into petsc and use it for my calculations? > Thanks in advance! > > Siddhesh M Godbole > > 5th year Dual Degree, > Civil Eng & Applied Mech. > IIT Madras From siddhesh4godbole at gmail.com Tue Jan 27 23:33:09 2015 From: siddhesh4godbole at gmail.com (siddhesh godbole) Date: Wed, 28 Jan 2015 11:03:09 +0530 Subject: [petsc-users] how to import an array from matlab? In-Reply-To: <83BBC792-FB0E-4789-A82B-C21FAD3B8613@mcs.anl.gov> References: <83BBC792-FB0E-4789-A82B-C21FAD3B8613@mcs.anl.gov> Message-ID: Hello, I have been trying to use the functions PetscSocketOpen but it gets stuck in this function shooting the following error [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Error in system call [0]PETSC ERROR: Connection refused by remote host renoir port 5005 [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 [0]PETSC ERROR: ./10D on a arch-linux2-c-debug named renoir by hridya Wed Jan 28 10:45:49 2015 [0]PETSC ERROR: Configure options --download-mpich [0]PETSC ERROR: #1 PetscOpenSocket() line 133 in /home/hridya/Downloads/petsc-3.5.2/src/sys/classes/viewer/impls/socket/send.c [0]PETSC ERROR: #2 PetscViewerSocketSetConnection() line 400 in /home/hridya/Downloads/petsc-3.5.2/src/sys/classes/viewer/impls/socket/send.c [0]PETSC ERROR: #3 PetscViewerSocketOpen() line 289 in /home/hridya/Downloads/petsc-3.5.2/src/sys/classes/viewer/impls/socket/send.c i am using this for the first time. Please help ! Thanks a lot *Siddhesh M Godbole* 5th year Dual Degree, Civil Eng & Applied Mech. IIT Madras On Tue, Jan 27, 2015 at 6:54 PM, Barry Smith wrote: > > Use PetscBinaryWrite.m from MATLAB (documentation at the top of the > file) to save the array into a file then in PETSc use VecLoad() to load the > matrix. PetscBinaryWrite.m is in $PETSC_DIR/bin/matlab or > $PETSC_DIR/share/petsc/matlab depending on your version of PETSc. > > Barry > > > > > On Jan 27, 2015, at 1:52 AM, siddhesh godbole < > siddhesh4godbole at gmail.com> wrote: > > > > Hello, > > i am trying to import an array of 10000 elements into petsc. interfacing > fails when i try to use launch('./mycode',np,opt) in my matlab due to some > incompatibility. Then i tried importing .mat file into petsc and i got > stuck. > > Can you please tell me how can i import an array from matlab into petsc > and use it for my calculations? > > Thanks in advance! > > > > Siddhesh M Godbole > > > > 5th year Dual Degree, > > Civil Eng & Applied Mech. > > IIT Madras > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Jan 28 07:29:05 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 28 Jan 2015 07:29:05 -0600 Subject: [petsc-users] how to import an array from matlab? In-Reply-To: References: <83BBC792-FB0E-4789-A82B-C21FAD3B8613@mcs.anl.gov> Message-ID: <73303A2A-0D0E-405C-80E4-575BBF2E1988@mcs.anl.gov> You probably want to stick to just using binary files to move the data between PETSc and MATLAB and not use sockets. But if you want to use sockets the reason you get the error message is that you haven't called PetscBinaryWrite(5005) (or PetscBinaryRead(5005)) or PetscOpenSocket(5005) BEFORE running the PETSc program to receive the results. Barry > On Jan 27, 2015, at 11:33 PM, siddhesh godbole wrote: > > Hello, > > I have been trying to use the functions PetscSocketOpen but it gets stuck in this function shooting the following error > > [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- > [0]PETSC ERROR: Error in system call > [0]PETSC ERROR: Connection refused by remote host renoir port 5005 > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. > [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 > [0]PETSC ERROR: ./10D on a arch-linux2-c-debug named renoir by hridya Wed Jan 28 10:45:49 2015 > [0]PETSC ERROR: Configure options --download-mpich > [0]PETSC ERROR: #1 PetscOpenSocket() line 133 in /home/hridya/Downloads/petsc-3.5.2/src/sys/classes/viewer/impls/socket/send.c > [0]PETSC ERROR: #2 PetscViewerSocketSetConnection() line 400 in /home/hridya/Downloads/petsc-3.5.2/src/sys/classes/viewer/impls/socket/send.c > [0]PETSC ERROR: #3 PetscViewerSocketOpen() line 289 in /home/hridya/Downloads/petsc-3.5.2/src/sys/classes/viewer/impls/socket/send.c > > i am using this for the first time. Please help ! > > Thanks a lot > > > Siddhesh M Godbole > > 5th year Dual Degree, > Civil Eng & Applied Mech. > IIT Madras > > On Tue, Jan 27, 2015 at 6:54 PM, Barry Smith wrote: > > Use PetscBinaryWrite.m from MATLAB (documentation at the top of the file) to save the array into a file then in PETSc use VecLoad() to load the matrix. PetscBinaryWrite.m is in $PETSC_DIR/bin/matlab or $PETSC_DIR/share/petsc/matlab depending on your version of PETSc. > > Barry > > > > > On Jan 27, 2015, at 1:52 AM, siddhesh godbole wrote: > > > > Hello, > > i am trying to import an array of 10000 elements into petsc. interfacing fails when i try to use launch('./mycode',np,opt) in my matlab due to some incompatibility. Then i tried importing .mat file into petsc and i got stuck. > > Can you please tell me how can i import an array from matlab into petsc and use it for my calculations? > > Thanks in advance! > > > > Siddhesh M Godbole > > > > 5th year Dual Degree, > > Civil Eng & Applied Mech. > > IIT Madras > > From Carol.Brickley at awe.co.uk Wed Jan 28 12:39:54 2015 From: Carol.Brickley at awe.co.uk (Carol.Brickley at awe.co.uk) Date: Wed, 28 Jan 2015 18:39:54 +0000 Subject: [petsc-users] F90 to petsc 3.4.3 interface - loss of accuracy Message-ID: <201501281840.t0SIe1iZ023233@msw1.awe.co.uk> Hi, Does anyone find loss of accuracy between F90 code and Petsc 3.4.3 C codes? I am noticing that some of my data is returning 9.99999997e-13 instead of 1.00000000e-12 for example. Carol Dr Carol Brickley BSc,PhD,ARCS,DIC,MBCS Senior Software Engineer Applied Computer Science DS+T, AWE Aldermaston Reading Berkshire RG7 4PR Direct: 0118 9855035 ___________________________________________________ ____________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsmith at mcs.anl.gov Wed Jan 28 12:52:16 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 28 Jan 2015 12:52:16 -0600 Subject: [petsc-users] F90 to petsc 3.4.3 interface - loss of accuracy In-Reply-To: <201501281840.t0SIe1iZ023233@msw1.awe.co.uk> References: <201501281840.t0SIe1iZ023233@msw1.awe.co.uk> Message-ID: > On Jan 28, 2015, at 12:39 PM, wrote: > > Hi, > > Does anyone find loss of accuracy between F90 code and Petsc 3.4.3 C codes? I am noticing that some of my data is returning 9.99999997e-13 instead of 1.00000000e-12 for example. I am not sure exactly what your question is. Do you have two codes a F90 code without PETSc and a PETSc based C code? What is the data that is different? Is it solutions, residual values, ...? This kind of small difference can often be caused by different tolerances used during the iterative solvers. We'll need more information in order to make any suggestions. Barry > > Carol > > Dr Carol Brickley > BSc,PhD,ARCS,DIC,MBCS > > Senior Software Engineer > Applied Computer Science > DS+T, > AWE > Aldermaston > Reading > Berkshire > RG7 4PR > > Direct: 0118 9855035 > > ___________________________________________________ ____________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR > From bsmith at mcs.anl.gov Wed Jan 28 12:59:13 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 28 Jan 2015 12:59:13 -0600 Subject: [petsc-users] EXTERNAL: Re: F90 to petsc 3.4.3 interface - loss of accuracy In-Reply-To: <201501281854.t0SIstXk004742@msw1.awe.co.uk> References: <201501281840.t0SIe1iZ023233@msw1.awe.co.uk> <201501281854.t0SIstXk004742@msw1.awe.co.uk> Message-ID: <98F278A3-39C3-47F1-88F9-000615611E93@mcs.anl.gov> > On Jan 28, 2015, at 12:54 PM, wrote: > > Hi, > > I have a F90 suite that uses the petsc and runs for structured and unstructured matrices. For the unstructured we do not see the change at tiny decimal places but in the structured we do. What data is the change in? A solution? Some derived quantity of the solution? Or in a residual? Depending on what the difference is in generally that seems a very small difference to me. > The same solver is being used - GMRES. The tolerance should be 1e-10 in both cases but I can check in case there is a mistake. You can try using KSP and SNES tolerances of 1e-12 to see if you get closer match -ksp_rtol 1.e-12 -snes_rtol 1.e-12 > > Carol > > Dr Carol Brickley > BSc,PhD,ARCS,DIC,MBCS > > Senior Software Engineer > Applied Computer Science > DS+T, > AWE > Aldermaston > Reading > Berkshire > RG7 4PR > > Direct: 0118 9855035 > > -----Original Message----- > From: Barry Smith [mailto:bsmith at mcs.anl.gov] > Sent: 28 January 2015 18:52 > To: Brickley Carol AWE > Cc: petsc-users at mcs.anl.gov > Subject: EXTERNAL: Re: [petsc-users] F90 to petsc 3.4.3 interface - loss of accuracy > > >> On Jan 28, 2015, at 12:39 PM, wrote: >> >> Hi, >> >> Does anyone find loss of accuracy between F90 code and Petsc 3.4.3 C codes? I am noticing that some of my data is returning 9.99999997e-13 instead of 1.00000000e-12 for example. > > I am not sure exactly what your question is. Do you have two codes a F90 code without PETSc and a PETSc based C code? What is the data that is different? Is it solutions, residual values, ...? This kind of small difference can often be caused by different tolerances used during the iterative solvers. We'll need more information in order to make any suggestions. > > Barry > >> >> Carol >> >> Dr Carol Brickley >> BSc,PhD,ARCS,DIC,MBCS >> >> Senior Software Engineer >> Applied Computer Science >> DS+T, >> AWE >> Aldermaston >> Reading >> Berkshire >> RG7 4PR >> >> Direct: 0118 9855035 >> >> ___________________________________________________ ____________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR >> > > > ___________________________________________________ > ____________________________ > > The information in this email and in any attachment(s) is > commercial in confidence. If you are not the named addressee(s) > or > if you receive this email in error then any distribution, copying or > use of this communication or the information in it is strictly > prohibited. Please notify us immediately by email at > admin.internet(at)awe.co.uk, and then delete this message from > your computer. While attachments are virus checked, AWE plc > does not accept any liability in respect of any virus which is not > detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR From vijay.m at gmail.com Wed Jan 28 19:39:08 2015 From: vijay.m at gmail.com (Vijay S. Mahadevan) Date: Wed, 28 Jan 2015 19:39:08 -0600 Subject: [petsc-users] Need to create $PREFIX/include explicitly Message-ID: With the current master, when using a prefix, configuration fails with the following error message. I've not attached configure.log since its around 7MB (but definitely can send that if that helps further deciphering the issue). The problem here seems to be that $PREFIX/include is not created (while $PREFIX/lib is created explicitly with mkdir -p). If I manually create $PREFIX/include and rerun configure, everything proceeds fine. Minor annoyance. I am not sure whether I just pulled in between merges though. My latest hash: c04667f413dc6e46059f28faddb2b19f70ad4cfd. Command: ./configure --CFLAGS="-O2 -mtune=generic" --CPPFLAGS=-I/usr/software/metis-5.1.0/include --CXXFLAGS="-O2 -mtune=generic" --FFLAGS="-O2 -mtune=generic" --LDFLAGS="-L/usr/software/moab/dev/optimized/lib -L/usr/software/pnetcdf-1.3.1/lib -L/usr/software/zoltan-3.6/lib -L/usr/software/ptscotch-6.0/lib -L/usr/software/parmetis-4.0.3/lib -L/usr/software/metis-5.1.0/lib" --LIBS="-lpnetcdf -lparmetis -lmetis -lm" --download-hypre=yes --download-mumps=yes --download-scalapack=yes --download-suitesparse=yes --prefix=/usr/software/petsc/dev/ubuntu_standalone_opt --with-blas-lapack-dir=/usr --with-boost-dir=/usr/software/boost/current --with-clanguage=C++ --with-cmake=/usr/software/cmake/bin/cmake --with-cuda=0 --with-debugging=0 --with-fortran-interfaces=1 --with-fortran-kernels=1 --with-fortran=1 --with-hdf5-dir=/usr/software/hdf5-1.8.11 --with-metis-dir=/usr/software/metis-5.1.0 --with-moab-include=/usr/software/moab/dev/optimized/include --with-moab-lib="-lMOAB -liMesh -lmbcoupler -lzoltan -lptscotch -lptscotcherr -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit -lz -lm " --with-mpi-dir=/usr/software/mpich-3.0.4 --with-netcdf-dir=/usr/software/netcdf-4.3.0 --with-openmp=0 --with-parmetis-dir=/usr/software/parmetis-4.0.3 --with-pic=1 --with-ptscotch-include=/usr/software/ptscotch-6.0/include --with-ptscotch-lib="-lptesmumps -lptscotch -lptscotcherr -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit -lz -lm" --with-shared-libraries=1 PETSC_ARCH=ubuntu_standalone_opt Error: ******************************************************************************* UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details): ------------------------------------------------------------------------------- Error running make on MUMPS: Could not execute "mkdir -p /usr/software/petsc/dev/ubuntu_standalone_opt/lib && cd /home/vijaysm/code/petsc/ubuntu_standalone_opt/externalpackages/MUMPS && cp -f lib/*.* /usr/software/petsc/dev/ubuntu_standalone_opt/lib/. && cp -f include/*.* /usr/software/petsc/dev/ubuntu_standalone_opt/include/.": cp: target '/usr/software/petsc/dev/ubuntu_standalone_opt/include/.' is not a directory ******************************************************************************* Vijay From bsmith at mcs.anl.gov Wed Jan 28 21:29:01 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Wed, 28 Jan 2015 21:29:01 -0600 Subject: [petsc-users] Need to create $PREFIX/include explicitly In-Reply-To: References: Message-ID: <97704C52-C7D2-4F3F-84C4-EA16DC9183A4@mcs.anl.gov> Fixed in master and next. Thanks for reporting it. Barry BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master > On Jan 28, 2015, at 7:39 PM, Vijay S. Mahadevan wrote: > > With the current master, when using a prefix, configuration fails with > the following error message. I've not attached configure.log since its > around 7MB (but definitely can send that if that helps further > deciphering the issue). The problem here seems to be that > $PREFIX/include is not created (while $PREFIX/lib is created > explicitly with mkdir -p). If I manually create $PREFIX/include and > rerun configure, everything proceeds fine. Minor annoyance. > > I am not sure whether I just pulled in between merges though. My > latest hash: c04667f413dc6e46059f28faddb2b19f70ad4cfd. > > Command: > ./configure --CFLAGS="-O2 -mtune=generic" > --CPPFLAGS=-I/usr/software/metis-5.1.0/include --CXXFLAGS="-O2 > -mtune=generic" --FFLAGS="-O2 -mtune=generic" > --LDFLAGS="-L/usr/software/moab/dev/optimized/lib > -L/usr/software/pnetcdf-1.3.1/lib -L/usr/software/zoltan-3.6/lib > -L/usr/software/ptscotch-6.0/lib -L/usr/software/parmetis-4.0.3/lib > -L/usr/software/metis-5.1.0/lib" --LIBS="-lpnetcdf -lparmetis -lmetis > -lm" --download-hypre=yes --download-mumps=yes > --download-scalapack=yes --download-suitesparse=yes > --prefix=/usr/software/petsc/dev/ubuntu_standalone_opt > --with-blas-lapack-dir=/usr > --with-boost-dir=/usr/software/boost/current --with-clanguage=C++ > --with-cmake=/usr/software/cmake/bin/cmake --with-cuda=0 > --with-debugging=0 --with-fortran-interfaces=1 > --with-fortran-kernels=1 --with-fortran=1 > --with-hdf5-dir=/usr/software/hdf5-1.8.11 > --with-metis-dir=/usr/software/metis-5.1.0 > --with-moab-include=/usr/software/moab/dev/optimized/include > --with-moab-lib="-lMOAB -liMesh -lmbcoupler -lzoltan -lptscotch > -lptscotcherr -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit > -lz -lm " --with-mpi-dir=/usr/software/mpich-3.0.4 > --with-netcdf-dir=/usr/software/netcdf-4.3.0 --with-openmp=0 > --with-parmetis-dir=/usr/software/parmetis-4.0.3 --with-pic=1 > --with-ptscotch-include=/usr/software/ptscotch-6.0/include > --with-ptscotch-lib="-lptesmumps -lptscotch -lptscotcherr > -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit -lz -lm" > --with-shared-libraries=1 PETSC_ARCH=ubuntu_standalone_opt > > Error: > ******************************************************************************* > UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log > for details): > ------------------------------------------------------------------------------- > Error running make on MUMPS: Could not execute "mkdir -p > /usr/software/petsc/dev/ubuntu_standalone_opt/lib && cd > /home/vijaysm/code/petsc/ubuntu_standalone_opt/externalpackages/MUMPS > && cp -f lib/*.* /usr/software/petsc/dev/ubuntu_standalone_opt/lib/. > && cp -f include/*.* > /usr/software/petsc/dev/ubuntu_standalone_opt/include/.": > cp: target '/usr/software/petsc/dev/ubuntu_standalone_opt/include/.' > is not a directory > ******************************************************************************* > > Vijay From vijay.m at gmail.com Wed Jan 28 22:30:45 2015 From: vijay.m at gmail.com (Vijay S. Mahadevan) Date: Wed, 28 Jan 2015 22:30:45 -0600 Subject: [petsc-users] Need to create $PREFIX/include explicitly In-Reply-To: <97704C52-C7D2-4F3F-84C4-EA16DC9183A4@mcs.anl.gov> References: <97704C52-C7D2-4F3F-84C4-EA16DC9183A4@mcs.anl.gov> Message-ID: > BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master Thanks Barry, I'll take a look at it. Will be spending time next couple of weeks on DMMoab to add some geometric multigrid hooks and more examples. Vijay On Wed, Jan 28, 2015 at 9:29 PM, Barry Smith wrote: > Fixed in master and next. Thanks for reporting it. > > Barry > > BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master > >> On Jan 28, 2015, at 7:39 PM, Vijay S. Mahadevan wrote: >> >> With the current master, when using a prefix, configuration fails with >> the following error message. I've not attached configure.log since its >> around 7MB (but definitely can send that if that helps further >> deciphering the issue). The problem here seems to be that >> $PREFIX/include is not created (while $PREFIX/lib is created >> explicitly with mkdir -p). If I manually create $PREFIX/include and >> rerun configure, everything proceeds fine. Minor annoyance. >> >> I am not sure whether I just pulled in between merges though. My >> latest hash: c04667f413dc6e46059f28faddb2b19f70ad4cfd. >> >> Command: >> ./configure --CFLAGS="-O2 -mtune=generic" >> --CPPFLAGS=-I/usr/software/metis-5.1.0/include --CXXFLAGS="-O2 >> -mtune=generic" --FFLAGS="-O2 -mtune=generic" >> --LDFLAGS="-L/usr/software/moab/dev/optimized/lib >> -L/usr/software/pnetcdf-1.3.1/lib -L/usr/software/zoltan-3.6/lib >> -L/usr/software/ptscotch-6.0/lib -L/usr/software/parmetis-4.0.3/lib >> -L/usr/software/metis-5.1.0/lib" --LIBS="-lpnetcdf -lparmetis -lmetis >> -lm" --download-hypre=yes --download-mumps=yes >> --download-scalapack=yes --download-suitesparse=yes >> --prefix=/usr/software/petsc/dev/ubuntu_standalone_opt >> --with-blas-lapack-dir=/usr >> --with-boost-dir=/usr/software/boost/current --with-clanguage=C++ >> --with-cmake=/usr/software/cmake/bin/cmake --with-cuda=0 >> --with-debugging=0 --with-fortran-interfaces=1 >> --with-fortran-kernels=1 --with-fortran=1 >> --with-hdf5-dir=/usr/software/hdf5-1.8.11 >> --with-metis-dir=/usr/software/metis-5.1.0 >> --with-moab-include=/usr/software/moab/dev/optimized/include >> --with-moab-lib="-lMOAB -liMesh -lmbcoupler -lzoltan -lptscotch >> -lptscotcherr -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit >> -lz -lm " --with-mpi-dir=/usr/software/mpich-3.0.4 >> --with-netcdf-dir=/usr/software/netcdf-4.3.0 --with-openmp=0 >> --with-parmetis-dir=/usr/software/parmetis-4.0.3 --with-pic=1 >> --with-ptscotch-include=/usr/software/ptscotch-6.0/include >> --with-ptscotch-lib="-lptesmumps -lptscotch -lptscotcherr >> -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit -lz -lm" >> --with-shared-libraries=1 PETSC_ARCH=ubuntu_standalone_opt >> >> Error: >> ******************************************************************************* >> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log >> for details): >> ------------------------------------------------------------------------------- >> Error running make on MUMPS: Could not execute "mkdir -p >> /usr/software/petsc/dev/ubuntu_standalone_opt/lib && cd >> /home/vijaysm/code/petsc/ubuntu_standalone_opt/externalpackages/MUMPS >> && cp -f lib/*.* /usr/software/petsc/dev/ubuntu_standalone_opt/lib/. >> && cp -f include/*.* >> /usr/software/petsc/dev/ubuntu_standalone_opt/include/.": >> cp: target '/usr/software/petsc/dev/ubuntu_standalone_opt/include/.' >> is not a directory >> ******************************************************************************* >> >> Vijay > From knepley at gmail.com Thu Jan 29 10:49:58 2015 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 29 Jan 2015 10:49:58 -0600 Subject: [petsc-users] Samrai's interface to Petsc In-Reply-To: References: Message-ID: On Mon, Jan 26, 2015 at 2:50 PM, Sharp Stone wrote: > Hi folks, > > I'm doing the simulations with Petsc. Now we want to turn to the samrai to > the current Petsc code. However, there are few resources, and someone says > the samrai's interface to the current Petsc 3.5.2 has been out of date and > might not be supported. Is this true? Otherwise, are there any resources or > manuals that could instruct us to integrate the Petsc with samrai? > Here is my current understanding, but someone correct me if this is out-of-date. SAMRAI does not have the people to track the PETSc interface, so they cannot use the last several releases. We are currently planning better support for AMR solvers, and have sent in proposals. We will give a thorough overview and development plan once we hear about those. Thanks, Matt > Thank you in advance! > > -- > Best regards, > > Feng > -- 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 Carol.Brickley at awe.co.uk Thu Jan 29 12:03:44 2015 From: Carol.Brickley at awe.co.uk (Carol.Brickley at awe.co.uk) Date: Thu, 29 Jan 2015 18:03:44 +0000 Subject: [petsc-users] FW: EXTERNAL: Re: EXTERNAL: Re: F90 to petsc 3.4.3 interface - loss of accuracy Message-ID: <201501291803.t0TI3q9n011697@msw1.awe.co.uk> All, I am still having problems with data inconsistencies. We think it is loss of accuracy but am not sure. I have tried using 1 tolerance of 1e-12 for the ksp tolerance (ksp_rtol) but that doesn't seem to change matters. Carol Dr Carol Brickley BSc,PhD,ARCS,DIC,MBCS Senior Software Engineer Applied Computer Science DS+T, AWE Aldermaston Reading Berkshire RG7 4PR Direct: 0118 9855035 -----Original Message----- From: Brickley Carol AWE Sent: 29 January 2015 17:12 To: 'Barry Smith' Subject: RE: EXTERNAL: Re: EXTERNAL: Re: [petsc-users] F90 to petsc 3.4.3 interface - loss of accuracy Hi, The data change is in material temperature and pressure. It is different from the unstructured case. I tried using 1e-12 but this made no difference. I also thought it may be the way the 2d structured matrix is read in compared to the 1d unstructured matrix but as its symmetrical apparently this would not matter (ie, inner index before outer or vice versa). Any other ideas would be gratefully appreciated. Carol Dr Carol Brickley BSc,PhD,ARCS,DIC,MBCS Senior Software Engineer Applied Computer Science DS+T, AWE Aldermaston Reading Berkshire RG7 4PR Direct: 0118 9855035 -----Original Message----- From: Barry Smith [mailto:bsmith at mcs.anl.gov] Sent: 28 January 2015 18:59 To: Brickley Carol AWE; PETSc users list Subject: EXTERNAL: Re: EXTERNAL: Re: [petsc-users] F90 to petsc 3.4.3 interface - loss of accuracy > On Jan 28, 2015, at 12:54 PM, wrote: > > Hi, > > I have a F90 suite that uses the petsc and runs for structured and unstructured matrices. For the unstructured we do not see the change at tiny decimal places but in the structured we do. What data is the change in? A solution? Some derived quantity of the solution? Or in a residual? Depending on what the difference is in generally that seems a very small difference to me. > The same solver is being used - GMRES. The tolerance should be 1e-10 in both cases but I can check in case there is a mistake. You can try using KSP and SNES tolerances of 1e-12 to see if you get closer match -ksp_rtol 1.e-12 -snes_rtol 1.e-12 > > Carol > > Dr Carol Brickley > BSc,PhD,ARCS,DIC,MBCS > > Senior Software Engineer > Applied Computer Science > DS+T, > AWE > Aldermaston > Reading > Berkshire > RG7 4PR > > Direct: 0118 9855035 > > -----Original Message----- > From: Barry Smith [mailto:bsmith at mcs.anl.gov] > Sent: 28 January 2015 18:52 > To: Brickley Carol AWE > Cc: petsc-users at mcs.anl.gov > Subject: EXTERNAL: Re: [petsc-users] F90 to petsc 3.4.3 interface - loss of accuracy > > >> On Jan 28, 2015, at 12:39 PM, wrote: >> >> Hi, >> >> Does anyone find loss of accuracy between F90 code and Petsc 3.4.3 C codes? I am noticing that some of my data is returning 9.99999997e-13 instead of 1.00000000e-12 for example. > > I am not sure exactly what your question is. Do you have two codes a F90 code without PETSc and a PETSc based C code? What is the data that is different? Is it solutions, residual values, ...? This kind of small difference can often be caused by different tolerances used during the iterative solvers. We'll need more information in order to make any suggestions. > > Barry > >> >> Carol >> >> Dr Carol Brickley >> BSc,PhD,ARCS,DIC,MBCS >> >> Senior Software Engineer >> Applied Computer Science >> DS+T, >> AWE >> Aldermaston >> Reading >> Berkshire >> RG7 4PR >> >> Direct: 0118 9855035 >> >> ___________________________________________________ ____________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR >> > > > ___________________________________________________ > ____________________________ > > The information in this email and in any attachment(s) is > commercial in confidence. If you are not the named addressee(s) > or > if you receive this email in error then any distribution, copying or > use of this communication or the information in it is strictly > prohibited. Please notify us immediately by email at > admin.internet(at)awe.co.uk, and then delete this message from > your computer. While attachments are virus checked, AWE plc > does not accept any liability in respect of any virus which is not > detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR ___________________________________________________ ____________________________ The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR From knepley at gmail.com Thu Jan 29 12:10:52 2015 From: knepley at gmail.com (Matthew Knepley) Date: Thu, 29 Jan 2015 12:10:52 -0600 Subject: [petsc-users] FW: EXTERNAL: Re: EXTERNAL: Re: F90 to petsc 3.4.3 interface - loss of accuracy In-Reply-To: <201501291803.t0TI3q9n011697@msw1.awe.co.uk> References: <201501291803.t0TI3q9n011697@msw1.awe.co.uk> Message-ID: On Thu, Jan 29, 2015 at 12:03 PM, wrote: > > All, > > I am still having problems with data inconsistencies. We think it is loss > of accuracy but am not sure. I have tried using 1 tolerance of 1e-12 for > the ksp tolerance (ksp_rtol) but that doesn't seem to change matters. > I am not sure I understand what you want. What you seemed to report in the first email was a difference in output of size 1e-21. This is smaller than the machine epsilon for double precision by several order of magnitude: http://en.wikipedia.org/wiki/Machine_epsilon This means that if you reverse the sum of just two numbers, you can have a difference this large since floating point operations are not commutative. In general, you can only expect an answer accurate to \kappa(A) \epsilon where \kappa(A) is the condition number of your operator, and this applies to both direct and iterative methods. So, there is a loss of accuracy compared to exact arithmetic, but this is inherent in the definition floating point. Thanks, Matt > Carol > > > Dr Carol Brickley > BSc,PhD,ARCS,DIC,MBCS > > Senior Software Engineer > Applied Computer Science > DS+T, > AWE > Aldermaston > Reading > Berkshire > RG7 4PR > > Direct: 0118 9855035 > > -----Original Message----- > From: Brickley Carol AWE > Sent: 29 January 2015 17:12 > To: 'Barry Smith' > Subject: RE: EXTERNAL: Re: EXTERNAL: Re: [petsc-users] F90 to petsc 3.4.3 > interface - loss of accuracy > > Hi, > > The data change is in material temperature and pressure. It is different > from the unstructured case. > > I tried using 1e-12 but this made no difference. I also thought it may be > the way the 2d structured matrix is read in compared to the 1d unstructured > matrix but as its symmetrical apparently this would not matter (ie, inner > index before outer or vice versa). > > Any other ideas would be gratefully appreciated. > > Carol > > Dr Carol Brickley > BSc,PhD,ARCS,DIC,MBCS > > Senior Software Engineer > Applied Computer Science > DS+T, > AWE > Aldermaston > Reading > Berkshire > RG7 4PR > > Direct: 0118 9855035 > > -----Original Message----- > From: Barry Smith [mailto:bsmith at mcs.anl.gov] > Sent: 28 January 2015 18:59 > To: Brickley Carol AWE; PETSc users list > Subject: EXTERNAL: Re: EXTERNAL: Re: [petsc-users] F90 to petsc 3.4.3 > interface - loss of accuracy > > > > On Jan 28, 2015, at 12:54 PM, < > Carol.Brickley at awe.co.uk> wrote: > > > > Hi, > > > > I have a F90 suite that uses the petsc and runs for structured and > unstructured matrices. For the unstructured we do not see the change at > tiny decimal places but in the structured we do. > > What data is the change in? A solution? Some derived quantity of the > solution? Or in a residual? Depending on what the difference is in > generally that seems a very small difference to me. > > > The same solver is being used - GMRES. The tolerance should be 1e-10 in > both cases but I can check in case there is a mistake. > > You can try using KSP and SNES tolerances of 1e-12 to see if you get > closer match -ksp_rtol 1.e-12 -snes_rtol 1.e-12 > > > > Carol > > > > Dr Carol Brickley > > BSc,PhD,ARCS,DIC,MBCS > > > > Senior Software Engineer > > Applied Computer Science > > DS+T, > > AWE > > Aldermaston > > Reading > > Berkshire > > RG7 4PR > > > > Direct: 0118 9855035 > > > > -----Original Message----- > > From: Barry Smith [mailto:bsmith at mcs.anl.gov] > > Sent: 28 January 2015 18:52 > > To: Brickley Carol AWE > > Cc: petsc-users at mcs.anl.gov > > Subject: EXTERNAL: Re: [petsc-users] F90 to petsc 3.4.3 interface - loss > of accuracy > > > > > >> On Jan 28, 2015, at 12:39 PM, < > Carol.Brickley at awe.co.uk> wrote: > >> > >> Hi, > >> > >> Does anyone find loss of accuracy between F90 code and Petsc 3.4.3 C > codes? I am noticing that some of my data is returning 9.99999997e-13 > instead of 1.00000000e-12 for example. > > > > I am not sure exactly what your question is. Do you have two codes a > F90 code without PETSc and a PETSc based C code? What is the data that is > different? Is it solutions, residual values, ...? This kind of small > difference can often be caused by different tolerances used during the > iterative solvers. We'll need more information in order to make any > suggestions. > > > > Barry > > > >> > >> Carol > >> > >> Dr Carol Brickley > >> BSc,PhD,ARCS,DIC,MBCS > >> > >> Senior Software Engineer > >> Applied Computer Science > >> DS+T, > >> AWE > >> Aldermaston > >> Reading > >> Berkshire > >> RG7 4PR > >> > >> Direct: 0118 9855035 > >> > >> ___________________________________________________ > ____________________________ The information in this email and in any > attachment(s) is commercial in confidence. If you are not the named > addressee(s) or if you receive this email in error then any distribution, > copying or use of this communication or the information in it is strictly > prohibited. Please notify us immediately by email at admin.internet(at) > awe.co.uk, and then delete this message from your computer. While > attachments are virus checked, AWE plc does not accept any liability in > respect of any virus which is not detected. AWE Plc Registered in England > and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR > >> > > > > > > ___________________________________________________ > > ____________________________ > > > > The information in this email and in any attachment(s) is > > commercial in confidence. If you are not the named addressee(s) > > or > > if you receive this email in error then any distribution, copying or > > use of this communication or the information in it is strictly > > prohibited. Please notify us immediately by email at > > admin.internet(at)awe.co.uk, and then delete this message from > > your computer. While attachments are virus checked, AWE plc > > does not accept any liability in respect of any virus which is not > > detected. > > > > AWE Plc > > Registered in England and Wales > > Registration No 02763902 > > AWE, Aldermaston, Reading, RG7 4PR > > > ___________________________________________________ > ____________________________ > > The information in this email and in any attachment(s) is > commercial in confidence. If you are not the named addressee(s) > or > if you receive this email in error then any distribution, copying or > use of this communication or the information in it is strictly > prohibited. Please notify us immediately by email at > admin.internet(at)awe.co.uk, and then delete this message from > your computer. While attachments are virus checked, AWE plc > does not accept any liability in respect of any virus which is not > detected. > > AWE Plc > Registered in England and Wales > Registration No 02763902 > AWE, Aldermaston, Reading, RG7 4PR > -- 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 vijay.m at gmail.com Thu Jan 29 19:10:03 2015 From: vijay.m at gmail.com (Vijay S. Mahadevan) Date: Thu, 29 Jan 2015 19:10:03 -0600 Subject: [petsc-users] Need to create $PREFIX/include explicitly In-Reply-To: References: <97704C52-C7D2-4F3F-84C4-EA16DC9183A4@mcs.anl.gov> Message-ID: Found another related issue although not directly affected when working with PETSc alone. I can created a new thread for this if needed. When configuring SLEPc with an installed version of PETSc, the operation fails due to not finding bfort. The issue seems to be that for some reason, PETSc failed to install the bin files that are clearly present in the source configuration i.e., they are under $PETSC_DIR/$PETSC_ARCH/bin but not in $PREFIX/bin. I can rectify this by manually copying the executables in $PETSC_DIR/$PETSC_ARCH/bin to $PREFIX/bin which then makes SLEPc configure happy. Here are the offending outputs. SLEPc configure:= vijaysm at tachyon ~/code/slepc (master) > PETSC_DIR=/usr/software/petsc/dev/ubuntu_standalone_dbg PETSC_ARCH="" ./configure --prefix=/usr/software/slepc/dev/ubuntu_standalone_dbg --with-arpack=1 --with-arpack-dir=/usr/software/arpack/lib --with-arpack-flags="-lparpack_ubuntu_x86_64 -larpack_ubuntu_x86_64" Checking environment... Checking PETSc installation... Checking ARPACK library... Checking LAPACK library... Traceback (most recent call last): File "./configure", line 10, in execfile(os.path.join(os.path.dirname(__file__), 'config', 'configure.py')) File "./config/configure.py", line 427, in generatefortranstubs.main(slepcdir,petscconf.BFORT,os.getcwd(),0) File "/home/vijaysm/code/slepc/bin/maint/generatefortranstubs.py", line 208, in main os.path.walk(dir, processDir, [petscdir, bfort,verbose]) File "/usr/lib/python2.7/posixpath.py", line 246, in walk walk(name, func, arg) File "/usr/lib/python2.7/posixpath.py", line 238, in walk func(arg, top, names) File "/home/vijaysm/code/slepc/bin/maint/generatefortranstubs.py", line 165, in processDir raise RuntimeError('Error running bfort\n'+cmd+'\n'+output) RuntimeError: Error running bfort cd /home/vijaysm/code/slepc/include; BFORT_CONFIG_PATH=/home/vijaysm/code/slepc/lib/slepc-conf /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/bfort -dir /home/vijaysm/code/slepc/include/ftn-auto -mnative -ansi -nomsgs -noprofile -anyname -mapptr -mpi -mpi2 -ferr -ptrprefix Petsc -ptr64 PETSC_USE_POINTER_CONVERSION -fcaps PETSC_HAVE_FORTRAN_CAPS -fuscore PETSC_HAVE_FORTRAN_UNDERSCORE -f90mod_skip_header -f90modfile f90module.f90 slepcsc.h slepcsvd.h slepcmfn.h slepcpep.h slepcbv.h slepcst.h slepcsys.h slepc.h slepceps.h slepcblaslapack.h slepcnep.h slepcmath.h slepcversion.h slepcvec.h slepcrg.h slepcds.h slepcfn.h slepcrgtypes.h sh: 1: /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/bfort: not found vijaysm at tachyon ~/code/slepc (master) > ls /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/ petsc-mpiexec.uni petsc-pythonscripts vijaysm at tachyon ~/code/slepc (master) > ls /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/petsc-pythonscripts/ PetscBinaryIO.py PetscBinaryIO_tests.py petsc_conf.py petsc_gen_xdmf.py petsclogformat.py petscnagupgrade.py petscnagupgrade.pyc Again, let me know if you need any of the log files for either PETSc or SLEPc. Thanks, Vijay On Wed, Jan 28, 2015 at 10:30 PM, Vijay S. Mahadevan wrote: >> BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master > > Thanks Barry, I'll take a look at it. Will be spending time next > couple of weeks on DMMoab to add some geometric multigrid hooks and > more examples. > > Vijay > > On Wed, Jan 28, 2015 at 9:29 PM, Barry Smith wrote: >> Fixed in master and next. Thanks for reporting it. >> >> Barry >> >> BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master >> >>> On Jan 28, 2015, at 7:39 PM, Vijay S. Mahadevan wrote: >>> >>> With the current master, when using a prefix, configuration fails with >>> the following error message. I've not attached configure.log since its >>> around 7MB (but definitely can send that if that helps further >>> deciphering the issue). The problem here seems to be that >>> $PREFIX/include is not created (while $PREFIX/lib is created >>> explicitly with mkdir -p). If I manually create $PREFIX/include and >>> rerun configure, everything proceeds fine. Minor annoyance. >>> >>> I am not sure whether I just pulled in between merges though. My >>> latest hash: c04667f413dc6e46059f28faddb2b19f70ad4cfd. >>> >>> Command: >>> ./configure --CFLAGS="-O2 -mtune=generic" >>> --CPPFLAGS=-I/usr/software/metis-5.1.0/include --CXXFLAGS="-O2 >>> -mtune=generic" --FFLAGS="-O2 -mtune=generic" >>> --LDFLAGS="-L/usr/software/moab/dev/optimized/lib >>> -L/usr/software/pnetcdf-1.3.1/lib -L/usr/software/zoltan-3.6/lib >>> -L/usr/software/ptscotch-6.0/lib -L/usr/software/parmetis-4.0.3/lib >>> -L/usr/software/metis-5.1.0/lib" --LIBS="-lpnetcdf -lparmetis -lmetis >>> -lm" --download-hypre=yes --download-mumps=yes >>> --download-scalapack=yes --download-suitesparse=yes >>> --prefix=/usr/software/petsc/dev/ubuntu_standalone_opt >>> --with-blas-lapack-dir=/usr >>> --with-boost-dir=/usr/software/boost/current --with-clanguage=C++ >>> --with-cmake=/usr/software/cmake/bin/cmake --with-cuda=0 >>> --with-debugging=0 --with-fortran-interfaces=1 >>> --with-fortran-kernels=1 --with-fortran=1 >>> --with-hdf5-dir=/usr/software/hdf5-1.8.11 >>> --with-metis-dir=/usr/software/metis-5.1.0 >>> --with-moab-include=/usr/software/moab/dev/optimized/include >>> --with-moab-lib="-lMOAB -liMesh -lmbcoupler -lzoltan -lptscotch >>> -lptscotcherr -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit >>> -lz -lm " --with-mpi-dir=/usr/software/mpich-3.0.4 >>> --with-netcdf-dir=/usr/software/netcdf-4.3.0 --with-openmp=0 >>> --with-parmetis-dir=/usr/software/parmetis-4.0.3 --with-pic=1 >>> --with-ptscotch-include=/usr/software/ptscotch-6.0/include >>> --with-ptscotch-lib="-lptesmumps -lptscotch -lptscotcherr >>> -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit -lz -lm" >>> --with-shared-libraries=1 PETSC_ARCH=ubuntu_standalone_opt >>> >>> Error: >>> ******************************************************************************* >>> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log >>> for details): >>> ------------------------------------------------------------------------------- >>> Error running make on MUMPS: Could not execute "mkdir -p >>> /usr/software/petsc/dev/ubuntu_standalone_opt/lib && cd >>> /home/vijaysm/code/petsc/ubuntu_standalone_opt/externalpackages/MUMPS >>> && cp -f lib/*.* /usr/software/petsc/dev/ubuntu_standalone_opt/lib/. >>> && cp -f include/*.* >>> /usr/software/petsc/dev/ubuntu_standalone_opt/include/.": >>> cp: target '/usr/software/petsc/dev/ubuntu_standalone_opt/include/.' >>> is not a directory >>> ******************************************************************************* >>> >>> Vijay >> From bsmith at mcs.anl.gov Thu Jan 29 20:01:39 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Thu, 29 Jan 2015 20:01:39 -0600 Subject: [petsc-users] Need to create $PREFIX/include explicitly In-Reply-To: References: <97704C52-C7D2-4F3F-84C4-EA16DC9183A4@mcs.anl.gov> Message-ID: <8FC388CD-078C-4902-B118-603160705D54@mcs.anl.gov> Hmm, this is because I intentionally turned off the installation of the sowing tools when installing PETSc; I didn't think of SLEPc using them. End users who do not get the source code from the repository get a tarball with the Fortran already built hence they do not need the sowing tools. I guess we should install them. Barry > On Jan 29, 2015, at 7:10 PM, Vijay S. Mahadevan wrote: > > Found another related issue although not directly affected when > working with PETSc alone. I can created a new thread for this if > needed. > > When configuring SLEPc with an installed version of PETSc, the > operation fails due to not finding bfort. The issue seems to be that > for some reason, PETSc failed to install the bin files that are > clearly present in the source configuration i.e., they are under > $PETSC_DIR/$PETSC_ARCH/bin but not in $PREFIX/bin. I can rectify this > by manually copying the executables in $PETSC_DIR/$PETSC_ARCH/bin to > $PREFIX/bin which then makes SLEPc configure happy. > > Here are the offending outputs. > > SLEPc configure:= > vijaysm at tachyon ~/code/slepc (master) > > PETSC_DIR=/usr/software/petsc/dev/ubuntu_standalone_dbg PETSC_ARCH="" > ./configure --prefix=/usr/software/slepc/dev/ubuntu_standalone_dbg > --with-arpack=1 --with-arpack-dir=/usr/software/arpack/lib > --with-arpack-flags="-lparpack_ubuntu_x86_64 -larpack_ubuntu_x86_64" > Checking environment... > Checking PETSc installation... > Checking ARPACK library... > Checking LAPACK library... > Traceback (most recent call last): > File "./configure", line 10, in > execfile(os.path.join(os.path.dirname(__file__), 'config', 'configure.py')) > File "./config/configure.py", line 427, in > generatefortranstubs.main(slepcdir,petscconf.BFORT,os.getcwd(),0) > File "/home/vijaysm/code/slepc/bin/maint/generatefortranstubs.py", > line 208, in main > os.path.walk(dir, processDir, [petscdir, bfort,verbose]) > File "/usr/lib/python2.7/posixpath.py", line 246, in walk > walk(name, func, arg) > File "/usr/lib/python2.7/posixpath.py", line 238, in walk > func(arg, top, names) > File "/home/vijaysm/code/slepc/bin/maint/generatefortranstubs.py", > line 165, in processDir > raise RuntimeError('Error running bfort\n'+cmd+'\n'+output) > RuntimeError: Error running bfort > cd /home/vijaysm/code/slepc/include; > BFORT_CONFIG_PATH=/home/vijaysm/code/slepc/lib/slepc-conf > /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/bfort -dir > /home/vijaysm/code/slepc/include/ftn-auto -mnative -ansi -nomsgs > -noprofile -anyname -mapptr -mpi -mpi2 -ferr -ptrprefix Petsc -ptr64 > PETSC_USE_POINTER_CONVERSION -fcaps PETSC_HAVE_FORTRAN_CAPS -fuscore > PETSC_HAVE_FORTRAN_UNDERSCORE -f90mod_skip_header -f90modfile > f90module.f90 slepcsc.h slepcsvd.h slepcmfn.h slepcpep.h slepcbv.h > slepcst.h slepcsys.h slepc.h slepceps.h slepcblaslapack.h slepcnep.h > slepcmath.h slepcversion.h slepcvec.h slepcrg.h slepcds.h slepcfn.h > slepcrgtypes.h > sh: 1: /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/bfort: not found > > vijaysm at tachyon ~/code/slepc (master) > ls > /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/ > petsc-mpiexec.uni petsc-pythonscripts > > vijaysm at tachyon ~/code/slepc (master) > ls > /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/petsc-pythonscripts/ > PetscBinaryIO.py PetscBinaryIO_tests.py petsc_conf.py > petsc_gen_xdmf.py petsclogformat.py petscnagupgrade.py > petscnagupgrade.pyc > > Again, let me know if you need any of the log files for either PETSc > or SLEPc. Thanks, > > Vijay > > On Wed, Jan 28, 2015 at 10:30 PM, Vijay S. Mahadevan wrote: >>> BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master >> >> Thanks Barry, I'll take a look at it. Will be spending time next >> couple of weeks on DMMoab to add some geometric multigrid hooks and >> more examples. >> >> Vijay >> >> On Wed, Jan 28, 2015 at 9:29 PM, Barry Smith wrote: >>> Fixed in master and next. Thanks for reporting it. >>> >>> Barry >>> >>> BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master >>> >>>> On Jan 28, 2015, at 7:39 PM, Vijay S. Mahadevan wrote: >>>> >>>> With the current master, when using a prefix, configuration fails with >>>> the following error message. I've not attached configure.log since its >>>> around 7MB (but definitely can send that if that helps further >>>> deciphering the issue). The problem here seems to be that >>>> $PREFIX/include is not created (while $PREFIX/lib is created >>>> explicitly with mkdir -p). If I manually create $PREFIX/include and >>>> rerun configure, everything proceeds fine. Minor annoyance. >>>> >>>> I am not sure whether I just pulled in between merges though. My >>>> latest hash: c04667f413dc6e46059f28faddb2b19f70ad4cfd. >>>> >>>> Command: >>>> ./configure --CFLAGS="-O2 -mtune=generic" >>>> --CPPFLAGS=-I/usr/software/metis-5.1.0/include --CXXFLAGS="-O2 >>>> -mtune=generic" --FFLAGS="-O2 -mtune=generic" >>>> --LDFLAGS="-L/usr/software/moab/dev/optimized/lib >>>> -L/usr/software/pnetcdf-1.3.1/lib -L/usr/software/zoltan-3.6/lib >>>> -L/usr/software/ptscotch-6.0/lib -L/usr/software/parmetis-4.0.3/lib >>>> -L/usr/software/metis-5.1.0/lib" --LIBS="-lpnetcdf -lparmetis -lmetis >>>> -lm" --download-hypre=yes --download-mumps=yes >>>> --download-scalapack=yes --download-suitesparse=yes >>>> --prefix=/usr/software/petsc/dev/ubuntu_standalone_opt >>>> --with-blas-lapack-dir=/usr >>>> --with-boost-dir=/usr/software/boost/current --with-clanguage=C++ >>>> --with-cmake=/usr/software/cmake/bin/cmake --with-cuda=0 >>>> --with-debugging=0 --with-fortran-interfaces=1 >>>> --with-fortran-kernels=1 --with-fortran=1 >>>> --with-hdf5-dir=/usr/software/hdf5-1.8.11 >>>> --with-metis-dir=/usr/software/metis-5.1.0 >>>> --with-moab-include=/usr/software/moab/dev/optimized/include >>>> --with-moab-lib="-lMOAB -liMesh -lmbcoupler -lzoltan -lptscotch >>>> -lptscotcherr -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit >>>> -lz -lm " --with-mpi-dir=/usr/software/mpich-3.0.4 >>>> --with-netcdf-dir=/usr/software/netcdf-4.3.0 --with-openmp=0 >>>> --with-parmetis-dir=/usr/software/parmetis-4.0.3 --with-pic=1 >>>> --with-ptscotch-include=/usr/software/ptscotch-6.0/include >>>> --with-ptscotch-lib="-lptesmumps -lptscotch -lptscotcherr >>>> -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit -lz -lm" >>>> --with-shared-libraries=1 PETSC_ARCH=ubuntu_standalone_opt >>>> >>>> Error: >>>> ******************************************************************************* >>>> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log >>>> for details): >>>> ------------------------------------------------------------------------------- >>>> Error running make on MUMPS: Could not execute "mkdir -p >>>> /usr/software/petsc/dev/ubuntu_standalone_opt/lib && cd >>>> /home/vijaysm/code/petsc/ubuntu_standalone_opt/externalpackages/MUMPS >>>> && cp -f lib/*.* /usr/software/petsc/dev/ubuntu_standalone_opt/lib/. >>>> && cp -f include/*.* >>>> /usr/software/petsc/dev/ubuntu_standalone_opt/include/.": >>>> cp: target '/usr/software/petsc/dev/ubuntu_standalone_opt/include/.' >>>> is not a directory >>>> ******************************************************************************* >>>> >>>> Vijay >>> From vijay.m at gmail.com Thu Jan 29 21:12:13 2015 From: vijay.m at gmail.com (Vijay S. Mahadevan) Date: Thu, 29 Jan 2015 21:12:13 -0600 Subject: [petsc-users] Need to create $PREFIX/include explicitly In-Reply-To: <8FC388CD-078C-4902-B118-603160705D54@mcs.anl.gov> References: <97704C52-C7D2-4F3F-84C4-EA16DC9183A4@mcs.anl.gov> <8FC388CD-078C-4902-B118-603160705D54@mcs.anl.gov> Message-ID: > Hmm, this is because I intentionally turned off the installation of the sowing tools when installing PETSc; I didn't think of SLEPc using them. Yes, that would be the culprit. The installation can possibly be avoided if SLEPc also downloads Sowing wherein this particular dependency on PETSc can be decoupled. Not sure whether that fits SLEPc's workflow though. > End users who do not get the source code from the repository get a tarball with the Fortran already built hence they do not need the sowing tools. It will be an issue for cases where a user installs PETSc source from tarball and uses SLEPc source from repo only to find bfort not available in the path. Perhaps this combination is already discouraged ? Vijay On Thu, Jan 29, 2015 at 8:01 PM, Barry Smith wrote: > > Hmm, this is because I intentionally turned off the installation of the sowing tools when installing PETSc; I didn't think of SLEPc using them. > > End users who do not get the source code from the repository get a tarball with the Fortran already built hence they do not need the sowing tools. > > I guess we should install them. > > Barry > >> On Jan 29, 2015, at 7:10 PM, Vijay S. Mahadevan wrote: >> >> Found another related issue although not directly affected when >> working with PETSc alone. I can created a new thread for this if >> needed. >> >> When configuring SLEPc with an installed version of PETSc, the >> operation fails due to not finding bfort. The issue seems to be that >> for some reason, PETSc failed to install the bin files that are >> clearly present in the source configuration i.e., they are under >> $PETSC_DIR/$PETSC_ARCH/bin but not in $PREFIX/bin. I can rectify this >> by manually copying the executables in $PETSC_DIR/$PETSC_ARCH/bin to >> $PREFIX/bin which then makes SLEPc configure happy. >> >> Here are the offending outputs. >> >> SLEPc configure:= >> vijaysm at tachyon ~/code/slepc (master) > >> PETSC_DIR=/usr/software/petsc/dev/ubuntu_standalone_dbg PETSC_ARCH="" >> ./configure --prefix=/usr/software/slepc/dev/ubuntu_standalone_dbg >> --with-arpack=1 --with-arpack-dir=/usr/software/arpack/lib >> --with-arpack-flags="-lparpack_ubuntu_x86_64 -larpack_ubuntu_x86_64" >> Checking environment... >> Checking PETSc installation... >> Checking ARPACK library... >> Checking LAPACK library... >> Traceback (most recent call last): >> File "./configure", line 10, in >> execfile(os.path.join(os.path.dirname(__file__), 'config', 'configure.py')) >> File "./config/configure.py", line 427, in >> generatefortranstubs.main(slepcdir,petscconf.BFORT,os.getcwd(),0) >> File "/home/vijaysm/code/slepc/bin/maint/generatefortranstubs.py", >> line 208, in main >> os.path.walk(dir, processDir, [petscdir, bfort,verbose]) >> File "/usr/lib/python2.7/posixpath.py", line 246, in walk >> walk(name, func, arg) >> File "/usr/lib/python2.7/posixpath.py", line 238, in walk >> func(arg, top, names) >> File "/home/vijaysm/code/slepc/bin/maint/generatefortranstubs.py", >> line 165, in processDir >> raise RuntimeError('Error running bfort\n'+cmd+'\n'+output) >> RuntimeError: Error running bfort >> cd /home/vijaysm/code/slepc/include; >> BFORT_CONFIG_PATH=/home/vijaysm/code/slepc/lib/slepc-conf >> /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/bfort -dir >> /home/vijaysm/code/slepc/include/ftn-auto -mnative -ansi -nomsgs >> -noprofile -anyname -mapptr -mpi -mpi2 -ferr -ptrprefix Petsc -ptr64 >> PETSC_USE_POINTER_CONVERSION -fcaps PETSC_HAVE_FORTRAN_CAPS -fuscore >> PETSC_HAVE_FORTRAN_UNDERSCORE -f90mod_skip_header -f90modfile >> f90module.f90 slepcsc.h slepcsvd.h slepcmfn.h slepcpep.h slepcbv.h >> slepcst.h slepcsys.h slepc.h slepceps.h slepcblaslapack.h slepcnep.h >> slepcmath.h slepcversion.h slepcvec.h slepcrg.h slepcds.h slepcfn.h >> slepcrgtypes.h >> sh: 1: /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/bfort: not found >> >> vijaysm at tachyon ~/code/slepc (master) > ls >> /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/ >> petsc-mpiexec.uni petsc-pythonscripts >> >> vijaysm at tachyon ~/code/slepc (master) > ls >> /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/petsc-pythonscripts/ >> PetscBinaryIO.py PetscBinaryIO_tests.py petsc_conf.py >> petsc_gen_xdmf.py petsclogformat.py petscnagupgrade.py >> petscnagupgrade.pyc >> >> Again, let me know if you need any of the log files for either PETSc >> or SLEPc. Thanks, >> >> Vijay >> >> On Wed, Jan 28, 2015 at 10:30 PM, Vijay S. Mahadevan wrote: >>>> BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master >>> >>> Thanks Barry, I'll take a look at it. Will be spending time next >>> couple of weeks on DMMoab to add some geometric multigrid hooks and >>> more examples. >>> >>> Vijay >>> >>> On Wed, Jan 28, 2015 at 9:29 PM, Barry Smith wrote: >>>> Fixed in master and next. Thanks for reporting it. >>>> >>>> Barry >>>> >>>> BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master >>>> >>>>> On Jan 28, 2015, at 7:39 PM, Vijay S. Mahadevan wrote: >>>>> >>>>> With the current master, when using a prefix, configuration fails with >>>>> the following error message. I've not attached configure.log since its >>>>> around 7MB (but definitely can send that if that helps further >>>>> deciphering the issue). The problem here seems to be that >>>>> $PREFIX/include is not created (while $PREFIX/lib is created >>>>> explicitly with mkdir -p). If I manually create $PREFIX/include and >>>>> rerun configure, everything proceeds fine. Minor annoyance. >>>>> >>>>> I am not sure whether I just pulled in between merges though. My >>>>> latest hash: c04667f413dc6e46059f28faddb2b19f70ad4cfd. >>>>> >>>>> Command: >>>>> ./configure --CFLAGS="-O2 -mtune=generic" >>>>> --CPPFLAGS=-I/usr/software/metis-5.1.0/include --CXXFLAGS="-O2 >>>>> -mtune=generic" --FFLAGS="-O2 -mtune=generic" >>>>> --LDFLAGS="-L/usr/software/moab/dev/optimized/lib >>>>> -L/usr/software/pnetcdf-1.3.1/lib -L/usr/software/zoltan-3.6/lib >>>>> -L/usr/software/ptscotch-6.0/lib -L/usr/software/parmetis-4.0.3/lib >>>>> -L/usr/software/metis-5.1.0/lib" --LIBS="-lpnetcdf -lparmetis -lmetis >>>>> -lm" --download-hypre=yes --download-mumps=yes >>>>> --download-scalapack=yes --download-suitesparse=yes >>>>> --prefix=/usr/software/petsc/dev/ubuntu_standalone_opt >>>>> --with-blas-lapack-dir=/usr >>>>> --with-boost-dir=/usr/software/boost/current --with-clanguage=C++ >>>>> --with-cmake=/usr/software/cmake/bin/cmake --with-cuda=0 >>>>> --with-debugging=0 --with-fortran-interfaces=1 >>>>> --with-fortran-kernels=1 --with-fortran=1 >>>>> --with-hdf5-dir=/usr/software/hdf5-1.8.11 >>>>> --with-metis-dir=/usr/software/metis-5.1.0 >>>>> --with-moab-include=/usr/software/moab/dev/optimized/include >>>>> --with-moab-lib="-lMOAB -liMesh -lmbcoupler -lzoltan -lptscotch >>>>> -lptscotcherr -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit >>>>> -lz -lm " --with-mpi-dir=/usr/software/mpich-3.0.4 >>>>> --with-netcdf-dir=/usr/software/netcdf-4.3.0 --with-openmp=0 >>>>> --with-parmetis-dir=/usr/software/parmetis-4.0.3 --with-pic=1 >>>>> --with-ptscotch-include=/usr/software/ptscotch-6.0/include >>>>> --with-ptscotch-lib="-lptesmumps -lptscotch -lptscotcherr >>>>> -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit -lz -lm" >>>>> --with-shared-libraries=1 PETSC_ARCH=ubuntu_standalone_opt >>>>> >>>>> Error: >>>>> ******************************************************************************* >>>>> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log >>>>> for details): >>>>> ------------------------------------------------------------------------------- >>>>> Error running make on MUMPS: Could not execute "mkdir -p >>>>> /usr/software/petsc/dev/ubuntu_standalone_opt/lib && cd >>>>> /home/vijaysm/code/petsc/ubuntu_standalone_opt/externalpackages/MUMPS >>>>> && cp -f lib/*.* /usr/software/petsc/dev/ubuntu_standalone_opt/lib/. >>>>> && cp -f include/*.* >>>>> /usr/software/petsc/dev/ubuntu_standalone_opt/include/.": >>>>> cp: target '/usr/software/petsc/dev/ubuntu_standalone_opt/include/.' >>>>> is not a directory >>>>> ******************************************************************************* >>>>> >>>>> Vijay >>>> > From thronesf at gmail.com Thu Jan 29 21:26:21 2015 From: thronesf at gmail.com (Sharp Stone) Date: Thu, 29 Jan 2015 22:26:21 -0500 Subject: [petsc-users] Samrai's interface to Petsc In-Reply-To: References: Message-ID: Matt, Thank you very much for your reply. It's an exciting news for Petsc to support AMR solvers, and I believe folks will also look forward to hearing from you. Thanks! Best, On Thu, Jan 29, 2015 at 11:49 AM, Matthew Knepley wrote: > On Mon, Jan 26, 2015 at 2:50 PM, Sharp Stone wrote: > >> Hi folks, >> >> I'm doing the simulations with Petsc. Now we want to turn to the samrai >> to the current Petsc code. However, there are few resources, and someone >> says the samrai's interface to the current Petsc 3.5.2 has been out of date >> and might not be supported. Is this true? Otherwise, are there any >> resources or manuals that could instruct us to integrate the Petsc with >> samrai? >> > > Here is my current understanding, but someone correct me if this is > out-of-date. SAMRAI does not have the people to track > the PETSc interface, so they cannot use the last several releases. We are > currently planning better support for AMR solvers, > and have sent in proposals. We will give a thorough overview and > development plan once we hear about those. > > Thanks, > > Matt > > >> Thank you in advance! >> >> -- >> Best regards, >> >> Feng >> > > > > -- > 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 > -- Best regards, Feng -------------- next part -------------- An HTML attachment was scrubbed... URL: From siddhesh4godbole at gmail.com Fri Jan 30 00:14:00 2015 From: siddhesh4godbole at gmail.com (siddhesh godbole) Date: Fri, 30 Jan 2015 11:44:00 +0530 Subject: [petsc-users] how to import an array from matlab? In-Reply-To: <73303A2A-0D0E-405C-80E4-575BBF2E1988@mcs.anl.gov> References: <83BBC792-FB0E-4789-A82B-C21FAD3B8613@mcs.anl.gov> <73303A2A-0D0E-405C-80E4-575BBF2E1988@mcs.anl.gov> Message-ID: hello, i am sorry this may be a very silly question but kindly help me. i want read an array of 10000 scalars from /home/Desktop/project/psi.mat to petsc. i have called the following routines: ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD,"psi.mat",FILE_MODE_READ,&fd);CHKERRQ(ierr); PetscViewerBinaryGetDescriptor(fd,&REV); PetscBinaryRead(REV,trial,10000,PETSC_SCALAR); 1) are these routines enough? 2) how do i give path during runtime while executing the program? *Siddhesh M Godbole* 5th year Dual Degree, Civil Eng & Applied Mech. IIT Madras On Wed, Jan 28, 2015 at 6:59 PM, Barry Smith wrote: > > You probably want to stick to just using binary files to move the data > between PETSc and MATLAB and not use sockets. > > But if you want to use sockets the reason you get the error message is > that you haven't called PetscBinaryWrite(5005) (or PetscBinaryRead(5005)) > or PetscOpenSocket(5005) BEFORE running the PETSc program to receive the > results. > > Barry > > > > On Jan 27, 2015, at 11:33 PM, siddhesh godbole < > siddhesh4godbole at gmail.com> wrote: > > > > Hello, > > > > I have been trying to use the functions PetscSocketOpen but it gets > stuck in this function shooting the following error > > > > [0]PETSC ERROR: --------------------- Error Message > -------------------------------------------------------------- > > [0]PETSC ERROR: Error in system call > > [0]PETSC ERROR: Connection refused by remote host renoir port 5005 > > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html > for trouble shooting. > > [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 > > [0]PETSC ERROR: ./10D on a arch-linux2-c-debug named renoir by hridya > Wed Jan 28 10:45:49 2015 > > [0]PETSC ERROR: Configure options --download-mpich > > [0]PETSC ERROR: #1 PetscOpenSocket() line 133 in > /home/hridya/Downloads/petsc-3.5.2/src/sys/classes/viewer/impls/socket/send.c > > [0]PETSC ERROR: #2 PetscViewerSocketSetConnection() line 400 in > /home/hridya/Downloads/petsc-3.5.2/src/sys/classes/viewer/impls/socket/send.c > > [0]PETSC ERROR: #3 PetscViewerSocketOpen() line 289 in > /home/hridya/Downloads/petsc-3.5.2/src/sys/classes/viewer/impls/socket/send.c > > > > i am using this for the first time. Please help ! > > > > Thanks a lot > > > > > > Siddhesh M Godbole > > > > 5th year Dual Degree, > > Civil Eng & Applied Mech. > > IIT Madras > > > > On Tue, Jan 27, 2015 at 6:54 PM, Barry Smith wrote: > > > > Use PetscBinaryWrite.m from MATLAB (documentation at the top of the > file) to save the array into a file then in PETSc use VecLoad() to load the > matrix. PetscBinaryWrite.m is in $PETSC_DIR/bin/matlab or > $PETSC_DIR/share/petsc/matlab depending on your version of PETSc. > > > > Barry > > > > > > > > > On Jan 27, 2015, at 1:52 AM, siddhesh godbole < > siddhesh4godbole at gmail.com> wrote: > > > > > > Hello, > > > i am trying to import an array of 10000 elements into petsc. > interfacing fails when i try to use launch('./mycode',np,opt) in my matlab > due to some incompatibility. Then i tried importing .mat file into petsc > and i got stuck. > > > Can you please tell me how can i import an array from matlab into > petsc and use it for my calculations? > > > Thanks in advance! > > > > > > Siddhesh M Godbole > > > > > > 5th year Dual Degree, > > > Civil Eng & Applied Mech. > > > IIT Madras > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From siddhesh4godbole at gmail.com Fri Jan 30 01:12:48 2015 From: siddhesh4godbole at gmail.com (siddhesh godbole) Date: Fri, 30 Jan 2015 12:42:48 +0530 Subject: [petsc-users] importing .mat to petsc Message-ID: hello, i tried importing matlab file containing 10000 scalars to petsc. *[0]PETSC ERROR: Read from file failed[0]PETSC ERROR: Error reading from file, errno 9[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.[0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 [0]PETSC ERROR: ./10D on a arch-linux2-c-debug named renoir by hridya Fri Jan 30 12:32:52 2015[0]PETSC ERROR: Configure options --download-mpich[0]PETSC ERROR: #1 PetscBinaryRead() line 275 in /home/hridya/Downloads/petsc-3.5.2/src/sys/fileio/sysio.c* i dont understand why should it not import the file. Please help! just in case for reference i have used following routines; * ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD,"psi.mat",FILE_MODE_READ,&fd);CHKERRQ(ierr); PetscViewerBinaryGetDescriptor(fd,&REV); PetscBinaryRead(REV,trial,trial,PETSC_SCALAR);* *Siddhesh M Godbole* 5th year Dual Degree, Civil Eng & Applied Mech. IIT Madras -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.mayhem23 at gmail.com Fri Jan 30 02:06:11 2015 From: dave.mayhem23 at gmail.com (Dave May) Date: Fri, 30 Jan 2015 09:06:11 +0100 Subject: [petsc-users] Is PetscViewerBinary special? Message-ID: Hello, I've noticed the create function PetscViewerCreate_Binary() doesn't appear to be using the options prefix attached to the PetscViewer. Specifically, I see on line 1276 of petsc-3.5.2/src/sys/classes/viewer/impls/binary/binv.c the following ierr = PetscOptionsGetBool(NULL,"-viewer_binary_mpiio",&useMPIIO,NULL);CHKERRQ(ierr); Is this an oversight or something intentional? Are PetscViewers in general behaving such that they cannot be configured independently of each other if PetscViewerSetOptionsPrefix() and PetscViewerSetFromOptions() are called? Cheers Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From rupp at iue.tuwien.ac.at Fri Jan 30 02:58:23 2015 From: rupp at iue.tuwien.ac.at (Karl Rupp) Date: Fri, 30 Jan 2015 09:58:23 +0100 Subject: [petsc-users] how to import an array from matlab? In-Reply-To: References: <83BBC792-FB0E-4789-A82B-C21FAD3B8613@mcs.anl.gov> <73303A2A-0D0E-405C-80E4-575BBF2E1988@mcs.anl.gov> Message-ID: <54CB47AF.9010700@iue.tuwien.ac.at> Hi, > i want read an array of 10000 scalars from > /home/Desktop/project/psi.mat to petsc. i have called the following > routines: > > ierr = > PetscViewerBinaryOpen(PETSC_COMM_WORLD,"psi.mat",FILE_MODE_READ,&fd);CHKERRQ(ierr); > PetscViewerBinaryGetDescriptor(fd,&REV); > PetscBinaryRead(REV,trial,10000,PETSC_SCALAR); I recommend a) replacing "psi.mat" with "/home/Desktop/project/psi.mat" b) checking the error codes of PetscViewerBinaryGetDescriptor() and PetscBinaryRead() by using ierr and CHKERRQ(ierr); To provide the filename at runtime, simply pass the appropriate string instead of a hard-coded string to PetscViewerBinaryOpen(). This is a basic C and you can find enough tutorials on the internet on how to use e.g. command line parameters. Best regards, Karli From jroman at dsic.upv.es Fri Jan 30 03:24:33 2015 From: jroman at dsic.upv.es (Jose E. Roman) Date: Fri, 30 Jan 2015 10:24:33 +0100 Subject: [petsc-users] Need to create $PREFIX/include explicitly In-Reply-To: References: <97704C52-C7D2-4F3F-84C4-EA16DC9183A4@mcs.anl.gov> <8FC388CD-078C-4902-B118-603160705D54@mcs.anl.gov> Message-ID: <93F3BE1C-EC56-4D0B-842C-7EA36FD2B1C8@dsic.upv.es> The easiest thing for SLEPc would be that PETSc installs Sowing binaries, as was done a few weeks ago. But, as you suggest, maybe it makes more sense that SLEPc is capable of downloading Sowing itself. I will have a look at it in the next days. Jose El 30/01/2015, a las 04:12, Vijay S. Mahadevan escribi?: >> Hmm, this is because I intentionally turned off the installation of the sowing tools when installing PETSc; I didn't think of SLEPc using them. > > Yes, that would be the culprit. The installation can possibly be > avoided if SLEPc also downloads Sowing wherein this particular > dependency on PETSc can be decoupled. Not sure whether that fits > SLEPc's workflow though. > >> End users who do not get the source code from the repository get a tarball with the Fortran already built hence they do not need the sowing tools. > > It will be an issue for cases where a user installs PETSc source from > tarball and uses SLEPc source from repo only to find bfort not > available in the path. Perhaps this combination is already discouraged > ? > > Vijay > > On Thu, Jan 29, 2015 at 8:01 PM, Barry Smith wrote: >> >> Hmm, this is because I intentionally turned off the installation of the sowing tools when installing PETSc; I didn't think of SLEPc using them. >> >> End users who do not get the source code from the repository get a tarball with the Fortran already built hence they do not need the sowing tools. >> >> I guess we should install them. >> >> Barry >> >>> On Jan 29, 2015, at 7:10 PM, Vijay S. Mahadevan wrote: >>> >>> Found another related issue although not directly affected when >>> working with PETSc alone. I can created a new thread for this if >>> needed. >>> >>> When configuring SLEPc with an installed version of PETSc, the >>> operation fails due to not finding bfort. The issue seems to be that >>> for some reason, PETSc failed to install the bin files that are >>> clearly present in the source configuration i.e., they are under >>> $PETSC_DIR/$PETSC_ARCH/bin but not in $PREFIX/bin. I can rectify this >>> by manually copying the executables in $PETSC_DIR/$PETSC_ARCH/bin to >>> $PREFIX/bin which then makes SLEPc configure happy. >>> >>> Here are the offending outputs. >>> >>> SLEPc configure:= >>> vijaysm at tachyon ~/code/slepc (master) > >>> PETSC_DIR=/usr/software/petsc/dev/ubuntu_standalone_dbg PETSC_ARCH="" >>> ./configure --prefix=/usr/software/slepc/dev/ubuntu_standalone_dbg >>> --with-arpack=1 --with-arpack-dir=/usr/software/arpack/lib >>> --with-arpack-flags="-lparpack_ubuntu_x86_64 -larpack_ubuntu_x86_64" >>> Checking environment... >>> Checking PETSc installation... >>> Checking ARPACK library... >>> Checking LAPACK library... >>> Traceback (most recent call last): >>> File "./configure", line 10, in >>> execfile(os.path.join(os.path.dirname(__file__), 'config', 'configure.py')) >>> File "./config/configure.py", line 427, in >>> generatefortranstubs.main(slepcdir,petscconf.BFORT,os.getcwd(),0) >>> File "/home/vijaysm/code/slepc/bin/maint/generatefortranstubs.py", >>> line 208, in main >>> os.path.walk(dir, processDir, [petscdir, bfort,verbose]) >>> File "/usr/lib/python2.7/posixpath.py", line 246, in walk >>> walk(name, func, arg) >>> File "/usr/lib/python2.7/posixpath.py", line 238, in walk >>> func(arg, top, names) >>> File "/home/vijaysm/code/slepc/bin/maint/generatefortranstubs.py", >>> line 165, in processDir >>> raise RuntimeError('Error running bfort\n'+cmd+'\n'+output) >>> RuntimeError: Error running bfort >>> cd /home/vijaysm/code/slepc/include; >>> BFORT_CONFIG_PATH=/home/vijaysm/code/slepc/lib/slepc-conf >>> /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/bfort -dir >>> /home/vijaysm/code/slepc/include/ftn-auto -mnative -ansi -nomsgs >>> -noprofile -anyname -mapptr -mpi -mpi2 -ferr -ptrprefix Petsc -ptr64 >>> PETSC_USE_POINTER_CONVERSION -fcaps PETSC_HAVE_FORTRAN_CAPS -fuscore >>> PETSC_HAVE_FORTRAN_UNDERSCORE -f90mod_skip_header -f90modfile >>> f90module.f90 slepcsc.h slepcsvd.h slepcmfn.h slepcpep.h slepcbv.h >>> slepcst.h slepcsys.h slepc.h slepceps.h slepcblaslapack.h slepcnep.h >>> slepcmath.h slepcversion.h slepcvec.h slepcrg.h slepcds.h slepcfn.h >>> slepcrgtypes.h >>> sh: 1: /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/bfort: not found >>> >>> vijaysm at tachyon ~/code/slepc (master) > ls >>> /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/ >>> petsc-mpiexec.uni petsc-pythonscripts >>> >>> vijaysm at tachyon ~/code/slepc (master) > ls >>> /usr/software/petsc/dev/ubuntu_standalone_dbg/bin/petsc-pythonscripts/ >>> PetscBinaryIO.py PetscBinaryIO_tests.py petsc_conf.py >>> petsc_gen_xdmf.py petsclogformat.py petscnagupgrade.py >>> petscnagupgrade.pyc >>> >>> Again, let me know if you need any of the log files for either PETSc >>> or SLEPc. Thanks, >>> >>> Vijay >>> >>> On Wed, Jan 28, 2015 at 10:30 PM, Vijay S. Mahadevan wrote: >>>>> BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master >>>> >>>> Thanks Barry, I'll take a look at it. Will be spending time next >>>> couple of weeks on DMMoab to add some geometric multigrid hooks and >>>> more examples. >>>> >>>> Vijay >>>> >>>> On Wed, Jan 28, 2015 at 9:29 PM, Barry Smith wrote: >>>>> Fixed in master and next. Thanks for reporting it. >>>>> >>>>> Barry >>>>> >>>>> BTW: I also updated some routines in moab.cxx for changes in how we handle setfromoptions in master >>>>> >>>>>> On Jan 28, 2015, at 7:39 PM, Vijay S. Mahadevan wrote: >>>>>> >>>>>> With the current master, when using a prefix, configuration fails with >>>>>> the following error message. I've not attached configure.log since its >>>>>> around 7MB (but definitely can send that if that helps further >>>>>> deciphering the issue). The problem here seems to be that >>>>>> $PREFIX/include is not created (while $PREFIX/lib is created >>>>>> explicitly with mkdir -p). If I manually create $PREFIX/include and >>>>>> rerun configure, everything proceeds fine. Minor annoyance. >>>>>> >>>>>> I am not sure whether I just pulled in between merges though. My >>>>>> latest hash: c04667f413dc6e46059f28faddb2b19f70ad4cfd. >>>>>> >>>>>> Command: >>>>>> ./configure --CFLAGS="-O2 -mtune=generic" >>>>>> --CPPFLAGS=-I/usr/software/metis-5.1.0/include --CXXFLAGS="-O2 >>>>>> -mtune=generic" --FFLAGS="-O2 -mtune=generic" >>>>>> --LDFLAGS="-L/usr/software/moab/dev/optimized/lib >>>>>> -L/usr/software/pnetcdf-1.3.1/lib -L/usr/software/zoltan-3.6/lib >>>>>> -L/usr/software/ptscotch-6.0/lib -L/usr/software/parmetis-4.0.3/lib >>>>>> -L/usr/software/metis-5.1.0/lib" --LIBS="-lpnetcdf -lparmetis -lmetis >>>>>> -lm" --download-hypre=yes --download-mumps=yes >>>>>> --download-scalapack=yes --download-suitesparse=yes >>>>>> --prefix=/usr/software/petsc/dev/ubuntu_standalone_opt >>>>>> --with-blas-lapack-dir=/usr >>>>>> --with-boost-dir=/usr/software/boost/current --with-clanguage=C++ >>>>>> --with-cmake=/usr/software/cmake/bin/cmake --with-cuda=0 >>>>>> --with-debugging=0 --with-fortran-interfaces=1 >>>>>> --with-fortran-kernels=1 --with-fortran=1 >>>>>> --with-hdf5-dir=/usr/software/hdf5-1.8.11 >>>>>> --with-metis-dir=/usr/software/metis-5.1.0 >>>>>> --with-moab-include=/usr/software/moab/dev/optimized/include >>>>>> --with-moab-lib="-lMOAB -liMesh -lmbcoupler -lzoltan -lptscotch >>>>>> -lptscotcherr -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit >>>>>> -lz -lm " --with-mpi-dir=/usr/software/mpich-3.0.4 >>>>>> --with-netcdf-dir=/usr/software/netcdf-4.3.0 --with-openmp=0 >>>>>> --with-parmetis-dir=/usr/software/parmetis-4.0.3 --with-pic=1 >>>>>> --with-ptscotch-include=/usr/software/ptscotch-6.0/include >>>>>> --with-ptscotch-lib="-lptesmumps -lptscotch -lptscotcherr >>>>>> -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit -lz -lm" >>>>>> --with-shared-libraries=1 PETSC_ARCH=ubuntu_standalone_opt >>>>>> >>>>>> Error: >>>>>> ******************************************************************************* >>>>>> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log >>>>>> for details): >>>>>> ------------------------------------------------------------------------------- >>>>>> Error running make on MUMPS: Could not execute "mkdir -p >>>>>> /usr/software/petsc/dev/ubuntu_standalone_opt/lib && cd >>>>>> /home/vijaysm/code/petsc/ubuntu_standalone_opt/externalpackages/MUMPS >>>>>> && cp -f lib/*.* /usr/software/petsc/dev/ubuntu_standalone_opt/lib/. >>>>>> && cp -f include/*.* >>>>>> /usr/software/petsc/dev/ubuntu_standalone_opt/include/.": >>>>>> cp: target '/usr/software/petsc/dev/ubuntu_standalone_opt/include/.' >>>>>> is not a directory >>>>>> ******************************************************************************* >>>>>> >>>>>> Vijay >>>>> >> From pierre at barbierdereuille.net Fri Jan 30 05:01:15 2015 From: pierre at barbierdereuille.net (Pierre Barbier de Reuille) Date: Fri, 30 Jan 2015 11:01:15 +0000 Subject: [petsc-users] Information about TSAdapt Message-ID: Hello, I have issues with the adaptive time stepping when using theta methods. The time step selected is extremely really small, much smaller than the time step selected by the explicit runge-kutta methods (2 or 3 order of magnitude smaller!). To try understand what is going on, I would like to have information on what is done for the basic adaptive time stepping (which is the one I started using). Also, any help on what is recommended as time-stepping goes would be great. Thanks, -- Dr. Barbier de Reuille, Pierre Institute of Plant Sciences Altenbergrain 21, CH-3013 Bern, Switzerlandhttp://www.botany.unibe.ch/associated/systemsx/index.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From knepley at gmail.com Fri Jan 30 06:56:59 2015 From: knepley at gmail.com (Matthew Knepley) Date: Fri, 30 Jan 2015 06:56:59 -0600 Subject: [petsc-users] Is PetscViewerBinary special? In-Reply-To: References: Message-ID: On Fri, Jan 30, 2015 at 2:06 AM, Dave May wrote: > Hello, > > I've noticed the create function PetscViewerCreate_Binary() doesn't appear > to be using the options prefix attached to the PetscViewer. > Specifically, I see on line 1276 of > petsc-3.5.2/src/sys/classes/viewer/impls/binary/binv.c > the following > ierr = > PetscOptionsGetBool(NULL,"-viewer_binary_mpiio",&useMPIIO,NULL);CHKERRQ(ierr); > > Is this an oversight or something intentional? > This is an oversight. Matt > Are PetscViewers in general behaving such that they cannot be configured > independently of each other if > PetscViewerSetOptionsPrefix() and PetscViewerSetFromOptions() are called? > > > Cheers > Dave > -- 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 bsmith at mcs.anl.gov Fri Jan 30 07:45:46 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 30 Jan 2015 07:45:46 -0600 Subject: [petsc-users] importing .mat to petsc In-Reply-To: References: Message-ID: PETSc cannot read .mat Matlab files. It can only read files saved with the PetscBinaryWrite.m script that we provide. Barry > On Jan 30, 2015, at 1:12 AM, siddhesh godbole wrote: > > hello, > i tried importing matlab file containing 10000 scalars to petsc. > > > [0]PETSC ERROR: Read from file failed > [0]PETSC ERROR: Error reading from file, errno 9 > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. > [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 > [0]PETSC ERROR: ./10D on a arch-linux2-c-debug named renoir by hridya Fri Jan 30 12:32:52 2015 > [0]PETSC ERROR: Configure options --download-mpich > [0]PETSC ERROR: #1 PetscBinaryRead() line 275 in /home/hridya/Downloads/petsc-3.5.2/src/sys/fileio/sysio.c > > > i dont understand why should it not import the file. Please help! > > > just in case for reference i have used following routines; > ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD,"psi.mat",FILE_MODE_READ,&fd);CHKERRQ(ierr); > > PetscViewerBinaryGetDescriptor(fd,&REV); > PetscBinaryRead(REV,trial,trial,PETSC_SCALAR); > > > > > > Siddhesh M Godbole > > 5th year Dual Degree, > Civil Eng & Applied Mech. > IIT Madras From dave.mayhem23 at gmail.com Fri Jan 30 07:51:09 2015 From: dave.mayhem23 at gmail.com (Dave May) Date: Fri, 30 Jan 2015 14:51:09 +0100 Subject: [petsc-users] Is PetscViewerBinary special? In-Reply-To: References: Message-ID: Thanks Matt. Given the PETSc way of doing things, I believe the following should be possible: [1] attach an option prefix to a viewer [2] skip the header on some binary viewers [3] use mpiio for some binary viewers, but not all of them. However, it doesn't appear to be completely simple to allow this behaviour. For instance, replacing ierr = PetscOptionsGetBool(NULL,"-viewer_binary_mpiio",&useMPIIO,NULL);CHKERRQ(ierr); with ierr = PetscOptionsGetBool(((PetscObject)viewer)->prefix,"-viewer_binary_mpiio",&useMPIIO,NULL);CHKERRQ(ierr); won't work as an option prefix will never have been set. If I was to add a PetscViewerSetFromOptions_Binary(), I would have to ensure that PetscViewerSetFromOptions() was called before PetscViewerFileSetName() was called as the latter this triggers a swap of the functions used to open binary file, e.g. from PetscViewerFileSetName_Binary() to PetscViewerFileSetName_MPIIO() Would it be simpler and cleaner to have MPIIO be defined as an independent implementation which was a sub-class of the binary class? Then we could use command line flags to switch between implementations at runtime -xxx_viewer_type binary versus -xxx_viewer_type mpiio rather than having to use -xxx_viewer_type binary -viewer_binary_mpiio which has obvious short comings like forcing all binary viewers, independent of the prefix to use mpiio. It would also allow the PetscViewer object to be used in a manner which follows the standard PETSc pattern of: XXCreate(), XXSetOptionsPrefix(), XXSetType(), XXSetFromOptions(). Then we could do this PetscViewerCreate() PetscViewerSetOptionsPrefix() PetscViewerSetType() PetscViewerFileSetMode() PetscViewerBinarySetSkipHeader() PetscViewerFileSetName() PetscViewerSetFromOptions() and it wouldn't matter which order SetName(), BinarySkipHeader() etc were called. What do people think? Cheers Dave On 30 January 2015 at 13:56, Matthew Knepley wrote: > On Fri, Jan 30, 2015 at 2:06 AM, Dave May wrote: > >> Hello, >> >> I've noticed the create function PetscViewerCreate_Binary() doesn't >> appear to be using the options prefix attached to the PetscViewer. >> Specifically, I see on line 1276 of >> petsc-3.5.2/src/sys/classes/viewer/impls/binary/binv.c >> the following >> ierr = >> PetscOptionsGetBool(NULL,"-viewer_binary_mpiio",&useMPIIO,NULL);CHKERRQ(ierr); >> >> Is this an oversight or something intentional? >> > > This is an oversight. > > Matt > > >> Are PetscViewers in general behaving such that they cannot be configured >> independently of each other if >> PetscViewerSetOptionsPrefix() and PetscViewerSetFromOptions() are called? >> >> >> Cheers >> Dave >> > > > > -- > 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 bsmith at mcs.anl.gov Fri Jan 30 07:56:12 2015 From: bsmith at mcs.anl.gov (Barry Smith) Date: Fri, 30 Jan 2015 07:56:12 -0600 Subject: [petsc-users] Is PetscViewerBinary special? In-Reply-To: References: Message-ID: <192D0F85-C6C7-4185-8CDD-B1ACFA5BE5FC@mcs.anl.gov> Dave, I did the mpiio hack originally and yes it is very ad hoc and could do with a good reorganization. I am fine with accepting a branch that treats the MPIIO one as a completely different class; the only reason not to do this is if both classes have essentially the same code but no reuse between them. Barry > On Jan 30, 2015, at 7:51 AM, Dave May wrote: > > Thanks Matt. > > Given the PETSc way of doing things, I believe the following should be possible: > [1] attach an option prefix to a viewer > [2] skip the header on some binary viewers > [3] use mpiio for some binary viewers, but not all of them. > > However, it doesn't appear to be completely simple to allow this behaviour. > > For instance, replacing > ierr = PetscOptionsGetBool(NULL,"-viewer_binary_mpiio",&useMPIIO,NULL);CHKERRQ(ierr); > with > ierr = PetscOptionsGetBool(((PetscObject)viewer)->prefix,"-viewer_binary_mpiio",&useMPIIO,NULL);CHKERRQ(ierr); > won't work as an option prefix will never have been set. > > If I was to add a PetscViewerSetFromOptions_Binary(), I would have to ensure that PetscViewerSetFromOptions() was called before PetscViewerFileSetName() was called as the latter this triggers a swap of the functions used to open binary file, e.g. from PetscViewerFileSetName_Binary() to PetscViewerFileSetName_MPIIO() > > Would it be simpler and cleaner to have MPIIO be defined as an independent implementation which was a sub-class of the binary class? > > Then we could use command line flags to switch between implementations at runtime > -xxx_viewer_type binary > versus > -xxx_viewer_type mpiio > rather than having to use > -xxx_viewer_type binary -viewer_binary_mpiio > which has obvious short comings like forcing all binary viewers, independent of the prefix to use mpiio. It would also allow the PetscViewer object to be used in a manner which follows the standard PETSc pattern of: XXCreate(), XXSetOptionsPrefix(), XXSetType(), XXSetFromOptions(). > > Then we could do this > PetscViewerCreate() > PetscViewerSetOptionsPrefix() > PetscViewerSetType() > PetscViewerFileSetMode() > PetscViewerBinarySetSkipHeader() > PetscViewerFileSetName() > PetscViewerSetFromOptions() > and it wouldn't matter which order SetName(), BinarySkipHeader() etc were called. > > What do people think? > > > Cheers > Dave > > > > > > On 30 January 2015 at 13:56, Matthew Knepley wrote: > On Fri, Jan 30, 2015 at 2:06 AM, Dave May wrote: > Hello, > > I've noticed the create function PetscViewerCreate_Binary() doesn't appear to be using the options prefix attached to the PetscViewer. > Specifically, I see on line 1276 of > petsc-3.5.2/src/sys/classes/viewer/impls/binary/binv.c > the following > ierr = PetscOptionsGetBool(NULL,"-viewer_binary_mpiio",&useMPIIO,NULL);CHKERRQ(ierr); > > Is this an oversight or something intentional? > > This is an oversight. > > Matt > > Are PetscViewers in general behaving such that they cannot be configured independently of each other if > PetscViewerSetOptionsPrefix() and PetscViewerSetFromOptions() are called? > > > Cheers > Dave > > > > -- > 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 balay at mcs.anl.gov Sat Jan 31 09:50:54 2015 From: balay at mcs.anl.gov (Satish Balay) Date: Sat, 31 Jan 2015 09:50:54 -0600 Subject: [petsc-users] petsc-3.5.3.tar.gz now available Message-ID: Dear PETSc users, The patch release petsc-3.5.3 is now available for download. http://www.mcs.anl.gov/petsc/download/index.html Some of the changes include: * BJacobi: optimize KSP/PCSetReusePreconditioner() for bjacobi with one block per process * DM: update validity checks in DMLocalToGlobalBegin_DA * lsqr: bugfix when beta==0.0 * fortran: enable interface for MatMAIJGetAIJ(), VecSetOptionsPrefix() * pastix: update to bugfix version 5.2.2.12 * build: update suitesparse build with correct value for 'long long' indices. * TS: TSAdapt fixes and update error checks in TS * IS: fix memory leak in ISConcatenate * Vec: VecSetValues, VecSetValuesLocal and VecGetValues - do not check for validity of array pointers - when no-of-entries=0 * build: fix --download-openmpi to workarround -Wall failure * Mat: bugfix for MatConvertToTriples_seqaij_seqsbaij() * PCMG: allow user to provide either interpolation or restriction operator with Galerkin coarse grid operators * Mat: fix memory allocation error where space is allocated in MatMult_SeqBAIJ with a space shorter than that needed in MatSOR_SeqBAIJ * KSP: allow Schur complement to be non-square * Vec: VecLoad_HDF5_DA() do not ignore group information * Mat: fix MatAXPY() for SUBSET_NONZERO_PATTERN case for sbaij matrix * Mat: Allow setting the matrix block size with MatSetBlockSize() before calling MatLoad() * configure: add option to disable prefetch check: [--with-prefetch=0] * configure: fix for Apple's blas in single precision (sdot and snrm2 return double precision number instead of float) * KSP: fixes for zero rank eigen calc. * Mat: fix memory leak of MatAXPY in the case of SUBSET_NONZERO_PATTERN * Mat: Added MatForward/BackwardSolve for SeqBAIJ block size 1-3 natural ordering * Tao: reassemble hessian after bqpip sets diagonal * Vec: fix VecMedian() restore parameter * PCASM remove "error check" for non-overlapping subdomains that prevents valid subdomains being provided by users * Mat: fix for MatMatMut_MPIAIJ_MPIAIJ, MatMatMult_xxx_nonscalable() when np=1 by pass parts of the code that for np>1 * fix: The PETSc macros MPI_Scatter() and friends could call MPI_Type_size() on MPI_DATATYPE_NULL which triggers an error with some MPI implementations * Vec: Fixes bug in VecMTDot_Seq/MPI where it did not work correctly for more than four vectors * Tao: bug fixes, check for repeated model in POUNDERS * Vec: fix VecRestoreSubVector for non-contiguous SubVector. Satish From balay at mcs.anl.gov Sat Jan 31 16:19:45 2015 From: balay at mcs.anl.gov (Satish Balay) Date: Sat, 31 Jan 2015 16:19:45 -0600 Subject: [petsc-users] PETSc and AMPI In-Reply-To: <030a01d03ca3$a5244da0$ef6ce8e0$@engr.wisc.edu> References: <030a01d03ca3$a5244da0$ef6ce8e0$@engr.wisc.edu> Message-ID: Dan, I'm forwarding this to e-mail petsc-users. I'm not familiar with Charm++ or AMPI - but others might have suggestions. Also - if you can send us confiugre.log the the failure with AMPI - we can look at it - and see if there is an issue from PETSc side. Satish On Fri, 30 Jan 2015, Dan Negrut wrote: > Hi Satish, > > We are trying to use PETSc and Charm++ for a project in the lab and wanted > to ask whether you have ever heard of anybody building PETSc on top of AMPI. > AMPI is part of the Charm++ distribution, it's their implementation of the > MPI standard (a part of it, it's my understanding). Two lab members kept > trying to get PETSc and AMPI to build together but to no avail. > > > > Thank you for your thoughts, I hope things are going great at your end, > > Dan > > ------------------------------------------------- > > Vilas Associate Professor > > NVIDIA CUDA Fellow > > Co-Director, Wisconsin Applied Computing Center > > Department of Mechanical Engineering > > Department of Electrical and Computer Engineering > > University of Wisconsin - Madison > > 2035ME, 1513 University Avenue > > Madison, WI 53706-1572 > > 608 265 6124 > > 608 265 2316 (Fax) > > http://sbel.wisc.edu/ > > > http://homepages.cae.wisc.edu/~negrut > > ------------------------------------------------- > > > > From knepley at gmail.com Sat Jan 31 16:32:58 2015 From: knepley at gmail.com (Matthew Knepley) Date: Sat, 31 Jan 2015 16:32:58 -0600 Subject: [petsc-users] PETSc and AMPI In-Reply-To: References: <030a01d03ca3$a5244da0$ef6ce8e0$@engr.wisc.edu> Message-ID: On Sat, Jan 31, 2015 at 4:19 PM, Satish Balay wrote: > Dan, > > I'm forwarding this to e-mail petsc-users. I'm not familiar with > Charm++ or AMPI - but others might have suggestions. > > Also - if you can send us confiugre.log the the failure with AMPI - we > can look at it - and see if there is an issue from PETSc side. > Also, I cannot find the download for AMPI. Can you mail it so we can try it here? Thanks, Matt > Satish > > On Fri, 30 Jan 2015, Dan Negrut wrote: > > > Hi Satish, > > > > We are trying to use PETSc and Charm++ for a project in the lab and > wanted > > to ask whether you have ever heard of anybody building PETSc on top of > AMPI. > > AMPI is part of the Charm++ distribution, it's their implementation of > the > > MPI standard (a part of it, it's my understanding). Two lab members kept > > trying to get PETSc and AMPI to build together but to no avail. > > > > > > > > Thank you for your thoughts, I hope things are going great at your end, > > > > Dan > > > > ------------------------------------------------- > > > > Vilas Associate Professor > > > > NVIDIA CUDA Fellow > > > > Co-Director, Wisconsin Applied Computing Center > > > > Department of Mechanical Engineering > > > > Department of Electrical and Computer Engineering > > > > University of Wisconsin - Madison > > > > 2035ME, 1513 University Avenue > > > > Madison, WI 53706-1572 > > > > 608 265 6124 > > > > 608 265 2316 (Fax) > > > > http://sbel.wisc.edu/ > > > > > > http://homepages.cae.wisc.edu/~negrut > > > > ------------------------------------------------- > > > > > > > > > > -- 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 jed at jedbrown.org Sat Jan 31 22:04:58 2015 From: jed at jedbrown.org (Jed Brown) Date: Sat, 31 Jan 2015 21:04:58 -0700 Subject: [petsc-users] PETSc and AMPI In-Reply-To: References: <030a01d03ca3$a5244da0$ef6ce8e0$@engr.wisc.edu> Message-ID: <87twz65lat.fsf@jedbrown.org> Matthew Knepley writes: > On Sat, Jan 31, 2015 at 4:19 PM, Satish Balay wrote: > >> Dan, >> >> I'm forwarding this to e-mail petsc-users. I'm not familiar with >> Charm++ or AMPI - but others might have suggestions. >> >> Also - if you can send us confiugre.log the the failure with AMPI - we >> can look at it - and see if there is an issue from PETSc side. >> > > Also, I cannot find the download for AMPI. Can you mail it so we can try it > here? http://charm.cs.uiuc.edu/research/ampi/ Barry experimented with this a while back. It is not currently supported and my understanding is that PETSc would need public API changes to support AMPI. This might be possible as part of the thread-safety work. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 818 bytes Desc: not available URL: