Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions easybuild/toolchains/mpi/intelmpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
:author: Kenneth Hoste (Ghent University)
"""

import easybuild.tools.toolchain as toolchain
from easybuild.toolchains.mpi.mpich2 import Mpich2
from easybuild.tools.toolchain.constants import COMPILER_FLAGS, COMPILER_VARIABLES
from easybuild.tools.toolchain.variables import CommandFlagList
Expand All @@ -53,6 +54,13 @@ class IntelMPI(Mpich2):
def _set_mpi_compiler_variables(self):
"""Add I_MPI_XXX variables to set."""

if self.comp_family() == toolchain.INTELCOMP:
self.MPI_COMPILER_MPICC = 'mpiicc'
self.MPI_COMPILER_MPICXX = 'mpiicpc'
self.MPI_COMPILER_MPIF77 = 'mpiifort'
self.MPI_COMPILER_MPIF90 = 'mpiifort'
self.MPI_COMPILER_MPIFC = 'mpiifort'

# this needs to be done first, otherwise e.g., CC is set to MPICC if the usempi toolchain option is enabled
for var, _ in COMPILER_VARIABLES:
self.variables.nappend('I_MPI_%s' % var, str(self.variables[var].get_first()), var_class=CommandFlagList)
Expand Down
9 changes: 5 additions & 4 deletions easybuild/toolchains/mpi/mpich2.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ class Mpich2(Mpich):
def _set_mpi_compiler_variables(self):
"""Set the MPICH_{CC, CXX, F77, F90, FC} variables."""

# hardwire MPI wrapper commands (otherwise Mpich parent class sets them based on MPICH version)
self.MPI_COMPILER_MPIF77 = 'mpif77'
self.MPI_COMPILER_MPIF90 = 'mpif90'
self.MPI_COMPILER_MPIFC = 'mpif90'
if self.MPI_COMPILER_MPIF77 is None and self.MPI_COMPILER_MPIF90 is None and self.MPI_COMPILER_MPIFC is None:
# hardwire MPI wrapper commands (otherwise Mpich parent class sets them based on MPICH version)

@ocaisa ocaisa Nov 23, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we add MPI{CC, CXX} to be consistent...or explain in the comment why you don't have to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ocaisa only MPI{F77,F90,FC} are being touched here, but I guess it doesn't hurt to clarify

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely clarify. The docstring says: Set the MPICH_{CC, CXX, F77, F90, FC} variables

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I guess clarifying wouldn't hurt.

@akesandgren can you include a comment that only the Fortran compiler commands need to be overridden, i.e. that the C/C++ compilers are correctly set via the parent class?

self.MPI_COMPILER_MPIF77 = 'mpif77'
self.MPI_COMPILER_MPIF90 = 'mpif90'
self.MPI_COMPILER_MPIFC = 'mpif90'

super(Mpich2, self)._set_mpi_compiler_variables()