<div dir="ltr"><div dir="ltr">Use PetscViewerBinarySetSkipHeader(viewer, PETSC_TRUE) before VecView().</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 29 Nov 2018 at 18:50, Sal Am via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Is there a way to write the solution from the system Ax=b in raw binary instead of PETSc binary format?</div><div><br></div><div>Currently I am doing:<br>  ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, "../../python/petscpy/Vector_x_petsc.dat", FILE_MODE_WRITE, &viewer);CHKERRQ(ierr);<br>  ierr = VecView(x,viewer);CHKERRQ(ierr);CHKERRQ(ierr);<br>  ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);</div><div><br></div><div>And then use PetscBinaryIO to read it back and save it using write('newformat', 'wb') to get to raw... however this approach is not good it seems as there are some troubles with little/big endian when using the resulting converted file on other systems for post-processing. <br></div><div><br></div><div>Thanks,</div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Lisandro Dalcin<br>============<br>Research Scientist<br>Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br><br>4700 King Abdullah University of Science and Technology<br>al-Khawarizmi Bldg (Bldg 1), Office # 0109<br>Thuwal 23955-6900, Kingdom of Saudi Arabia<br><a href="http://www.kaust.edu.sa" target="_blank">http://www.kaust.edu.sa</a><br><br>Office Phone: +966 12 808-0459</div>