idl_startup issues [message #79747] |
Mon, 26 March 2012 08:18 |
Reimar Bauer
Messages: 14 Registered: August 2002
|
Junior Member |
|
|
Hi
I try to track down a very strange - complicated issue of idl crashes
by reading many netCDF files.
We have introduced for our idl library a startup file which sets the X
graphics device by
device, get_visual_depth=depth
device, true_color=depth
window, /free, /pixmap, colors=-10
wdelete, !d.window
device, decomposed=0, retain=2
widget_control,default_font='-adobe-h
elvetica-medium-r-normal--12-*-*-*-*-60-*-*'
Currently I'm looking on all of these commands because we found a
strange problem on NFS filesystems reading of netcdf data. It did not
work as long one of these commands is in our startup and could be
executed. The data file must be on a NFS filesystem. On a local
filesystem there is also no failure.
For example if I ssh without x to another system I don't get a
segfault for reading a large netCDF file many times
because the X commands don't be executed. If the data file is readed
from a local hard disk it also did not fail.
The difference with NFS is the blocksize of the files. We don't have
the IO Block: 4096 on NFS mounted devices.
Well one could question how that is linked. We had in 1999 a similiar
problem with AIX. There it raises an exception just with open many
times a netCDF file. There we had the same components identified.
Any ideas, hints are welcome.
Remar
snippet of example.pro
device, get_visual_depth=depth
widget_control,default_font='-adobe-helvetica-medium-r-norma l--12-*-*-
*-*-60-*-*'
window, /free, /pixmap, colors=-10
wdelete, !d.window
device,decomposed=0
file= '/home/icg1/icg105/nfs_test_file.nc'
vars=['O3','PV','NOONLAT','NOONLON','THETA','EQLAT','HCN']
n_vars = n_elements(vars)
if file_test(file) eq 0 then begin
dummy = findgen(6912)
file_id = NCDF_CREATE(file)
dim = NCDF_DIMDEF(file_id,'time',n_elements(dummy))
vid = make_array(/long, n_vars)
for t=0, n_vars -1 do $
vid[t] = NCDF_VARDEF(file_id,vars[t],dim,/FLOAT)
NCDF_CONTROL,file_id, /endef
for t=0, n_vars -1 do $
NCDF_VARPUT,file_id,vid[t], dummy
NCDF_CLOSE,file_id
endif
FOR i=0L, 100000L DO BEGIN
print, i
nc_id = ncdf_open(file)
for ivar=0, n_vars -1 do begin
var_id = ncdf_varid(nc_id,vars[ivar])
if (var_id eq -1) then begin
print, 'Var: ', vars[ivar], ' does not exist !'
stop
endif
ncdf_varget, nc_id, var_id, data
endfor
ncdf_close, nc_id
ENDFOR
END
|
|
|