对不起,我确定犯了一个愚蠢的错误,但没有成功。错误的mpi处理器数量
我编写一个简单的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
但我的电脑是酷睿i7与4个核。一切似乎都可以,即。 cat/proc/cpuinfo显示4个处理器
发生了什么??? 提前致谢!
看起来不像是你的MPI代码的问题。你安装了哪个MPI库?你是如何安装它的? – 2012-04-03 10:02:26
[MPI \ _Rank返回所有进程的相同进程号的可能的重复](http://stackoverflow.com/questions/20287564/mpi-rank-return-same-process-number-for-all-process) – 2014-06-16 15:19:04