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

CTSM-FATES timing/cost #1076

Open
2 tasks
dlawrenncar opened this issue Jul 7, 2020 · 26 comments
Open
2 tasks

CTSM-FATES timing/cost #1076

dlawrenncar opened this issue Jul 7, 2020 · 26 comments
Assignees
Labels
performance idea or PR to improve performance (e.g. throughput, memory)

Comments

@dlawrenncar
Copy link
Contributor

dlawrenncar commented Jul 7, 2020

@rosiealice @ckoven @wwieder @ekluzek Following up on conversations we had about CTSM-FATES costs at the LMWG meeting. The new CSL allocation request is going to need to be written this summer and this would be good opportunity to try to establish at least general FATES costs, relative to big-leaf CTSM, for the purpose of writing the proposal. I'm aware that the costs will be more variable through time, but even a ballpark estimate would be helpful for perhaps the SP version and the full competition BGC version. I'd be happy to explore myself, which would give me opportunity to run FATES for the first time. Perhaps @rosiealice could point me to two relevant cases (SP, BGC full competition) to start with.

Definition of done:

  • Upload timing results for FATES-SP
  • Upload timing results for FATES-fixed-BGP
@ckoven
Copy link
Contributor

ckoven commented Jul 7, 2020

@dlawrenncar if it helps, my historical transient runs took 20 minutes per decade at 4x5 resolution (so ~1000 gridcells, of which ~750 had living vegetation) on 288 cores on cheyenne.

output from that run is here: /glade/scratch/charlie/archive/fates_clm50_global_4x5_historicaltransient_2e3f469f_2905a9ba if you're interested.

@ckoven
Copy link
Contributor

ckoven commented Jul 7, 2020

sorry, 20 minutes per year.

@dlawrenncar
Copy link
Contributor Author

dlawrenncar commented Jul 7, 2020 via email

@wwieder
Copy link
Contributor

wwieder commented Jul 7, 2020 via email

@ekluzek ekluzek added next this should get some attention in the next week or two. Normally each Thursday SE meeting. and removed next this should get some attention in the next week or two. Normally each Thursday SE meeting. labels Jul 8, 2020
@ekluzek
Copy link
Collaborator

ekluzek commented Jul 9, 2020

@dlawrenncar is going to work on this. Note, that you need to make sure that FATES is spunup well for your timing tests. FATES is more likely to have a change in timing cost as the model runs, unlike big-leaf CTSM.

@rosiealice
Copy link
Contributor

Hi @dlawrenncar ,
I set these 4x5 simulations off before I saw your comment on the 1/2 deg simulations.

FATES Fixed biogeog with competition with 6 PFTs. 40y
/glade/scratch/rfisher/archive/fates_timin_6pft_fbg_comp/lnd/hist

CLM5 BGC no crop. 40y.
/glade/scratch/rfisher/archive/clm5_timing_bgc/lnd/hist

Broadly, the CLM simulation took 3 hours, and the FATES one took 18. It might be slightly longer given the spinup issues Eric mentioned. I can take a look at the latter years to check (lots to do today before they turn the computer off!!)

One interesting thing would be to look at how the FATES aggregation parameters affect the speed (because they should, especially for patch dynamics...

@dlawrenncar
Copy link
Contributor Author

dlawrenncar commented Jul 10, 2020 via email

@ckoven
Copy link
Contributor

ckoven commented Jul 10, 2020

I'm actually a bit surprised that the number of patches should be greater than the number of PFTs. FATES currently limits it to 10 primary patches per site, which seems like less than 6x the number of PFTs in big-leaf CLM?

@rgknox
Copy link
Collaborator

rgknox commented Jul 10, 2020

For any given column, we seem to be operating with our 1600 cohorts each requiring their own photosynthesis calculations, a scheme which is embedded in the canflux iterative solve. So only 6X, yay.

@dlawrenncar
Copy link
Contributor Author

dlawrenncar commented Jul 10, 2020 via email

@rgknox
Copy link
Collaborator

rgknox commented Jul 10, 2020

For accuracy's sake, I just want to point out that we actually perform photosynthesis on each leaf-layer of each canopy-layer, and since we use PPA, each pft has its own leaf layer (sorry, I shouldn't had said cohort). So we end up doing photosynthesis on an array that is pft x leaf-layer x canopy layer. In order to make sure we hit all the possible layers, we DO loop by cohort, but we also do a lot of masking to avoid redundancy.

See here, we actually loop over leaf layers: https://github.com/NGEET/fates/blob/master/biogeophys/FatesPlantRespPhotosynthMod.F90#L375

That said, I think that reducing our number of leaf layers is something that could potentially reduce computation, and may be low hanging fruit.

@rgknox
Copy link
Collaborator

rgknox commented Jul 10, 2020

There is also this old issue here: NGEET/fates#386

@rosiealice
Copy link
Contributor

Also for accuracy's sake, while 10 is the maximum number of patches, if the fusion criteria were on the fussy end, and every site had the max number of patches, that would be inefficient. I meant to check the distribution of NPATCHES but all the computer resources are down today because of Wyoming-related things.

The number of all calculations (photosynthesis, cohorts etc.) scales with NPATCHES, but as @rgknox mentioned, the correspondance between the number of cohorts and the number of photosynthesis calculations is more complicated...

@rosiealice
Copy link
Contributor

Anthony Walker (who isn't on this repo) also had mentioned in the past that he was working on an analytical method for speeding up the photosynthesis routines. If we could do that, it might be pretty useful. I'll ask him...

@dlawrenncar
Copy link
Contributor Author

I ran 2deg and 4x5 FATES fixed biogeography and got timing costs for 1850 Control

2deg: ~600 pe-hrs/yr (compared to 75 pe-hrs/yr CLM5BGC) = 8x
4x5: ~110 pe-hrs/yr (compared to 14 pe-hrs/yr CLM5BGC) = 8x

In both cases, cost comes into 'equilibrium' after about 4-6 years of simulation.

Cases:
/glade/work/dlawren/cases/timing_tests/ctsm50fates_2deg_timing_fixed_biogeog
/glade/work/dlawren/cases/timing_tests/ctsm50fates_4x5_timing_fixedbiogeog

Would be good to discuss at forthcoming CTSM-FATES meeting.

@ckoven
Copy link
Contributor

ckoven commented Aug 13, 2020

it seems like one place to start on this is to put timing calls around every instance where CTSM calls FATES code, so that we can better understand exactly where the costs in FATES are being incurred?

@jkshuman
Copy link
Contributor

FWIW @dlawrenncar with my fire runs on a somewhat old tag (tag1331_api81) with fire disturbance for the tropics only I get
1 deg tropics fire: ~530 pe-hrs/yr

@dlawrenncar
Copy link
Contributor Author

@jkshuman Interesting. Just to be clear, is this a Tropics only run? I guess it must be. What is the domain more precisely?

@jkshuman
Copy link
Contributor

@dlawrenncar yes, tropics only offline land. here is a fig for reference and coords below. Do you want me to kick off another run with a more recent tag?
long= 0 to 360
lat = -55 to 30
TLAI_per_yr13_tropicsYr70_Fire_Hybrid_1deg_MoiT_C3_lightning_1x1_a1a8efe5_d5289355

@jkshuman
Copy link
Contributor

I should add that this is a 3PFT run with fire disturbance, so perhaps not directly comparable?

@dlawrenncar
Copy link
Contributor Author

dlawrenncar commented Aug 18, 2020 via email

@billsacks
Copy link
Member

Cross-reference: see the more recent issue NGEET/fates#859

@samsrabin samsrabin added the performance idea or PR to improve performance (e.g. throughput, memory) label Feb 8, 2024
@ekluzek
Copy link
Collaborator

ekluzek commented Aug 14, 2024

Closing as it looks like the thing that was needed was figured out.

@ekluzek ekluzek closed this as completed Aug 14, 2024
@wwieder
Copy link
Contributor

wwieder commented Aug 15, 2024

Definition of done is when Fates timing files added to cesm3 website for SP and FixedBiogeoraphy simulations

@wwieder wwieder reopened this Aug 15, 2024
@ekluzek
Copy link
Collaborator

ekluzek commented Aug 15, 2024

Notes from Jim about how to store the timing results:

I forgot to mention in yesterday's meeting - You may get requests to update the cesm3 timing table at https://cseg.cgd.ucar.edu/timing/timings/
I will handle the fully active compsets and feel free to forward those requests to me. But I would appreciate it if you would do the component specific compsets yourself.
To do so run a PFS test with the compset and resolution you want, then upload the resulting timing table to https://cseg.cgd.ucar.edu/timing/upload/
(you will need to login to do this).

@samsrabin
Copy link
Collaborator

Procedure needed for some compsets, including fixed-biogeo—see #2745.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance idea or PR to improve performance (e.g. throughput, memory)
Projects
None yet
Development

No branches or pull requests

9 participants