l***@yahoo.com
2008-08-13 01:57:24 UTC
Hi,
I have a few questions regarding running MPI on just one node.
If I used "mpiexec -n 3 ./a.out", does it create 3 threads and run
them independently as if there are 3 nodes? Are the variables all
shared, unlike when there's actually 3 nodes and the variables are
local and can be written without affecting variables of the same name
in another node?
If I have MPI functions like MPI_Send and MPI_Recv, does the node
actually try to simulate the sending/receiving of data? Is that data
shared or local?
I tried a program that does the following. It simulates 5 nodes when
there is really only 1:
I have declared a variable i, and it's equal to the value of rank, and
I do a sum reduction. I get the correct value 0 + 1 + 2 + 3 + 4 = 10
Then I send i from "Node" 1,2,3,4 to "Node" 0, explicitly calculate
the sum and get 10.
Now I do a sum reduction again and this time, I got the result 14,
which is 10 + (the last value of i, 4). Why is the last value of i
kept?
Thank you.
Regards,
Rayne
I have a few questions regarding running MPI on just one node.
If I used "mpiexec -n 3 ./a.out", does it create 3 threads and run
them independently as if there are 3 nodes? Are the variables all
shared, unlike when there's actually 3 nodes and the variables are
local and can be written without affecting variables of the same name
in another node?
If I have MPI functions like MPI_Send and MPI_Recv, does the node
actually try to simulate the sending/receiving of data? Is that data
shared or local?
I tried a program that does the following. It simulates 5 nodes when
there is really only 1:
I have declared a variable i, and it's equal to the value of rank, and
I do a sum reduction. I get the correct value 0 + 1 + 2 + 3 + 4 = 10
Then I send i from "Node" 1,2,3,4 to "Node" 0, explicitly calculate
the sum and get 10.
Now I do a sum reduction again and this time, I got the result 14,
which is 10 + (the last value of i, 4). Why is the last value of i
kept?
Thank you.
Regards,
Rayne