mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Addressed reviewer's comments.
This commit is contained in:
parent
0bc1630cc9
commit
42247105bf
@ -286,7 +286,7 @@ void pack(const char* str, std::vector<char>& buffer, int& position,
|
|||||||
std::size_t length = strlen(str)+1;
|
std::size_t length = strlen(str)+1;
|
||||||
MPI_Pack(&length, 1, Dune::MPITraits<std::size_t>::getType(), buffer.data(),
|
MPI_Pack(&length, 1, Dune::MPITraits<std::size_t>::getType(), buffer.data(),
|
||||||
buffer.size(), &position, comm);
|
buffer.size(), &position, comm);
|
||||||
MPI_Pack(str, strlen(str)+1, MPI_CHAR, buffer.data(), buffer.size(),
|
MPI_Pack(str, strlen(str)+1, MPI_CHAR, buffer.data(), buffer.size(),
|
||||||
&position, comm);
|
&position, comm);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -486,11 +486,10 @@ void unpack(std::string& str, std::vector<char>& buffer, int& position,
|
|||||||
{
|
{
|
||||||
std::size_t length=0;
|
std::size_t length=0;
|
||||||
unpack(length, buffer, position, comm);
|
unpack(length, buffer, position, comm);
|
||||||
char* cStr = new char[length];
|
std::vector<char> cStr(length, '\0');
|
||||||
unpack(cStr, length, buffer, position, comm);
|
unpack(cStr.data(), length, buffer, position, comm);
|
||||||
assert(str.empty());
|
assert(str.empty());
|
||||||
str.append(cStr);
|
str.append(cStr.data());
|
||||||
delete[] cStr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T1, class T2>
|
template<class T1, class T2>
|
||||||
|
Loading…
Reference in New Issue
Block a user