macOS Sequoia系统下Open-MPI与MPICH运行简单测试脚本均失败的问题求助
macOS Sequoia系统下Open-MPI与MPICH运行简单测试脚本均失败的问题求助
各位好,我是刚接触MPI的新手,最近在我的macOS Sequoia 15.5(Darwin 24.5.0,Intel x86_64处理器)上运行Open-MPI和MPICH时遇到了棘手的问题——不管用哪种方式安装,运行最简单的MPI测试程序都会崩溃,我怀疑是编译器或系统库出了大问题,试过各种方法都没解决,实在没办法了来求助大家。
我的环境信息
- 系统:macOS Sequoia 15.5(Darwin 24.5.0)
- 处理器:Intel x86_64架构
- MPI版本:试过Open-MPI和MPICH的多个版本,均通过以下方式安装
尝试过的安装方式
我已经把能想到的MPI安装方法都试了一遍,但结果完全一致:
- Homebrew常规二进制安装:
brew install open-mpi/brew install mpich - Homebrew源码编译安装:
brew install --build-from-source open-mpi/brew install --build-from-source mpich - 指定Homebrew自带的编译器进行Homebrew安装
- 手动从官方源码包编译安装
- 通过PETSc自动下载编译安装(这个方法我之前了解到很可靠,使用
--download-openmpi=yes或--download-mpich=yes参数)
我的测试代码
为了排除业务逻辑问题,我写了一段最基础的MPI测试代码:
#include <mpi.h> #include <stdio.h> int main(int argc, char** argv) { int rank, ierr; ierr = MPI_Init(&argc, &argv); printf("ierr %d\n", ierr); MPI_Comm_rank(MPI_COMM_WORLD, &rank); printf("Hello from rank %d\n", rank); MPI_Finalize(); return 0; }
执行步骤与错误输出
编译过程完全正常,但执行多进程任务时就会触发段错误,以下是完整的终端输出:
ccroberts@lumos Desktop % mpicc test_mpi.c -o test_mpi_c ccroberts@lumos Desktop % mpiexec -n 2 test_mpi_c ierr 0 Hello from rank 0 [lumos:45729] *** Process received signal *** [lumos:45729] Signal: Segmentation fault: 11 (11) [lumos:45729] Signal code: Address not mapped (1) [lumos:45729] Failing at address: 0x0 [lumos:45729] [ 0] 0 libsystem_platform.dylib 0x00007ff81b08b25d _sigtramp + 29 [lumos:45729] [ 1] 0 ??? 0x0000000000000000 0x0 + 0 [lumos:45729] [ 2] 0 libmpi.40.dylib 0x000000010be896df ompi_rte_finalize + 415 [lumos:45729] [ 3] 0 libmpi.40.dylib 0x000000010be8c535 ompi_mpi_instance_finalize_common + 1260 [lumos:45729] [ 4] 0 libmpi.40.dylib 0x000000010be8c8b8 ompi_mpi_instance_finalize + 128 [lumos:45729] [ 5] 0 libmpi.40.dylib 0x000000010be86139 ompi_mpi_finalize + 728 [lumos:45729] [ 6] 0 test_mpi_c 0x000000010bbe051d main + 93 [lumos:45729] [ 7] 0 dyld 0x00007ff81acad530 start + 3056 [lumos:45729] *** End of error message *** -------------------------------------------------------------------------- It looks like MPI_INIT failed for some reason; your parallel process is likely to abort. There are many reasons that a parallel process can fail during MPI_INIT; some of which are due to configuration or environment problems. This failure appears to be an internal failure; here's some additional information (which may only be relevant to an Open MPI developer): PML add procs failed --> Returned "Not found" (-13) instead of "Success" (0) -------------------------------------------------------------------------- -------------------------------------------------------------------------- It looks like MPI_INIT failed for some reason; your parallel process is likely to abort. There are many reasons that a parallel process can fail during MPI_INIT; some of which are due to configuration or environment problems. This failure appears to be an internal failure; here's some additional information (which may only be relevant to an Open MPI developer): ompi_mpi_init: ompi_mpi_instance_init failed --> Returned "Not found" (-13) instead of "Success" (0) -------------------------------------------------------------------------- [lumos:00000] *** An error occurred in MPI_Init [lumos:00000] *** reported by process [3963092993,1] [lumos:00000] *** on a NULL communicator [lumos:00000] *** Unknown error [lumos:00000] *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort, [lumos:00000] *** and MPI will try to terminate your MPI job as well) -------------------------------------------------------------------------- prterun noticed that process rank 0 with PID 45729 on node lumos exited on signal 11 (Segmentation fault: 11). --------------------------------------------------------------------------
我已经把自己能想到的排查方向都试过了,但完全找不到问题根源,作为MPI新手实在束手无策,希望有经验的朋友能帮我分析一下这到底是哪里出了问题,非常感谢!
内容来源于stack exchange
相关产品推荐
相关产品推荐

