Read and write PETScWrappers::MPI::Vector to binary file

65 views
Skip to first unread message

Shiva Rudraraju

unread,
Jun 1, 2016, 6:14:30 PM6/1/16
to deal.II User Group
Hi,

Wondering if there is any existing implementation for reading and writing PETScWrappers::MPI::Vector to files, essentially to get a restart capability in time stepping computations. PETScWrappers::VectorBase::write_ascii() provides the equivalent of  VecView. But looking for something which is the equivalent of Petsc VecLoad and which works in parallel. 

If not, I can give a try to implement a new method PETScWrappers::VectorBase::read_ascii(). 

Thanks,
Shiva 

Shiva Rudraraju
Asst. Research Scientist, Mechanical Engineering
University of Michigan Ann Arbor.

Jean-Paul Pelteret

unread,
Jun 2, 2016, 1:05:46 AM6/2/16
to deal.II User Group
Hi Shiva,

I do believe that the serialize() function is the one that you're looking for. Its a function thats inherited from the Subscriptor base class.

J-P

Shiva Rudraraju

unread,
Jun 2, 2016, 9:40:12 AM6/2/16
to dea...@googlegroups.com
Hi J-P,

Thanks for the suggestion. However, I doubt that serialize() has the implementation that I need as it is for the Subscriptor base class and I do not see any overloading of this method for PETScWrappers::VectorBase or PETScWrappers::MPI::Vector to give the parallel read/write capability.

I think the closest functionality available is that of PETScWrappers::VectorBase::write_ascii()….. and I am looking something like PETScWrappers::MPI::Vector::write_ascii() and PETScWrappers::MPI::Vector::read_ascii() 

Thanks,
Shiva

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/55ZQS7uRyjs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruno Turcksin

unread,
Jun 2, 2016, 9:48:41 AM6/2/16
to deal.II User Group
Shiva,

take a look here for an example of checkpoint-restart: https://github.com/geodynamics/aspect/blob/master/source/simulator/checkpoint_restart.cc You need to use SolutionTransfer to do the serialization/deserialization.

Best,

Bruno
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages