<div dir="ltr">Thanks Hong<div><br><div>I confirmed that it's fixed by your changes.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Giang</div></div></div>
<br><div class="gmail_quote">On Sun, Jun 18, 2017 at 4:45 PM, Hong <span dir="ltr"><<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</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"><span style="color:rgb(80,0,80);font-family:Calibri,sans-serif;font-size:14.6667px">Hoang,</span><div><font color="#500050" face="Calibri, sans-serif"><span style="font-size:14.6667px">I pushed a fix </span></font></div><div><font color="#500050" face="Calibri, sans-serif"><span style="font-size:14.6667px"><a href="https://bitbucket.org/petsc/petsc/commits/d4e3277789d24018f0db1641a80db7be76600165" target="_blank">https://bitbucket.org/petsc/<wbr>petsc/commits/<wbr>d4e3277789d24018f0db1641a80db7<wbr>be76600165</a></span></font></div><div><font color="#500050" face="Calibri, sans-serif"><span style="font-size:14.6667px">and added your test to </span></font></div><div><font color="#500050" face="Calibri, sans-serif"><span style="font-size:14.6667px">petsc/src/ksp/ksp/examples/<wbr>tests/ex53.c</span></font></div><div><font color="#500050" face="Calibri, sans-serif"><span style="font-size:14.6667px"><br></span></font></div><div><font color="#500050" face="Calibri, sans-serif"><span style="font-size:14.6667px">It is on the branch hzhang/fix-blockedIS-submat</span></font></div><div><font color="#500050" face="Calibri, sans-serif"><span style="font-size:14.6667px">Let me know if it still does not fix your problem.</span></font></div><span class="HOEnZb"><font color="#888888"><div><font color="#500050" face="Calibri, sans-serif"><span style="font-size:14.6667px"><br></span></font></div></font></span><div><span class="HOEnZb"><font color="#888888"><font color="#500050" face="Calibri, sans-serif"><span style="font-size:14.6667px">Hong<br></span></font></font></span><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 17, 2017 at 4:06 PM, Zhang, Hong <span dir="ltr"><<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>

<div id="m_-3682166320540266785gmail-m_6525553675041922105divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>never mind, I know it is ok to set blocksize=2</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_-3682166320540266785gmail-m_6525553675041922105divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Zhang, Hong<br>
<b>Sent:</b> Saturday, June 17, 2017 3:56:35 PM<div><div class="m_-3682166320540266785gmail-h5"><br>
<b>To:</b> Smith, Barry F.; Hoang Giang Bui<br>
<b>Cc:</b> petsc-users<br>
<b>Subject:</b> Re: [petsc-users] empty split for fieldsplit</div></div></font>
<div> </div>
</div><div><div class="m_-3682166320540266785gmail-h5">
<div>
<div id="m_-3682166320540266785gmail-m_6525553675041922105divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Matrix A is a tridiagonal matrix with blocksize=1.</p>
<p>Why do you set block_size=2 for A_IS and B_IS?</p>
<p><br>
</p>
<p>Hong</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_-3682166320540266785gmail-m_6525553675041922105divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Zhang, Hong<br>
<b>Sent:</b> Friday, June 16, 2017 7:55:45 AM<br>
<b>To:</b> Smith, Barry F.; Hoang Giang Bui<br>
<b>Cc:</b> petsc-users<br>
<b>Subject:</b> Re: [petsc-users] empty split for fieldsplit</font>
<div> </div>
</div>
<div>
<div id="m_-3682166320540266785gmail-m_6525553675041922105divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>I'm in Boulder and will be back home this evening.</p>
<p>Will test it this weekend.</p>
<p><br>
</p>
<p>Hong</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_-3682166320540266785gmail-m_6525553675041922105divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Smith, Barry F.<br>
<b>Sent:</b> Thursday, June 15, 2017 1:38:11 PM<br>
<b>To:</b> Hoang Giang Bui; Zhang, Hong<br>
<b>Cc:</b> petsc-users<br>
<b>Subject:</b> Re: [petsc-users] empty split for fieldsplit</font>
<div> </div>
</div>
<div>
<div class="m_-3682166320540266785gmail-m_6525553675041922105BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="m_-3682166320540266785gmail-m_6525553675041922105PlainText"><br>
   Hong,<br>
<br>
Please build the attached code with master and run with <br>
<br>
petscmpiexec -n 2 ./ex1 -mat_size 40 -block_size 2 -method 2<br>
<br>
I think this is a bug in your new MatGetSubMatrix routines. You take the block size of the outer IS and pass it into the inner IS but that inner IS may not support the same block size hence the crash.<br>
<br>
   Can you please debug this?<br>
<br>
    Thanks<br>
<br>
     Barry<br>
</div>
</span></font></div>
<div class="m_-3682166320540266785gmail-m_6525553675041922105BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="m_-3682166320540266785gmail-m_6525553675041922105PlainText"><br>
<br>
<br>
> On Jun 15, 2017, at 7:56 AM, Hoang Giang Bui <<a href="mailto:hgbk2008@gmail.com" target="_blank">hgbk2008@gmail.com</a>> wrote:<br>
> <br>
> Hi Barry<br>
> <br>
> Thanks for pointing out the error. I think the problem coming from the zero fieldsplit in proc 0. In this modified example, I parameterized the matrix size and block size, so when you're executing<br>
> <br>
> mpirun -np 2 ./ex -mat_size 40 -block_size 2 -method 1<br>
> <br>
> everything was fine. With method = 1, fieldsplit size of B is nonzero and is divided by the block size.<br>
> <br>
> With method=2, i.e mpirun -np 2 ./ex -mat_size 40 -block_size 2 -method 2, the fieldsplit B is zero on proc 0, and the error is thrown<br>
> <br>
> [1]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
> [1]PETSC ERROR: Arguments are incompatible<br>
> [1]PETSC ERROR: Local size 11 not compatible with block size 2<br>
> <br>
> This is somehow not logical, because 0 is divided by block_size.<br>
> <br>
> Furthermore, if you execute  "mpirun -np 2 ./ex -mat_size 20 -block_size 2 -method 2", the code hangs at ISSetBlockSize, which is pretty similar to my original problem. Probably the original one also hangs at ISSetBlockSize, which I may not realize at that
 time.<br>
> <br>
> Giang<br>
> <br>
> On Wed, Jun 14, 2017 at 5:29 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:<br>
> <br>
> You can't do this<br>
> <br>
>    ierr = MatSetSizes(A,PETSC_DECIDE,N,N<wbr>,N);CHKERRQ(ierr);<br>
> <br>
>   use PETSC_DECIDE for the third argument<br>
> <br>
> Also this is wrong<br>
> <br>
>   for (i = Istart; i < Iend; ++i)<br>
>    {<br>
>        ierr = MatSetValue(A,i,i,2,INSERT_VAL<wbr>UES);CHKERRQ(ierr);<br>
>        ierr = MatSetValue(A,i+1,i,-1,INSERT_<wbr>VALUES);CHKERRQ(ierr);<br>
>        ierr = MatSetValue(A,i,i+1,-1,INSERT_<wbr>VALUES);CHKERRQ(ierr);<br>
>    }<br>
> <br>
> you will get<br>
> <br>
> $ petscmpiexec -n 2 ./ex1<br>
> 0: Istart = 0, Iend = 60<br>
> 1: Istart = 60, Iend = 120<br>
> [1]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
> [1]PETSC ERROR: Argument out of range<br>
> [1]PETSC ERROR: Row too large: row 120 max 119<br>
> [1]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">
http://www.mcs.anl.gov/petsc/d<wbr>ocumentation/faq.html</a> for trouble shooting.<br>
> [1]PETSC ERROR: Petsc Development GIT revision: v3.7.6-4103-g93161b8192  GIT Date: 2017-06-11 14:49:39 -0500<br>
> [1]PETSC ERROR: ./ex1 on a arch-basic named Barrys-MacBook-Pro.local by barrysmith Wed Jun 14 18:26:52 2017<br>
> [1]PETSC ERROR: Configure options PETSC_ARCH=arch-basic<br>
> [1]PETSC ERROR: #1 MatSetValues_MPIAIJ() line 550 in /Users/barrysmith/Src/petsc/sr<wbr>c/mat/impls/aij/mpi/mpiaij.c<br>
> [1]PETSC ERROR: #2 MatSetValues() line 1270 in /Users/barrysmith/Src/petsc/sr<wbr>c/mat/interface/matrix.c<br>
> [1]PETSC ERROR: #3 main() line 30 in /Users/barrysmith/Src/petsc/te<wbr>st-dir/ex1.c<br>
> [1]PETSC ERROR: PETSc Option Table entries:<br>
> [1]PETSC ERROR: -malloc_test<br>
> <br>
> You need to get the example working so it ends with the error you reported previously not these other bugs.<br>
> <br>
> <br>
> > On Jun 12, 2017, at 10:19 AM, Hoang Giang Bui <<a href="mailto:hgbk2008@gmail.com" target="_blank">hgbk2008@gmail.com</a>> wrote:<br>
> ><br>
> > Dear Barry<br>
> ><br>
> > I made a small example with 2 process with one empty split in proc 0. But it gives another strange error<br>
> ><br>
> > [1]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
> > [1]PETSC ERROR: Arguments are incompatible<br>
> > [1]PETSC ERROR: Local size 31 not compatible with block size 2<br>
> ><br>
> > The local size is always 60, so this is confusing.<br>
> ><br>
> > Giang<br>
> ><br>
> > On Sun, Jun 11, 2017 at 8:11 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:<br>
> >   Could be, send us a simple example that demonstrates the problem and we'll track it down.<br>
> ><br>
> ><br>
> > > On Jun 11, 2017, at 12:34 PM, Hoang Giang Bui <<a href="mailto:hgbk2008@gmail.com" target="_blank">hgbk2008@gmail.com</a>> wrote:<br>
> > ><br>
> > > Hello<br>
> > ><br>
> > > I noticed that my code stopped very long, possibly hang, at PCFieldSplitSetIS. There are two splits and one split is empty in one process. May that be the possible reason that PCFieldSplitSetIS hang ?<br>
> > ><br>
> > > Giang<br>
> ><br>
> ><br>
> > <ex.c><br>
> <br>
> <br>
> <ex.c><br>
<br>
</div>
</span></font></div>
</div>
</div>
</div>
</div></div></div>

</blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div></div></div>