Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
bd18838c
Commit
bd18838c
authored
Feb 22, 2017
by
Uwe Schulzweida
Browse files
CDI_CHUNK_AUTO: set chunk_size_max to 128MB.
parent
11c16d7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
bd18838c
2017-02-22 Uwe Schulzweida
* CDI_CHUNK_AUTO: set chunk_size_max to 128MB
2017-02-14 Uwe Schulzweida
* using CGRIBEX library version 1.7.6
...
...
src/cdf_write.c
View file @
bd18838c
...
...
@@ -350,7 +350,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
vlistInqVarDimorder
(
vlistID
,
varID
,
&
dimorder
);
in
t
gridsize
=
gridInqSize
(
gridID
);
size_
t
gridsize
=
gridInqSize
(
gridID
);
bool
lchunk
=
(
gridsize
>
1
);
int
gridtype
=
gridInqType
(
gridID
);
int
gridindex
=
nc_grid_index
(
streamptr
,
gridID
);
...
...
@@ -395,6 +395,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
if ( xid != CDI_UNDEFID ) chunks[ndims] = xsize;
if ( xid != CDI_UNDEFID ) dims[ndims++] = xid;
*/
size_t
chunk_size_max
=
128
*
1024
;
// 128MB
for
(
int
id
=
0
;
id
<
3
;
++
id
)
{
if
(
dimorder
[
id
]
==
3
&&
zid
!=
CDI_UNDEFID
)
...
...
@@ -406,13 +407,19 @@ int cdfDefVar(stream_t *streamptr, int varID)
}
else
if
(
dimorder
[
id
]
==
2
&&
yid
!=
CDI_UNDEFID
)
{
chunks
[
ndims
]
=
(
chunktype
==
CDI_CHUNK_LINES
)
?
1
:
ysize
;
if
(
chunktype
==
CDI_CHUNK_AUTO
)
chunks
[
ndims
]
=
(
chunk_size_max
>
gridsize
)
?
ysize
:
chunk_size_max
/
xsize
;
else
chunks
[
ndims
]
=
(
chunktype
==
CDI_CHUNK_LINES
)
?
1
:
ysize
;
dims
[
ndims
]
=
yid
;
ndims
++
;
}
else
if
(
dimorder
[
id
]
==
1
&&
xid
!=
CDI_UNDEFID
)
{
chunks
[
ndims
]
=
xsize
;
if
(
chunktype
==
CDI_CHUNK_AUTO
&&
yid
==
CDI_UNDEFID
)
chunks
[
ndims
]
=
(
chunk_size_max
>
xsize
)
?
xsize
:
chunk_size_max
;
else
chunks
[
ndims
]
=
xsize
;
dims
[
ndims
]
=
xid
;
ndims
++
;
}
...
...
@@ -502,11 +509,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
#if defined (HAVE_NETCDF4)
if
(
lchunk
&&
(
streamptr
->
filetype
==
CDI_FILETYPE_NC4
||
streamptr
->
filetype
==
CDI_FILETYPE_NC4C
)
)
{
if
(
chunktype
==
CDI_CHUNK_AUTO
)
retval
=
nc_def_var_chunking
(
fileID
,
ncvarid
,
NC_CHUNKED
,
NULL
);
else
retval
=
nc_def_var_chunking
(
fileID
,
ncvarid
,
NC_CHUNKED
,
chunks
);
retval
=
nc_def_var_chunking
(
fileID
,
ncvarid
,
NC_CHUNKED
,
chunks
);
if
(
retval
)
Error
(
"nc_def_var_chunking failed, status = %d"
,
retval
);
}
#endif
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment