Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
HEP
HEPnOS
Commits
fa9f6119
Commit
fa9f6119
authored
Nov 02, 2018
by
Matthieu Dorier
Browse files
corrected memory error when calling MPI_Gather
parent
06b069b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/service/ConnectionInfoGenerator.cpp
View file @
fa9f6119
...
...
@@ -24,7 +24,10 @@ ConnectionInfoGenerator::~ConnectionInfoGenerator() {}
void
ConnectionInfoGenerator
::
generateFile
(
MPI_Comm
comm
,
const
std
::
string
&
filename
)
const
{
int
rank
,
size
;
const
char
*
addr
=
m_impl
->
m_addr
.
c_str
();
auto
addr_cpy
=
m_impl
->
m_addr
;
addr_cpy
.
resize
(
1024
,
'\0'
);
const
char
*
addr
=
addr_cpy
.
c_str
();
MPI_Comm_rank
(
comm
,
&
rank
);
MPI_Comm_size
(
comm
,
&
size
);
...
...
@@ -34,8 +37,8 @@ void ConnectionInfoGenerator::generateFile(MPI_Comm comm, const std::string& fil
std
::
string
proto
(
addr
,
j
);
// Exchange addresses
std
::
vector
<
char
>
addresses_buf
(
1
28
*
size
);
MPI_Gather
(
addr
,
1
28
,
MPI_BYTE
,
addresses_buf
.
data
(),
1
28
,
MPI_BYTE
,
0
,
comm
);
std
::
vector
<
char
>
addresses_buf
(
1
024
*
size
);
MPI_Gather
(
addr
,
1
024
,
MPI_BYTE
,
addresses_buf
.
data
(),
1
024
,
MPI_BYTE
,
0
,
comm
);
// Exchange bake providers info
std
::
vector
<
uint16_t
>
bake_pr_ids_buf
(
size
);
...
...
@@ -58,7 +61,7 @@ void ConnectionInfoGenerator::generateFile(MPI_Comm comm, const std::string& fil
std
::
vector
<
std
::
string
>
addresses
;
for
(
unsigned
i
=
0
;
i
<
size
;
i
++
)
{
addresses
.
emplace_back
(
&
addresses_buf
[
1
28
*
i
]);
addresses
.
emplace_back
(
&
addresses_buf
[
1
024
*
i
]);
}
YAML
::
Node
config
;
...
...
Write
Preview
Markdown
is supported
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