snek5000 / snek5000

:snake: Python framework for Nek5000 :rocket:
https://snek5000.readthedocs.io
BSD 3-Clause "New" or "Revised" License
26 stars 10 forks source link

pytest --runslow rises errors #128

Closed akhoubani closed 2 years ago

akhoubani commented 2 years ago

The non-linear simulation of snek5000-cbox hangs at first time step:

...
 dump history points
 reading history points
 found           25  points
 done :: userchk

gridpoints unique/tot:          5329         6400
dofs vel/pr:                    5041         5329

 Initialization successfully completed   0.10516     sec

Starting time loop ...

     DT/DTCFL/DTFS/DTINIT   0.500E-02   0.500E-02   0.000E+00   0.500E-02
Step      1, t= 5.0000000E-03, DT= 5.0000000E-03, C=  0.000 0.0000E+00 0.0000E+00
             Solving for Hmholtz scalars
  Temperature/Passive scalar solution

To investigate, I created a conda environment using:

conda create -n my-env -c conda-forge python=3.9 pip

after activating the environment, I installed snek5000, snek5000-cbox in their directories:

pip install -e .

By running the tests in the snek5000 directory:

pytest --runslow

The summary of tests is as follows:

=============================================================================== short test summary info ===============================================================================
FAILED tests/test_cbox.py::test_loadsimul_phys_fields - ValueError: Resulting object does not have monotonic global indexes along dimension x
FAILED tests/test_cbox.py::test_phys_fields_get_var_before_load - ValueError: Resulting object does not have monotonic global indexes along dimension x
FAILED tests/test_solver.py::test_entrypoints - AttributeError: 'str' object has no attribute '_key'
ERROR tests/test_tuto_packaging.py::test_load - ModuleNotFoundError: No module named 'snek5000_canonical'
ERROR tests/test_tuto_packaging.py::test_package_canonical - ModuleNotFoundError: No module named 'snek5000_canonical'
====================================================== 3 failed, 71 passed, 3 xfailed, 3 warnings, 2 errors in 102.06s (0:01:42) ======================================================

while in the snek5000-cbox directory it doesn't give error:

================================================================================== warnings summary ===================================================================================
tests/test_slow.py::test_simple_simul
  /home/users/khoubani8a/.local/lib/python3.9/site-packages/ratelimiter.py:127: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    __aexit__ = asyncio.coroutine(__exit__)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

---------- coverage: platform linux, python 3.9.10-final-0 -----------
Name                                      Stmts   Miss  Cover   Missing
-----------------------------------------------------------------------
src/snek5000_cbox/__init__.py                 4      0   100%
src/snek5000_cbox/output.py                  15      0   100%
src/snek5000_cbox/solver.py                  94      0   100%
src/snek5000_cbox/templates/__init__.py       5      0   100%
src/snek5000_cbox/toolbox/__init__.py         0      0   100%
tests/conftest.py                            12      4    67%   19-22
tests/test_init.py                           80      0   100%
tests/test_slow.py                           55      0   100%
tests/test_slow_RB.py                        55      0   100%
-----------------------------------------------------------------------
TOTAL                                       320      4    99%

====================================================================== 6 passed, 1 warning in 254.47s (0:04:14) =======================================================================
akhoubani commented 2 years ago

Some errors were due to the new changes in the snek5000-cbox solver.

paugier commented 2 years ago

To run snek5000 tests, you need to update snek5000-cbox to the stable branch. If you do that, do you still have errors?

akhoubani commented 2 years ago

No, I don't get the errors. It was my mistake.

By the way, the issue of the Nek5000 hanging was related to the xmax and ymax in the useric and userbc of .usr file.