Opened 17 years ago

Closed 17 years ago

#221 closed defect (wontfix)

Unit tests on latest sourceforge version and svn version will not complete on ubuntu

Reported by: John Jakeman Owned by: ole
Priority: normal Milestone:
Component: Compilation and installation Version:
Severity: normal Keywords:
Cc: duncan

Description

I cannot install the latest svn version of ANUGA onto my ubuntu 7.04 system (64-bit Intel core 2). The system compiles without error. However when I run test_all.py several errors are returned before a floating point exception is raised and the core is dumped. Because of the core dump I am unable to tell which tests are failing and where.

Change History (7)

comment:1 Changed 17 years ago by anonymous

  • Component changed from Appearance and visualisation to Compilation and installation

comment:2 follow-up: Changed 17 years ago by ole

  • Cc duncan added

The only 64 bit architecture we have tested ANUGA on is AMD Opteron 64 with Red Hat Linux. The first thing to check, is what the appropriate compile and link flags should be on your system - e.g. try to manually compile on small module such as polygon_ext.c (in anuga/utilities) and then run test_polygon.py.

You will see the suggested compile string as output from compile_all.c

If it turns out that you need different flags etc, we need to update the compile.py script accordingly.

Cheers Ole

comment:3 in reply to: ↑ description Changed 17 years ago by anonymous

I changed the line in \source\anuga\test_all.py (approx line 159) from

runner = unittest.TextTestRunner?() #verbosity=2

to

runner = unittest.TextTestRunner?(verbosity=2)

and found that the following tests were failing test_URS_points_needed (test_data_manager.Test_Data_Manager) ... ok test_URS_points_needed_and_urs_ungridded2sww (test_data_manager.Test_Data_Manager) ... ERROR test_Urs_points (test_data_manager.Test_Data_Manager) ... ok test_asc_csiro2sww (test_data_manager.Test_Data_Manager) ... ERROR test_asc_csiro2sww2 (test_data_manager.Test_Data_Manager) ... ok test_asc_csiro2sww3 (test_data_manager.Test_Data_Manager) ... ERROR test_asc_csiro2sww4 (test_data_manager.Test_Data_Manager) ... ERROR Test decimation of dem file ... ERROR Test decimation of dem file that includes NODATA values ... ERROR Test conversion from dem in ascii format to native NetCDF format ... Floating point exception (core dumped)

comment:4 in reply to: ↑ 2 Changed 17 years ago by John Jakeman

I tried manually compiling polygon_ext.c and then running test_polygon.py using the compile string used in anuga/utilities/compile.py. No warnings or errors occur. However when I ran test_polygon.py I received the following messages

.E.E....FF............. ====================================================================== ERROR: Test case where all points are outside poly


Traceback (most recent call last):

File "test_polygon.py", line 360, in test_all_outside_polygon

assert allclose(indices, [0,1,2,3])

File "/usr/lib/python2.5/site-packages/Numeric/Numeric.py", line 735, in allclose

d = less(absolute(x-y), atol + rtol * absolute(y))

ValueError?: frames are not aligned

====================================================================== ERROR: test_in_and_outside_polygon_main (main.Test_Polygon)


Traceback (most recent call last):

File "test_polygon.py", line 561, in test_in_and_outside_polygon_main

assert outside[0] == 0

IndexError?: index out of bounds

====================================================================== FAIL: test_outside_polygon (main.Test_Polygon)


Traceback (most recent call last):

File "test_polygon.py", line 315, in test_outside_polygon

assert is_outside_polygon( [1.5, 0.5], U )

AssertionError?

====================================================================== FAIL: test_outside_polygon2 (main.Test_Polygon)


Traceback (most recent call last):

File "test_polygon.py", line 342, in test_outside_polygon2

assert is_outside_polygon( [0.5, 1.0], U, closed = False )

AssertionError?


Ran 23 tests in 0.263s

FAILED (failures=2, errors=2)

comment:5 follow-up: Changed 17 years ago by ole

OK - let us focus on the test "test_polygon.py", line 360, in test_all_outside_polygon

You get the error

Traceback (most recent call last):

    File "test_polygon.py", line 360, in test_all_outside_polygon

        assert allclose(indices, [0,1,2,3])

    File "/usr/lib/python2.5/site-packages/Numeric/Numeric.py", line 735, in allclose

        d = less(absolute(x-y), atol + rtol * absolute(y))

ValueError?: frames are not aligned 

One thing to do is to print out the value before the assertion as in

   print 'indices', indices

and see why the error is there.

Another thing that may cause this problem is if Numeric, netcdf or maybe even Python itself wasn't compiled for 64 bit. All the code has to be compiled either for 32 bit or 64 bit to work together.

I'll be in tomorrow, maybe we can have a quick look together?

Cheers Ole

comment:6 in reply to: ↑ 5 Changed 17 years ago by John Jakeman

Hi Ole, The problem is that [0,1,2,3] is a list and not an array. If I change the code to array([0,1,2,3]) the error does not arise. However Changing this everywhere in the code is not an option. I have tried running ANUGA on my machine with Python 2.4 instead of python 2.5 and all the unit tests complete. I think there is a compatibility problem with numeric in python 2.5 and ANUGA. I am not sure why though

comment:7 Changed 17 years ago by ole

  • Resolution set to wontfix
  • Status changed from new to closed

Allclose should easily be able to compare lists to Numeric arrays - as you can see when using Python 2.4 - I think you are right about a possible compatibility problem. This highlights the issue addressed in ticket:58 about migrating ANUGA to numpy.

I will close this ticket and update the installation guide.

Note: See TracTickets for help on using tickets.