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

Enhancement request: Use realpath when comparing namelists #4638

Open
samsrabin opened this issue May 28, 2024 · 4 comments
Open

Enhancement request: Use realpath when comparing namelists #4638

samsrabin opened this issue May 28, 2024 · 4 comments

Comments

@samsrabin
Copy link
Contributor

When comparing a test to a baseline generated by a different user, I ran into the following supposed diff in our namelists:

SMS_D_Ld5.5x5_amazon.I1850Clm60Bgc.derecho_gnu.clm-HillslopeC
2024-05-28 11:36:12: NLCOMP
Comparison failed between '/glade/derecho/scratch/samrabin/tests_0528-113433de/SMS_D_Ld5.5x5_amazon.I1850Clm60Bgc.derecho_gnu.clm-HillslopeC.GC.0528-113433de_gnu/CaseDocs/nuopc.runconfig' with '/glade/campaign/cgd/tss/ctsm_baselines/ctsm5.2.005/SMS_D_Ld5.5x5_amazon.I1850Clm60Bgc.derecho_gnu.clm-HillslopeC/CaseDocs/nuopc.runconfig'
DRIVER_attributes->PELAYOUT_attributes->ALLCOMP_attributes:
 - mesh_atm : /glade/campaign/cesm/cesmdata/cseg/inputdata/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc
 + mesh_atm : /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc
DRIVER_attributes->PELAYOUT_attributes->ALLCOMP_attributes:
 - mesh_lnd : /glade/campaign/cesm/cesmdata/cseg/inputdata/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc
 + mesh_lnd : /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc

I say "supposed" because the differences are only skin-deep: The new versions (+) resolve through an alias to match the baseline versions (-) exactly.

There may be reasons it is the way it is, but I feel like it'd be better for such situations to not count as diffs. I think this could be accomplished by using os.path.realpath() somewhere in _normalize_string_value(). Although looking at that code, I see that os.path.basename() is used, so maybe I'm misunderstanding what's happening where.

Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@jedwards4b
Copy link
Contributor

@samsrabin I think that this may have just been a problem on one machine due to sym-links - is there still an issue?

@samsrabin
Copy link
Contributor Author

There may well still be an issue, yes—I haven't recently been in the situation where the problem arises.

@ekluzek
Copy link
Contributor

ekluzek commented Aug 27, 2024

This does have to do with softlinks. The underlying reason it came up was that I was inadvertently overriding $CESMDATAROOT in my startup files (from way in the past). Now, I've stopped doing that so we aren't likely to see it anymore. This was on Derecho and not that long ago though.

So it's a good change to make, but might not be worth it. Also you could argue that the components that come up with the namelist filenames is the place where this should be corrected. The problem there is it has to be done in each component. If this was easy to do in cime it would allow it to be done in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants