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
02005bf1
Commit
02005bf1
authored
Dec 13, 2012
by
Thomas Jahns
🤸
Browse files
Use on-stack memory for short message buffer.
parent
6841fbaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pio_server.c
View file @
02005bf1
...
...
@@ -398,7 +398,7 @@ void getData ( int tsID, int vdate, int vtime )
void
IOServer
()
{
int
source
,
tag
,
*
iBuffer
,
size
,
nProcsModel
=
commInqNProcsModel
();
int
source
,
tag
,
size
,
nProcsModel
=
commInqNProcsModel
();
static
int
nfinished
=
0
;
char
*
buffer
;
MPI_Comm
commCalc
;
...
...
@@ -472,18 +472,18 @@ void IOServer ()
break
;
case
WRITETS
:
xdebugMsg
(
tag
,
source
,
nfinished
);
xmpi
(
MPI_Get_count
(
&
status
,
MPI_INTEGER
,
&
size
));
xassert
(
size
==
timestepSize
);
iBuffer
=
xmalloc
(
size
*
sizeof
(
int
));
xmpi
(
MPI_Recv
(
iBuffer
,
size
,
MPI_INTEGER
,
source
,
tag
,
commCalc
,
&
status
));
xdebug
(
"RECEIVED MESSAGE WITH TAG
\"
WRITETS
\"
: "
"tsID=%d, vdate=%d, vtime=%d, source=%d"
,
{
int
iBuffer
[
timestepSize
];
xdebugMsg
(
tag
,
source
,
nfinished
);
xmpi
(
MPI_Get_count
(
&
status
,
MPI_INTEGER
,
&
size
));
xassert
(
size
==
timestepSize
);
xmpi
(
MPI_Recv
(
iBuffer
,
size
,
MPI_INTEGER
,
source
,
tag
,
commCalc
,
&
status
));
xdebug
(
"RECEIVED MESSAGE WITH TAG
\"
WRITETS
\"
: "
"tsID=%d, vdate=%d, vtime=%d, source=%d"
,
iBuffer
[
0
],
iBuffer
[
1
],
iBuffer
[
2
],
source
);
getData
(
iBuffer
[
0
],
iBuffer
[
1
],
iBuffer
[
2
]
);
free
(
iBuffer
);
getData
(
iBuffer
[
0
],
iBuffer
[
1
],
iBuffer
[
2
]);
}
break
;
default:
...
...
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