Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mathieu Westphal
libcdi
Commits
efd37a20
Commit
efd37a20
authored
3 months ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
vlistChangeGridIndex: call delete_chunks()
parent
4a15ed9a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/vlist.c
+22
-4
22 additions, 4 deletions
src/vlist.c
with
22 additions
and
4 deletions
src/vlist.c
+
22
−
4
View file @
efd37a20
...
...
@@ -1342,6 +1342,22 @@ vlistGridIndex(int vlistID, int gridID)
return
index
;
}
static
void
delete_chunks
(
int
vlistID
,
int
varID
)
{
int
chunkKeys
[
4
]
=
{
CDI_KEY_CHUNKSIZE_DIMX
,
CDI_KEY_CHUNKSIZE_DIMY
,
CDI_KEY_CHUNKSIZE_DIMZ
,
CDI_KEY_CHUNKSIZE_DIMT
};
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
int
chunkSize
=
0
;
cdiInqKeyInt
(
vlistID
,
varID
,
chunkKeys
[
i
],
&
chunkSize
);
if
(
chunkSize
!=
0
)
cdiDeleteKey
(
vlistID
,
varID
,
chunkKeys
[
i
]);
}
int
chunkSize
=
0
;
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_CHUNKSIZE
,
&
chunkSize
);
if
(
chunkSize
>
0
)
cdiDeleteKey
(
vlistID
,
varID
,
CDI_KEY_CHUNKSIZE
);
}
void
vlistChangeGridIndex
(
int
vlistID
,
int
index
,
int
gridID
)
{
...
...
@@ -1357,9 +1373,7 @@ vlistChangeGridIndex(int vlistID, int index, int gridID)
if
(
vlistptr
->
vars
[
varID
].
gridID
==
gridIDold
)
{
vlistptr
->
vars
[
varID
].
gridID
=
gridID
;
int
chunkSize
=
0
;
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_CHUNKSIZE
,
&
chunkSize
);
if
(
chunkSize
>
0
)
cdiDeleteKey
(
vlistID
,
varID
,
CDI_KEY_CHUNKSIZE
);
delete_chunks
(
vlistID
,
varID
);
if
(
gridInqXsize
(
gridIDold
)
==
0
&&
gridInqXsize
(
gridID
)
>
0
&&
vlistInqVarXYZ
(
vlistID
,
varID
)
!=
0
)
vlistDefVarXYZ
(
vlistID
,
varID
,
0
);
}
...
...
@@ -1385,7 +1399,11 @@ vlistChangeGrid(int vlistID, int gridID1, int gridID2)
}
int
nvars
=
vlistptr
->
nvars
;
for
(
int
varID
=
0
;
varID
<
nvars
;
varID
++
)
if
(
vlistptr
->
vars
[
varID
].
gridID
==
gridID1
)
vlistptr
->
vars
[
varID
].
gridID
=
gridID2
;
if
(
vlistptr
->
vars
[
varID
].
gridID
==
gridID1
)
{
vlistptr
->
vars
[
varID
].
gridID
=
gridID2
;
delete_chunks
(
vlistID
,
varID
);
}
reshSetStatus
(
vlistID
,
&
vlistOps
,
RESH_DESYNC_IN_USE
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment