Re: [petsc-users] changing solver options at runtime

2015-02-26 Thread Barry Smith

 TSSetOptionsPrefix() or SNESSetOptionsPrefix() or KSPSetOptionsPrefix(); you 
can call them at any time and then any call to TS/SNES/KSPSetFromOptions() on 
that object after that will use the command line options associated with that 
prefix. Check the manual pages.

  Barry



 On Feb 26, 2015, at 11:01 PM, Manav Bhatia bhatiama...@gmail.com wrote:
 
 Hi, 
 
   Is there a way to change, between two consecutive linear solves, the 
 command line options that petsc uses to initialize the solver (using 
 xxxSetFromOptions)? 
 
   I am attempting a multidisciplinary simulation, such that each discipline 
 has its own linear system of equations to solve (perhaps repeatedly), and I 
 wish to set separate options for each disciplinary solve. Passing the options 
 at command line will set the same values for each discipline, which is what I 
 wish to change. Of course, this can be done by writing code to set each 
 option, but the convenience of doing it through command line options is very 
 attractive. 
 
   Any help will be greatly appreciated. 
 
 Thanks,
 Manav
 
 



Re: [petsc-users] Memory leak in PetscRandom?

2015-02-26 Thread Lisandro Dalcin
On 26 February 2015 at 01:09, Jed Brown j...@jedbrown.org wrote:
 Barry Smith bsm...@mcs.anl.gov writes:

Thanks for the report. I ran the example with those options under
Linux with valgrind and found no memory leaks, I cannot run
valgrind on my Mac.

 When are you going to get a real operating system?  In the mean time,
 several people have reported that this works:

 http://ranf.tl/2014/11/28/valgrind-on-mac-os-x-10-10-yosemite/

When is valgrind going to use a real VCS? ;-)

-- 
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


Re: [petsc-users] Memory leak in PetscRandom?

2015-02-26 Thread Jed Brown
Lisandro Dalcin dalc...@gmail.com writes:

 When is valgrind going to use a real VCS? ;-)

Good question.


signature.asc
Description: PGP signature


[petsc-users] Partitioning in DMNetwork

2015-02-26 Thread Miguel Angel Salazar de Troya
Hi

In DMNetwork we have edges and vertices and we can add an arbitrary number
of variables to both edges and vertices. When the partitioning is carried
out, is this done according to the number of edges and vertices or the
variables? Say for example, that we assigned a very large number of
variables to the first edge, a number much greater than the total number of
edges or vertices. After the partitioning, the processor that contains that
edge with many variables would have a very large portion of the global
vector, wouldn't it?

This case is hypothetical and something to avoid, but, could it happen?
Would the partitioning be made in some other way to avoid this load
unbalance?

Thanks
Miguel

-- 
*Miguel Angel Salazar de Troya*
Graduate Research Assistant
Department of Mechanical Science and Engineering
University of Illinois at Urbana-Champaign
(217) 550-2360
salaz...@illinois.edu


Re: [petsc-users] Partitioning in DMNetwork

2015-02-26 Thread Matthew Knepley
On Thu, Feb 26, 2015 at 11:33 AM, Miguel Angel Salazar de Troya 
salazardetr...@gmail.com wrote:

 Hi

 In DMNetwork we have edges and vertices and we can add an arbitrary number
 of variables to both edges and vertices. When the partitioning is carried
 out, is this done according to the number of edges and vertices or the
 variables? Say for example, that we assigned a very large number of
 variables to the first edge, a number much greater than the total number of
 edges or vertices. After the partitioning, the processor that contains that
 edge with many variables would have a very large portion of the global
 vector, wouldn't it?

 This case is hypothetical and something to avoid, but, could it happen?
 Would the partitioning be made in some other way to avoid this load
 unbalance?


We can do weighted partitioning. We have not done it yet because in my
experience the partitioners
are quite fragile with respect to the weights and also the weighting has to
be very coarse-grained.
However, if you have something that really needs it, we can do it.

  Thanks,

 Matt


 Thanks
 Miguel

 --
 *Miguel Angel Salazar de Troya*
 Graduate Research Assistant
 Department of Mechanical Science and Engineering
 University of Illinois at Urbana-Champaign
 (217) 550-2360
 salaz...@illinois.edu




-- 
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


[petsc-users] GMRES stability

2015-02-26 Thread Orxan Shibliyev
Hi

I tried to solve Ax=b with my own Gauss-Seidel code and Petsc's GMRES.
With my GS, for a steady state problem I can set CFL=40 and for
unsteady case can set dt=0.1. However, for GMRES I can't set CFL more
than 5 and for unsteady case dt more than 0.1. I need GMRES for
parallel computations so I cannot use GS for this purpose. Is there a
way to improve the stability of GMRES?


[petsc-users] changing solver options at runtime

2015-02-26 Thread Manav Bhatia
Hi, 

   Is there a way to change, between two consecutive linear solves, the command 
line options that petsc uses to initialize the solver (using 
xxxSetFromOptions)? 

   I am attempting a multidisciplinary simulation, such that each discipline 
has its own linear system of equations to solve (perhaps repeatedly), and I 
wish to set separate options for each disciplinary solve. Passing the options 
at command line will set the same values for each discipline, which is what I 
wish to change. Of course, this can be done by writing code to set each option, 
but the convenience of doing it through command line options is very 
attractive. 

   Any help will be greatly appreciated. 

Thanks,
Manav




Re: [petsc-users] GMRES stability

2015-02-26 Thread Barry Smith

  By stability I assume you mean the the GMRES does not converge (or converges 
too slowly)?

  The way to improve GMRES convergence is with a preconditioner better suited 
to your problem. By default PETSc uses GMRES with a block Jacobi preconditioner 
with one block per process and ILU(0) on each block. For some problems this is 
fine, but for many problems it will give bad convergence.

   What do you get for -ksp_view  (are you using the default?) Are you running 
yet in parallel?

  As a test on one process you can use GS in PETSc as the preconditioner and 
make sure you get similar convergence to your code. For example -ksp_richardson 
-pc_type sor on one processor will give you a GS solver.
 
   Once we know a bit more about your problem we can suggest better 
preconditioners.

  Barry


 On Feb 26, 2015, at 10:25 PM, Orxan Shibliyev orxan.shi...@gmail.com wrote:
 
 Hi
 
 I tried to solve Ax=b with my own Gauss-Seidel code and Petsc's GMRES.
 With my GS, for a steady state problem I can set CFL=40 and for
 unsteady case can set dt=0.1. However, for GMRES I can't set CFL more
 than 5 and for unsteady case dt more than 0.1. I need GMRES for
 parallel computations so I cannot use GS for this purpose. Is there a
 way to improve the stability of GMRES?