<div dir="ltr"><div><div><div>Hi Jason,<br><br></div>One more question about BLMVM... if it only uses gradient information and does not require the definitition of a Hessian Matrix, can this method be applied to solve problems that are nonsymmetric by nature? (e.g., advection-diffusion equations). If I had wanted to solve the same equations using TRON I would need to rewrite the problem as "normal equations" (i.e., min 1/2*||K*u - f||^2 or min 1/2*u^T*K^T*K*u - u^T*K^T*f)  so that I get a symmetric Hessian (but this method results in extremely high condition numbers and renders the numerical solution less reliable and accurate).<br><br></div>Thanks,<br></div>Justin<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 29, 2015 at 5:53 PM, Justin Chang <span dir="ltr"><<a href="mailto:jchang27@uh.edu" target="_blank">jchang27@uh.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Okay that's what I figured, thanks you very much<br><br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 29, 2015 at 10:39 AM, Jason Sarich <span dir="ltr"><<a href="mailto:jason.sarich@gmail.com" target="_blank">jason.sarich@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Justin,<div><br></div><div>This expected behavior due to the accumulation of numerical round-offs. If this is a problem or if you just want to confirm that this is the cause, you can try configuring PETSc for quad precision (--with-precision=__float128, works with GNU compilers) and the results should match better.</div><span><font color="#888888"><div><br></div><div>Jason</div><div><br></div></font></span></div><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Apr 28, 2015 at 10:19 PM, Justin Chang <span dir="ltr"><<a href="mailto:jchang27@uh.edu" target="_blank">jchang27@uh.edu</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div><span><span>
<div dir="ltr">
<div>
<div>Jason (or anyone),<br>
 <br>
</div>
I am noticing that the iteration numbers reported by TaoGetSolutionStatus() for blmvm differ whenever I change the number of processes. The solution seems to remain the same though. Is there a reason why this could be happening?<br>
<br>
</div>
Thanks,<br>
</div>
</span></span><div><div><div><div><div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Apr 21, 2015 at 10:40 AM, Jason Sarich <span dir="ltr">
<<a href="mailto:jason.sarich@gmail.com" target="_blank">jason.sarich@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Justin,
<div><br>
</div>
<div>1) The big difference between TRON and BLMVM is that TRON requires hessian information, BLMVM only uses gradient information. Thus TRON will usually converge faster, but requires more information, memory, and a KSP solver. GPCG (gradient projected conjugate
 gradient) is another gradient-only option, but usually performs worse than BLMVM.</div>
<div><br>
</div>
<div>2) TaoGetLinearSolveIterations() will get the total number of KSP iterations per solve</div>
<span><font color="#888888">
<div><br>
</div>
<div>Jason</div>
<div><br>
</div>
</font></span></div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Apr 21, 2015 at 10:33 AM, Justin Chang <span dir="ltr">
<<a href="mailto:jychang48@gmail.com" target="_blank">jychang48@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Jason, <br>
<br>
</div>
Tightening the tolerances did the trick. Thanks. Though I do have a couple more related questions:<br>
</div>
<br>
</div>
1) Is there a general guideline for choosing tron over blmvm or vice versa? Also is there another tao type that is also suitable given only bounded constraints?<br>
<br>
</div>
2) Is it possible to obtain the total number of KSP and/or PG iterations from tron?
<br>
<br>
</div>
Thanks,<br>
</div>
Justin<br>
</div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Apr 21, 2015 at 9:52 AM, Jason Sarich <span dir="ltr">
<<a href="mailto:jason.sarich@gmail.com" target="_blank">jason.sarich@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>Hi Justin,</div>
<div><br>
</div>
blmvm believes that it is already sufficiently close to a minimum, so it doesn't do anything. You may need to tighten some of the tolerance to force an iteration.<span><font color="#888888">
<div><br>
</div>
<div>Jason</div>
<div><br>
</div>
</font></span></div>
<div class="gmail_extra"><br>
<div class="gmail_quote">
<div>
<div>On Tue, Apr 21, 2015 at 9:48 AM, Justin Chang <span dir="ltr"><<a href="mailto:jychang48@gmail.com" target="_blank">jychang48@gmail.com</a>></span> wrote:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div>
<div>
<div>
<div>
<div dir="ltr">
<div>Time step 1:<br>
<br>
Tao Object: 1 MPI processes<br>
  type: blmvm<br>
      Gradient steps: 0<br>
  TaoLineSearch Object:   1 MPI processes<br>
    type: more-thuente<br>
  Active Set subset type: subvec<br>
  convergence tolerances: fatol=0.0001,   frtol=0.0001<br>
  convergence tolerances: gatol=0,   steptol=0,   gttol=0<br>
  Residual in Function/Gradient:=0.0663148<br>
  Objective value=-55.5945<br>
  total number of iterations=35,                          (max: 2000)<br>
  total number of function/gradient evaluations=37,      (max: 4000)<br>
  Solution converged:   estimated |f(x)-f(X*)|/|f(X*)| <= frtol<br>
<br>
</div>
Time step 2:<br>
<div><br>
Tao Object: 1 MPI processes<br>
  type: blmvm<br>
      Gradient steps: 0<br>
  TaoLineSearch Object:   1 MPI processes<br>
    type: more-thuente<br>
  Active Set subset type: subvec<br>
  convergence tolerances: fatol=0.0001,   frtol=0.0001<br>
  convergence tolerances: gatol=0,   steptol=0,   gttol=0<br>
  Residual in Function/Gradient:=0.0682307<br>
  Objective value=-66.9675<br>
  total number of iterations=23,                          (max: 2000)<br>
  total number of function/gradient evaluations=25,      (max: 4000)<br>
  Solution converged:   estimated |f(x)-f(X*)|/|f(X*)| <= frtol<br>
<br>
Time step 3:<br>
<br>
Tao Object: 1 MPI processes<br>
  type: blmvm<br>
      Gradient steps: 0<br>
  TaoLineSearch Object:   1 MPI processes<br>
    type: more-thuente<br>
  Active Set subset type: subvec<br>
  convergence tolerances: fatol=0.0001,   frtol=0.0001<br>
  convergence tolerances: gatol=0,   steptol=0,   gttol=0<br>
  Residual in Function/Gradient:=0.0680522<br>
  Objective value=-71.8211<br>
  total number of iterations=19,                          (max: 2000)<br>
  total number of function/gradient evaluations=22,      (max: 4000)<br>
  Solution converged:   estimated |f(x)-f(X*)|/|f(X*)| <= frtol<br>
<br>
Time step 4:<br>
<br>
Tao Object: 1 MPI processes<br>
  type: blmvm<br>
      Gradient steps: 0<br>
  TaoLineSearch Object:   1 MPI processes<br>
    type: more-thuente<br>
  Active Set subset type: subvec<br>
  convergence tolerances: fatol=0.0001,   frtol=0.0001<br>
  convergence tolerances: gatol=0,   steptol=0,   gttol=0<br>
  Residual in Function/Gradient:=0.0551556<br>
  Objective value=-75.1252<br>
  total number of iterations=18,                          (max: 2000)<br>
  total number of function/gradient evaluations=20,      (max: 4000)<br>
  Solution converged:   estimated |f(x)-f(X*)|/|f(X*)| <= frtol<br>
<br>
Time step 5:<br>
<br>
Tao Object: 1 MPI processes<br>
  type: blmvm<br>
      Gradient steps: 0<br>
  TaoLineSearch Object:   1 MPI processes<br>
    type: more-thuente<br>
  Active Set subset type: subvec<br>
  convergence tolerances: fatol=0.0001,   frtol=0.0001<br>
  convergence tolerances: gatol=0,   steptol=0,   gttol=0<br>
  Residual in Function/Gradient:=0.0675667<br>
  Objective value=-77.4414<br>
  total number of iterations=6,                          (max: 2000)<br>
  total number of function/gradient evaluations=8,      (max: 4000)<br>
  Solution converged:   estimated |f(x)-f(X*)|/|f(X*)| <= frtol<br>
<br>
Time step 6:<br>
<br>
Tao Object: 1 MPI processes<br>
  type: blmvm<br>
      Gradient steps: 0<br>
  TaoLineSearch Object:   1 MPI processes<br>
    type: more-thuente<br>
  Active Set subset type: subvec<br>
  convergence tolerances: fatol=0.0001,   frtol=0.0001<br>
  convergence tolerances: gatol=0,   steptol=0,   gttol=0<br>
  Residual in Function/Gradient:=0.059143<br>
  Objective value=-79.5007<br>
  total number of iterations=3,                          (max: 2000)<br>
  total number of function/gradient evaluations=5,      (max: 4000)<br>
  Solution converged:   estimated |f(x)-f(X*)|/|f(X*)| <= frtol<br>
<br>
Time step 7:<br>
<br>
Tao Object: 1 MPI processes<br>
  type: blmvm<br>
      Gradient steps: 0<br>
  TaoLineSearch Object:   1 MPI processes<br>
    type: more-thuente<br>
  Active Set subset type: subvec<br>
  convergence tolerances: fatol=0.0001,   frtol=0.0001<br>
  convergence tolerances: gatol=0,   steptol=0,   gttol=0<br>
  Residual in Function/Gradient:=0.0433683<br>
  Objective value=-81.3546<br>
  total number of iterations=5,                          (max: 2000)<br>
  total number of function/gradient evaluations=8,      (max: 4000)<br>
  Solution converged:   estimated |f(x)-f(X*)|/|f(X*)| <= frtol<br>
<br>
Time step 8:<br>
<br>
Tao Object: 1 MPI processes<br>
  type: blmvm<br>
      Gradient steps: 0<br>
  TaoLineSearch Object:   1 MPI processes<br>
    type: more-thuente<br>
  Active Set subset type: subvec<br>
  convergence tolerances: fatol=0.0001,   frtol=0.0001<br>
  convergence tolerances: gatol=0,   steptol=0,   gttol=0<br>
  Residual in Function/Gradient:=0.0840676<br>
  Objective value=-82.9382<br>
  total number of iterations=0,                          (max: 2000)<br>
  total number of function/gradient evaluations=1,      (max: 4000)<br>
  Solution converged:   estimated |f(x)-f(X*)|/|f(X*)| <= frtol<br>
<br>
Time step 9:<br>
<br>
Tao Object: 1 MPI processes<br>
  type: blmvm<br>
      Gradient steps: 0<br>
  TaoLineSearch Object:   1 MPI processes<br>
    type: more-thuente<br>
  Active Set subset type: subvec<br>
  convergence tolerances: fatol=0.0001,   frtol=0.0001<br>
  convergence tolerances: gatol=0,   steptol=0,   gttol=0<br>
  Residual in Function/Gradient:=0.0840676<br>
  Objective value=-82.9382<br>
  total number of iterations=0,                          (max: 2000)<br>
  total number of function/gradient evaluations=1,      (max: 4000)<br>
  Solution converged:   estimated |f(x)-f(X*)|/|f(X*)| <= frtol<br>
<br>
Time step 10:<br>
<br>
Tao Object: 1 MPI processes<br>
  type: blmvm<br>
      Gradient steps: 0<br>
  TaoLineSearch Object:   1 MPI processes<br>
    type: more-thuente<br>
  Active Set subset type: subvec<br>
  convergence tolerances: fatol=0.0001,   frtol=0.0001<br>
  convergence tolerances: gatol=0,   steptol=0,   gttol=0<br>
  Residual in Function/Gradient:=0.0840676<br>
  Objective value=-82.9382<br>
  total number of iterations=0,                          (max: 2000)<br>
  total number of function/gradient evaluations=1,      (max: 4000)<br>
  Solution converged:   estimated |f(x)-f(X*)|/|f(X*)| <= frtol<br>
<br>
<br>
<br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Apr 21, 2015 at 9:28 AM, Jason Sarich <span dir="ltr">
<<a href="mailto:jason.sarich@gmail.com" target="_blank">jason.sarich@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Justin,
<div><br>
</div>
<div>what reason is blmvm giving for stopping the solve? (you can use -tao_view or -tao_converged_reason to get this)</div>
<span><font color="#888888">
<div><br>
</div>
<div>Jason</div>
</font></span></div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Apr 20, 2015 at 6:32 PM, Justin Chang <span dir="ltr">
<<a href="mailto:jychang48@gmail.com" target="_blank">jychang48@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
<div>
<div>
<div>Jason,<br>
<br>
</div>
I am using TaoGetSolutionStatus(tao,&its, ...) and it gives me exactly what I want. However, I seem to be having an issue with blmvm<br>
<br>
</div>
I wrote my own backward euler code for a transient linear diffusion problem with lower bounds >= 0 and upper bounds <= 1. For the first several time steps I am getting its > 0, and it decreases over time due to the nature of the discrete maximum principles.
 However, at some point my its become 0 and the solution does not "update", which seems to me that TaoSolve is not doing anything after that. This doesn't happen if I were to use tron (my KSP and PC are cg and jacobi respectively).<br>
<br>
</div>
Do you know why this behavior may occur?<br>
<br>
</div>
Thanks,<br>
</div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Apr 14, 2015 at 9:35 AM, Jason Sarich <span dir="ltr">
<<a href="mailto:jason.sarich@gmail.com" target="_blank">jason.sarich@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Justin,
<div><br>
</div>
<div>I have pushed these changes to the "next" branch, your code snippet should work fine there.</div>
<div><br>
</div>
<div>Note that there is also available (since version 3.5.0) the routine TaoGetSolutionStatus(tao,&its,NULL,NULL,NULL,NULL,NULL) which will provide the</div>
<div>same information</div>
<span><font color="#888888">
<div><br>
</div>
<div>Jason</div>
</font></span></div>
<div class="gmail_extra"><br>
<div class="gmail_quote"><span>On Fri, Apr 10, 2015 at 6:28 PM, Justin Chang <span dir="ltr">
<<a href="mailto:jychang48@gmail.com" target="_blank">jychang48@gmail.com</a>></span> wrote:<br>
</span>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><span><span>
<div dir="ltr">
<div>
<div>
<div>Whatever is convenient and/or follow the "PETSc" standards. Something similar to SNESGetIterationNumber() or KSPGetIterationNumber() would be nice. Ideally I want my code to look like this:<br>
<br>
</div>
ierr = TaoGetIterationNumber(tao,&its);CHKERRQ(ierr);<br>
</div>
ierr = PetscPrintf(PETSC_COMM_WORLD, "Number of Tao iterations = %D\n", its);<br>
<br>
</div>
<div>Thanks :)<br>
</div>
</div>
</span></span>
<div class="gmail_extra"><br>
<div class="gmail_quote"><span><span>On Fri, Apr 10, 2015 at 5:53 PM, Jason Sarich
<span dir="ltr"><<a href="mailto:jason.sarich@gmail.com" target="_blank">jason.sarich@gmail.com</a>></span> wrote:<br>
</span></span>
<div>
<div>
<div>
<div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p dir="ltr">Hi Justin, I'll get this in. I assume that displaying the number of iterations with tao_converged_reason is what you are asking for in particular? Or did you have something else in mind?</p>
<span><font color="#888888">
<p dir="ltr">Jason</p>
</font></span>
<div class="gmail_quote"><span>On Apr 10, 2015 16:42, "Smith, Barry F." <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:<br type="attribution">
</span>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
  Justin,<br>
<br>
    Sorry TAO simply doesn't even collect this information currently. But yes we should definitely make it available!<br>
<br>
  Jason,<br>
<br>
     Could you please add this; almost all the TaoSolve_xxx() have a local variable iter; change that to tao->niter (I'm guess this is suppose to capture this information) and add a TaoGetIterationNumber() and the uses can access this. Also modify at the end
 of TaoSolve() -tao_converged_reason to also print the iteration count. At the same time since you add this you can add a tao->totalits which would accumulate all iterations over all the solves for that Tao object and the routine TaoGetTotalIterations() to
 access this.  Note that TaoSolve() would initialize tao->niter = 0 at the top.<br>
<br>
   Thanks<br>
<br>
  Barry<br>
<br>
<br>
<br>
> On Apr 10, 2015, at 4:16 PM, Justin Chang <<a href="mailto:jchang27@uh.edu" target="_blank">jchang27@uh.edu</a>> wrote:<br>
><br>
</span>
<div>
<div>> Hi all,<br>
><br>
> Is there a way to generically obtain the number of Tao iterations? I am looking through the -help options for Tao and I don't see any metric where you can output this quantity in the manner that you could for SNES or KSP solves. I am currently using blmvm
 and tron, and the only way I can see getting this metric is by outputting -tao_view and/or -tao_monitor and manually finding this number. I find this cumbersome especially for transient problems where I would like to simply have this number printed for each
 step instead of ending up with unnecessary info.<br>
><br>
> Thanks,<br>
><br>
><br>
> --<br>
> Justin Chang<br>
> PhD Candidate, Civil Engineering - Computational Sciences<br>
> University of Houston, Department of Civil and Environmental Engineering<br>
> Houston, TX 77004<br>
> <a href="tel:%28512%29%20963-3262" value="+15129633262" target="_blank">(512) 963-3262</a><br>
<br>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br clear="all">
<br>
-- <br>
<div>
<div dir="ltr">
<div>
<div>
<div>Justin Chang<br>
</div>
PhD Candidate, Civil Engineering - Computational Sciences<br>
</div>
University of Houston, Department of Civil and Environmental Engineering<br>
</div>
Houston, TX 77004<br>
<a href="tel:%28512%29%20963-3262" value="+15129633262" target="_blank">(512) 963-3262</a><br>
</div>
</div>
</div></div></div></div></div>

</blockquote></div><br></div>
</blockquote></div><br></div><br clear="all"><br>-- <br><div><div dir="ltr"><div><div><div>Justin Chang<br></div>PhD Candidate, Civil Engineering - Computational Sciences<br></div>University of Houston, Department of Civil and Environmental Engineering<br></div>Houston, TX 77004<br><a href="tel:%28512%29%20963-3262" value="+15129633262" target="_blank">(512) 963-3262</a><br></div></div>
</div></div></blockquote></div><br></div>