Skip to content

Ref port debug#183

Merged
PhilippPlank merged 42 commits intolava-nc:mainfrom
PhilippPlank:ref_port_debug
Feb 17, 2022
Merged

Ref port debug#183
PhilippPlank merged 42 commits intolava-nc:mainfrom
PhilippPlank:ref_port_debug

Conversation

@PhilippPlank
Copy link
Copy Markdown
Contributor

@PhilippPlank PhilippPlank commented Feb 16, 2022

Issue Number: #160

Objective of pull request: Enable usage of multiple RefPort to VarPort connections for different Vars but same Process.

Pull request checklist

Your PR fulfills the following requirements:

  • Issue created that explains the change and why it's needed
  • Tests are part of the PR (for bug fixes / features)
  • Docs reviewed and added / updated if needed (for bug fixes / features)
  • PR conforms to Coding Conventions
  • PR applys BSD 3-clause or LGPL2.1+ Licenses to all code files
  • Lint (pyb) passes locally
  • Build tests (pyb -E unit) or (python -m unittest) passes locally

Pull request type

Please check your PR type:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation changes
  • Other (please describe):

What is the current behavior?

  • Execution blocks.

What is the new behavior?

  • Execution finishes.

Does this introduce a breaking change?

  • Yes
  • No

Supplemental information

The problem was a overlooked lexical closure when using lambda functions, leading to always pick the same VarPort being serviced, despite having already done that and the other VarPort needing the service. See https://stackoverflow.com/questions/233673/how-do-lexical-closures-work for more information.

PhilippPlank and others added 30 commits November 12, 2021 14:53
@PhilippPlank PhilippPlank added the 1-bug Something isn't working label Feb 16, 2022
@PhilippPlank PhilippPlank self-assigned this Feb 16, 2022
@PhilippPlank PhilippPlank linked an issue Feb 16, 2022 that may be closed by this pull request
7 tasks
Copy link
Copy Markdown
Contributor

@awintel awintel left a comment

Choose a reason for hiding this comment

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

Looks good. Seems like a small bug fix.

If not done already, please make sure that the different usage models of RefPorts are documented.

Copy link
Copy Markdown
Contributor

@mathisrichter mathisrichter left a comment

Choose a reason for hiding this comment

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

Looks good overall - but have a look at my comment on the unit test for RefPorts in hierarchical Processes.

Comment thread tests/lava/magma/runtime/test_ref_var_ports.py Outdated
Comment thread tests/lava/magma/runtime/test_ref_var_ports.py
@PhilippPlank PhilippPlank merged commit 76a6a79 into lava-nc:main Feb 17, 2022
@PhilippPlank PhilippPlank deleted the ref_port_debug branch February 17, 2022 22:33
monkin77 pushed a commit to monkin77/thesis-lava that referenced this pull request Jul 12, 2024
* - Fix problem with RefPorts (lava Issue lava-nc#160) - lexical closure problem (see https://stackoverflow.com/questions/233673/how-do-lexical-closures-work)

* - Fix problem with RefPorts (lava Issue lava-nc#160) - lexical closure problem (see https://stackoverflow.com/questions/233673/how-do-lexical-closures-work)
- added unit test

* - adding another unit test

* - fixing docstrings

* - merged with main

* - fixed linting issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1-bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Execution hangs when more than one RefPort is connected to a process's vars.

3 participants