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

Make coastal refined meshes produced with JGSAW BFB between runs #180

Merged
merged 1 commit into from
Mar 8, 2019

Conversation

sbrus89
Copy link

@sbrus89 sbrus89 commented Mar 7, 2019

This PR fixes the consistency issues observed when producing coastal refined meshes (issue #178). The cause was not setting the random seed used in the approximate nearest neighbor library (pyflann). This led to varying resolution specification inputs going into JIGSAW each time the COMPASS workflow was run. Setting the random seed to the same specified value resolves the issue.

closes #178

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

Looks good! This is exactly what we discussed.

@xylar
Copy link
Collaborator

xylar commented Mar 7, 2019

@mark-petersen and @pwolfram, again, a quick review by inspection is what is needed here. Once we get this onto ocean/develop, we should be able to produce new EC60to30 and CONUS meshes that are reproducible.

@sbrus89
Copy link
Author

sbrus89 commented Mar 7, 2019

@xylar, If there were reproducibility issues with generating EC60to30, we may need to look into that further. That mesh does not use my coastal_tools.py to produce the resolution distribution input for JIGSAW, it's just specified by a latitude-dependent function.

def cellWidthVsLatLon():
lat = np.arange(-90, 90.01, 0.1)
lon = np.arange(-180, 180.01, 10.0)
cellWidthVsLat = mdt.EC_CellWidthVsLat(lat)
cellWidth = np.outer(cellWidthVsLat, np.ones([1, lon.size]))
return cellWidth, lon, lat

cc @mark-petersen

@sbrus89
Copy link
Author

sbrus89 commented Mar 7, 2019

I'll test it right now.

@sbrus89
Copy link
Author

sbrus89 commented Mar 7, 2019

I found that the JIGSAW EC60to30 case is BFB between runs.

@xylar
Copy link
Collaborator

xylar commented Mar 8, 2019

@sbrus89, as we discussed in person, we suspect that the reproducibility issues with the EC60to30 mesh are likely to do with @mark-petersen running on two different machines (grizzly and badger) with two different compilations of JIGSAW (perhaps different versions).

@xylar
Copy link
Collaborator

xylar commented Mar 8, 2019

The reproducibility issues are likely going to be diminished by using a common version of JIGSAW from conda in the future but for now we probably need to document details like which machine was used, which modules (and versions) were loaded and which JIGSAW hashtag was used.

Copy link
Contributor

@mark-petersen mark-petersen left a comment

Choose a reason for hiding this comment

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

Approve by visual inspection. Like @xylar said, I ran on two different machines before. If you get bfb reproducibility with this change, that's a great confirmation.

Copy link
Contributor

@pwolfram pwolfram left a comment

Choose a reason for hiding this comment

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

Perfect, thanks for fixing @sbrus89!

Thanks @xylar, @mark-petersen for help in sorting this out.

xylar added a commit to xylar/MPAS-Model that referenced this pull request Mar 8, 2019
Make coastal refined meshes produced with JGSAW BFB between runs

This PR fixes the consistency issues observed when producing coastal refined meshes (issue MPAS-Dev#178). The cause was not setting the random seed used in the approximate nearest neighbor library (pyflann). This led to varying resolution specification inputs going into JIGSAW each time the COMPASS workflow was run. Setting the random seed to the same specified value resolves the issue.
@xylar
Copy link
Collaborator

xylar commented Mar 8, 2019

Testing

I tested the nightly regression suite on badger with GNU and this branch is bit-for-bit identical to the current ocean/develop

@xylar xylar added the mesh label Mar 8, 2019
@xylar xylar merged commit e135967 into MPAS-Dev:ocean/develop Mar 8, 2019
@sbrus89 sbrus89 deleted the BFB_jigsaw_meshes branch March 8, 2019 23:11
ashwathsv pushed a commit to ashwathsv/MPAS-Model that referenced this pull request Jul 21, 2020
Make coastal refined meshes produced with JGSAW BFB between runs

This PR fixes the consistency issues observed when producing coastal refined meshes (issue MPAS-Dev#178). The cause was not setting the random seed used in the approximate nearest neighbor library (pyflann). This led to varying resolution specification inputs going into JIGSAW each time the COMPASS workflow was run. Setting the random seed to the same specified value resolves the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants