MPI_Init() 在 Raspberry Pi 4 上立即崩溃 [英] MPI_Init() crashes instantly on Raspberry Pi 4
问题描述
在全新的 Raspberry Pi 4 Ubuntu 上运行干净的 Ubuntu,
Running a clean Ubuntu on a brand-new Raspberry Pi 4 Ubuntu,
ubuntu@ubuntu:~/mpi-hello-world/mpitutorial/tutorials/mpi-hello-world/code$ uname -a
Linux ubuntu 5.4.0-1028-raspi #31-Ubuntu SMP PREEMPT Wed Jan 20 11:36:14 UTC 2021 armv7l armv7l armv7l GNU/Linux
就
sudo apt install mpi mpich
使这个工作正常:
#include <mpi.h>
#include <stdio.h>
int main(int argc, char** argv) {
// Initialize the MPI environment. The two arguments to MPI Init are not
// currently used by MPI implementations, but are there in case future
// implementations might need the arguments.
fprintf(stderr,"Starting...\n");
MPI_Init(NULL, NULL);
fprintf(stderr,"MPI_Init accomplished...\n");
// Finalize the MPI environment. No more MPI calls can be made after this
MPI_Finalize();
fprintf(stderr,"MPI_Finalize done!\n");
}
但是运行它,当 MPI_Initialize() 被调用时instacrash.
but running it, instacrash when MPI_Initialize() is called.
ubuntu@ubuntu:~/mpi-hello-world/mpitutorial/tutorials/mpi-hello-world/code$ mpirun -np 2 ./mpi_hello_world
Starting...
Starting...
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 7855 RUNNING AT ubuntu
= EXIT CODE: 139
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions
有什么建议吗?!?
推荐答案
是的,问题是混合使用了 mpi 和 mpich!这解决了它:
Yes, the problem was mixing mpi and mpich! This solved it:
sudo apt remove mpi mpich
sudo apt install mpi mpi-default-dev
之后make
运行顺利(之前是这样),然后execute也顺利运行!
After which make
runs smoothly (which it did before), and then the execute also runs smoothly!
mpirun -np 2 ./mpi_hello_world
一切都很好.感谢@Gilles 的提示.
and all is good. Thanks @Gilles for the hint.
(我或多或少随机地选择了 mpi 而不是 mpich,简单的网络搜索并没有显示出明确的理由来为我们计划做的简单事情选择一个或另一个.)
(I picked mpi over mpich more or less at random, simple web searches don't show a clear reason to pick one or the other for the simple things we're planning to do.)
这篇关于MPI_Init() 在 Raspberry Pi 4 上立即崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!