Commit 0d197dba authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Merged.

parents 0d6f6894 58533ea7
......@@ -3,10 +3,22 @@
* using CGRIBEX library version 1.9.1
* Version 1.9.5 released
2018-07-03 Uwe Schulzweida
* gridCompare: bug fix comparing uuid of unstructured grid
2018-07-02 Uwe Schulzweida
* reshGetStatus: applied patch from Kalle+Thomas
2018-06-23 Uwe Schulzweida
* NetCDF dimension IDs do not have to start at 0 and their increment can not be equal to 1! (bug fix)
2018-05-31 Uwe Schulzweida
* Limit chunksizehint to filesize
2018-05-30 Uwe Schulzweida
* Added error code CDI_ETMOF (Too many open files)
......
......@@ -77,7 +77,7 @@ int cdf_open(const char *path, int omode, int *ncidp)
struct stat filestat;
size_t chunksizehint = 0;
#if defined (HAVE_LIBNC_DAP)
#ifdef HAVE_LIBNC_DAP
if ( strncmp(path, "http:", 5) == 0 || strncmp(path, "https:", 6) == 0 ) dapfile = true;
#endif
......@@ -89,8 +89,9 @@ int cdf_open(const char *path, int omode, int *ncidp)
{
if ( stat(path, &filestat) != 0 ) SysError(path);
#if defined (HAVE_STRUCT_STAT_ST_BLKSIZE)
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
chunksizehint = (size_t) filestat.st_blksize * 4;
if ( chunksizehint > (size_t) filestat.st_size ) chunksizehint = (size_t) filestat.st_size;
#endif
/*
if ( chunksizehint < ChunkSizeMin ) chunksizehint = ChunkSizeMin;
......@@ -101,7 +102,7 @@ int cdf_open(const char *path, int omode, int *ncidp)
/* FIXME: parallel part missing */
status = nc__open(path, omode, &chunksizehint, ncidp);
if ( CDF_Debug ) Message("chunksizehint %d", chunksizehint);
if ( CDF_Debug ) Message("chunksizehint %zu", chunksizehint);
}
if ( CDF_Debug )
......
......@@ -2331,7 +2331,7 @@ bool gridCompare(int gridID, const grid_t *grid, bool coord_compare)
else
{
/* FIXME: not octet 0 but octet 7 is guaranteed non-zero for any non-NULL UUID */
differ = differ || (gridRef->uuid[0] && grid->uuid[0] && memcmp(gridRef->uuid, grid->uuid, CDI_UUID_SIZE) != 0);
differ |= ((gridRef->uuid[0] || grid->uuid[0]) && memcmp(gridRef->uuid, grid->uuid, CDI_UUID_SIZE));
if ( !differ &&
((grid->x.vals == NULL) ^ (gridRef->x.vals == NULL)) &&
......
......@@ -697,30 +697,29 @@ void reshSetStatus ( cdiResH resH, const resOps * ops, int status )
int reshGetStatus ( cdiResH resH, const resOps * ops )
{
int nsp;
namespaceTuple_t nspT;
LIST_INIT(1);
LIST_LOCK();
nsp = namespaceGetActive ();
int nsp = namespaceGetActive ();
nspT = namespaceResHDecode ( resH );
namespaceTuple_t nspT = namespaceResHDecode ( resH );
xassert ( nspT.nsp == nsp &&
nspT.idx >= 0 &&
nspT.idx < resHList[nsp].size );
nspT.idx >= 0 );
listElem_t *listElem = resHList[nsp].resources + nspT.idx;
const resOps *elemOps = listElem->res.v.ops;
int status = RESH_UNUSED;
if (nspT.idx < resHList[nsp].size)
{
listElem_t *listElem = resHList[nsp].resources + nspT.idx;
const resOps *elemOps = listElem->res.v.ops;
xassert(listElem && (!(listElem->status & RESH_IN_USE_BIT) || elemOps == ops));
status = listElem->status;
}
LIST_UNLOCK();
xassert(listElem && (!(listElem->status & RESH_IN_USE_BIT) || elemOps == ops));
return listElem->status;
return status;
}
/**************************************************************/
......
......@@ -2564,7 +2564,7 @@ bool cdf_set_unstructured_par(ncvar_t *ncvar, grid_t *grid, int *xdimid, int *yd
if ( number_of_grid_used != CDI_UNDEFID ) grid->number = number_of_grid_used;
if ( ncvar->position > 0 ) grid->position = ncvar->position;
if ( uuidOfHGrid[0] != 0 ) memcpy(grid->uuid, uuidOfHGrid, 16);
if ( uuidOfHGrid[0] != 0 ) memcpy(grid->uuid, uuidOfHGrid, CDI_UUID_SIZE);
return false;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment