<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;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%" tabindex="-1">
<div id="divRplyFwdMsg" 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<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><style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;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%" tabindex="-1">
<div id="divRplyFwdMsg" 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><style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;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%" tabindex="-1">
<div id="divRplyFwdMsg" 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="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText"><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="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText"><br>
<br>
<br>
> On Jun 15, 2017, at 7:56 AM, Hoang Giang Bui <hgbk2008@gmail.com> 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 --------------------------------------------------------------<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 <bsmith@mcs.anl.gov> wrote:<br>
> <br>
> You can't do this<br>
> <br>
> ierr = MatSetSizes(A,PETSC_DECIDE,N,N,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_VALUES);CHKERRQ(ierr);<br>
> ierr = MatSetValue(A,i+1,i,-1,INSERT_VALUES);CHKERRQ(ierr);<br>
> ierr = MatSetValue(A,i,i+1,-1,INSERT_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 --------------------------------------------------------------<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">
http://www.mcs.anl.gov/petsc/documentation/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/src/mat/impls/aij/mpi/mpiaij.c<br>
> [1]PETSC ERROR: #2 MatSetValues() line 1270 in /Users/barrysmith/Src/petsc/src/mat/interface/matrix.c<br>
> [1]PETSC ERROR: #3 main() line 30 in /Users/barrysmith/Src/petsc/test-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 <hgbk2008@gmail.com> 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 --------------------------------------------------------------<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 <bsmith@mcs.anl.gov> 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 <hgbk2008@gmail.com> 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>
</body>
</html>