Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix uninitialized array #149

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/libPMacc/include/memory/buffers/GridBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@ class GridBuffer
{
sendExchanges[i] = NULL;
receiveExchanges[i] = NULL;
/* fill array with valid empty events to avoid side effects if
* array is accessed without calling hasExchange() before usage */
receiveEvents[i]=EventTask();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add a comment why this would deadlock otherwise so we don't forget

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Remembering @psychocoderHPC today) He just realized it does not really deadlock since he checked all the time for hasExchange (or so). Anyway, if one does not check for it, it will probably deadlock on this un-initialized variables because of ...
(jump in @psychocoderHPC ) :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any more comments on this? otherwise I'll merge it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please wait I will add some code comments

sendEvents[i]=EventTask();
}
if (buildDeviceBuffer)
{
Expand Down