MPI处理器数量? [英] MPI Number of processors?
本文介绍了MPI处理器数量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是我在MPI中执行的代码,该代码是在i7核心CPU(四核)上运行的,但问题是它显示出它在1个处理器CPU(必须为4个)下运行.
Following is my code in MPI, which I run it over a core i7 CPU (quad core), but the problem is it shows me that it's running under 1 processor CPU, which has to be 4.
int main(int argc, char *argv[])
{
int rank, size;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
printf("Hello world! I am %d of %d\n", rank, size);
MPI_Finalize();
return 0;
}
我想知道问题出在MPI库还是其他?
I was wondering if the problem is with MPI library or sth else?
这是显示给我的结果:
Hello world! I am 0 of 1
其他信息: Windows 7-专业版x64
Additional info: Windows 7 - Professional x64
推荐答案
初步看来,您似乎正在直接运行该程序.您是否尝试使用mpiexec -n 2
或-n 4
?
Prima facie it looks like you are running the program directly. Did you try using mpiexec -n 2
or -n 4
?
这篇关于MPI处理器数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文