[petsc-dev] I do not think this is the right solution

Matthew Knepley knepley at gmail.com
Sun Mar 18 20:50:21 CDT 2012


On Sun, Mar 18, 2012 at 7:05 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> On Sun, Mar 18, 2012 at 18:54, Matthew Knepley <knepley at gmail.com> wrote:
>
>> That has nothing to do with anything we are talking about.
>>
>
> Bull, run your code in parallel, but have it create the matrix in two
> ways, one on COMM_SELF and one running on COMM_WORLD. Take the COMM_WORLD
> one and MatGetRedundantMatrix(Aworld,...,&Ared) to get the redundant
> matrix, then compute the norm of Ared - Aself.
>

Oh, vastly complicate my code, so that I can do something equivalent to
what I get in a few lines. Please
reconsider further coding suggestions.

  Matt


> From looking at your code, this is more intrusive than below.
>
>
>>
>>
>>> And if you really want to stay parallel and print all the non-small
>>> values, MatDuplicate and fill up the new matrix with the thresholded values.
>>>
>>
>> Neither does this.
>>
>
> Imagine a world in which
>
>     ierr = MatChop(JacP, 1.0e-10);CHKERRQ(ierr);
>     ierr = MatView(JacP, PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);
>
> was instead written
>
>     Mat Chopped;
>     ierr = MatChop(JacP, 1.0e-10, &Chopped);CHKERRQ(ierr);
>     ierr = MatView(Chopped, PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);
>     ierr = MatDestroy(&Chopped);CHKERRQ(ierr);
>
> You could MatHeaderReplace(JacP,Chopped); if you were feeling ornery
> (considering that the local callback you are using didn't pass a Mat* or
> forward the SNES down that far (i.e. an API bug because we assert that you
> can change the matrix in a Jacobian evaluation routine)).
>
>
>>
>>
>>> Note, there was a request a while back to be able to make an ASCII
>>> viewer use a user-defined floating-point format string.
>>>
>>
>> That would not help. For a small number, you do not want ANY significant
>> digits.
>>
>
> %f
>



-- 
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: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120318/d8ac259d/attachment.html>


More information about the petsc-dev mailing list