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
Container Registry
Model registry
Operate
Environments
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
mpim-sw
libcdi
Commits
662169b1
Commit
662169b1
authored
7 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Only perform computation and reallocation when actually needed.
parent
9dfaddf5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pio_server.c
+12
-6
12 additions, 6 deletions
src/pio_server.c
with
12 additions
and
6 deletions
src/pio_server.c
+
12
−
6
View file @
662169b1
...
...
@@ -1375,15 +1375,11 @@ writeGribStream(size_t streamIdx,
:
false
;
struct
cacheRedist
*
restrict
retained
=
rxWin
[
streamIdx
].
retained
;
struct
passDict
*
varsInPass
=
NULL
;
size_t
varsInPassSize
=
0
;
size_t
varsInPassSize
=
0
,
maxNumVarsAlloc
=
0
;
MPI_Aint
*
displ
=
NULL
;
const
struct
winHeaderEntry
*
winDict
=
(
wHECast
)
clientBuf
[
0
].
mem
;
for
(
size_t
pass
=
0
;
pass
<
numPasses
;
++
pass
)
{
size_t
numVarsInPass
=
buildPassVarDict
(
collSize
,
passes
[
pass
],
writtenRecords
,
&
varsInPassSize
,
&
varsInPass
);
varRedists
=
Realloc
(
varRedists
,
numVarsInPass
*
sizeof
(
*
varRedists
));
size_t
myRecordStart
=
passes
[
pass
][
collRank
].
recordAggStart
,
myRecordEnd
=
passes
[
pass
][
collRank
].
recordAggEnd
;
size_t
myAggSize
=
0
;
...
...
@@ -1396,9 +1392,19 @@ writeGribStream(size_t streamIdx,
}
else
{
size_t
numVarsInPass
=
buildPassVarDict
(
collSize
,
passes
[
pass
],
writtenRecords
,
&
varsInPassSize
,
&
varsInPass
);
int
myVarStart
=
passes
[
pass
][
collRank
].
varStart
,
myVarEnd
=
passes
[
pass
][
collRank
].
varEnd
;
displ
=
Realloc
(
displ
,
sizeof
(
*
displ
)
*
(
numVarsInPass
*
2
+
1
));
if
(
numVarsInPass
>
maxNumVarsAlloc
)
{
maxNumVarsAlloc
=
numVarsInPass
;
varRedists
=
Realloc
(
varRedists
,
numVarsInPass
*
sizeof
(
*
varRedists
));
displ
=
Realloc
(
displ
,
(
numVarsInPass
*
2
+
1
)
*
sizeof
(
*
displ
));
}
memset
(
displ
,
0
,
sizeof
(
*
displ
)
*
(
numVarsInPass
+
1
));
for
(
size_t
varIdx
=
0
;
varIdx
<
numVarsInPass
;
++
varIdx
)
{
...
...
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