【发布时间】:2012-04-16 23:17:18
【问题描述】:
抱歉,我肯定犯了一个愚蠢的错误,但没有成功。
我正在编译一个简单的 mpi hello world:
#include <stdio.h>
#include <mpi.h>
int main (argc, argv)
int argc;
char *argv[];
{
int rank, size;
MPI_Init (&argc, &argv); /* starts MPI */
MPI_Comm_rank (MPI_COMM_WORLD, &rank); /* get current process id */
MPI_Comm_size (MPI_COMM_WORLD, &size); /* get number of processes */
printf( "Hello world from process %d of %d\n", rank, size );
MPI_Finalize();
return 0;
}
还有:
> mpicc -o hello_world_c hello_world.c
> mpirun -np 4 hello_world_c
但返回:
Hello world from process 0 of 1
Hello world from process 0 of 1
Hello world from process 0 of 1
Hello world from process 0 of 1
但我的电脑是 4 核的 core i7。一切似乎都很好,即。 cat /proc/cpuinfo 显示 4 个处理器
发生了什么??? 提前谢谢!!!!
【问题讨论】:
-
您的 MPI 代码似乎没有问题。您安装了哪个 MPI 库?你是怎么安装的?
标签: mpi processors