[petsc-users] PetscViewer with 64bit

Matthew Knepley knepley at gmail.com
Tue Feb 14 16:32:07 CST 2023


On Tue, Feb 14, 2023 at 11:45 AM Mike Michell <mi.mike1021 at gmail.com> wrote:

> I was trying to modify the header flags from "Int32" to "Int64", but the
> problem was not resolved. Could I get any additional comments?
>

The calculated offsets are not correct I think.

  Matt


> Thanks,
> Mike
>
>
>> Thanks for the comments.
>> To be precise on the question, the entire part of the header of the .vtu
>> file is attached:
>>
>> <?xml version="1.0"?>
>> <VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
>>   <UnstructuredGrid>
>>     <Piece NumberOfPoints="4872" NumberOfCells="4000">
>>       <Points>
>>         <DataArray type="Float64" Name="Position" NumberOfComponents="3"
>> format="appended" offset="0" />
>>       </Points>
>>       <Cells>
>>         <DataArray type="Int32" Name="connectivity"
>> NumberOfComponents="1" format="appended" offset="116932" />
>>         <DataArray type="Int32" Name="offsets"
>>  NumberOfComponents="1" format="appended" offset="372936" />
>>         <DataArray type="UInt8" Name="types"
>>  NumberOfComponents="1" format="appended" offset="404940" />
>>       </Cells>
>>       <CellData>
>>         <DataArray type="Int32" Name="Rank" NumberOfComponents="1"
>> format="appended" offset="408944" />
>>       </CellData>
>>       <PointData>
>>         <DataArray type="Float64" Name="Vec_0x37c89c0_4Field_0.0"
>> NumberOfComponents="1" format="appended" offset="424948" />
>>       </PointData>
>>     </Piece>
>>     <Piece NumberOfPoints="4872" NumberOfCells="4000">
>>       <Points>
>>         <DataArray type="Float64" Name="Position" NumberOfComponents="3"
>> format="appended" offset="463928" />
>>       </Points>
>>       <Cells>
>>         <DataArray type="Int32" Name="connectivity"
>> NumberOfComponents="1" format="appended" offset="580860" />
>>         <DataArray type="Int32" Name="offsets"
>>  NumberOfComponents="1" format="appended" offset="836864" />
>>         <DataArray type="UInt8" Name="types"
>>  NumberOfComponents="1" format="appended" offset="868868" />
>>       </Cells>
>>       <CellData>
>>         <DataArray type="Int32" Name="Rank" NumberOfComponents="1"
>> format="appended" offset="872872" />
>>       </CellData>
>>       <PointData>
>>         <DataArray type="Float64" Name="Vec_0x37c89c0_4Field_0.0"
>> NumberOfComponents="1" format="appended" offset="888876" />
>>       </PointData>
>>     </Piece>
>>   </UnstructuredGrid>
>>   <AppendedData encoding="raw">
>>
>>
>> Thanks,
>> Mike
>>
>>
>>> On Sun, Feb 12, 2023 at 6:15 PM Mike Michell <mi.mike1021 at gmail.com>
>>> wrote:
>>>
>>>> Dear PETSc team,
>>>>
>>>> I am a user of PETSc with Fortran. My code uses DMPlex to handle dm
>>>> object. To print out output variable and mesh connectivity, I use VecView()
>>>> by defining PetscSection on that dm and borrow a vector. The type of the
>>>> viewer is set to PETSCVIEWERVTK.
>>>>
>>>> With 32bit indices, the above work flow has no issue. However, if PETSc
>>>> is configured with 64bit indices, my output .vtu file has an error if I
>>>> open the file with visualization tools, such as Paraview or Tecplot, saying
>>>> that:
>>>> "Cannot read cell connectivity from Cells in piece 0 because the
>>>> "offsets" array is not monotonically increasing or starts with a value
>>>> other than 0."
>>>>
>>>> If I open the .vtu file from terminal, I can see such a line:
>>>> ...
>>>> <DataArray type="Int32" Name="connectivity" NumberOfComponents="1"
>>>> format="appended" offset="580860" />
>>>> ...
>>>>
>>>> I expected "DataArray type="Int64", since the PETSc has 64bit indices.
>>>> Could I get recommendations that I need to check to resolve the issue?
>>>>
>>>
>>> This is probably a bug. We will look at it.
>>>
>>> Jed, I saw that Int32 is hardcoded in plexvtu.c, but sizeof(PetscInt) is
>>> used to calculate the offset, which looks inconsistent. Can you take a look?
>>>
>>>   Thanks,
>>>
>>>      Matt
>>>
>>>
>>>> Thanks,
>>>> Mike
>>>>
>>>
>>>
>>> --
>>> 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
>>>
>>> https://www.cse.buffalo.edu/~knepley/
>>> <http://www.cse.buffalo.edu/~knepley/>
>>>
>>

-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230214/7374601e/attachment.html>


More information about the petsc-users mailing list