Dear Barry,<br /><br />Does BoomeAMG precondition (one v-cycle) the system after every iteration of GMRES(m) <br />OR<br />it precondition the linear system once only and then GMRES(m) iterations until convergence is reached?<br /><br />Kind regards, Younas   <br /><br /><br /><span>On 14-12-11, petsc-users-request@mcs.anl.gov wrote:</span><blockquote cite="mid:mailman.4205.1323873883.4254.petsc-users@mcs.anl.gov" class="iwcQuote" style="border-left: 1px solid rgb(0, 0, 255); padding-left: 13px; margin-left: 0pt;" type="cite"><div class="mimepart text plain">Send petsc-users mailing list submissions to<br />        petsc-users@mcs.anl.gov<br /><br />To subscribe or unsubscribe via the World Wide Web, visit<br />        <a href="https://lists.mcs.anl.gov/mailman/listinfo/petsc-users" target="l">https://lists.mcs.anl.gov/mailman/listinfo/petsc-users</a><br />or, via email, send a message with subject or body 'help' to<br />        petsc-users-request@mcs.anl.gov<br /><br />You can reach the person managing the list at<br />        petsc-users-owner@mcs.anl.gov<br /><br />When replying, please edit your Subject line so it is more specific<br />than &quot;Re: Contents of petsc-users digest...&quot;<br /><br /><br />Today's Topics:<br /><br />   1.  run successfully on 20 processors but failed on 24<br />      processors (Xiangdong Liang)<br />   2. Re:  run successfully on 20 processors but failed on        24<br />      processors (Matthew Knepley)<br />   3.  Two Questions about Matrix Preallocation (behzad baghapour)<br />   4.  Multigrid as preconditioner (M.Younas)<br />   5.  save vector to bin-file at each time step (robert)<br />   6.  AMG as preconditioner (M.Younas)<br />   7. Re:  Two Questions about Matrix Preallocation (Barry Smith)<br />   8. Re:  Multigrid as preconditioner (Barry Smith)<br />   9. Re:  save vector to bin-file at each time step (Barry Smith)<br />  10. Re:  save vector to bin-file at each time step (robert)<br /><br /><br />----------------------------------------------------------------------<br /><br />Message: 1<br />Date: Tue, 13 Dec 2011 22:49:40 -0500<br />From: Xiangdong Liang &lt;xdliang@gmail.com&gt;<br />Subject: [petsc-users] run successfully on 20 processors but failed on<br />        24        processors<br />To: PETSc users list &lt;petsc-users@mcs.anl.gov&gt;<br />Message-ID:<br />        &lt;CAGzjfYZMW3dY7-PDH8AReAnQRuUVC0W6Jtbfu-ETMTc5JaopcQ@mail.gmail.com&gt;<br />Content-Type: text/plain; charset=ISO-8859-1<br /><br />Hello everyone,<br /><br />I am solving complex Ax=b with PaStix on 20 processors successfully<br />but failed on 24 processors. The relatively error indicated by<br />mat_pastix_verbose becomes &quot;nan&quot;  for 24 processors. Where could be<br />wrong? Can someone give me some hints on how I can debug? Thanks.<br /><br />Xiangdong<br /><br /><br />------------------------------<br /><br />Message: 2<br />Date: Tue, 13 Dec 2011 22:59:09 -0600<br />From: Matthew Knepley &lt;knepley@gmail.com&gt;<br />Subject: Re: [petsc-users] run successfully on 20 processors but<br />        failed on        24 processors<br />To: PETSc users list &lt;petsc-users@mcs.anl.gov&gt;<br />Message-ID:<br />        &lt;CAMYG4Gm_fnVMEpks_wt07_fg8PF3q-oCNAzw4U1G48JTJVwvPA@mail.gmail.com&gt;<br />Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br /><br />On Tue, Dec 13, 2011 at 9:49 PM, Xiangdong Liang &lt;xdliang@gmail.com&gt; wrote:<br /><br />&gt; Hello everyone,<br />&gt;<br />&gt; I am solving complex Ax=b with PaStix on 20 processors successfully<br />&gt; but failed on 24 processors. The relatively error indicated by<br />&gt; mat_pastix_verbose becomes &quot;nan&quot;  for 24 processors. Where could be<br />&gt; wrong? Can someone give me some hints on how I can debug? Thanks.<br /><br /><br />First, make sure you did not put any NaNs in your matrix or rhs.<br /><br />   Matt<br /><br /><br />&gt;<br />&gt; Xiangdong<br /><br />-- <br />What most experimenters take for granted before they begin their<br />experiments is infinitely more interesting than any results to which their<br />experiments lead.<br />-- Norbert Wiener<br />-------------- next part --------------<br />An HTML attachment was scrubbed...<br />URL: &lt;<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111213/339c4743/attachment-0001.htm" target="l">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111213/339c4743/attachment-0001.htm</a>&gt;<br /><br />------------------------------<br /><br />Message: 3<br />Date: Wed, 14 Dec 2011 11:32:48 +0330<br />From: behzad baghapour &lt;behzad.baghapour@gmail.com&gt;<br />Subject: [petsc-users] Two Questions about Matrix Preallocation<br />To: PETSc users list &lt;petsc-users@mcs.anl.gov&gt;<br />Message-ID:<br />        &lt;CA+jOtDLYQy-2Xt8UsvNdnZySbqNBQTwyFi5vrp39=6j9hagD0Q@mail.gmail.com&gt;<br />Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br /><br />Dear Developers,<br /><br />I am facing with two questions about Block-Sparse Preallocation:<br /><br />1- I set array &quot;nnz[]&quot; and did:<br /><br />    MatSetType ( JAC, MATSEQBAIJ );<br />    MatSetSizes( JAC, PETSC_DECIDE, PETSC_DECIDE, nt, nt );<br />    MatSeqAIJSetPreallocation( JAC, 0, nnz );<br /><br />but when I saw log file with -info -mat_view_info, I found this message:<br /><br />[0] MatSetUpPreallocation(): Warning not preallocating matrix storage<br /><br />What this means? Did I correctly preallocate the matrix?<br /><br />2- I need to test MatSeqBAIJSetPreallocation() too but I little confused<br />with descriptions of the command in man-page:<br /><br />what are &quot;nz&quot; and &quot;nnz[]&quot; in this case?<br /><br />what about number of blocks per row?<br /><br />Thanks bothering too much :-)<br />BehZad<br />-------------- next part --------------<br />An HTML attachment was scrubbed...<br />URL: &lt;<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111214/abec449b/attachment-0001.htm" target="l">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111214/abec449b/attachment-0001.htm</a>&gt;<br /><br />------------------------------<br /><br />Message: 4<br />Date: Wed, 14 Dec 2011 14:07:10 +0100<br />From: &quot;M.Younas&quot; &lt;m.younas@rug.nl&gt;<br />Subject: [petsc-users] Multigrid as preconditioner<br />To: petsc-users@mcs.anl.gov<br />Message-ID: &lt;73f0f8e5cc491.4ee8ad8e@rug.nl&gt;<br />Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br /><br />?Hi, PETSc, Team,<br /><br />I have solved a non-symmetric Poisson problem using GMRES(m) as solver and BoomerAMG (from Hypre) as preconditioner. But I don't understand how the BoomerAMG works as preconditioner with GMRES(m). Can anyone explain the procedure? Does it work like BoomerAMG precondition the liner system first (once only) and then GMRES(m) is being used for stopping criterion?<br /><br />Kind regards,<br /><br />Younas<br /><br />RUG, Groningen, The Netherlands.<br />-------------- next part --------------<br />An HTML attachment was scrubbed...<br />URL: &lt;<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111214/684a66f7/attachment-0001.htm" target="l">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111214/684a66f7/attachment-0001.htm</a>&gt;<br /><br />------------------------------<br /><br />Message: 5<br />Date: Wed, 14 Dec 2011 15:00:03 +0100<br />From: robert &lt;robert.bodner@unil.ch&gt;<br />Subject: [petsc-users] save vector to bin-file at each time step<br />To: petsc-users@mcs.anl.gov<br />Message-ID: &lt;4EE8ABE3.5050108@unil.ch&gt;<br />Content-Type: text/plain; charset=&quot;iso-8859-1&quot;; Format=&quot;flowed&quot;<br /><br />Hello,<br /><br />I am quite new to petsc and therefore my question might be quite trivial.<br /><br />I have a 1D finite difference code and want to store several vectors in <br />a binary:<br /><br />     ierr = PetscViewerCreate(PETSC_COMM_WORLD,&amp;viewer);CHKERRQ(ierr);<br />     ierr = <br />PetscViewerBinaryOpen(PETSC_COMM_WORLD,&quot;out.bin&quot;,FILE_MODE_APPEND,&amp;viewer); <br />CHKERRQ(ierr);<br />     ierr = PetscObjectSetName((PetscObject)u,&quot;u&quot;);CHKERRQ(ierr);<br />     ierr = PetscObjectSetName((PetscObject)rhs,&quot;rhs&quot;);CHKERRQ(ierr);<br />     ierr = VecView(u,viewer); CHKERRQ(ierr);<br />     ierr = VecView(rhs,viewer);CHKERRQ(ierr);<br /><br />However, when I read the file with matlab (PetscBinaryRead.m) I only get <br />the first vector.<br /><br />In further application I would like to use something similar but putting <br />out the solution vector every timestep.<br /><br />Could someone just provide me some sample code?<br /><br />Thanks,<br />Robert<br /><br /><br />-------------- next part --------------<br />An HTML attachment was scrubbed...<br />URL: &lt;<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111214/5a31167d/attachment-0001.htm" target="l">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111214/5a31167d/attachment-0001.htm</a>&gt;<br /><br />------------------------------<br /><br />Message: 6<br />Date: Wed, 14 Dec 2011 15:04:47 +0100<br />From: &quot;M.Younas&quot; &lt;m.younas@rug.nl&gt;<br />Subject: [petsc-users] AMG as preconditioner<br />To: petsc-users@mcs.anl.gov<br />Message-ID: &lt;7420f1bdca4d2.4ee8bb0f@rug.nl&gt;<br />Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br /><br />?Hi, PETSc, Team,<br /><br />I have <br />solved a non-symmetric Poisson problem using GMRES(m) as solver and <br />BoomerAMG (from Hypre) as preconditioner. But I don't understand how the<br /> BoomerAMG works as preconditioner with GMRES(m). Can anyone explain the<br /> procedure? Does it work like BoomerAMG precondition the liner system <br />first (once only) and then GMRES(m) is being used for stopping <br />criterion?<br /><br />Kind regards,<br /><br />Younas<br /><br />RUG, Groningen, The Netherlands.<br />-------------- next part --------------<br />An HTML attachment was scrubbed...<br />URL: &lt;<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111214/70b57dea/attachment-0001.htm" target="l">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111214/70b57dea/attachment-0001.htm</a>&gt;<br /><br />------------------------------<br /><br />Message: 7<br />Date: Wed, 14 Dec 2011 08:22:33 -0600<br />From: Barry Smith &lt;bsmith@mcs.anl.gov&gt;<br />Subject: Re: [petsc-users] Two Questions about Matrix Preallocation<br />To: PETSc users list &lt;petsc-users@mcs.anl.gov&gt;,        behzad baghapour<br />        &lt;behzad.baghapour@gmail.com&gt;<br />Message-ID: &lt;CF31FC30-6E95-4F0E-AA13-6D7260172041@mcs.anl.gov&gt;<br />Content-Type: text/plain; charset=us-ascii<br /><br /><br />On Dec 14, 2011, at 2:02 AM, behzad baghapour wrote:<br /><br />&gt; Dear Developers,<br />&gt; <br />&gt; I am facing with two questions about Block-Sparse Preallocation:<br />&gt; <br />&gt; 1- I set array &quot;nnz[]&quot; and did:<br />&gt; <br />&gt;     MatSetType ( JAC, MATSEQBAIJ );<br />&gt;     MatSetSizes( JAC, PETSC_DECIDE, PETSC_DECIDE, nt, nt );    <br />&gt;     MatSeqAIJSetPreallocation( JAC, 0, nnz );<br />&gt; <br />&gt; but when I saw log file with -info -mat_view_info, I found this message:<br />&gt; <br />&gt; [0] MatSetUpPreallocation(): Warning not preallocating matrix storage<br /><br />   Since you are using BAIJ matrix type you need to also call MatSeqBAIJSetPreallocation()<br /><br />&gt; <br />&gt; What this means? Did I correctly preallocate the matrix?<br />&gt; <br />&gt; 2- I need to test MatSeqBAIJSetPreallocation() too but I little confused with descriptions of the command in man-page:<br />&gt; <br />&gt; what are &quot;nz&quot; and &quot;nnz[]&quot; in this case?<br />&gt; <br />&gt; what about number of blocks per row?<br /><br />   nz is the maximum number of blocks per row, just like with other matrix formats or you can set nnz[] which for each row is the number of blocks from the diagonal block to the end of the row.  For example with a block size of one the matrix<br /><br />  1   0  2<br />   0  3 4<br />   2  4  5 <br /><br />would have a nnz[] = 2,2,1<br /><br /> Barry<br /><br />&gt; <br />&gt; Thanks bothering too much :-)<br />&gt; BehZad<br />&gt; <br /><br /><br /><br />------------------------------<br /><br />Message: 8<br />Date: Wed, 14 Dec 2011 08:26:27 -0600<br />From: Barry Smith &lt;bsmith@mcs.anl.gov&gt;<br />Subject: Re: [petsc-users] Multigrid as preconditioner<br />To: PETSc users list &lt;petsc-users@mcs.anl.gov&gt;<br />Message-ID: &lt;2770E217-0CC1-4E85-AB40-35B00F705D53@mcs.anl.gov&gt;<br />Content-Type: text/plain; charset=us-ascii<br /><br /><br />On Dec 14, 2011, at 7:07 AM, M.Younas wrote:<br /><br />&gt;  Hi, PETSc, Team,<br />&gt; <br />&gt; I have solved a non-symmetric Poisson problem using GMRES(m) as solver and BoomerAMG (from Hypre) as preconditioner. But I don't understand how the BoomerAMG works as preconditioner with GMRES(m). Can anyone explain the procedure? Does it work like BoomerAMG precondition the liner system first (once only) and then GMRES(m) is being used for stopping criterion?<br /><br />   By default PETSc uses ONE v-cycle of the BoomerAMG as a preconditioner for GMRES. <br /><br />   With the option -ksp_type richardson then PETSc is using a bunch of BoomerAMG v-cycles until the convergence criteria is satisfied without using a GMRES<br /><br />   Barry<br /><br />Note that a preconditioner can be any stationary linear iterative scheme. That is any linear operation that approximately solves A x = b, no matter how complicated the stationary linear iterative scheme is it can be used as a preconditioner.<br /><br /><br />&gt; <br />&gt; Kind regards,<br />&gt; <br />&gt; Younas<br />&gt; <br />&gt; RUG, Groningen, The Netherlands.<br /><br /><br /><br />------------------------------<br /><br />Message: 9<br />Date: Wed, 14 Dec 2011 08:32:58 -0600<br />From: Barry Smith &lt;bsmith@mcs.anl.gov&gt;<br />Subject: Re: [petsc-users] save vector to bin-file at each time step<br />To: PETSc users list &lt;petsc-users@mcs.anl.gov&gt;<br />Message-ID: &lt;76717B20-13EF-4FD2-BF50-CC12E9E87842@mcs.anl.gov&gt;<br />Content-Type: text/plain; charset=us-ascii<br /><br /><br />On Dec 14, 2011, at 8:00 AM, robert wrote:<br /><br />&gt; Hello, <br />&gt; <br />&gt; I am quite new to petsc and therefore my question might be quite trivial.<br />&gt; <br />&gt; I have a 1D finite difference code and want to store several vectors in a binary:<br />&gt; <br />&gt;     ierr = PetscViewerCreate(PETSC_COMM_WORLD,&amp;viewer);CHKERRQ(ierr);<br />&gt;     ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD,&quot;out.bin&quot;,FILE_MODE_APPEND,&amp;viewer); CHKERRQ(ierr);<br />&gt;     ierr = PetscObjectSetName((PetscObject)u,&quot;u&quot;);CHKERRQ(ierr);<br />&gt;     ierr = PetscObjectSetName((PetscObject)rhs,&quot;rhs&quot;);CHKERRQ(ierr);<br />&gt;     ierr = VecView(u,viewer); CHKERRQ(ierr);<br />&gt;     ierr = VecView(rhs,viewer);CHKERRQ(ierr);<br />&gt; <br />&gt; However, when I read the file with matlab (PetscBinaryRead.m) I only get the first vector.<br /><br />   1) Did you call PetscViewerDestroy() before the end of the program? If not called all the data may not be flushed into the file.<br /><br />   2) How are you reading the vectors into Matlab? For example   [u,rhs] = PetscBinaryRead('filename') will read in two vectors.  If you want to call PetscBinaryRead() repeatedly to read more information than read the help for PetscBinaryRead() carefully, you cannot simply call u = PetscBinaryRead('filename'); rhs = PetscBinaryRead('filename') and hope to get the second vector <br /><br />  For example: fd = PetscOpenFile('filename');<br />                u = PetscBinaryRead(fd);   % get first vector<br />                rhs = PetscBinaryRead(fd);  % get second vector<br /><br />  Barry<br /><br /><br />&gt; <br />&gt; In further application I would like to use something similar but putting out the solution vector every timestep.<br />&gt; <br />&gt; Could someone just provide me some sample code?<br />&gt; <br />&gt; Thanks, <br />&gt; Robert<br />&gt; <br />&gt; <br /><br /><br /><br />------------------------------<br /><br />Message: 10<br />Date: Wed, 14 Dec 2011 15:44:39 +0100<br />From: robert &lt;robert.bodner@unil.ch&gt;<br />Subject: Re: [petsc-users] save vector to bin-file at each time step<br />To: PETSc users list &lt;petsc-users@mcs.anl.gov&gt;<br />Message-ID: &lt;4EE8B657.4090506@unil.ch&gt;<br />Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br /><br />On 12/14/2011 03:32 PM, Barry Smith wrote:<br />&gt; On Dec 14, 2011, at 8:00 AM, robert wrote:<br />&gt;<br />&gt;&gt; Hello,<br />&gt;&gt;<br />&gt;&gt; I am quite new to petsc and therefore my question might be quite trivial.<br />&gt;&gt;<br />&gt;&gt; I have a 1D finite difference code and want to store several vectors in a binary:<br />&gt;&gt;<br />&gt;&gt;      ierr = PetscViewerCreate(PETSC_COMM_WORLD,&amp;viewer);CHKERRQ(ierr);<br />&gt;&gt;      ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD,&quot;out.bin&quot;,FILE_MODE_APPEND,&amp;viewer); CHKERRQ(ierr);<br />&gt;&gt;      ierr = PetscObjectSetName((PetscObject)u,&quot;u&quot;);CHKERRQ(ierr);<br />&gt;&gt;      ierr = PetscObjectSetName((PetscObject)rhs,&quot;rhs&quot;);CHKERRQ(ierr);<br />&gt;&gt;      ierr = VecView(u,viewer); CHKERRQ(ierr);<br />&gt;&gt;      ierr = VecView(rhs,viewer);CHKERRQ(ierr);<br />&gt;&gt;<br />&gt;&gt; However, when I read the file with matlab (PetscBinaryRead.m) I only get the first vector.<br />&gt;&gt;<br />&gt;&gt;<br />&gt;&gt;     2) How are you reading the vectors into Matlab? For example   [u,rhs] = PetscBinaryRead('filename') will read in two vectors.  If you want to call PetscBinaryRead() repeatedly to read more information than ...<br /><br />Hi,<br /><br />thank you for your fast reply. It's as easy as that and I spent hours <br />... :-)<br />&gt;&gt;<br /><br /><br />&gt;&gt; In further application I would like to use something similar but putting out the solution vector every timestep.<br />&gt;&gt;<br />&gt;&gt; Could someone just provide me some sample code?<br />&gt;&gt;<br />&gt;&gt; Thanks,<br />&gt;&gt; Robert<br />&gt;&gt;<br />&gt;&gt;<br />&gt;<br /><br /><br /><br />------------------------------<br /><br />_______________________________________________<br />petsc-users mailing list<br />petsc-users@mcs.anl.gov<br /><a href="https://lists.mcs.anl.gov/mailman/listinfo/petsc-users" target="l">https://lists.mcs.anl.gov/mailman/listinfo/petsc-users</a><br /><br /><br />End of petsc-users Digest, Vol 36, Issue 50<br />*******************************************<br /></div></blockquote>