openEMS-Project icon indicating copy to clipboard operation
openEMS-Project copied to clipboard

problem running matlab examples, PlotHDF5FieldData failing

Open g3grau opened this issue 1 year ago • 0 comments

Hi, after some trouble with the Python interface I tried to run the matlab ones in octave. I added the openEMS and CSXCAD matlab paths to .octaverc and I actually got some useful output on Suse, but the script fails to complete on Suse and Ubuntu.

On the Ubuntu20 side with VTK7.1.1: I get 3 plot windows from running Rect_Waveguide, but the windows show no plots (like frozen, garbage inside).

octave:1> Rect_Waveguide

remove entire contents of tmp_mod? (yes or no) yes
args = "rect_wg.xml" 
 ---------------------------------------------------------------------- 
 | openEMS 64bit -- version v0.0.35
 | (C) 2010-2018 Thorsten Liebig <[email protected]>  GPL license
 ---------------------------------------------------------------------- 
	Used external libraries:
		CSXCAD -- Version: v0.6.2
		hdf5   -- Version: 1.10.7
		          compiled against: HDF5 library version: 1.10.7
		tinyxml -- compiled against: 2.6.2
		fparser
		boost  -- compiled against: 1_74
		vtk -- Version: 7.1.1
		       compiled against: 7.1.1

Create FDTD operator (compressed SSE + multi-threading)
FDTD simulation size: 27x12x122 --> 39528 FDTD cells 
FDTD timestep is: 7.79642e-13 s; Nyquist rate: 24 timesteps @2.67217e+10 Hz
Excitation signal length is: 1225 timesteps (9.55062e-10s)
Max. number of timesteps: 10000 ( --> 8.16327 * Excitation signal length)
Create FDTD engine (compressed SSE + multi-threading)
Running FDTD engine... this may take a while... grab a cup of coffee?!?
[@        4s] Timestep:          656 || Speed:    6.5 MC/s (6.120e-03 s/TS) || Energy: ~1.76e-22 (- 0.00dB)
[@        8s] Timestep:         1304 || Speed:    6.4 MC/s (6.177e-03 s/TS) || Energy: ~1.19e-27 (-51.73dB)
Time for 1304 iterations with 39528.00 cells : 8.02 sec
Speed: 6.43 MCells/s 
warning: legend: 'best' not yet implemented for location specifier, using 'northeast' instead
warning: legend: 'best' not yet implemented for location specifier, using 'northeast' instead
warning: function "h5readatt_octave" not found, trying to run "setup"
warning: called from
    ReadHDF5Attribute at line 15 column 9
    ReadHDF5FieldData_octave at line 97 column 34
    ReadHDF5FieldData at line 29 column 19
    PlotHDF5FieldData at line 25 column 8
    Rect_Waveguide at line 121 column 1

setting up openEMS matlab/octave interface
compiling oct files
HDF5 library path found at: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so
/usr/lib/x86_64-linux-gnu/hdf5/openmpi
HDF5 include path found at: /usr/include/hdf5/serial
/usr/bin/ld: cannot open output file h5readatt_octave.oct: Permission denied
collect2: error: ld returned 1 exit status
sh: 2: /usr/lib/x86_64-linux-gnu/hdf5/openmpi: Permission denied
error: running "setup" failed...
error: called from
    ReadHDF5Attribute at line 19 column 13
    ReadHDF5FieldData_octave at line 97 column 34
    ReadHDF5FieldData at line 29 column 19
    PlotHDF5FieldData at line 25 column 8
    Rect_Waveguide at line 121 column 1
octave:2> 

The same thing on openSuse Tumbleweed using the binaries from the Science repo: I get 3 windows, one with Sparam, one with impedance, and #3 remains empty. The error looks similar but is not exactly the same:

...
... all ok up to here
Speed: 26.20 MCells/s 
warning: legend: 'best' not yet implemented for location specifier, using 'northeast' instead
warning: legend: 'best' not yet implemented for location specifier, using 'northeast' instead
warning: function "h5readatt_octave" not found, trying to run "setup"
warning: called from
    ReadHDF5Attribute at line 15 column 9
    ReadHDF5FieldData>ReadHDF5FieldData_octave at line 97 column 34
    ReadHDF5FieldData at line 29 column 19
    PlotHDF5FieldData at line 25 column 8
    Rect_Waveguide at line 121 column 1

setting up openEMS matlab/octave interface
compiling oct files
HDF5 library path found at: /usr/lib/hpc/gnu14/mvapich2/hdf5/1.12.3/lib64/libhdf5.so
/usr/lib/hpc/gnu14/hdf5/1.12.3/lib64/libhdf5.so
/usr/lib/hpc/gnu14/openmpi4/hdf5/1.12.3/lib64/libhdf5.so
/usr/lib/hpc/gnu14/mpich/hdf5/1.12.3/lib64/libhdf5.so
/usr/lib/hpc/gnu13/mvapich2/hdf5/1.12.2/lib/libhdf5.so
/usr/lib/hpc/gnu13/hdf5/1.12.2/lib/libhdf5.so
/usr/lib/hpc/gnu13/openmpi4/hdf5/1.12.2/lib/libhdf5.so
/usr/lib/hpc/gnu13/mpich/hdf5/1.12.2/lib
HDF5 include path found at: /usr/include
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crt1.o: in function `_start':
/home/abuild/rpmbuild/BUILD/glibc-2.40/csu/../sysdeps/x86_64/start.S:103:(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status
sh: line 8: /usr/lib/hpc/gnu13/mpich/hdf5/1.12.2/lib: Is a directory
error: running "setup" failed...
error: called from
    ReadHDF5Attribute at line 19 column 13
    ReadHDF5FieldData>ReadHDF5FieldData_octave at line 97 column 34
    ReadHDF5FieldData at line 29 column 19
    PlotHDF5FieldData at line 25 column 8
    Rect_Waveguide at line 121 column 1
octave:2> 

I don't understand what's happening at this point. What is doing a setup and why? The errors are apparently triggered by the command PlotHDF5FieldData(dump_file, PlotArgs).

Both systems created output files including a h5 in the tmp_mod, but on Suse the Et.h5 is twice as large (may explain why I get plots only there), I didn't figure out the reason yet

On Ubuntu this looks like

h5stat tmp_mod/Et.h5 
Filename: tmp_mod/Et.h5
File information
	# of unique groups: 4
	# of unique datasets: 330
	# of unique named datatypes: 0
	# of unique links: 0
	# of unique other: 0
	Max. # of links to object: 1
	Max. # of objects in group: 327
File space information for file metadata (in bytes):
	Superblock: 96
	Superblock extension: 0
	User block: 0
	Object headers: (total/unused)
		Groups: 280/0
		Datasets(exclude compact data): 89760/384
		Datatypes: 0/0
	Groups:
		B-tree/List: 31360
		Heap: 6024
	Attributes:
		B-tree/List: 0
		Heap: 0
	Chunked datasets:
		Index: 0
	Datasets:
		Heap: 0
	Shared Messages:
		Header: 0
		B-tree/List: 0
		Heap: 0
	Free-space managers:
		Header: 0
		Amount of free space: 0
Small groups (with 0 to 9 links):
	# of groups with 1 link(s): 1
	# of groups with 2 link(s): 1
	# of groups with 3 link(s): 1
	Total # of small groups: 3
Group bins:
	# of groups with 1 - 9 links: 3
	# of groups with 100 - 999 links: 1
	Total # of groups: 4
Dataset dimension information:
	Max. rank of datasets: 4
	Dataset ranks:
		# of dataset with rank 1: 3
		# of dataset with rank 4: 327
1-D Dataset information:
	Max. dimension size of 1-D datasets: 61
	Small 1-D datasets (with dimension sizes 0 to 9):
		# of datasets with dimension sizes 6: 1
		Total # of small datasets: 1
	1-D Dataset dimension bins:
		# of datasets with dimension size 1 - 9: 1
		# of datasets with dimension size 10 - 99: 2
		Total # of datasets: 3
Dataset storage information:
	Total raw data size: 20106900
	Total external raw data size: 0
Dataset layout information:
	Dataset layout counts[COMPACT]: 0
	Dataset layout counts[CONTIG]: 330
	Dataset layout counts[CHUNKED]: 0
	Dataset layout counts[VIRTUAL]: 0
	Number of external files : 0
Dataset filters information:
	Number of datasets with:
		NO filter: 330
		GZIP filter: 0
		SHUFFLE filter: 0
		FLETCHER32 filter: 0
		SZIP filter: 0
		NBIT filter: 0
		SCALEOFFSET filter: 0
		USER-DEFINED filter: 0
Dataset datatype information:
	# of unique datatypes used by datasets: 1
	Dataset datatype #0:
		Count (total/named) = (330/0)
		Size (desc./elmt) = (22/4)
	Total dataset datatype count: 330
Small # of attributes (objects with 1 to 10 attributes):
	# of objects with 1 attributes: 328
	Total # of objects with small # of attributes: 328
Attribute bins:
	# of objects with 1 - 9 attributes: 328
	Total # of objects with attributes: 328
	Max. # of attributes to objects: 1
Free-space persist: FALSE
Free-space section threshold: 1 bytes
Small size free-space sections (< 10 bytes):
	Total # of small size sections: 0
Free-space section bins:
	Total # of sections: 0
File space management strategy: H5F_FSPACE_STRATEGY_FSM_AGGR
File space page size: 4096 bytes
Summary of file space information:
  File metadata: 127520 bytes
  Raw data: 20106900 bytes
  Amount/Percent of tracked free space: 0 bytes/0.0%
  Unaccounted space: 553772 bytes
Total space: 20788192 bytes

I don't know what permission it is looking for. The path is a directory with read access, inside are symlinks to libraries, the libraries have read access (no executable), that should be ok?

On Suse this looks like

h5stat tmp_mod/Et.h5
Filename: tmp_mod/Et.h5
File information
        # of unique groups: 4
        # of unique datasets: 667
        # of unique named datatypes: 0
        # of unique links: 0
        # of unique other: 0
        Max. # of links to object: 1
        Max. # of objects in group: 664
File space information for file metadata (in bytes):
        Superblock: 96
        Superblock extension: 0
        User block: 0
        Object headers: (total/unused)
                Groups: 280/0
                Datasets(exclude compact data): 181424/384
                Datatypes: 0/0
        Groups:
                B-tree/List: 60544
                Heap: 11656
        Attributes:
                B-tree/List: 0
                Heap: 0
        Chunked datasets:
                Index: 0
        Datasets:
                Heap: 0
        Shared Messages:
                Header: 0
                B-tree/List: 0
                Heap: 0
        Free-space managers:
                Header: 0
                Amount of free space: 0
Small groups (with 0 to 9 links):
        # of groups with 1 link(s): 1
        # of groups with 2 link(s): 1
        # of groups with 3 link(s): 1
        Total # of small groups: 3
Group bins:
        # of groups with 1 - 9 links: 3
        # of groups with 100 - 999 links: 1
        Total # of groups: 4
Dataset dimension information:
        Max. rank of datasets: 4
        Dataset ranks:
                # of dataset with rank 1: 3
                # of dataset with rank 4: 664
1-D Dataset information:
        Max. dimension size of 1-D datasets: 61
        Small 1-D datasets (with dimension sizes 0 to 9):
                # of datasets with dimension sizes 6: 1
                Total # of small datasets: 1
        1-D Dataset dimension bins:
                # of datasets with dimension size 1 - 9: 1
                # of datasets with dimension size 10 - 99: 2
                Total # of datasets: 3
Dataset storage information:
        Total raw data size: 40828356
        Total external raw data size: 0
Dataset layout information:
        Dataset layout counts[COMPACT]: 0
        Dataset layout counts[CONTIG]: 667
        Dataset layout counts[CHUNKED]: 0
        Dataset layout counts[VIRTUAL]: 0
        Number of external files : 0
Dataset filters information:
        Number of datasets with:
                NO filter: 667
                GZIP filter: 0
                SHUFFLE filter: 0
                FLETCHER32 filter: 0
                SZIP filter: 0
                NBIT filter: 0
                SCALEOFFSET filter: 0
                USER-DEFINED filter: 0
Dataset datatype information:
        # of unique datatypes used by datasets: 1
        Dataset datatype #0:
                Count (total/named) = (667/0)
                Size (desc./elmt) = (22/4)
        Total dataset datatype count: 667
Small # of attributes (objects with 1 to 10 attributes):
        # of objects with 1 attributes: 665
        Total # of objects with small # of attributes: 665
Attribute bins:
        # of objects with 1 - 9 attributes: 665
        Total # of objects with attributes: 665
        Max. # of attributes to objects: 1
Free-space persist: FALSE
Free-space section threshold: 1 bytes
Small size free-space sections (< 10 bytes):
        Total # of small size sections: 0
Free-space section bins:
        Total # of sections: 0
File space management strategy: H5F_FSPACE_STRATEGY_FSM_AGGR
File space page size: 4096 bytes
Summary of file space information:
  File metadata: 254000 bytes
  Raw data: 40828356 bytes
  Amount/Percent of tracked free space: 0 bytes/0.0%
  Unaccounted space: 1126956 bytes
Total space: 42209312 bytes

Plotting on Ubuntu fails even after commenting out PlotHDF5FieldData, so I have more trouble there. On Suse that looks fine. Any ideas how to debug the PlotHDF5FieldData?

g3grau avatar Dec 18 '24 11:12 g3grau