Repository navigation
Ctrl-C generation menu: apply event and thread count changes promptly - #534
Open
theoheimel wants to merge 2 commits into
Open
theoheimel wants to merge 2 commits into
theoheimel wants to merge 2 commits into
Conversation
Changing the requested events from the generation menu only took effect after the current round of batches, which for large targets came much later or never. The batches not dispatched yet are now dropped, so the round ends once the jobs in flight commit and the new target applies. A thread count change instead pauses the dispatch until no job is in flight, applies the new count and resumes the round from its queue, so the events stay identical to a run without the change. The "requested events" and "CPU thread count" messages are only logged in log mode; in pretty mode they broke the progress boxes and the menu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…anged target Review follow-up. In pretty mode, nevents/nb_core from <run dir>/control were applied silently, as only the menu shows the changes: they are logged again outside the menu, and the progress boxes redrawn below. Re-entering the current number of events no longer drops the batches not dispatched yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
How CI reacts to this PR
|
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two issues of the Ctrl-C menu during event generation, plus review follow-ups.
Changes
Changing the number of events took effect much later or never. The new target was only applied between rounds, and a round of a large target kept dispatching batches sized for the old one. Now, once a target change is pending, the batches not dispatched yet are dropped (
EventGenerator::drop_ready_jobs, which also resets the per-channel flags so channels get new batches next round). The round ends once the jobs in flight commit, and the new target applies. A changed target breaks reproducibility either way; re-entering the current value drops nothing.Changing the number of CPU threads stays reproducible. Instead of dropping batches, the dispatch pauses until no job is in flight, the thread pools are resized, and the round resumes from its unchanged queue. Job ids, seeds and commit order are the same as without the change. Thread changes now also apply during
optimize()/fix_max_weights().Log lines no longer break the interactive display. The C++ "requested events changed" / "CPU thread count set" messages are only printed with
Verbosity::log. In Python,GenerationControllogs the change except from the menu in pretty mode (the menu shows it). Commands from<run dir>/controlare still logged, and the progress boxes are redrawn below them.Testing
EventGeneratorwith a real SIGINT whose handler callsset_target_count/set_thread_count(3-channel e+e- -> d d~ g setup of the madspace tests):GenerationControlwith a stub generator: control-file changes logged and redrawn in pretty mode, menu changes silentmadspace/tests:test_weighting_steps,test_survey_job_failure,test_event_stream,test_flavor_switch_step(36 passed)launchwith the menu🤖 Generated with Claude Code