Skip to content
GitLab
Menu
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
3c80a15d
Commit
3c80a15d
authored
Nov 19, 2013
by
Thomas Jahns
🤸
Browse files
Merge identical code blocks in single function.
parent
9465ce2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pio_interface.c
View file @
3c80a15d
...
...
@@ -562,6 +562,17 @@ cdiPio_xt_idxlist_pack_wrap(void *data, void *buf, int size, int *pos,
size
,
pos
,
comm
);
}
static
inline
void
collWait
(
int
collID
)
{
if
(
txWin
[
collID
].
postSet
)
{
xmpi
(
MPI_Win_wait
(
txWin
[
collID
].
win
));
txWin
[
collID
].
postSet
=
0
;
modelWinFlushBuffer
(
collID
);
}
}
void
pioBufferPartData
(
int
streamID
,
int
varID
,
const
double
*
data
,
int
nmiss
,
Xt_idxlist
partDesc
)
...
...
@@ -574,12 +585,7 @@ pioBufferPartData(int streamID, int varID, const double *data,
collID
<
commInqNProcsColl
()
&&
txWin
!=
NULL
);
if
(
txWin
[
collID
].
postSet
)
{
xmpi
(
MPI_Win_wait
(
txWin
[
collID
].
win
));
txWin
[
collID
].
postSet
=
0
;
modelWinFlushBuffer
(
collID
);
}
collWait
(
collID
);
Xt_int
chunk
=
xt_idxlist_get_num_indices
(
partDesc
);
xassert
(
chunk
<=
INT_MAX
);
...
...
@@ -619,12 +625,7 @@ void pioBufferFuncCall(struct winHeaderEntry header,
for
(
collID
=
0
;
collID
<
nProcsColl
;
++
collID
)
{
if
(
txWin
[
collID
].
postSet
)
{
xmpi
(
MPI_Win_wait
(
txWin
[
collID
].
win
));
txWin
[
collID
].
postSet
=
0
;
modelWinFlushBuffer
(
collID
);
}
collWait
(
collID
);
xassert
(
txWin
[
collID
].
dictRPCUsed
+
txWin
[
collID
].
dictDataUsed
<
txWin
[
collID
].
dictSize
);
xassert
(
txWin
[
collID
].
refuseFuncCall
==
0
);
...
...
@@ -839,12 +840,7 @@ void pioWriteTimestep()
for
(
collID
=
0
;
collID
<
nProcsColl
;
collID
++
)
{
if
(
txWin
[
collID
].
postSet
)
{
xmpi
(
MPI_Win_wait
(
txWin
[
collID
].
win
));
txWin
[
collID
].
postSet
=
0
;
modelWinFlushBuffer
(
collID
);
}
collWait
(
collID
);
struct
winHeaderEntry
header
=
{
.
id
=
HEADERSIZEMARKER
,
.
specific
.
headerSize
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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