-
Notifications
You must be signed in to change notification settings - Fork 225
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: Misc code generation improvements #2282
Changes from 1 commit
bbe3f5d
a0af11f
96f145d
465fd99
5e9e8a2
89c8514
48368e5
7664589
ecaa2aa
b073fb0
bfd961b
5113b3d
1ef8f70
6b0c1c5
be4b1bf
e7bf2a1
6cbdbe9
3bc43ae
5842722
b31976c
efafe51
00f8693
d322cdc
025bac4
c4e1d24
34b16cb
dd349ab
7546ac0
2037fb4
05bd196
5d7d0df
ff7e480
568cf3e
e748bc0
ac7c854
35f78b7
0e12b6f
4988492
a72f64a
b4102d9
9930c4e
e7d5d34
632319c
762ea3d
796b05f
b815b03
dfd7968
5f63560
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -737,7 +737,7 @@ def __init_finalize__(self, **kwargs): | |
|
||
if kwargs.get('mpi'): | ||
self.__init_intel_mpi__() | ||
self.cflags.insert(0, '-cc=%s' % self.CC) | ||
self.__init_intel_mpi_flags__() | ||
|
||
def __init_intel_mpi__(self, **kwargs): | ||
# Make sure the MPI compiler uses an Intel compiler underneath, | ||
|
@@ -747,6 +747,9 @@ def __init_intel_mpi__(self, **kwargs): | |
warning("Expected Intel MPI distribution with `%s`, but found `%s`" | ||
% (self.__class__.__name__, mpi_distro)) | ||
|
||
def __init_intel_mpi_flags__(self, **kwargs): | ||
self.cflags.insert(0, '-cc=%s' % self.CC) | ||
|
||
def get_version(self): | ||
if configuration['mpi']: | ||
cmd = (self.cc, "-cc=%s" % self.CC, "--version") | ||
|
@@ -779,7 +782,7 @@ def __lookup_cmds__(self): | |
class IntelKNLCompiler(IntelCompiler): | ||
|
||
def __init_finalize__(self, **kwargs): | ||
IntelCompiler.__init_finalize__(self, **kwargs) | ||
super().__init_finalize__(**kwargs) | ||
|
||
language = kwargs.pop('language', configuration['language']) | ||
|
||
|
@@ -792,6 +795,8 @@ def __init_finalize__(self, **kwargs): | |
class OneapiCompiler(IntelCompiler): | ||
|
||
def __init_finalize__(self, **kwargs): | ||
super().__init_finalize__(**kwargs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK |
||
|
||
platform = kwargs.pop('platform', configuration['platform']) | ||
language = kwargs.pop('language', configuration['language']) | ||
|
||
|
@@ -817,9 +822,6 @@ def __init_finalize__(self, **kwargs): | |
self.cflags.append('-gline-tables-only') | ||
self.cflags.append('-fdebug-info-for-profiling') | ||
|
||
if kwargs.get('mpi'): | ||
self.__init_intel_mpi__() | ||
|
||
def __init_intel_mpi__(self, **kwargs): | ||
super().__init_intel_mpi__(**kwargs) | ||
|
||
|
@@ -830,6 +832,9 @@ def __init_intel_mpi__(self, **kwargs): | |
if isinstance(platform, IntelDevice): | ||
environ['I_MPI_OFFLOAD'] = '1' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is no compiler flag for it? Seems "dangerous" to change environ like that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately no compiler flag... it is "dangerous" but devito would break anyway without this env var. It's what enables device pointer support in MPI calls ("GPU-aware MPI"), which is what we rely on (only sane choice today) |
||
|
||
def __init_intel_mpi_flags__(self, **kwargs): | ||
pass | ||
|
||
get_version = Compiler.get_version | ||
|
||
def __lookup_cmds__(self): | ||
|
@@ -846,6 +851,8 @@ class SyclCompiler(OneapiCompiler): | |
_cpp = True | ||
|
||
def __init_finalize__(self, **kwargs): | ||
IntelCompiler.__init_finalize__(self, **kwargs) | ||
|
||
platform = kwargs.pop('platform', configuration['platform']) | ||
language = kwargs.pop('language', configuration['language']) | ||
|
||
|
@@ -868,9 +875,6 @@ def __init_finalize__(self, **kwargs): | |
else: | ||
raise NotImplementedError("Unsupported platform %s" % platform) | ||
|
||
if kwargs.get('mpi'): | ||
self.__init_intel_mpi__() | ||
|
||
|
||
class CustomCompiler(Compiler): | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this needs to be
IntelCompiler.__init_finalize__(self, **kwargs)
or it breaksCustomCompiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK