[petsc-users] PETSc binary write format

Smith, Barry F. bsmith at mcs.anl.gov
Wed Dec 5 18:13:43 CST 2018


   Please email the binary file that you created that is causing you problems.

   Barry


> On Dec 5, 2018, at 1:05 PM, Sajid Ali via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> To clarify : 
> The data from xxd -b petsc_output_dat is what I've reordered. The binary dump is confusing to read since it contains 6 bytes per line (alongside the unnecessary ascii conversions) and the numbers start and end in odd places. I wanted each line to have only one number and copy pasted the data into a new file. Then I changed the spacing so that the first two lines have 4 bytes (corresponding to int-32) each and correspond to VEC_FILE_CLASSID and num_elements (20 in this case). This is followed by 8 bytes (64-bit double) per line which store the actual elements of the vector.
> 
> 
> On Wed, Dec 5, 2018 at 12:57 PM Sajid Ali <sajidsyed2021 at u.northwestern.edu> wrote:
> It's just a cleaner re-write of the petsc output that I can understand (which I intend to modify from python in the future). I tried removing the new line characters but that didn't work either.
> 
> Looking at the first line of the binary dump from petsc output : 
> [sajid at xrm
>  temp]$ xxd -b vector.dat
> 0000000: 00000000 00010010 01111011 01001110 00000000 00000000  ..{N..
> 
> 
> The first 4 bytes combine to give 
> 00000000000100100111101101001110
> Which is int-32 representation of VEC_FILE_CLASSID and this is the first line of my file as well. 
> 
> 
> Thank You,
> Sajid Ali
> Applied Physics
> Northwestern University
> 
> 
> -- 
> Sajid Ali
> Applied Physics
> Northwestern University



More information about the petsc-users mailing list