Skip to content
Snippets Groups Projects
Commit 82609fbc authored by Christian Engwer's avatar Christian Engwer
Browse files

[parallel,bugfix] don't create empty MessageInformation

when we try to send data, it might happen, that for some reason we don't want to any data.
This happens, when the dynamic size of our CommPolicy is 0. In that case we must not add a
MessageInformation, otherwise we get an MPI error.
parent 4b0fd997
No related branches found
No related tags found
No related merge requests found
...@@ -1160,7 +1160,8 @@ namespace Dune ...@@ -1160,7 +1160,8 @@ namespace Dune
interfacePair != end; ++interfacePair) { interfacePair != end; ++interfacePair) {
int noSend = MessageSizeCalculator<Data,Flag>() (interfacePair->second.first); int noSend = MessageSizeCalculator<Data,Flag>() (interfacePair->second.first);
int noRecv = MessageSizeCalculator<Data,Flag>() (interfacePair->second.second); int noRecv = MessageSizeCalculator<Data,Flag>() (interfacePair->second.second);
messageInformation_.insert(std::make_pair(interfacePair->first, if (noSend + noRecv > 0)
messageInformation_.insert(std::make_pair(interfacePair->first,
std::make_pair(MessageInformation(bufferSize_[0], std::make_pair(MessageInformation(bufferSize_[0],
noSend*sizeof(typename CommPolicy<Data>::IndexedType)), noSend*sizeof(typename CommPolicy<Data>::IndexedType)),
MessageInformation(bufferSize_[1], MessageInformation(bufferSize_[1],
...@@ -1195,8 +1196,8 @@ namespace Dune ...@@ -1195,8 +1196,8 @@ namespace Dune
interfacePair != end; ++interfacePair) { interfacePair != end; ++interfacePair) {
int noSend = MessageSizeCalculator<Data,Flag>() (source, interfacePair->second.first); int noSend = MessageSizeCalculator<Data,Flag>() (source, interfacePair->second.first);
int noRecv = MessageSizeCalculator<Data,Flag>() (dest, interfacePair->second.second); int noRecv = MessageSizeCalculator<Data,Flag>() (dest, interfacePair->second.second);
if (noSend + noRecv > 0)
messageInformation_.insert(std::make_pair(interfacePair->first, messageInformation_.insert(std::make_pair(interfacePair->first,
std::make_pair(MessageInformation(bufferSize_[0], std::make_pair(MessageInformation(bufferSize_[0],
noSend*sizeof(typename CommPolicy<Data>::IndexedType)), noSend*sizeof(typename CommPolicy<Data>::IndexedType)),
MessageInformation(bufferSize_[1], MessageInformation(bufferSize_[1],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment