<div dir="ltr">Hello PETSc community !<div><br></div><div>I would like to read in another code a matrix / rhs / sol  saved by PETSc.</div><div>I am dealing with large matrices and for precision I would like to use the binary format.</div><div><br></div><div>To save a matrix I am using the following lines (please let me know if I should make any changes), I am using an old version PETSc 2.1.5 for backward compatibility.</div><div></div><div><br></div><div> ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD,filename,PETSC_BINARY_CREATE,&petsc_view);CHKERRQ(ierr);<br>  ierr = VecView(solut,petsc_view);CHKERRQ(ierr);<br>       ierr = PetscViewerDestroy(petsc_view);CHKERRQ(ierr);<br></div><div><br></div><div>And to save a vector:  </div><div><br></div><div> ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, filename, PETSC_BINARY_CREATE, &petsc_view);CHKERRQ(ierr);<br> ierr = VecView(solut, petsc_view);CHKERRQ(ierr);<br>      ierr = PetscViewerDestroy(petsc_view);CHKERRQ(ierr);<br></div><div><br></div><div>The files are saved without any problems, and now I need to write the code to read the binary files.</div><div>Please, would anyone point me to the format of these binary files and/or a code snippet to take as an example ?  <br></div><div><br></div><div>Thank you very much in advance !</div><div>Cheers</div></div>