NetCDF: HDF error on teach cluster

NetCDF: HDF error on teach cluster

by Jasper Kranias -
Number of replies: 4

My code for Assignment 7 compiles on the teach cluster, but when I run it I get the error:

terminate called after throwing an instance of 'netCDF::exceptions::NcHdfErr'

  what():  NetCDF: HDF error

file: ncVar.cpp  line:1468

Aborted

I has this error last week as well, but it stopped occurring without me changing my code, which makes me suspect there is something wrong with netcdf or hdf5 on my account in the teach cluster. Does anyone know what could be causing this? I am using "module load hdf5 netcdf" in the terminal, and 
-lnetcdf -lnetcdf_c++4 in my makefile.


In reply to Jasper Kranias

Re: NetCDF: HDF error on teach cluster

by Jasper Kranias -
I found my mistake, please ignore
In reply to Jasper Kranias

Re: NetCDF: HDF error on teach cluster

by Faisal Halabeya -
What was causing the error? I have a similar error on netCDF.
In reply to Faisal Halabeya

Re: NetCDF: HDF error on teach cluster

by Jasper Kranias -
On assignment 6 I had problems with a similar error as you are having now, except it said "permission denied" instead of "no such file or directory" (still says ncFile.cpp). It was not an issue with my code, I tried my friend's code that worked on his computer but when I ran it on mine (on the teach cluster still) it was the same error. Someone else told me he had a similar problem. It fixed itself after a tried at a different time so I have no idea what caused it.
In reply to Jasper Kranias

Re: NetCDF: HDF error on teach cluster

by Ramses van Zon -
an "HDF error" when reading is quite different than a "no such file or directory". The former means the format of the file is incorrect (e.g. because the file was not copied completely), while the latter means that the file does not exist or is not readable. Exactly which is the case or why is hard to say.