- edited description
Unknown PetscViewer type given: hdf5
I met a problem when | create hdf5 file.
I use the example code from demo
import sys, petsc4py
petsc4py.init(sys.argv)
from petsc4py import PETSc
nx, ny, nz = 12, 12, 12 # Dimensions for PETSc DA object
# Set up global space
DMDA3D = PETSc.DMDA().create([nx,ny,nz], dof=3, stencil_width=1)
# Set up a global vector
myVector = DMDA3D.createGlobalVec()
myVector.setName('grid3d')
myVector.set(-1.0)
# Save *.h5 file
#ViewHDF5 = PETSc.Viewer() # Init. Viewer
PETSc.Viewer().createHDF5('grid.h5', mode=PETSc.Viewer.Mode.WRITE,comm= PETSc.COMM_WORLD)
The error message is as follows.
16 # Save *.h5 file
17 #ViewHDF5 = PETSc.Viewer() # Init. Viewer
---> 18 PETSc.Viewer().createHDF5('grid.h5', mode=PETSc.Viewer.Mode.WRITE,comm= PETSc.COMM_WORLD)
19 # ViewHDF5.view(obj=myVector) # Put PETSc object into the viewer
20 # ViewHDF5.destroy() # Destroy Viewer
PETSc/Viewer.pyx in petsc4py.PETSc.Viewer.createHDF5()
Error: error code 86
[0] PetscViewerSetType() line 444 in /home/3_10/depedence/petscsource/petsc-3.10.5/src/sys/classes/viewer/interface/viewreg.c
[0] Unknown type. Check for miss-spelling or missing package: http://www.mcs.anl.gov/petsc/documentation/installation.html#external
[0] Unknown PetscViewer type given: hdf5
Comments (11)
-
reporter -
reporter - edited description
I met a problem when | create hdf5 file.
The error message is as follows.
16 # Save *.h5 file 17 #ViewHDF5 = PETSc.Viewer() # Init. Viewer ---> 18 PETSc.Viewer().createHDF5('grid.h5', mode=PETSc.Viewer.Mode.WRITE,comm= PETSc.COMM_WORLD) 19 # ViewHDF5.view(obj=myVector) # Put PETSc object into the viewer 20 # ViewHDF5.destroy() # Destroy Viewer PETSc/Viewer.pyx in petsc4py.PETSc.Viewer.createHDF5() Error: error code 86 [0] PetscViewerSetType() line 444 in /home/3_10/depedence/petscsource/petsc-3.10.5/src/sys/classes/viewer/interface/viewreg.c [0] Unknown type. Check for miss-spelling or missing package: http://www.mcs.anl.gov/petsc/documentation/installation.html#external [0] Unknown PetscViewer type given: hdf5
The example code from demo
import sys, petsc4py
petsc4py.init(sys.argv)
from petsc4py import PETSc
nx, ny, nz = 12, 12, 12 # Dimensions for PETSc DA object
Set up global space
DMDA3D = PETSc.DMDA().create([nx,ny,nz], dof=3, stencil_width=1)
Set up a global vector
myVector = DMDA3D.createGlobalVec()
myVector.setName('grid3d')
myVector.set(-1.0)
Save *.h5 file
#ViewHDF5 = PETSc.Viewer() # Init. Viewer
PETSc.Viewer().createHDF5('grid.h5', mode=PETSc.Viewer.Mode.WRITE,comm= PETSc.COMM_WORLD)
ViewHDF5.view(obj=myVector) # Put PETSc object into the viewe
ViewHDF5.destroy() # Destroy Viewer
-
reporter - edited description
I met a problem when | create hdf5 file.
The error message is as follows.
16 # Save *.h5 file 17 #ViewHDF5 = PETSc.Viewer() # Init. Viewer ---> 18 PETSc.Viewer().createHDF5('grid.h5', mode=PETSc.Viewer.Mode.WRITE,comm= PETSc.COMM_WORLD) 19 # ViewHDF5.view(obj=myVector) # Put PETSc object into the viewer 20 # ViewHDF5.destroy() # Destroy Viewer PETSc/Viewer.pyx in petsc4py.PETSc.Viewer.createHDF5() Error: error code 86 [0] PetscViewerSetType() line 444 in /home/3_10/depedence/petscsource/petsc-3.10.5/src/sys/classes/viewer/interface/viewreg.c [0] Unknown type. Check for miss-spelling or missing package: http://www.mcs.anl.gov/petsc/documentation/installation.html#external [0] Unknown PetscViewer type given: hdf5
The example code from demo
import sys, petsc4py
petsc4py.init(sys.argv)
from petsc4py import PETSc
nx, ny, nz = 12, 12, 12 # Dimensions for PETSc DA object
# Set up global space
DMDA3D = PETSc.DMDA().create([nx,ny,nz], dof=3, stencil_width=1)
# Set up a global vector
myVector = DMDA3D.createGlobalVec()
myVector.setName('grid3d')
myVector.set(-1.0)
# Save *.h5 file
#ViewHDF5 = PETSc.Viewer() # Init. Viewer
PETSc.Viewer().createHDF5('grid.h5', mode=PETSc.Viewer.Mode.WRITE,comm= PETSc.COMM_WORLD)
ViewHDF5.view(obj=myVector) # Put PETSc object into the viewe
ViewHDF5.destroy() # Destroy Viewer
-
reporter - edited description
I met a problem when | create hdf5 file.
The error message is as follows.
16 # Save *.h5 file 17 #ViewHDF5 = PETSc.Viewer() # Init. Viewer ---> 18 PETSc.Viewer().createHDF5('grid.h5', mode=PETSc.Viewer.Mode.WRITE,comm= PETSc.COMM_WORLD) 19 # ViewHDF5.view(obj=myVector) # Put PETSc object into the viewer 20 # ViewHDF5.destroy() # Destroy Viewer PETSc/Viewer.pyx in petsc4py.PETSc.Viewer.createHDF5() Error: error code 86 [0] PetscViewerSetType() line 444 in /home/3_10/depedence/petscsource/petsc-3.10.5/src/sys/classes/viewer/interface/viewreg.c [0] Unknown type. Check for miss-spelling or missing package: http://www.mcs.anl.gov/petsc/documentation/installation.html#external [0] Unknown PetscViewer type given: hdf5
The example code from demo
import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc nx, ny, nz = 12, 12, 12 # Dimensions for PETSc DA object # Set up global space DMDA3D = PETSc.DMDA().create([nx,ny,nz], dof=3, stencil_width=1) # Set up a global vector myVector = DMDA3D.createGlobalVec() myVector.setName('grid3d') myVector.set(-1.0) # Save *.h5 file #ViewHDF5 = PETSc.Viewer() # Init. Viewer PETSc.Viewer().createHDF5('grid.h5', mode=PETSc.Viewer.Mode.WRITE,comm= PETSc.COMM_WORLD)
-
You need PETSc configured with HDF5 for this to work. Please reconfigure PETSc using
--download-hdf5
, or install HDF5 development packages and configure PETSc with--with-hdf5
. -
reporter Thanks very much. I can create the h5 file now after recompiling the PETSC with --with-hdf5.
A new View problem occur as follows with same demo code. What cause this ? MPI?
--------------------------------------------------------------------------- Error Traceback (most recent call last) <ipython-input-1-7f5bc862b969> in <module> 23 ViewHDF5 = PETSc.Viewer() # Init. Viewer 24 ViewHDF5.createHDF5('grid.h5', mode=PETSc.Viewer.Mode.READ,comm= PETSc.COMM_WORLD) ---> 25 ViewHDF5.view(obj=myVector) # Put PETSc object into the viewer 26 ViewHDF5.destroy() # Destroy Viewer 27 PETSc/Viewer.pyx in petsc4py.PETSc.Viewer.view() Error: error code 76 [0] PetscObjectView() line 100 in /home/3_10/depedence/petscsource/petsc-3.10.5/src/sys/objects/destroy.c [0] VecView() line 590 in /home/3_10/depedence/petscsource/petsc-3.10.5/src/vec/vec/interface/vector.c [0] VecView_MPI_DA() line 702 in /home/3_10/depedence/petscsource/petsc-3.10.5/src/dm/impls/da/gr2.c [0] VecView_MPI_HDF5_DA() line 524 in /home/3_10/depedence/petscsource/petsc-3.10.5/src/dm/impls/da/gr2.c [0] Error in external library [0] Error in HDF5 call H5Dset_extent() Status -1
-
Can you run
ldd $PETSC_DIR/$PETSC_ARCH/lib/libpetsc.so
and check that the HDF5 library listed there is the right one and not some other one elsewhere in the system? -
reporter
I have only one hdf5 (hdf5-1.10.5)install in my prefixed path.
ldd $PETSC_DIR/$PETSC_ARCH/lib/libpetsc.so
ldd $PETSC_DIR/$PETSC_ARCH/lib/libpetsc.so linux-vdso.so.1 (0x00007ffc709a5000) libsuperlu.so.5 => /home/3_10/depedence/petscsource/petsc-3.10.5/arch-linux2-c-opt/lib/libsuperlu.so.5 (0x00007f0dc9955000) libhdf5.so.103 => /home/build_install/all/lib/libhdf5.so.103 (0x00007f0dc934c000) libparmetis.so => /home/build_install/all/lib/libparmetis.so (0x00007f0dc90c6000) libmetis.so => /home/build_install/all/lib/libmetis.so (0x00007f0dc8e55000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0dc8ab7000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f0dc877f000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0dc8560000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0dc81d7000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0dc7fd3000) libmpifort.so.12 => /home/build_install/all/lib/libmpifort.so.12 (0x00007f0dc7d9a000) libmpi.so.12 => /home/build_install/all/lib/libmpi.so.12 (0x00007f0dc7888000) libgfortran.so.4 => /usr/lib/x86_64-linux-gnu/libgfortran.so.4 (0x00007f0dc74a9000) libgcc_s.so.1 => /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1 (0x00007f0dc7291000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f0dc7089000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0dc6c98000) libz.so.1 => /home/build_install/all/lib/libz.so.1 (0x00007f0dc6a7a000) /lib64/ld-linux-x86-64.so.2 (0x00007f0dcb62d000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f0dc6852000) libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f0dc6612000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f0dc640e000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f0dc6208000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f0dc5ff3000)
-
OK, that looks good. Then I have no clue what’s going on, I’m not an expert user of HDF5.Hold on. It seems you are building PETSc with some external HDF5 build, that is, you did not pass
--download-hdf5
to PETSC’s configure script. Is that correct? In that case, it may very well be that your HDF5 build is not compatible with PETSc expectations. For example, is your own HDF5 build MPI-enabled?At this point, I think you have to ask for help in petsc-users mailing list or raise an issue in petsc.
But I warn you that in the end you may be asked to try
--download-hdf5
. If you do, I recommend toexport LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib:$LD_LIBRARY_PATH
before running, such that PETSc’s downloaded HDF5 will be picked, and not the other one you have in your prefix. -
reporter Thanks for your help.
Yes, I do not build hdf5 by passing --download-hdf5 to PETSC’s configure script. I use my own hdf5 build mpi-enabled.
I will try it by re-building the Petsc with --download-hdf5.
Best regard.
-
- changed status to resolved
- Log in to comment