[petsc-users] Complex numbers and HDF5 Viewer
    Barry Smith 
    bsmith at mcs.anl.gov
       
    Wed Jul 15 18:44:17 CDT 2015
    
    
  
  Thanks for reporting this.
  Yikes, this is a bug that crept in with the addition of the dim2 option that was added. I have fixed this in the maint, master, and next branches and here is the patch
--- a/src/vec/vec/impls/mpi/pdvec.c
+++ b/src/vec/vec/impls/mpi/pdvec.c
@@ -736,7 +736,7 @@ PetscErrorCode VecView_MPI_HDF5(Vec xin, PetscViewer viewer)
   }
   ierr = PetscHDF5IntCast(xin->map->n/bs,count + dim);CHKERRQ(ierr);
   ++dim;
-  if (bs >= 1 || dim2) {
+  if (bs > 1 || dim2) {
     count[dim] = bs;
     ++dim;
   }
@@ -760,7 +760,7 @@ PetscErrorCode VecView_MPI_HDF5(Vec xin, PetscViewer viewer)
   }
   ierr = PetscHDF5IntCast(low/bs,offset + dim);CHKERRQ(ierr);
   ++dim;
-  if (bs >= 1 || dim2) {
+  if (bs > 1 || dim2) {
     offset[dim] = 0;
     ++dim;
   }
> On Jul 15, 2015, at 1:25 PM, Gianluca Meneghello <gianmail at gmail.com> wrote:
> 
> Dear all,
> 
> I would like to write a complex Vec to an HDF5 viewer, but I receive an error. 
> 
> Is it possible to write complex numbers to an HDF5 viewer?
> 
> The error is reproducible on my computer by running src/vec/vec/examples/tutorials/ex10.c when compiled with --with-scalar-type=complex (and --download-hdf5 if that is important). I attach the output of ./ex10 -hdf5.
> 
> Thanks for your help,
> 
> Gianluca
> 
> 
> <ex10.log>
    
    
More information about the petsc-users
mailing list