[petsc-dev] [petsc4py] PETSc.Viewer().createHDF5 wipes out existing files

Blaise Bourdin bourdin at math.lsu.edu
Thu Sep 9 15:40:33 CDT 2010


Hi,

I am trying to do HDF5 IO in petsc4py. I noticed that when I create a viewer using 
  PETSc.Viewer().createHDF5(inputfile,comm= PETSc.COMM_WORLD)
the file "outputfile" is wiped out and replaced with a empty hdf5 container, which is bad since I am trying to read forrm it... 

Unsurprisingly, I have no problems using the longer approach:
  h5in = PETSc.Viewer().create(PETSc.COMM_WORLD)
  h5in.setType(PETSc.Viewer.Type.HDF5)
  h5in.setFileMode(PETSc.Viewer.Mode.READ)
  h5in.setFileName(inputfile)

Is this expected?

Regards,
Blaise
-- 
Department of Mathematics and Center for Computation & Technology
Louisiana State University, Baton Rouge, LA 70803, USA
Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin










More information about the petsc-dev mailing list