コード例 #1
0
    def __init__(self):
        super(Test, self).__init__('test')
        self.add_target(self.default, Target(self.default))
        self.add_target(self.front_end, Target(self.front_end))

        self.add_operating_system(self.default_os, OS('debian', 6))
        self.add_operating_system(self.front_os, OS('redhat', 6))
コード例 #2
0
    def __init__(self):
        super(Test, self).__init__('test')
        self.add_target(self.default, Target(self.default))
        self.add_target(self.front_end, Target(self.front_end))

        self.add_operating_system(self.default_os, Cnl())
        linux_dist = LinuxDistro()
        self.front_os = linux_dist.name
        self.add_operating_system(self.front_os, linux_dist)
コード例 #3
0
    def __init__(self):
        ''' Create a Cray system platform.

        Target names should use craype target names but not include the
        'craype-' prefix. Uses first viable target from:
          self
          envars [SPACK_FRONT_END, SPACK_BACK_END]
          configuration file "targets.yaml" with keys 'front_end', 'back_end'
          scanning /etc/bash/bashrc.local for back_end only
        '''
        super(Cray, self).__init__('cray')

        # Make all craype targets available.
        for target in self._avail_targets():
            name = target.replace('-', '_')
            self.add_target(name, Target(name, 'craype-%s' % target))

        self.add_target("x86_64", Target("x86_64"))
        self.add_target("front_end", Target("x86_64"))
        self.front_end = "x86_64"

        # Get aliased targets from config or best guess from environment:
        for name in ('front_end', 'back_end'):
            _target = getattr(self, name, None)
            if _target is None:
                _target = os.environ.get('SPACK_' + name.upper())
            if _target is None and name == 'back_end':
                _target = self._default_target_from_env()
            if _target is not None:
                safe_name = _target.replace('-', '_')
                setattr(self, name, safe_name)
                self.add_target(name, self.targets[safe_name])

        if self.back_end is not None:
            self.default = self.back_end
            self.add_target('default', self.targets[self.back_end])
        else:
            raise NoPlatformError()

        front_distro = CrayFrontend()
        back_distro = Cnl()

        self.default_os = str(back_distro)
        self.back_os = self.default_os
        self.front_os = str(front_distro)

        self.add_operating_system(self.back_os, back_distro)
        self.add_operating_system(self.front_os, front_distro)
コード例 #4
0
ファイル: bgq.py プロジェクト: zepx/spack
    def __init__(self):
        ''' IBM Blue Gene/Q system platform.'''

        super(Bgq, self).__init__('bgq')

        self.add_target(self.front_end, Target(self.front_end))
        self.add_target(self.back_end, Target(self.back_end))

        front_distro = LinuxDistro()
        back_distro = Cnk()

        self.front_os = str(front_distro)
        self.back_os = str(back_distro)
        self.default_os = self.back_os

        self.add_operating_system(str(front_distro), front_distro)
        self.add_operating_system(str(back_distro), back_distro)
コード例 #5
0
ファイル: linux.py プロジェクト: zatviaj295162/spack
    def __init__(self):
        super(Linux, self).__init__('linux')
        self.add_target('x86_64', Target('x86_64'))
        self.add_target('ppc64le', Target('ppc64le'))

        self.default = platform.machine()
        self.front_end = platform.machine()
        self.back_end = platform.machine()

        if self.default not in self.targets:
            self.add_target(self.default, Target(self.default))

        linux_dist = LinuxDistro()
        self.default_os = str(linux_dist)
        self.front_os = self.default_os
        self.back_os = self.default_os
        self.add_operating_system(str(linux_dist), linux_dist)
コード例 #6
0
ファイル: cray.py プロジェクト: scheibelp/spack
    def __init__(self):
        ''' Create a Cray system platform.

        Target names should use craype target names but not include the
        'craype-' prefix. Uses first viable target from:
          self
          envars [SPACK_FRONT_END, SPACK_BACK_END]
          configuration file "targets.yaml" with keys 'front_end', 'back_end'
          scanning /etc/bash/bashrc.local for back_end only
        '''
        super(Cray, self).__init__('cray')

        # Make all craype targets available.
        for target in self._avail_targets():
            name = _target_name_from_craype_target_name(target)
            self.add_target(name, Target(name, 'craype-%s' % target))

        self.back_end = os.environ.get('SPACK_BACK_END',
                                       self._default_target_from_env())
        self.default = self.back_end
        if self.back_end not in self.targets:
            # We didn't find a target module for the backend
            raise NoPlatformError()

        # Setup frontend targets
        for name in archspec.cpu.TARGETS:
            if name not in self.targets:
                self.add_target(name, Target(name))
        self.front_end = os.environ.get(
            'SPACK_FRONT_END', archspec.cpu.host().name
        )
        if self.front_end not in self.targets:
            self.add_target(self.front_end, Target(self.front_end))

        front_distro = CrayFrontend()
        back_distro = CrayBackend()

        self.default_os = str(back_distro)
        self.back_os = self.default_os
        self.front_os = str(front_distro)

        self.add_operating_system(self.back_os, back_distro)
        if self.front_os != self.back_os:
            self.add_operating_system(self.front_os, front_distro)
コード例 #7
0
    def __init__(self):
        super(Darwin, self).__init__('darwin')
        self.add_target(self.default, Target(self.default))
        mac_os = MacOs()

        self.default_os = str(mac_os)
        self.front_os   = str(mac_os)
        self.back_os    = str(mac_os)

        self.add_operating_system(str(mac_os), mac_os)
コード例 #8
0
    def __init__(self):
        super(Linux, self).__init__('linux')

        for name in cpu.targets:
            self.add_target(name, Target(name))

        # Get specific default
        self.default = cpu.host().name
        self.front_end = self.default
        self.back_end = self.default

        linux_dist = LinuxDistro()
        self.default_os = str(linux_dist)
        self.front_os = self.default_os
        self.back_os = self.default_os
        self.add_operating_system(str(linux_dist), linux_dist)
コード例 #9
0
    def __init__(self):
        super(Darwin, self).__init__('darwin')

        for name in cpu.targets:
            self.add_target(name, Target(name))

        self.default = cpu.host().name
        self.front_end = self.default
        self.back_end = self.default

        mac_os = MacOs()

        self.default_os = str(mac_os)
        self.front_os = str(mac_os)
        self.back_os = str(mac_os)

        self.add_operating_system(str(mac_os), mac_os)
コード例 #10
0
 def __init__(self):
     super(Bgq, self).__init__('bgq')
     self.add_target(self.front_end, Target(self.front_end))
     self.add_target(self.back_end, Target(self.back_end,))