diff --git a/ci/scripts/test.sh b/ci/scripts/test.sh index 729b3837e93ba16c1ecec28a19573db64c25e52a..65adde1d2218949375cdf9a8e0c7d1637932f2fb 100644 --- a/ci/scripts/test.sh +++ b/ci/scripts/test.sh @@ -32,9 +32,12 @@ fi export PYTHONPATH="$INSTALL_DIR/lib/python2.7/site-packages" python -c 'import hysop; print hysop' -$HYSOP_DIR/fields/tests/test_cartesian.sh +# long backend dependent tests #python "$HYSOP_DIR/backend/device/codegen/kernels/tests/test_directional_advection.py" #python "$HYSOP_DIR/backend/device/codegen/kernels/tests/test_directional_remesh.py" + +python "$HYSOP_DIR/core/arrays/tests/test_array.py" +$HYSOP_DIR/fields/tests/test_cartesian.sh python "$HYSOP_DIR/operator/tests/test_analytic.py" python "$HYSOP_DIR/operator/tests/test_transpose.py" python "$HYSOP_DIR/operator/tests/test_derivative.py" diff --git a/hysop/__init__.py b/hysop/__init__.py index 3d858751360fa2b672c80e971cf6a117ef995fc6..5002ef3da3eb815276f1d1944d41d969d5fb6537 100644 --- a/hysop/__init__.py +++ b/hysop/__init__.py @@ -45,8 +45,8 @@ __TEST_ALL_OPENCL_PLATFORMS__ = get_env('TEST_ALL_OPENCL_PLATFORMS', False) __ENABLE_LONG_TESTS__ = get_env('ENABLE_LONG_TESTS', ("OFF" is "ON")) # OpenCL -__DEFAULT_PLATFORM_ID__ = get_env('DEFAULT_PLATFORM_ID', 0) -__DEFAULT_DEVICE_ID__ = get_env('DEFAULT_DEVICE_ID', 0) +__DEFAULT_PLATFORM_ID__ = int(get_env('DEFAULT_PLATFORM_ID', 0)) +__DEFAULT_DEVICE_ID__ = int(get_env('DEFAULT_DEVICE_ID', 0)) if __MPI_ENABLED__: diff --git a/hysop/__init__.py.in b/hysop/__init__.py.in index 8037731957abe6e93d8225e8b3f5d1a977e2f486..f63bf48fa96c06638b6b80dfccf9633937ec5b06 100644 --- a/hysop/__init__.py.in +++ b/hysop/__init__.py.in @@ -45,8 +45,8 @@ __TEST_ALL_OPENCL_PLATFORMS__ = get_env('TEST_ALL_OPENCL_PLATFORMS', False) __ENABLE_LONG_TESTS__ = get_env('ENABLE_LONG_TESTS', ("@ENABLE_LONG_TESTS@" is "ON")) # OpenCL -__DEFAULT_PLATFORM_ID__ = get_env('DEFAULT_PLATFORM_ID', @OPENCL_DEFAULT_OPENCL_PLATFORM_ID@) -__DEFAULT_DEVICE_ID__ = get_env('DEFAULT_DEVICE_ID', @OPENCL_DEFAULT_OPENCL_DEVICE_ID@) +__DEFAULT_PLATFORM_ID__ = int(get_env('DEFAULT_PLATFORM_ID', @OPENCL_DEFAULT_OPENCL_PLATFORM_ID@)) +__DEFAULT_DEVICE_ID__ = int(get_env('DEFAULT_DEVICE_ID', @OPENCL_DEFAULT_OPENCL_DEVICE_ID@)) if __MPI_ENABLED__: from hysop.core.mpi import MPI, main_rank, main_size, \ diff --git a/hysop/core/arrays/tests/test_array.py b/hysop/core/arrays/tests/test_array.py index 39eaf54d0ee5cc6f0a7b95fc1f21b252b1617487..ef66f3e421f1e539033c48dfa9f95a59922bbe8e 100644 --- a/hysop/core/arrays/tests/test_array.py +++ b/hysop/core/arrays/tests/test_array.py @@ -546,14 +546,15 @@ class TestArray(object): tol = atol[0] if not close: close = allclose(r0,r1,relaxed_precision=True,ignore_mask=mask) - tol = 1e-2 + tol = 1e-1 if close: msg='WARNING: test passed with relaxed precision for {}::{}.' msg=msg.format(backend.__class__.__name__, opname) print msg if not close: msg = '\n{}::{} returned dtypes did match (got {}) ' - msg+= 'but failed to match numpy output,\n absolute tolerance was set to {}.' + msg+= 'but failed to match numpy output,' + msg+='\n absolute tolerance was set to {}.' msg=msg.format(backend.__class__.__name__,opname,r1.dtype,tol) print msg if isinstance(r0, np.ndarray) and isinstance(r1, np.ndarray): diff --git a/hysop/operator/tests/test_directional_advection.py b/hysop/operator/tests/test_directional_advection.py index 6e5c440c5f61f20080a53f46b9109addbc57d953..f64496d4fa761dca501d854f691a14da2884d268 100644 --- a/hysop/operator/tests/test_directional_advection.py +++ b/hysop/operator/tests/test_directional_advection.py @@ -59,8 +59,8 @@ class TestDirectionalAdvectionOperator(object): else: flt_types = (npw.float,) time_integrators = (RK2,) - remesh_kernels = (Remesh.L4_2, Remesh.L4_2s,) - velocity_cfls = (0.62, 1.89) + remesh_kernels = (Remesh.L4_2,) + velocity_cfls = (1.89,) domain = Box(length=(2*npw.pi,)*dim) for dtype in flt_types: