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

Make sure that Run and Cleanup are called after Prepare #898

Merged
merged 3 commits into from Mar 8, 2018

Conversation

@hakonsbm
Copy link
Contributor

@hakonsbm hakonsbm commented Mar 7, 2018

An error will now be raised if Run() or Cleanup() are called without calling Prepare() first.

This fixes #659.

@@ -430,6 +431,7 @@ nest::SimulationManager::prepare()
* kernel().connection_manager.get_min_delay();
kernel().music_manager.enter_runtime( tick );
}
prepared_ = true;

This comment has been minimized.

@apeyser

apeyser Mar 8, 2018
Contributor

We should check at the top of the function that ! prepared_ and otherwise throw an exception like in the other checks.

@@ -169,7 +169,8 @@ class SimulationManager : public ManagerInterface
delay to_step_; //!< update clock_+from_step<=T<clock_+to_step_
timeval t_slice_begin_; //!< Wall-clock time at the begin of a time slice
timeval t_slice_end_; //!< Wall-clock time at the end of time slice
long t_real_; //!< Accumunated wall-clock time spent simulating (in us)
long t_real_; //!< Accumulated wall-clock time spent simulating (in us)
bool prepared_; //!< indicates whether the SimulationManager has already been

This comment has been minimized.

@apeyser

apeyser Mar 8, 2018
Contributor

indicates whether the SimulationManager has already been seems to be missing a word or two.

ResetKernel
Cleanup
} fail_or_die

This comment has been minimized.

@apeyser

apeyser Mar 8, 2018
Contributor

And prepare after prepare test.

@apeyser
apeyser approved these changes Mar 8, 2018
Copy link
Contributor

@apeyser apeyser left a comment

👍

@apeyser apeyser merged commit 641f48c into nest:master Mar 8, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@hakonsbm hakonsbm deleted the hakonsbm:run_state_checks branch Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.