Repository navigation
Description
Brief summary of bug
In bringing in #4110 I found that some of the longer threaded tests fail when using DGLC.
ERP_Ly3_P64x2.f10_f10_mg37.IHistClm50BgcCrop.derecho_intel.clm-cropMonthOutput ( COMPARE_base_rest )
ERP_Ly3_P64x2.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-cropMonthOutput--clm-matrixcnOn_ignore_warnings ( COMPARE_base_rest )
ERP_P64x2_Ld1096.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-clm50cropIrrigMonth_interp ( COMPARE_base_rest )
ERP_P64x2_Ld1096.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-irrig_o3falk_reduceOutput ( COMPARE_base_rest )
ERP_P64x2_Ld366.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-irrig_alternate_monthly ( COMPARE_base_rest )
ERP_P64x2_Ld396.f10_f10_mg37.IHistClm60Bgc.derecho_gnu.clm-monthly ( COMPARE_base_rest )
ERP_P64x2_Ld765.f10_f10_mg37.I2000Clm60BgcCrop.derecho_intel.clm-monthly ( COMPARE_base_rest )
It seems to be only tests that go beyond a year, at least that's my speculation.
General bug information
CTSM version you are using: ctsm5.4.049-98-g48ed6abb9
Does this bug cause significantly incorrect results in the model's science? No
Configurations affected: ERP restart tests and PEM tests
Details of bug
Looking at the threaded tests that fail comparison of rest to base. It's the cpl history files that fail for 4 fields:
tail -n20 /glade/derecho/scratch/erik/tests_ctsm545acl/ERP_P64x2_Ld366.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-irrig_alternate_monthly.GC.ctsm545acl_int/run/ERP_P64x2_Ld366.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-irrig_alternate_monthly.GC.ctsm545acl_int.cpl.hi.2001-01-02-00000.nc.base.cprnc.out
grep RMS run/ERP_P64x2_Ld366.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-irrig_alternate_monthly.GC.ctsm545acl_int.cpl.hi.2001-01-02-00000.nc.base.cprnc.out
RMS rofImp_Forr_rofi_glc 7.0515E-21 NORMALIZED 8.4114E-14
RMS rofExp_Fgrg_rofi 7.3536E-22 NORMALIZED 9.1454E-15
RMS glc1Imp_Fgrg_rofi 5.0408E-21 NORMALIZED 1.3781E-15
RMS glc1Exp_Flgl_qice 4.7167E-21 NORMALIZED 4.4018E-16so it's a roundoff difference somehow due to DGLC when threading is on.
Important details of your setup / configuration so we can reproduce the bug
This was found in #4110 with this comment:
Important output or errors that show the problem
These are examples of tests that fail:
ERP_P64x2_Ld366.f10_f10_mg37.I2000Clm60Sp.derecho_intel.clm-nofireemis ( COMPARE_base_rest )
PEA_P64x2_Ld366.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop ( RUN)
PEM_P64x2_Ld366.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop ( COMPARE_base_modpes )
and these are tests that PASS
ERI_P64x2_Ld366.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop
ERS_P64x2_Ld366.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop
PET_P64x2_Ld366.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop
REP_P64x2_Ld366.f10_f10_mg37.I2000Clm50BgcCrop.derecho_intel.clm-crop
So it's not just exact restart that fails, or a fail when processors change, it's exact restart with a processor change. But, the PEM test fails while PET passes and those are with a change in processors. It's odd that PET passes (only changes OMP threads) while the PEM test fails (only changes MPI tasks), since it's only seen in threaded tests. I would think that would be switched.
Activity
ekluzek commentedon Aug 9, 2026
Until this is resolved we should add tests for the longest shorter period that works, to make sure other problems don't come up. From testing I see that the shortest period is 364 days. Once it hits the 365 mark there's a change in answers.
Add shorter tests that pass until ESCOMP#4160 is handled
[-]Threaded exact restart tests that change task/thread count fail with DGLC%NOEVOLVE fail when run over a year[/-][+]Threaded exact restart tests that change task/thread count fail with DGLC%NOEVOLVE fail when run to a year or more[/+][-]Threaded exact restart tests that change task/thread count fail with DGLC%NOEVOLVE fail when run to a year or more[/-][+]Threaded exact restart tests that change task/thread count fail with DGC or CISM fail when run to a year or more[/+]ekluzek commentedon Aug 10, 2026
This problem occurs for both DGLC and CISM (From running ERP_P64x2_Ld365.f10_f10_mg37.I1850Clm50BgcCropG.derecho_intel.clm-monthly that fails similarly). For CISM two additional fields fail, and the difference is large for glc1Imp_Fgrd_rofi on the CPL history files. And there are differences in the CISM history files.
cpl.hist:
cism.gris.h:
ekluzek commentedon Aug 10, 2026
Since the problem shows up for CPL fields on the CISM grid (which CLM doesn't know abiout I think this means the problem is in CMEPS. But, it's odd that it shows up for threading tests only as CMEPS doesn't do threading
Pinging: @billsacks @Katetc
ekluzek commentedon Aug 10, 2026
I thought the problem might be because of GLC_TWO_WAY_COUPLING==TRUE, but I reran a test case doing that and the problem didn't go away (but I'm not sure how safe it is to rerun a ERP threaded case).
billsacks commentedon Aug 10, 2026
It's puzzling that you only see this in threaded tests, but the fact that you see this in PEM and not PET tests makes me think that the fundamental issue is related to changing processor count. And that makes me wonder if you're seeing the same issue that @Katetc found, reported here: ESCOMP/CMEPS#650
You could check whether you're hitting the same issue by turning off the smb renormalization: set
glc_renormalize_smb = 'off'in user_nl_cpl.ekluzek commentedon Aug 10, 2026
@billsacks you are right -- it is that issue!
Yes, the test passes correctly when I do that.
So what does this mean? @KateC and @billsacks? Should we run with this setting off? Does this make ESCOMP/CMEPS#650 a higher priority to solve? Or is this restricted enough that it's still a low priority to fix?
ekluzek commentedon Aug 10, 2026
Also @billsacks is 650 the right number for this issue? That CMEPS issue seems to be slightly different maybe? It doesn't reference the glc_renormalize_smb namelist and is about reproducable sums. Although I suppose maybe that's the cause for the difference there are sums being done for glc_renormalize_smb that aren't reproducable on a change in number of tasks?
billsacks commentedon Aug 10, 2026
Yes, ESCOMP/CMEPS#650 is the right issue number. It didn't directly reference glc_renormalize_smb but I just edited it to reference that variable directly for future searchability. The problem is that glc_renormalize_smb does a global sum, and it's done in the normal, simple way that leads to the sum differing for different processor counts. As that issue notes, I'm actually surprised that this doesn't come up in the runoff coupling, since there is also a global sum in handling negative runoff, but maybe something in the details of that implementation mean that roundoff-level changes typically don't matter there.
I do feel like this makes ESCOMP/CMEPS#650 higher priority. I'll see if I can resolve at least the glc_renormalize_smb portion of this quickly....
billsacks commentedon Aug 10, 2026
This is turning out to be more involved than I had imagined it would be. (Why do things like that continue to surprise me?) But with the help of Claude, I think I'm making progress....
billsacks commentedon Aug 11, 2026
I realized that, in addition to the CMEPS changes, I think we also need similar changes in DGLC for the allreduce there... I'll work on that, too.
billsacks commentedon Sep 17, 2026
PRs to get bit-for-bit answers with changing processor count when using DGLC:
billsacks commentedon Sep 18, 2026
Those PRs have been merged now.
ekluzek commentedon Sep 18, 2026
Thanks @billsacks I've put in a placeholder to bring this into CTSM. I'm looking forward to this fixing some of our expected fails.
[-]Threaded exact restart tests that change task/thread count fail with DGC or CISM fail when run to a year or more[/-][+]Threaded exact restart tests that change task/thread count fail with DGLC or CISM fail when run to a year or more[/+]Remove the 364 day tests that were there until ESCOMP#4160 was resolved
[-]Threaded exact restart tests that change task/thread count fail with DGLC or CISM fail when run to a year or more[/-][+]Threaded exact restart tests that change task/thread count fail with DGLC or CISM when run to a year or more[/+]