geoschem / geos-chem

GEOS-Chem "Science Codebase" repository. Contains GEOS-Chem science routines, run directory generation scripts, and interface code. This repository is used as a submodule within the GCClassic and GCHP wrappers, as well as in other modeling contexts (external ESMs).
http://geos-chem.org
Other
171 stars 166 forks source link

[FEATURE REQUEST] Investigate performance of aerosol chemistry #1069

Open yantosca opened 2 years ago

yantosca commented 2 years ago

As shown in the timing results from 1-month internal benchmarks, GEOS-Chem 13 versions now spend more time in aerosol chemistry (green bar) than in gas-phase chemistry/KPP solver (red bar). We should look into ways in which we can improve the performance of aerosol chemistry, perhaps by optimizing the computations.

1mo

This is not yet slated for any upcoming version, but I am just opening the issue so that we don't lose sight of this.

yantosca commented 8 months ago

@lizziel @msulprizio: Several recent code modifications have added a lot of cluttered code to aerosol_mod.F90. This module would benefit from "never-nesting" (i.e. refactoring code to remove ELSE blocks). However this is probably not a development priority at this time given scheduling constraints. We should keep this on our radar though.

lizziel commented 8 months ago

It looks like the amount of time for aerosol chem nearly doubled with the update "13.3.0+MEGANfix...", and it has not gone down since. Do you know what changed in there to cause that? Could it be a bug?

msulprizio commented 8 months ago

It looks like the amount of time for aerosol chem nearly doubled with the update "13.3.0+MEGANfix...", and it has not gone down since. Do you know what changed in there to cause that? Could it be a bug?

The run "13.3.0+MEGANfix_wGCC10.2" that you're referring to is identical to the previous bar. It's not labeled in the image above but that bar corresponds to "13.3.0+MEGANfix" (which used ifort 19). That suggests that the switch in compiler from ifort 19 to gnu 10.2 caused the increase in aerosol chem timing.

lizziel commented 8 months ago

Ah, and I just realized that figure is from 2021! The latest timing results show a much more reasonable timing ratio of aerosol chem to gas phase.

Screenshot 2024-03-25 at 1 20 49 PM
yantosca commented 8 months ago

@lizziel @msulprizio: I still think we can do better in the aerosol chemistry, since there are a lot of IF / ELSE blocks. If we refactor properly then I think we can get better performance. But it may be a ways off before we can tackle this.