[petsc-users] Skipping data when reading from binary file

Peder Jørgensgaard Olesen pjool at mek.dtu.dk
Mon Oct 4 08:26:42 CDT 2021


Hello


I have a binary file in which a mix of different objects is stored (Vecs, Mats, PetscInts). I can read each element just fine using VecLoad, MatLoad, and PetscIntView, provided they're read in the order in which they were put in the binary. What I would like to do is to skip the reading of any unneeded element, instead proceeding directly to the next one. I tried using PetscBinarySeek() for this, as shown in the attached code. This produces segmentation faults, suggesting that the file pointer isn't going where I want it to.


Any suggestions as to what I'm doing wrong here?


Best regards,

Peder


[http://www.dtu.dk/-/media/DTU_Generelt/Andet/mail-signature-logo.png]

Peder Jørgensgaard Olesen
PhD student
Department of Mechanical Engineering

pjool at mek.dtu.dk<mailto:pjool at mek.dtu.dk>
Koppels Allé
Building 403, room 105
2800 Kgs. Lyngby
www.dtu.dk/english<https://www.dtu.dk/english>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20211004/a0649443/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: skip_mwe.c
Type: text/x-csrc
Size: 3880 bytes
Desc: skip_mwe.c
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20211004/a0649443/attachment-0001.bin>


More information about the petsc-users mailing list