Skip to content

Commit

Permalink
Merge pull request #1044 from boegel/systemtools_fixes_power
Browse files Browse the repository at this point in the history
enhance systemtools.py to also support POWER systems
  • Loading branch information
boegel committed Feb 26, 2015
2 parents 0b8a334 + 7ff5511 commit 3c0f1d1
Show file tree
Hide file tree
Showing 6 changed files with 525 additions and 208 deletions.
56 changes: 28 additions & 28 deletions easybuild/toolchains/compiler/clang.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,38 +53,38 @@ class Clang(Compiler):
'loop-vectorize': ['fvectorize'],
'basic-block-vectorize': ['fslp-vectorize'],
'optarch':'march=native',

# Clang's options do not map well onto these precision modes. The flags enable and disable certain classes of
# optimizations.
#
# -fassociative-math: allow re-association of operands in series of floating-point operations, violates the
# ISO C and C++ language standard by possibly changing computation result.
# -freciprocal-math: allow optimizations to use the reciprocal of an argument rather than perform division.
# -fsigned-zeros: do not allow optimizations to treat the sign of a zero argument or result as insignificant.
# -fhonor-infinities: disallow optimizations to assume that arguments and results are not +/- Infs.
# -fhonor-nans: disallow optimizations to assume that arguments and results are not +/- NaNs.
# -ffinite-math-only: allow optimizations for floating-point arithmetic that assume that arguments and results
# are not NaNs or +-Infs (equivalent to -fno-honor-nans -fno-honor-infinities)
# -funsafe-math-optimizations: allow unsafe math optimizations (implies -fassociative-math, -fno-signed-zeros,
# -freciprocal-math).
# -ffast-math: an umbrella flag that enables all optimizations listed above, provides preprocessor macro
# __FAST_MATH__.
#
# Using -fno-fast-math is equivalent to disabling all individual optimizations, see
# http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?view=markup (lines 2100 and following)
#
# 'strict', 'precise' and 'defaultprec' are all ISO C++ and IEEE complaint, but we explicitly specify details
# flags for strict and precise for robustness against future changes.
'strict': ['fno-fast-math'],
'precise': ['fno-unsafe-math-optimizations'],
'defaultprec': [],
'loose': ['ffast-math', 'fno-unsafe-math-optimizations'],
'veryloose': ['ffast-math'],
# Clang's options do not map well onto these precision modes. The flags enable and disable certain classes of
# optimizations.
#
# -fassociative-math: allow re-association of operands in series of floating-point operations, violates the
# ISO C and C++ language standard by possibly changing computation result.
# -freciprocal-math: allow optimizations to use the reciprocal of an argument rather than perform division.
# -fsigned-zeros: do not allow optimizations to treat the sign of a zero argument or result as insignificant.
# -fhonor-infinities: disallow optimizations to assume that arguments and results are not +/- Infs.
# -fhonor-nans: disallow optimizations to assume that arguments and results are not +/- NaNs.
# -ffinite-math-only: allow optimizations for floating-point arithmetic that assume that arguments and results
# are not NaNs or +-Infs (equivalent to -fno-honor-nans -fno-honor-infinities)
# -funsafe-math-optimizations: allow unsafe math optimizations (implies -fassociative-math, -fno-signed-zeros,
# -freciprocal-math).
# -ffast-math: an umbrella flag that enables all optimizations listed above, provides preprocessor macro
# __FAST_MATH__.
#
# Using -fno-fast-math is equivalent to disabling all individual optimizations, see
# http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?view=markup (lines 2100 and following)
#
# 'strict', 'precise' and 'defaultprec' are all ISO C++ and IEEE complaint, but we explicitly specify details
# flags for strict and precise for robustness against future changes.
'strict': ['fno-fast-math'],
'precise': ['fno-unsafe-math-optimizations'],
'defaultprec': [],
'loose': ['ffast-math', 'fno-unsafe-math-optimizations'],
'veryloose': ['ffast-math'],
}

COMPILER_OPTIMAL_ARCHITECTURE_OPTION = {
systemtools.INTEL : 'march=native',
systemtools.AMD : 'march=native'
systemtools.AMD : 'march=native',
systemtools.POWER: 'mcpu=native', # no support for march=native on POWER
}

COMPILER_CC = 'clang'
Expand Down
43 changes: 21 additions & 22 deletions easybuild/toolchains/compiler/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,30 @@ class Gcc(Compiler):

COMPILER_FAMILY = TC_CONSTANT_GCC
COMPILER_UNIQUE_OPTS = {
'loop': (False, "Automatic loop parallellisation"),
'f2c': (False, "Generate code compatible with f2c and f77"),
'lto':(False, "Enable Link Time Optimization"),
}
'loop': (False, "Automatic loop parallellisation"),
'f2c': (False, "Generate code compatible with f2c and f77"),
'lto':(False, "Enable Link Time Optimization"),
}
COMPILER_UNIQUE_OPTION_MAP = {
'i8': 'fdefault-integer-8',
'r8': 'fdefault-real-8',
'unroll': 'funroll-loops',
'f2c': 'ff2c',
'loop': ['ftree-switch-conversion', 'floop-interchange',
'floop-strip-mine', 'floop-block'],
'lto':'flto',
'optarch':'march=native',
'openmp':'fopenmp',
'strict': ['mieee-fp', 'mno-recip'],
'precise':['mno-recip'],
'defaultprec':[],
'loose': ['mrecip', 'mno-ieee-fp'],
'veryloose': ['mrecip=all', 'mno-ieee-fp'],
}
'i8': 'fdefault-integer-8',
'r8': 'fdefault-real-8',
'unroll': 'funroll-loops',
'f2c': 'ff2c',
'loop': ['ftree-switch-conversion', 'floop-interchange', 'floop-strip-mine', 'floop-block'],
'lto': 'flto',
'openmp': 'fopenmp',
'strict': ['mieee-fp', 'mno-recip'],
'precise':['mno-recip'],
'defaultprec':[],
'loose': ['mrecip', 'mno-ieee-fp'],
'veryloose': ['mrecip=all', 'mno-ieee-fp'],
}

COMPILER_OPTIMAL_ARCHITECTURE_OPTION = {
systemtools.INTEL : 'march=native',
systemtools.AMD : 'march=native'
}
systemtools.AMD : 'march=native',
systemtools.INTEL : 'march=native',
systemtools.POWER: 'mcpu=native', # no support for march=native on POWER
}

COMPILER_CC = 'gcc'
COMPILER_CXX = 'g++'
Expand Down
Loading

0 comments on commit 3c0f1d1

Please sign in to comment.