<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
> On Nov 30, 2018, at 1:30 PM, Sajid Ali via petsc-users <petsc-users@mcs.anl.gov> wrote:<br>
> <br>
> Hi, <br>
> <br>
> I tried running ex19.c and I get the following error (I added a small snippet to print the local size on rank0 as well) :<br>
> <br>
> [sajid@xrm temp]$ mpirun -np 2 ./ex19 <br>
> local_sizes : 3 4 <br>
> [1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
> [1]PETSC ERROR: Arguments are incompatible<br>
> [1]PETSC ERROR: Incompatible vector local lengths parameter # 1 local size 3 != parameter # 2 local size 2<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 Release Version 3.10.2, unknown <br>
> [1]PETSC ERROR: ./ex19 on a named xrm by sajid Fri Nov 30 13:28:36 2018<br>
> [1]PETSC ERROR: [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
> [0]PETSC ERROR: Arguments are incompatible<br>
> [0]PETSC ERROR: Incompatible vector local lengths parameter # 1 local size 3 != parameter # 2 local size 4<br>
> [0]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>
> [0]PETSC ERROR: Petsc Release Version 3.10.2, unknown <br>
> [0]PETSC ERROR: ./ex19 on a named xrm by sajid Fri Nov 30 13:28:36 2018<br>
> <br>
> Does this mean that PETSC_DECIDE is inconsistent between two calls in the same file ?
<br>
<br>
No. The reason for the error is a bug in the code. The x1 vector has a block size of 1 hence when it is divided among two processes it gets 3 entries on each process. The x2 vector has a block size of 2 so when it is divided among two processes it gets 4
entries on the first process and 2 on the second. The call to VecCopy() does not work because the two vectors have different layouts.<br>
<br>
I have attached a fixed version of the code (that does not copy from x1 to x2).
<br>
<br>
Barry<br>
<br>
</div>
</span></font></div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
> <br>
> Thank You, <br>
> Sajid Ali<br>
> Applied Physics<br>
> Northwestern University<br>
<br>
</div>
</span></font></div>
</body>
</html>