[petsc-users] ERROR: Cannot pass default in for both input and output indices
Barry Smith
bsmith at mcs.anl.gov
Mon Oct 24 15:46:54 CDT 2011
Your problem is that you think that somehow if you pass defaults to VecScatter is going to magically determine which elements you want mapped from the first vector to which elements in the second vector. Unless both vectors have the exact same local sizes how is it to know what mapping you want? (Hence the error it generated) You need to determine exactly what you want mapped from the first vector to the second and then set up the IS to make that happen. Hoping that some defaults will do what you want is not a good idea. Note that each process has to provide the same size in ix and iy, that determine the froms and tos for the entries. It makes no sense for a process to provide the locations of some froms but not the locations of the corresponding toos.
Barry
On Oct 24, 2011, at 3:29 PM, Dominik Szczerba wrote:
>>>> The best solution is for you to pass in an index set for either one or both of the IS arguments.
>>>
>>> This is changing very many lines in a few codes, so I am looking for a
>>> minimalistic approach. Am I rigorously correct, or just lucky till the
>>> next release, to replace the first PETSC_NULL with IS created with
>>> ISCreateStride?
>>
>> Yes. Just make the local size of the scatter the same as the local size of the vector.
>
> When doing so, I receive:
>
> [1]PETSC ERROR: VecScatterCreate() line 1136 in
> /home/dsz/pack/petsc-3.2-p3/src/vec/vec/utils/vscat.c Local scatter
> sizes don't match
>
> Inspecting vscat.c reveals:
>
>
>
> ierr = ISGetLocalSize(ix,&nx);CHKERRQ(ierr);
> ...
> ierr = ISGetLocalSize(iy,&ny);CHKERRQ(ierr);
> ...
> if (nx != ny) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_SIZ,"Local scatter
> sizes don't match");
>
>
>
> which looks quite suspicious to me, i.e. 1) If iy is PETSC_NULL, how
> can its size be queried? 2) looks like NONE of the index sets is
> actually allowed to be PETSC_NULL.
>
> I would be very grateful for some clarifications here.
>
> Many thanks and best regards,
> Dominik
More information about the petsc-users
mailing list