Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPI Number of processors?

Tags:

mpi

processors

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

like image 273
Gabriel Avatar asked Sep 15 '11 20:09

Gabriel


1 Answers

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

like image 100
Foo Bah Avatar answered Oct 21 '22 05:10

Foo Bah