[petsc-dev] ISLocalToGlobalMappingGetInfo

Pierre Jolivet pierre.jolivet at enseeiht.fr
Fri Aug 9 02:35:43 CDT 2019


Actually, I don’t think it is a bug, but rather an undocumented feature.
Someone clearly knew what they were doing when writing this: https://www.mcs.anl.gov/petsc/petsc-current/src/vec/is/utils/isltog.c.html#line1379 <https://www.mcs.anl.gov/petsc/petsc-current/src/vec/is/utils/isltog.c.html#line1379>
Now, the question becomes: is this really needed? Can’t the values associated to "rank" be stripped from the arrays from the get go?
I’m guessing this also explains why some loop start at 1 and not 0, e.g., https://www.mcs.anl.gov/petsc/petsc-current/src/vec/is/utils/isltog.c.html#line1583 <https://www.mcs.anl.gov/petsc/petsc-current/src/vec/is/utils/isltog.c.html#line1583>

I’ll try to take a crack at it, anyway, now I know that the information I’m looking for is basically all the arrays shifted by 1 and nproc = nproc - 1.

Thanks,
Pierre

> On 9 Aug 2019, at 8:52 AM, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
> 
> 
>  The documents and the code indicate that nproc should be 1 in this case. So there is a bug, if you are unable to determine the cause I can try to look at it but have stones of things to do.
> 
>  Barry
> 
> 
>> On Aug 9, 2019, at 12:37 AM, Pierre Jolivet <pierre.jolivet at enseeiht.fr> wrote:
>> 
>> Again, with only 2 processes, where nproc is set to 2, I get the following numprocs and indices arrays on rank 0:
>> 0	110 111 112 113 114 115 116 117 … 
>> 1	110 111 112 113 114 115 116 117 …
>> Are these the expected values? If so, what is the true definition of nproc, please?
>> 
>> Thanks,
>> Pierre
>> 
>>> On 9 Aug 2019, at 3:45 AM, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
>>> 
>>> 
>>> There could be a bug. Perhaps check the entries for that "extra" connection, are they all actual meaningful connections. The code that fills up these data structures is somewhat involved.
>>> 
>>> Barry
>>> 
>>> 
>>>> On Aug 8, 2019, at 9:39 AM, Pierre Jolivet via petsc-dev <petsc-dev at mcs.anl.gov> wrote:
>>>> 
>>>> Hello,
>>>> When I use ISLocalToGlobalMappingGetInfo, e.g., in src/ksp/ksp/examples/tutorials/ex71.c ISLocalToGlobalMappingGetInfo(map, &nproc, &procs, &numprocs, &indices), I get the following value for nproc:
>>>> - with 1 process: 0
>>>> - with 2 processes: 2
>>>> In the source code, it says that nproc is the “number of processors that are connected to this one”.
>>>> How come this value is equal to the size of the global communicator when using 2 processes?
>>>> According to the comment in the source code, shouldn’t the returned value be 1?
>>>> 
>>>> Thanks,
>>>> Pierre
>>> 
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20190809/8d37af07/attachment.html>


More information about the petsc-dev mailing list