gpt4 book ai didi

python - 在交互式 qsub 环境中使用 mpirun 激活虚拟环境

转载 作者:行者123 更新时间:2023-11-28 19:14:11 24 4
gpt4 key购买 nike

我在项目中使用 openmdao 0.13 python 模块。此模块仅可用作 virtualenv。当我激活虚拟环境时,它似乎只在一个节点上激活。什么可以解释这种奇怪的行为?为什么非主节点上的处理器无法加载 virtualenv?

$ mpirun --version
mpirun (Open MPI) 1.7.3
$ qsub --version
Version: 5.1.1.2
$ qsub -V -I -l nodes=2:ppn=24
$ cd openmdao-0.10.3.2/
$ . bin/activate
$ mpirun -np 24 python -c "import openmdao"
# no errors
$ mpirun -np 27 python -c "import openmdao"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named openmdao
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named openmdao
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named openmdao

看起来我所有的处理器都正确引用了 python

$ mpirun -np 27 which python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python
/home/jquick/here_it_is/openmdao-0.10.3.2/bin/python

我不明白是什么导致了这个导入错误。 bin/activate 对我的主节点有什么影响,但对辅助节点没有影响?

最佳答案

在开始 qsub 作业之前激活 virtualenv 为我解决了这个问题

关于python - 在交互式 qsub 环境中使用 mpirun 激活虚拟环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35645066/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com