[vtkusers] read XDMF in parallel

Nico Schlömer nico.schloemer at gmail.com
Fri Jun 19 04:15:01 EDT 2015


Thanks for the info! I've reverted back to Xdmf2 (using the same code I
attached above, replacing `vtkXdmf3Reader` by `vtkXdmfReader`). I found
that:

1) A serial read gives the output
```
numprocs: 1   myproc: 0
XDMF Error in
/home/nschloe/software/vtk/upstream/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfAttribute.cxx
line 183 (Unknown Attribute Type None)
759 409
```
where the error message doesn't seem to have any effect (bug?).

2) A parallel read returns
```
numprocs: 2   myproc: 0
numprocs: 2   myproc: 1
XDMF Error in
/home/nschloe/software/vtk/upstream/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfAttribute.cxx
line 183 (Unknown Attribute Type None)
XDMF Error in
/home/nschloe/software/vtk/upstream/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfAttribute.cxx
line 183 (Unknown Attribute Type None)
0 0
```
(the last two numbers being the number of points and cells on one proc) and
then just chokes.

If there's something obvious I'm doing wrong, I'd love to hear about it.

Cheers,
Nico



On Fri, Jun 19, 2015 at 3:48 AM David E DeMarle <dave.demarle at kitware.com>
wrote:

> I believe this is a change in the API between Xdmf2 and 3.
>
> In Xdmf2 the VTK level reader would break up a single regular grid
> automatically for you. In Xdmf3 I didn't implement that.
>
> Workarounds include modifying your xdmf file to manually partition the
> underlying hdf5 grid, or reverting to xdmf2.
>
> Others have come across this already before. This and the new boost
> dependency are the reasons why I have not yet deprecated xdmf2 and made
> xdmf3 the default in VTK and ParaView. I'ld love to fix this issue, but
> have not yet found the funding to devote the time for it.
>
>
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
> On Thu, Jun 18, 2015 at 3:15 PM, Nico Schlömer <nico.schloemer at gmail.com>
> wrote:
>
>> I've created a minimal working example that shows what's going wrong;
>> find it attached.
>>
>> I'd be glad about any hints here.
>>
>> Cheers,
>> Nico
>>
>>
>> On Thu, Jun 18, 2015 at 8:37 PM Nico Schlömer <nico.schloemer at gmail.com>
>> wrote:
>>
>>> It's quite the same: All nodes are on all processes. (Or so it seems:
>>> `m->GetNumberOfPoints()` returns the number of all points on all nodes.)
>>>
>>>
>>> --Nico
>>>
>>> On Wed, Jun 17, 2015 at 6:00 PM Berk Geveci <berk.geveci at kitware.com>
>>> wrote:
>>>
>>>> Hi Nico,
>>>>
>>>> What happens if you call
>>>>
>>>> xreader->UpdateInformation();
>>>>
>>>> before you call SetUpdateExtent() ?
>>>>
>>>> Best,
>>>> -berk
>>>>
>>>> On Tue, Jun 16, 2015 at 9:06 AM, Nico Schlömer <
>>>> nico.schloemer at gmail.com> wrote:
>>>>
>>>>> From [1], I find that parallel reading of XDMF files is as simple as
>>>>> ```
>>>>>   vtkMPIController *contr = vtkMPIController::New();
>>>>>   contr->Initialize();
>>>>>   int proc = contr->GetLocalProcessId();
>>>>>   int numprocs = contr->GetNumberOfProcesses();
>>>>>   contr->Barrier();
>>>>>   vtkXdmf3Reader *xreader = vtkXdmf3Reader::New();
>>>>>   xreader->SetFileName("data/pacman.xmf");
>>>>>   contr->Barrier();
>>>>>   xreader->SetUpdateExtent(proc, numprocs, 0);
>>>>>   xreader->Update();
>>>>> ```
>>>>> How can I check if this really worked?
>>>>> After retrieving the output
>>>>> ```
>>>>>   vtkDataObject *rOutput = xreader->GetOutputDataObject(0);
>>>>>   TEUCHOS_ASSERT(rOutput != nullptr);
>>>>>   vtkUnstructuredGrid * m =
>>>>> dynamic_cast<vtkUnstructuredGrid*>(rOutput);
>>>>>   TEUCHOS_ASSERT(m != nullptr);
>>>>>
>>>>>   std::cout << m->GetNumberOfCells() << " " << m->GetNumberOfPoints()
>>>>> << std::endl;
>>>>> ```
>>>>> it seems that the all procs have all points and cells.
>>>>>
>>>>> Is there a way to only retrieve the locally owned cells/points?
>>>>>
>>>>> Cheers,
>>>>> Nico
>>>>>
>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Please keep messages on-topic and check the VTK FAQ at:
>>>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>>>
>>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://public.kitware.com/mailman/listinfo/vtkusers
>>>>>
>>>>
>>>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150619/168527df/attachment.html>


More information about the vtkusers mailing list