[petsc-users] ISLocalToGlobalMappingApplyIS switches communicator?

Matthew Knepley knepley at gmail.com
Mon Feb 24 09:10:21 CST 2014


On Mon, Feb 24, 2014 at 6:57 AM, De Groof, Vincent Frans Maria <
Vincent.De-Groof at uibk.ac.at> wrote:

>  Hi,
>
>
>  I have an IS object, which lists per process certain DOFs in local
> numbering. I want to get the global numbering, so I apply
> ISLocalToGlobalMappingApplyIS. However, while I can view them in local
> numbering using the ISView(ISLocal, PETSC_VIEWER_STDOUT_WORLD), I cannot
> view them in global numbering using ISView(ISGlobal, VIEWER_STDOUT_WORLD).
> It complains that "Arguments must have same communicators".
>
>  Is this normal? Can someone explain what is happening? I assumed that
> the ISLocalToGlobalMappingApplyIS would just copy the communicator from the
> local IS.
>

This is a bug. IS used to be purely serial, but then it evolved parallel
abilities (it was bitten by a radioactive spider), so there
are some PETSC_COMM_SELFs hidden in the code. I will fix this, but you can
just change the creation line in
src/vec/is/utils/isltog.c:ISLocalToGlobalMappingApplyIS() to use
PetscObjectComm((PetscObject) is) instead.

  Thanks,

     Matt


> Code snippet:
>
>  IS ISLocal, ISGlobal;
> ierr = ISCreateGeneral(PETSC_COMM_WORLD, nvtx, vtx_idx, PETSC_COPY_VALUES,
> &ISLocal); CHKERRQ(ierr);
> ierr = ISLocalToGlobalMappingApplyIS(ISg2lMap, ISLocal, &ISGlobal);
> CHKERRQ(ierr);
> ISView(ISLocal, PETSC_VIEWER_STDOUT_WORLD);
> ISView(ISGlobal, PETSC_VIEWER_STDOUT_WORLD);   <-- returns the error.
>
>
>
>
>  thanks,
> Vincent
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140224/f5e3a3d6/attachment.html>


More information about the petsc-users mailing list