pycharm远程调用mpi报错MPI_Init_thread help-orte-runtime: No such file or directory help-mpi-runtime.txt:

我在服务器里面安装openmpi,系统是ubuntu的
官网下载https://www.open-mpi.org/software/ompi/v4.1/

tar -zxvf openmpi-4.1.4.tar.gz
cd openmpi-4.1.4
mkdir build
../configure --prefix=/usr/local/mpi  如果不加--prefix默认会安装到/usr/local/mpi这个目录
make -j20
make install

安装完成之后在/usr/local/mpi将有如下五个文件夹

bin  etc  include  lib  share

其中我们使用的mpirun目录就在bin目录里面,lib文件夹存放编译好的so

安装python版本,使用python接口

pip install mpi4py

然后在服务器里面进行调用
from mpi4py import MPI
在这里插入图片描述
如果正常说明安装没有问题,
但是我使用pycharm进行远程运行from mpi4py import MPI的时候遇到一个错误:

--------------------------------------------------------------------------
Sorry!  You were supposed to get help about:
    opal_init:startup:internal-failure
But I couldn't open the help file:
    /build-result/hpcx-v2.9.0-gcc-inbox-ubuntu20.04-x86_64/ompi/share/openmpi/help-opal-runtime.txt: No such file or directory.  Sorry!
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Sorry!  You were supposed to get help about:
    orte_init:startup:internal-failure
But I couldn't open the help file:
    /build-result/hpcx-v2.9.0-gcc-inbox-ubuntu20.04-x86_64/ompi/share/openmpi/help-orte-runtime: No such file or directory.  Sorry!
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Sorry!  You were supposed to get help about:
    mpi_init:startup:internal-failure
But I couldn't open the help file:
    /build-result/hpcx-v2.9.0-gcc-inbox-ubuntu20.04-x86_64/ompi/share/openmpi/help-mpi-runtime.txt: No such file or directory.  Sorry!
--------------------------------------------------------------------------
*** An error occurred in MPI_Init_thread
*** on a NULL communicator
*** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
***    and potentially your MPI job)
[yjy-yjy-dev-face-totjhz:56409] Local abort before MPI_INIT completed completed successfully, but am not able to aggregate error messages, and not able to guarantee that all other processes were killed!

Process finished with exit code 1

解决办法:将/usr/local/mpi/lib加入LD_LIBRARY_PATH环境变量,从而让pycharm能找到mpi所在so的位置
在这里插入图片描述
1)点击Edit Configurations,然后加入环境变量
在这里插入图片描述
2)点击Environment variables右侧的小书图片编辑环境变量LD_LIBRARY_PATH的值,或者直接手动填入LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpi/lib
如果添加了lib路径还是报错,可能是因为OPAL路径找不到,添加下面的环境变量即可OPAL_PREFIX=/opt/hpcx/ompi
最后添加的环境变量如下:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpi/lib;OPAL_PREFIX=/opt/hpcx/ompi
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
ImportError: libxerces-c-3.2.so: cannot open shared object file: No such file or directory是一个错误提示,表明系统无法找到libxerces-c-3.2.so共享库。解决这个问题的方法可以参考以下步骤: 1. 首先,确认该共享库是否已经安装在系统中。你可以使用以下命令来查找该共享库: ``` find / -name "libxerces-c-3.2.so" ``` 如果找不到该共享库,则需要安装它。你可以从官方网站或者其他可靠的来源下载并安装该共享库。 2. 如果已经安装了该共享库,但系统仍然找不到它,那可能是由于文件路径的问题。你可以尝试以下方法来解决: - 确保该共享库所在的路径在系统的搜索路径中。你可以通过以下命令来设置LD_LIBRARY_PATH环境变量: ``` export LD_LIBRARY_PATH=/path/to/library:$LD_LIBRARY_PATH ``` 将"/path/to/library"替换为libxerces-c-3.2.so所在的路径。这将临时添加该路径到系统的搜索路径中。 - 如果你希望永久性地将该路径添加到系统的搜索路径中,可以将上述命令添加到你的shell配置文件(例如~/.bashrc或~/.bash_profile)中。然后重新启动终端或执行"source ~/.bashrc"来使设置生效。 3. 如果上述步骤仍然无法解决问题,那可能是由于共享库与应用程序之间存在版本不兼容的问题。你可以尝试升级或降级相关的库或应用程序,以使它们的版本兼容。 总结起来,当出现ImportError: libxerces-c-3.2.so: cannot open shared object file: No such file or directory的错误时,可以通过确认共享库是否已安装、设置LD_LIBRARY_PATH环境变量以及升级或降级相关库或应用程序来解决该问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [解决ImportError:lib***.so--cannot open shared object file: No such...(pycharm/clion报错但shell不...](https://blog.csdn.net/m0_58348465/article/details/122653790)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [ubuntu报错:libg2c.so.0:cannot open shared object file: no such file or directory/wrong ELF class...](https://download.csdn.net/download/weixin_42191440/15522073)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值