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

Avoid mutating the input cubes when building the combined cube in preprocessor function multi_model_statistics #2564

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

bouweandela
Copy link
Member

@bouweandela bouweandela commented Oct 23, 2024

Description

Avoid mutating the input cubes when building the combined cube in preprocessor function multi_model_statistics.

Issue was introduced in #2518 and is not present in any released version of the tool.

Closes #2559


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@bouweandela bouweandela added the bug Something isn't working label Oct 23, 2024
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.97%. Comparing base (865ea7d) to head (b42f07d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2564   +/-   ##
=======================================
  Coverage   94.97%   94.97%           
=======================================
  Files         254      254           
  Lines       14747    14748    +1     
=======================================
+ Hits        14006    14007    +1     
  Misses        741      741           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bettina-gier
Copy link
Contributor

Just commenting to say that this fixes the issue, the new portrait plot recipe runs successfully with this Pr as tested by @lukruh and me.

@bouweandela bouweandela added this to the v2.12.0 milestone Jan 17, 2025
@bouweandela
Copy link
Member Author

It looks like non-lazy statistics operators will soon be a thing of the past (last one in-progress in SciTools/iris#6167), so maybe it's not worth it to spend time on writing tests for this case.

@bouweandela bouweandela marked this pull request as ready for review January 17, 2025 12:20
@schlunma
Copy link
Contributor

I tested this last Friday with

esmvaltool run ~/ESMValTool/esmvaltool/recipes/recipe_perfmetrics_CMIP5.yml --search_esgf=when_missing --max-parallel-tasks=4

The good news is that the recipe runs successfully now. The bad news is that it takes more than 6 hours to run (with the threaded scheduler); in the previous recipe testing, it finished in ~45min. The main reason seems to be diagnostics with the variable ta:

...
2025-01-17 23:50:48,725 UTC [1608452] INFO    Successfully completed task ta5/ta (priority 37) in 1:51:59.521698
...
2025-01-18 02:59:26,616 UTC [1608450] INFO    Successfully completed task taZONAL/ta (priority 3) in 5:56:36.845380
...

Here is an example log: job_14827486.out.log

I also did a test with the distributed scheduler, but that failed (my guess would be that something is not fully lazy, but I didn't investigate this further).

Probably also not related to this PR.

Copy link
Contributor

@schlunma schlunma left a comment

Choose a reason for hiding this comment

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

Tested this again with the distributed scheduler, this time with 8GB of memory per worker instead of 4GB. The recipe now ran successfully in 45min. Merging this now 🚀

@schlunma schlunma merged commit c1133a8 into main Jan 20, 2025
7 checks passed
@schlunma schlunma deleted the multi-model-statistics-mix-lazy-real-operators branch January 20, 2025 11:13
@bouweandela
Copy link
Member Author

That seems slow indeed, it used to run in about 15 minutes for v2.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Perfmetrics recipe fails in multi model mean step
3 participants