Added strategy method in init

This commit is contained in:
Mario Melara 2015-10-21 11:09:05 -07:00
parent c31da9bc8f
commit 9b387e7682

View File

@ -57,18 +57,13 @@ def __init__(self, front=None, back=None):
back = None defaults to None. Should be the back-end architecture of the machine back = None defaults to None. Should be the back-end architecture of the machine
If no arguments are given it will return an empty dictionary If no arguments are given it will return an empty dictionary
Uses the _add_compiler_strategy(front, back) to create the dictionary
""" """
_names = []
_names.append(front) def _add_compiler_strategy(front,back):
_names.append(back) names = []
names.append(front)
def _add_compiler_strategy(names): names.append(back)
""" Create a dictionary of {'arch-name': 'strategy'}
This will tell Spack whether to look in the $PATH
or $MODULES location for compilers
Else it will return No Strategy
"""
#TODO: Look for other strategies
d = {} d = {}
for n in names: for n in names:
if n: if n:
@ -80,7 +75,8 @@ def _add_compiler_strategy(names):
d[n] = 'No Strategy' d[n] = 'No Strategy'
return d return d
self.arch_dict = _add_compiler_strategy(_names) self.arch_dict = _add_compiler_strategy(front, back)
def get_sys_type_from_spack_globals(): def get_sys_type_from_spack_globals():
"""Return the SYS_TYPE from spack globals, or None if it isn't set.""" """Return the SYS_TYPE from spack globals, or None if it isn't set."""