Skip to content

Commit

Permalink
tests: Add safe_math=True for some icx-mpi tests
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Jul 21, 2023
1 parent 613a304 commit 9fea3ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion devito/arch/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def __init__(self, *args, **kwargs):
platform = kwargs.pop('platform', configuration['platform'])
language = kwargs.pop('language', configuration['language'])

# Earlier to versions to OneAPI 2023.2.0 (clang17 underneath), have an OpenMP bug
# Earlier versions to OneAPI 2023.2.0 (clang17 underneath), have an OpenMP bug
if self.version < Version('17.0.0') and language == 'openmp':
self.ldflags.remove('-qopenmp')
self.ldflags.append('-fopenmp')
Expand Down
5 changes: 5 additions & 0 deletions tests/test_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
SparseTimeFunction, Dimension, ConditionalDimension, SubDimension,
SubDomain, Eq, Ne, Inc, NODE, Operator, norm, inner, configuration,
switchconfig, generic_derivative)
from devito.arch.compiler import OneapiCompiler
from devito.data import LEFT, RIGHT
from devito.ir.iet import (Call, Conditional, Iteration, FindNodes, FindSymbols,
retrieve_iteration_tree)
Expand Down Expand Up @@ -514,6 +515,8 @@ def test_scatter_gather(self):
assert np.all(sf.data == data[sf.local_indices]*2)

@pytest.mark.parallel(mode=4)
@switchconfig(condition=isinstance(configuration['compiler'],
(OneapiCompiler)), safe_math=True)
def test_sparse_coords(self):
grid = Grid(shape=(21, 31, 21), extent=(20, 30, 20))
x, y, z = grid.dimensions
Expand Down Expand Up @@ -1492,6 +1495,8 @@ def test_injection_wodup(self):
assert np.all(f.data == 1.25)

@pytest.mark.parallel(mode=4)
@switchconfig(condition=isinstance(configuration['compiler'],
(OneapiCompiler)), safe_math=True)
def test_injection_wodup_wtime(self):
"""
Just like ``test_injection_wodup``, but using a SparseTimeFunction
Expand Down

0 comments on commit 9fea3ca

Please sign in to comment.