-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3971 from ocaisa/mpitrampoline
add gmpit toolchain definition (GCC + MPItrampoline)
- Loading branch information
Showing
3 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
## | ||
# Copyright 2022-2022 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), | ||
# Flemish Research Foundation (FWO) (http://www.fwo.be/en) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# https://github.com/easybuilders/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
EasyBuild support for gmpit compiler toolchain (includes GCC and MPItrampoline). | ||
:author: Alan O'Cais (CECAM) | ||
""" | ||
from distutils.version import LooseVersion | ||
import re | ||
|
||
from easybuild.toolchains.gcc import GccToolchain | ||
from easybuild.toolchains.mpi.mpitrampoline import MPItrampoline | ||
|
||
|
||
class Gmpit(GccToolchain, MPItrampoline): | ||
"""Compiler toolchain with GCC and MPItrampoline.""" | ||
NAME = 'gmpit' | ||
SUBTOOLCHAIN = GccToolchain.NAME | ||
|
||
def is_deprecated(self): | ||
"""Return whether or not this toolchain is deprecated.""" | ||
# need to transform a version like '2018b' with something that is safe to compare with '2019' | ||
# comparing subversions that include letters causes TypeErrors in Python 3 | ||
# 'a' is assumed to be equivalent with '.01' (January), and 'b' with '.07' (June) (good enough for this purpose) | ||
version = self.version.replace('a', '.01').replace('b', '.07') | ||
|
||
deprecated = False | ||
|
||
# make sure a non-symbolic version (e.g., 'system') is used before making comparisons using LooseVersion | ||
if re.match('^[0-9]', version): | ||
if LooseVersion(version) < LooseVersion('2019'): | ||
deprecated = True | ||
|
||
return deprecated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
## | ||
# Copyright 2022-2022 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), | ||
# Flemish Research Foundation (FWO) (http://www.fwo.be/en) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# https://github.com/easybuilders/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
Support for MPItrampoline as toolchain MPI library. | ||
:author: Alan O'Cais (CECAM) | ||
""" | ||
|
||
from easybuild.tools.toolchain.constants import COMPILER_VARIABLES, MPI_COMPILER_VARIABLES | ||
from easybuild.tools.toolchain.mpi import Mpi | ||
from easybuild.tools.toolchain.variables import CommandFlagList | ||
|
||
|
||
TC_CONSTANT_MPITRAMPOLINE = "MPItrampoline" | ||
TC_CONSTANT_MPI_TYPE_MPITRAMPOLINE = "MPI_TYPE_MPITRAMPOLINE" | ||
|
||
|
||
class MPItrampoline(Mpi): | ||
"""MPItrampoline MPI class""" | ||
MPI_MODULE_NAME = ['MPItrampoline'] | ||
MPI_FAMILY = TC_CONSTANT_MPITRAMPOLINE | ||
MPI_TYPE = TC_CONSTANT_MPI_TYPE_MPITRAMPOLINE | ||
|
||
MPI_LIBRARY_NAME = 'mpi' | ||
|
||
# May be version-dependent, so defined at runtime | ||
MPI_COMPILER_MPIF77 = None | ||
MPI_COMPILER_MPIF90 = None | ||
MPI_COMPILER_MPIFC = None | ||
|
||
# MPItrampoline reads from CC etc env variables | ||
MPI_SHARED_OPTION_MAP = dict([('_opt_%s' % var, '') for var, _ in MPI_COMPILER_VARIABLES]) | ||
|
||
MPI_LINK_INFO_OPTION = '-showme:link' | ||
|
||
def __init__(self, *args, **kwargs): | ||
"""Toolchain constructor""" | ||
super(MPItrampoline, self).__init__(*args, **kwargs) | ||
|
||
def _set_mpi_compiler_variables(self): | ||
"""Define MPI wrapper commands and add MPITRAMPOLINE_* variables to set.""" | ||
|
||
self.MPI_COMPILER_MPIF77 = 'mpifort' | ||
self.MPI_COMPILER_MPIF90 = 'mpifort' | ||
self.MPI_COMPILER_MPIFC = 'mpifort' | ||
|
||
# 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( | ||
'MPITRAMPOLINE_%s' % var, str(self.variables[var].get_first()), | ||
var_class=CommandFlagList | ||
) | ||
|
||
super(MPItrampoline, self)._set_mpi_compiler_variables() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters