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 jenkins green... again #35

Merged
merged 32 commits into from
Dec 2, 2021
Merged

Make jenkins green... again #35

merged 32 commits into from
Dec 2, 2021

Conversation

rheacangeo
Copy link
Contributor

@rheacangeo rheacangeo commented Nov 24, 2021

Fixing various issues that are disrupting our tests, including:

  • replace cached_property in MetricTerms with a decorator that works, as the former was caching at the class level, not the instance level, impacting validation when the tests are run together
  • adjusting some thresholds that need changing for running standalone, for grid computation on c48
  • add a --skip_grid_tests flag to test_regressions that enables turning off testing grid generation. This was added so on PRs we can not run these tests (since the code is unlikely to change, and if impacted by other changes, other code is to likely fail as well) because they increase the time to compute (especially on c54 ranks) significantly. We will not turn off testing the grid in the regressions-cron plan so that someone is alerted if a code change breaks grid generation
  • fixed the state initialization to work on gpu, doing numpy operations on the memoryview does not work
  • run_on_daint script takes a namelist and an experiment name rather than a whole dataset, since we don't need the serialized data for this script anymore. run_standalone passes the namelist and experiment name to it.

@rheacangeo
Copy link
Contributor Author

launch jenkins

cp -rp .gt_cache* ${CACHE_DIR}
# copying the cache is in a separate action (generache_cache.sh),
# otherwise delete it
if [ "${SAVE_CACHE}" != "true" ] ; then
Copy link
Contributor

Choose a reason for hiding this comment

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

should we call the action here if it is true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying to leave open the flexibility to call other code, such as the regression tests, and then at the end the jenkins plan would call the generate_caches script. I think run_standalone should be sufficient for the cache, but have you seen evidence more things are compiled when we run the regression tests?

@@ -39,7 +39,7 @@ def parse_args() -> Namespace:
"data_dir",
type=str,
action="store",
help="directory containing data to run with",
help="namelist configuration for model run",
Copy link
Contributor

Choose a reason for hiding this comment

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

this should probably also change its name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, danger of manually undoing a change!

def get_experiment_info(data_directory: str) -> Tuple[str, bool]:
config_yml = yaml.safe_load(
open(
data_directory + "/input.yml",
Copy link
Contributor

Choose a reason for hiding this comment

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

is both the nml and the yml file always copied over to have both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they should both be with the data now. We can eventually refer to one, but the Namelist class got a lot more hard coded... it's a bit of a hassle to check it for the test_case which might not exist. It's easier to read this for the moment. 'experiment' can indeed be derived from the folder or the yml

)
# create a state from serialized data
savepoint_in = serializer.get_savepoint("FVDynamics-In")[0]
driver_object = fv3core.testing.TranslateFVDynamics([grid])
Copy link
Contributor

Choose a reason for hiding this comment

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

where does this grid come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol how did this work at all?


return wrapped

# TODO: when every environment in python3.8, replace
Copy link
Contributor

Choose a reason for hiding this comment

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

we could even have:

def cached_property(f):
    @property
    @functools.lru_cache()
    def wrapper(self, *args, **kwargs):
        return f(self, *args, **kwargs)
    return wrapper

here and then the only change would be to get rid of it once we've moved up. Not super necessary

Copy link
Contributor Author

@rheacangeo rheacangeo Dec 2, 2021

Choose a reason for hiding this comment

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

I got really sick of trying out decorators and them not working right... I can do try this if you want, though wouldn't mind pushing forward for this PR

Copy link
Contributor

@twicki twicki left a comment

Choose a reason for hiding this comment

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

lgtm

@rheacangeo rheacangeo enabled auto-merge (squash) December 2, 2021 19:40
@rheacangeo rheacangeo merged commit b0fb381 into main Dec 2, 2021
@rheacangeo rheacangeo deleted the make-jenkins-green branch December 2, 2021 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants