Skip to content
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

compiler: Keep -qopenmp by default after icx 2023.2 #2164

Merged
merged 3 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion devito/arch/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def sniff_compiler_version(cc):
compiler = "clang"
elif ver.startswith("Homebrew clang"):
compiler = "clang"
elif ver.startswith("Intel"):
compiler = "icx"
elif ver.startswith("icc"):
compiler = "icc"
elif ver.startswith("icx"):
Expand Down Expand Up @@ -761,7 +763,8 @@ def __init__(self, *args, **kwargs):
platform = kwargs.pop('platform', configuration['platform'])
language = kwargs.pop('language', configuration['language'])

if language == 'openmp':
georgebisbas marked this conversation as resolved.
Show resolved Hide resolved
# 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