impi.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:JSC 作者: easybuilders 项目源码 文件源码
def post_install_step(self):
        """Custom post install step for IMPI, fix broken env scripts after moving installed files."""
        super(EB_impi, self).post_install_step()

        impiver = LooseVersion(self.version)
        if impiver == LooseVersion('4.1.1.036') or impiver >= LooseVersion('5.0.1.035'):
            if impiver >= LooseVersion('2018.0.128'):
                script_paths = [os.path.join('intel64', 'bin')]
            else:
                script_paths = [os.path.join('intel64', 'bin'), os.path.join('mic', 'bin')]
            # fix broken env scripts after the move
            for script in [os.path.join(script_path,'mpivars.csh') for script_path in script_paths]:
                for line in fileinput.input(os.path.join(self.installdir, script), inplace=1, backup='.orig.easybuild'):
                    line = re.sub(r"^setenv I_MPI_ROOT.*", "setenv I_MPI_ROOT %s" % self.installdir, line)
                    sys.stdout.write(line)
            for script in [os.path.join(script_path,'mpivars.sh') for script_path in script_paths]:
                for line in fileinput.input(os.path.join(self.installdir, script), inplace=1, backup='.orig.easybuild'):
                    line = re.sub(r"^I_MPI_ROOT=.*", "I_MPI_ROOT=%s; export I_MPI_ROOT" % self.installdir, line)
                    sys.stdout.write(line)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号