MPI Number of processors?

女生的网名这么多〃 提交于 2019-12-07 04:12:44

问题


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;
}

I was wondering if the problem is with MPI library or sth else?

Here is the result that it shows me:

Hello world! I am 0 of 1

Additional info: Windows 7 - Professional x64


回答1:


Prima facie it looks like you are running the program directly. Did you try using mpiexec -n 2 or -n 4?



来源:https://stackoverflow.com/questions/7437320/mpi-number-of-processors

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!