<div dir="ltr"><div>Barry, while I understand your frustration, I really hope you reconsider your decision. Without you this project will slowly (fastly?) go straight down to a sinkhole. There are many of us that appreciate you highly are keep participating in this project thanks to your tirelessly efforts leading it. In a totally selfish note, I depend on PETSc being alive and in good health for my present and future work, and I think many of us are in the same situation. We need you. We will not be good enough to keep the wheel rolling without you.</div><div><br></div><div>Yes, maybe you were rude, but heck, you spent quite a bit of time over 20 years writing long answers to user emails, it is quite hard to not loose your temper if you waste your time writing good advise that end up being totally ignored. Maybe the OP did not do it intentionally, and in that case, an interchange of mutual apologies should be enough. Users (and fellow developers) should have a bit of understanding of core developers like you. You worked for years to provide the tools for people to graduate fast, do research fast, and even make money in private enterprises. IMHO, it is not surprising for a core dev to feel underwhelmed with the responsibility, and even more if you have a lead role. Many of us jumped in the PETSc wagon after it was already an stablished project. I believe we all owe gratitude to you. Tons of it. I certainly do.</div><div><br></div><div>Regards,</div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 20 Feb 2020 at 23:58, Smith, Barry F. via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov">petsc-dev@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
PETSc developers and users,<br>
<br>
I apologize for my rude and unfair message to PETSc developers.<br>
<br>
I have removed myself from the PETSc mailing lists and removed my access to the PETSc repository and will no longer be involved in PETSc.<br>
<br>
Barry<br>
<br>
<br>
> On Feb 18, 2020, at 9:10 PM, Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:<br>
> <br>
> <br>
> In the past you needed a brain to get a Stanford email account<br>
> <br>
> <br>
>> Begin forwarded message:<br>
>> <br>
>> From: Yuyun Yang <<a href="mailto:yyang85@stanford.edu" target="_blank">yyang85@stanford.edu</a>><br>
>> Subject: Re: [petsc-users] Matrix-free method in PETSc<br>
>> Date: February 18, 2020 at 8:26:11 AM CST<br>
>> To: Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
>> Cc: "Smith, Barry F." <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>>, "<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
>> <br>
>> Thanks. Also, when using KSP, would the syntax be KSPSetOperators(ksp,A,A)? Since you mentioned preconditioners are not generally used for matrix-free operators, I wasn’t sure whether I should still put “A” in the Pmat field.<br>
>> <br>
>> Is it still possible to use TS in conjunction with the matrix-free operator? I’d like to create a simple test case that solves the 1d heat equation implicitly with variable coefficients, but didn’t know how the time stepping can be set up.<br>
>> <br>
>> Thanks,<br>
>> Yuyun<br>
>> <br>
>> From: Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
>> Date: Tuesday, February 18, 2020 at 9:23 PM<br>
>> To: Yuyun Yang <<a href="mailto:yyang85@stanford.edu" target="_blank">yyang85@stanford.edu</a>><br>
>> Cc: "Smith, Barry F." <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>>, "<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
>> Subject: Re: [petsc-users] Matrix-free method in PETSc<br>
>> <br>
>> On Tue, Feb 18, 2020 at 8:20 AM Yuyun Yang <<a href="mailto:yyang85@stanford.edu" target="_blank">yyang85@stanford.edu</a>> wrote:<br>
>> Thanks for the clarification.<br>
>> <br>
>> Got one more question: if I have variable coefficients, my stencil will be updated at every time step, so will the coefficients in myMatMult. In that case, is it necessary to destroy the shell matrix and create it all over again, or can I use it as it is, only calling the stencil update function, assuming the result will be passed into the matrix operation automatically?<br>
>> <br>
>> You update the information in the context associated with the shell matrix. No need to destroy it.<br>
>> <br>
>> Thanks,<br>
>> <br>
>> Matt<br>
>> <br>
>> Thanks,<br>
>> Yuyun<br>
>> <br>
>> On 2/18/20, 7:34 AM, "Smith, Barry F." <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:<br>
>> <br>
>> <br>
>> <br>
>> > On Feb 17, 2020, at 7:56 AM, Yuyun Yang <<a href="mailto:yyang85@stanford.edu" target="_blank">yyang85@stanford.edu</a>> wrote:<br>
>> > <br>
>> > Hello,<br>
>> > <br>
>> > I actually have a question about the usage of DMDA since I'm quite new to this. I wonder if the DMDA suite of functions can be directly called on vectors created from VecCreate?<br>
>> <br>
>> Yes, but you have to make sure the ones you create have the same sizes and parallel layouts. Generally best to get them from the DMDA or VecDuplicate() than the hassle of figuring out sizes.<br>
>> <br>
>> > Or the vectors have to be formed by DMDACreateGlobalVector? I'm also not sure about what the dof and stencil width arguments do.<br>
>> > <br>
>> > I'm still unsure about the usage of MatCreateShell and MatShellSetOperation, since it seems that MyMatMult should still have 3 inputs just like MatMult (the matrix and two vectors). Since I'm not forming the matrix, does that mean the matrix input is meaningless but still needs to exist for the sake of this format?<br>
>> <br>
>> Well the matrix input is your shell matrix so it likely has information you need to do your multiply routine. MatShellGetContext() (No you do not want to put your information about the matrix stencil inside global variables!)<br>
>> <br>
>> <br>
>> > <br>
>> > After I create such a shell matrix, can I use it like a regular matrix in KSP and utilize preconditioners?<br>
>> > <br>
>> > Thanks!<br>
>> > Yuyun<br>
>> > From: petsc-users <<a href="mailto:petsc-users-bounces@mcs.anl.gov" target="_blank">petsc-users-bounces@mcs.anl.gov</a>> on behalf of Yuyun Yang <<a href="mailto:yyang85@stanford.edu" target="_blank">yyang85@stanford.edu</a>><br>
>> > Sent: Sunday, February 16, 2020 3:12 AM<br>
>> > To: Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>><br>
>> > Cc: <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
>> > Subject: Re: [petsc-users] Matrix-free method in PETSc<br>
>> > <br>
>> > Thank you, that is very helpful information indeed! I will try it and send you my code when it works.<br>
>> > <br>
>> > Best regards,<br>
>> > Yuyun<br>
>> > From: Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>><br>
>> > Sent: Saturday, February 15, 2020 10:02 PM<br>
>> > To: Yuyun Yang <<a href="mailto:yyang85@stanford.edu" target="_blank">yyang85@stanford.edu</a>><br>
>> > Cc: <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
>> > Subject: Re: [petsc-users] Matrix-free method in PETSc<br>
>> > <br>
>> > Yuyun,<br>
>> > <br>
>> > If you are speaking about using a finite difference stencil on a structured grid where you provide the Jacobian vector products yourself by looping over the grid doing the stencil operation we unfortunately do not have exactly that kind of example. <br>
>> > <br>
>> > But it is actually not difficult. I suggest starting with src/ts/examples/tests/ex22.c It computes the sparse matrix explicitly with FormIJacobian() <br>
>> > <br>
>> > What you need to do is instead in main() use MatCreateShell() and MatShellSetOperation(,MATOP_MULT,(void (*)(void))MyMatMult) then provide the routine MyMatMult() to do your stencil based matrix free product; note that you can create this new routine by taking the structure of IFunction() and reorganizing it to do the Jacobian product instead. You will need to get the information about the shell matrix size on each process by calling DMDAGetCorners(). <br>
>> > <br>
>> > You will then remove the explicit computation of the Jacobian, and also remove the Event stuff since you don't need it.<br>
>> > <br>
>> > Extending to 2 and 3d is straight forward. <br>
>> > <br>
>> > Any questions let us know.<br>
>> > <br>
>> > Barry<br>
>> > <br>
>> > If you like this would make a great merge request with your code to improve our examples.<br>
>> > <br>
>> > <br>
>> > > On Feb 15, 2020, at 9:42 PM, Yuyun Yang <<a href="mailto:yyang85@stanford.edu" target="_blank">yyang85@stanford.edu</a>> wrote:<br>
>> > > <br>
>> > > Hello team,<br>
>> > > <br>
>> > > I wanted to apply the Krylov subspace method to a matrix-free implementation of a stencil, such that the iterative method acts on the operation without ever constructing the matrix explicitly (for example, when doing backward Euler).<br>
>> > > <br>
>> > > I'm not sure whether there is already an example for that somewhere. If so, could you point me to a relevant example?<br>
>> > > <br>
>> > > Thank you!<br>
>> > > <br>
>> > > Best regards,<br>
>> > > Yuyun<br>
>> <br>
>> <br>
>> <br>
>> <br>
>> <br>
>> -- <br>
>> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
>> -- Norbert Wiener<br>
>> <br>
>> <a href="https://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
> <br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Lisandro Dalcin<br>============<br>Research Scientist<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br></div></div></div></div>