Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Conversation

ohm314
Copy link
Contributor

@ohm314 ohm314 commented Oct 2, 2020

Until now NetSendBuffer_t was allocated at a fixed size that could not
be changed. When using buffered net_send and invoking multiple
net_send's in INITIAL blocks in NMODL it may happen that we run out of
buffer. Currently this case is not handled and causes a buffer overflow.

As a first step NetSendBuffer_t has been given a constructor and
destructor as well as a grow function that doubles all internal buffer
sizes and copies data to the new buffers.

Until now NetSendBuffer_t was allocated at a fixed size that could not
be changed. When using buffered net_send and invoking multiple
net_send's in INITIAL blocks in NMODL it may happen that we run out of
buffer. Currently this case is not handled and causes a buffer overflow.

As a first step NetSendBuffer_t has been given a constructor and
destructor as well as a grow function that doubles all internal buffer
sizes and copies data to the new buffers.
@ohm314 ohm314 requested a review from pramodk October 2, 2020 22:59
Copy link
Collaborator

@nrnhines nrnhines left a comment

Choose a reason for hiding this comment

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

LGTM. But is it a no-no to approve WIP

@ohm314 ohm314 marked this pull request as ready for review October 4, 2020 23:55
Updated destructor to use free wrapper for cuda compatibility.
@ohm314
Copy link
Contributor Author

ohm314 commented Oct 5, 2020

please retest

Omar Awile added 2 commits October 5, 2020 12:05
By inheriting from MemoryManaged the class overloads new and free
operators to use cudaMallocManaged alloctors when necessary.
- fixed a bug, _size was not being updated
- Check for OpenACC and throw an error, as reallocation will not work
  on device
Copy link
Collaborator

@pramodk pramodk left a comment

Choose a reason for hiding this comment

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

LGTM

@ohm314 ohm314 merged commit 639e9e0 into master Oct 5, 2020
@pramodk pramodk deleted the nsb_grow branch December 4, 2020 18:14
pramodk pushed a commit to neuronsimulator/nrn that referenced this pull request Nov 2, 2022
Until now NetSendBuffer_t was allocated at a fixed size that could not
be changed. When using buffered net_send and invoking multiple
net_send's in INITIAL blocks in NMODL it may happen that we run out of
buffer. Currently this case is not handled and causes a buffer overflow.

As a first step NetSendBuffer_t has been given a constructor and
destructor as well as a grow function that doubles all internal buffer
sizes and copies data to the new buffers.

- By inheriting from MemoryManaged the class overloads new and free
operators to use cudaMallocManaged alloctors when necessary.
- Check for OpenACC and throw an error, as reallocation will not work
  on device

CoreNEURON Repo SHA: BlueBrain/CoreNeuron@639e9e0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants