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

Performance: added option to move matplotlib figure generation to separate process #12

Merged
merged 28 commits into from
Jul 11, 2024

Conversation

thisistheplace
Copy link
Contributor

Hi @andrewlyden,

The matplotlib savefig method is causing a bottleneck in the overall runtime. It takes ~ 1/3 to 1/2 of the overall time when running the fixed order solver. There doesn't seem to be anything that can be done about this within the matplotlib library.

I originally planned on moving the figure writing to a separate thread but matplotlib isn't threadsafe.

Instead I've moved the figure writing to a separate process (compute core) so that it doesn't block the solver from moving onto the next parametric simulation. This can make debugging more tricky but single core processing can be forced by specifying the new --singlecore option.

I've also changed the progress bars to use the tqdm library which is simpler to implement. Log messages mostly get written to the log file with just progress (and warnings/errors!) written to the screen which hopefully makes monitoring the overall run progress a bit clearer.

Thanks,

Ben

@thisistheplace thisistheplace changed the title Added option to move matplotlib figure generation to separate process Performance: added option to move matplotlib figure generation to separate process Jun 19, 2024
@andrewlyden andrewlyden merged commit 0691d63 into andrewlyden:master Jul 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants