-
Notifications
You must be signed in to change notification settings - Fork 32
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
CMOR tests #436
Comments
Thanks @hot007, can you provide a little more context as to how you have configured CMOR - did you install via conda, from source etc etc? It'd also be useful to know/see snippets of the segfaults and any CMOR log history. |
Hi Paul, Yep, installed via conda on NCI's Raijin as per the instructions https://cmor.llnl.gov/mydoc_cmor3_conda/ leveraging an existing climate community conda set up so that it's appropriately HDF/netCDF/udunits aware (afaik). I don't think I can give much useful info re output - once it stopped giving errors about missing files all I get is the segfault. I'm not sure how to set a cmor log file when just calling tests (help?) but please find attached some portion of stdout from when it was producing errors, followed by me copying in some remaining missing files, trying again and exceeding job memory (4GB), trying again with 8GB and simply getting a segfault during test collection. |
I don't know whether this is worth mentioning, but note that when it was producing output it seems like it was having issues in cmor.write; that is also where we're experiencing issues with our ACCESS post-processor, so I'd like to be sure we can run tests that rely on cmor.write. |
The best way I have gotten to run the unit tests is to clone the CMOR repo, and install cmor with testsrunner.
I tried running run_tests.py in the same git clone directory but with the tests stored in the conda environment. It gave these errors for every tests:
Even if I copied the Tables directory, Test/CMOR_input_example.json, and run_tests.py to the conda environment folder it would still produce those errors. If I use pytest instead of run_tests.py, all of the CMIP6_CV tests will pass except for test_python_CMIP6_CV_terminate_signal.py
|
Thanks for the suggestions @mauzey1. I will try again with the testrunner env. In the meantime, I upped my memory request to 32GB and managed to get output without segfaults. I'm thinking maybe a lot of the tests are simply not viable in a general environment, I'm not sure where I'd get these files from (they don't look like something that'll be available through Synda), so I thought I'd look for tests that have cmor.write issues, as that's what I'm trying to rule out, and run them specifically. However even when a test seems to depend on general data (e.g. data/tas_sample.nc), I'm still finding similar problems. e.g.
Put the sample file in and rerun:
We seem to have lots of hardcoded paths in these tests for files that aren't in the data directory. So, maybe I should open a separate issue for this question, but can you tell me how we could confirm that cmor.write is behaving as expected? Ideally, can you tell me what is a test that should write lat, lon, time and data (e.g. tas) that we could modify to try on our locally produced data, with the assumption that the unit tests do work as expected? |
Here is a branch of CMOR with a correction made to the NetCDF path in Test/test_python_user_interface_03.py |
Okay, that code looks better... at the risk of making @durack1 say "told you so" (#206) though, I'm now getting the "genutil module not present" warning. I don't imagine it's fatal but the only output from pytest I then get is the warning, no info about tests passed or failed or if anything was done (collected 0 items?). Maybe this is expected behaviour, but I'm guessing not? Is there a particular way I should try to install genutil? This feels like a red herring but not sure what to do with it...
|
@hot007 glad you’re up and running. I personally think |
I've installed genutil via cdat-lite, I'm not sure that was the right choice though, as the test seems to require "cdms2 interface" which google implies is UVCDAT but that in principle requires its own conda env. How is this test usually run?? Sorry to be such a pain, I'm just not sure what additional dependencies are required for testing. |
@hot007 |
I am in a conda env so can do... interestingly that wants to downgrade CMOR to 3.3.3. Dunno if that's a bug... |
Just to note, that I support the notion that CMOR should not need CDMS or UVCDAT or genutil as dependencies. It was (originally) designed as a "writer", not a "reader" and interacts directly with the netCDF library (and that library has dependencies on hdf and other packages). The fewer the dependencies, the simpler the build, and the fewer problems will be encountered. CMOR does rely on udunits, so that is a dependency. It is possible that PrePARE has added features that require other dependencies. Perhaps @dnadeau4 or @doutriaux1 or @mauzey1 can advise. |
Although cdms2 is used by the CMIP6 CV Python tests, the tests with the pattern Test/test_python_CMIP6_CV*.py, I don't see the genutil warning showing up when running them like it does with test_python_user_interface_03.py. The reason why pytest collected 0 items from test_python_user_interface_03.py is due to the test not being in a function with a name that starts with "test". Fox example, https://github.com/PCMDI/cmor/blob/master/Test/test_python_CMIP6_CV_badinstitutionID.py Currently, we are using the test_python_CMIP6_CV*.py tests for our Python unit tests on CircleCI and Travis. These tests are run with the TestsRunner module. https://github.com/CDAT/TestsRunner
|
Okay, thanks @mauzey1 that's good to know that the test_python_CMIP6 tests are what you're using with CI. I'll give them a go and see if I have more luck. cheers. |
Thanks @mauzey1 , makes sense to run the same tests you're using for CircleCI/Travis. I had some multiprocessing.pool hangs with run_tests but seemed otherwise okay, and all clear/as expected with pytest. So, the good news is I'm going to assume that means our installation is all good, this issue can be closed. As you'll have seen in #440 we tracked down what the bug we were seeing was and it certainly seems like it's not related to an installation problem. Thanks all for your assistance! |
Hi there,
We're trying to start CMORising ACCESS model output, and hitting some walls that are almost certainly in our post-processing code, but we're trying to debug them at the moment. As I installed the CMOR library I thought maybe I should check that CMOR is behaving as expected, by running the embedded unit tests. I couldn't find any doco on how you're meant to do that, so I've run "python -m pytest ." in the cmor library folder (containing the Test directory). I had to copy a bunch of table files and tas_sample.nc in after various errors, initially there was cmor.write errors, once all files were present I get a segmentation fault. This occurred for both CMOR 3.3.3 and 3.4.
I have tried running this with up to 8GB memory and unlimited stacksize so I don't imagine it's a memory problem now, can you please point me to any instructions on how to run the tests from a conda install and whether we'd expect them to pass?
Thanks,
Claire
The text was updated successfully, but these errors were encountered: