Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
squash! Add wall-time step timers to Simulator
Having separate build and connect methods didn't seem to make sense, especially because connect depended on build and other methods depended on either connect or build and sometimes it raised an error if one wasn't called, and other times it would just call it. With the changes in this commit, we just have a `connect` method which does the build and connect (it could be called `build`, but the `connected` property makes more sense, and it would be weird to set `connected` with `build`). If we expect to be connected and aren't, we raise an error.
- Loading branch information
Showing
3 changed files
with
35 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1aeca78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One place where it was nice to have this separate was for power measurements. We need to do a baseline power measurement, and it's good to have it as close to the actual run as possible (since chip power draw changes with temperature, etc.). The build can take a long time (minutes). Having them separate, I could make the Simulator for the actual network and have it all built, then make and run another Simulator for the baseline power, before running the actual network. I'm worried if we connect right away, it would stop the baseline power simulator from connecting and running in this kind of setup. It's possible it would still work (if multiple simulators can be connected at once), but definitely something we should check.
1aeca78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this PR, the build was done at the end of
__init__
, which would make that separation pretty straightforward (build in__init__
, then connect when you enter the context manager). Is there a reason that was moved from the__init__
?1aeca78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were doing
HardwareInterface.create_io_snip
at the start ofconnect
, and I moved it tobuild
so that it wouldn't be included in timing. I think I removed it from__init__
when doing that, but looking at it now, I don't see a clear reason thatbuild
can't still happen in__init__
. So I'd be fine moving it back there.1aeca78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll do that.