[petsc-users] PETSc binary write format
Lisandro Dalcin
dalcinl at gmail.com
Wed Dec 5 12:50:05 CST 2018
On Wed, 5 Dec 2018 at 21:41, Sajid Ali via petsc-users <
petsc-users at mcs.anl.gov> wrote:
> I've created the same file as per the format specified in this thread,
> i.e. VEC_FILE_CLASSID, num_elements followed by the elements in ieee-754
> 64-bit format.
>
> I've saved everything as 1's and 0's in a file as shown above. If it were
> indeed a binary file, doing a cat on it should output garbage as it did for
> the file above. But it instead interprets each 0 and 1 as an ascii
> character.
>
>
Did you take care of byteswapping? Rember that everything (the integer
class id, integer vec size, and 64bit ieee floating point values) written
in the file should be in big-endian format.
--
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/
4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 0109
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa
Office Phone: +966 12 808-0459
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181205/a7d83488/attachment-0001.html>
More information about the petsc-users
mailing list