[petsc-users] empty split for fieldsplit

Hoang Giang Bui hgbk2008 at gmail.com
Thu Jun 15 07:56:46 CDT 2017


Hi Barry

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

mpirun -np 2 ./ex -mat_size 40 -block_size 2 -method 1

everything was fine. With method = 1, fieldsplit size of B is nonzero and
is divided by the block size.

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

[1]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[1]PETSC ERROR: Arguments are incompatible
[1]PETSC ERROR: Local size 11 not compatible with block size 2

This is somehow not logical, because 0 is divided by block_size.

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.

Giang

On Wed, Jun 14, 2017 at 5:29 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
> You can't do this
>
>    ierr = MatSetSizes(A,PETSC_DECIDE,N,N,N);CHKERRQ(ierr);
>
>   use PETSC_DECIDE for the third argument
>
> Also this is wrong
>
>   for (i = Istart; i < Iend; ++i)
>    {
>        ierr = MatSetValue(A,i,i,2,INSERT_VALUES);CHKERRQ(ierr);
>        ierr = MatSetValue(A,i+1,i,-1,INSERT_VALUES);CHKERRQ(ierr);
>        ierr = MatSetValue(A,i,i+1,-1,INSERT_VALUES);CHKERRQ(ierr);
>    }
>
> you will get
>
> $ petscmpiexec -n 2 ./ex1
> 0: Istart = 0, Iend = 60
> 1: Istart = 60, Iend = 120
> [1]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [1]PETSC ERROR: Argument out of range
> [1]PETSC ERROR: Row too large: row 120 max 119
> [1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [1]PETSC ERROR: Petsc Development GIT revision: v3.7.6-4103-g93161b8192
> GIT Date: 2017-06-11 14:49:39 -0500
> [1]PETSC ERROR: ./ex1 on a arch-basic named Barrys-MacBook-Pro.local by
> barrysmith Wed Jun 14 18:26:52 2017
> [1]PETSC ERROR: Configure options PETSC_ARCH=arch-basic
> [1]PETSC ERROR: #1 MatSetValues_MPIAIJ() line 550 in
> /Users/barrysmith/Src/petsc/src/mat/impls/aij/mpi/mpiaij.c
> [1]PETSC ERROR: #2 MatSetValues() line 1270 in
> /Users/barrysmith/Src/petsc/src/mat/interface/matrix.c
> [1]PETSC ERROR: #3 main() line 30 in /Users/barrysmith/Src/petsc/te
> st-dir/ex1.c
> [1]PETSC ERROR: PETSc Option Table entries:
> [1]PETSC ERROR: -malloc_test
>
> You need to get the example working so it ends with the error you reported
> previously not these other bugs.
>
>
> > On Jun 12, 2017, at 10:19 AM, Hoang Giang Bui <hgbk2008 at gmail.com>
> wrote:
> >
> > Dear Barry
> >
> > I made a small example with 2 process with one empty split in proc 0.
> But it gives another strange error
> >
> > [1]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> > [1]PETSC ERROR: Arguments are incompatible
> > [1]PETSC ERROR: Local size 31 not compatible with block size 2
> >
> > The local size is always 60, so this is confusing.
> >
> > Giang
> >
> > On Sun, Jun 11, 2017 at 8:11 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> >   Could be, send us a simple example that demonstrates the problem and
> we'll track it down.
> >
> >
> > > On Jun 11, 2017, at 12:34 PM, Hoang Giang Bui <hgbk2008 at gmail.com>
> wrote:
> > >
> > > Hello
> > >
> > > 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 ?
> > >
> > > Giang
> >
> >
> > <ex.c>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170615/777f8a8c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex.c
Type: text/x-csrc
Size: 4020 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170615/777f8a8c/attachment.c>


More information about the petsc-users mailing list