<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I use (or try to use) mpicxx. There is an older post in http://www.mail-archive.com/cmake@cmake.org/msg36851.html<br><br>--------------------------------------------------------------------------<br><br>Hm... this is the CMake user list, not the MPI-user list..... You're<br>posing your question on the wrong list.<br>(but.... how did you compile? Did you use mpicc?)<br><br>Sincerely,<br>Jakob<br><br>On 06/22/2011 02:25 PM, M? Dolores Villalobos Ortiz wrote:<br>> >What do you mean with "it doesn't run correctly"? Does it not even<br>> start? How do you start your program?<br>><br>> ------------------------------------------------------<br>><br>> My program's code is:<br>><br>> #include <iostream><br>> using namespace std;<br>> #include "mpi.h"<br>><br>> int main( int argc, char * argv[] )<br>>
{<br>><br>> int node;<br>> int num_nodes;<br>> int i, buf;<br>><br>> MPI::Init(argc, argv);<br>> node = MPI::COMM_WORLD.Get_rank();<br>> num_nodes = MPI::COMM_WORLD.Get_size();<br>><br>> std::cout << "I am node " << node << std::endl;<br>><br>> if ( node == 0 ) {<br>> std::cout << "I am node " << node << std::endl;<br>> std::cout << "Num threads (Get_size) -> " << num_nodes << std::endl;<br>> }<br>> else<br>> {<br>> std::cout << "I am node " << node << std::endl;<br>> }<br>> MPI_Finalize();<br>> return 0;<br>> }<br>> ------------------------------------------------------<br>><br>> And, in order to run the program, I type in Ubuntu's terminal:<br>><br>> mpiexec -n 2 ./main_program<br>><br>> -------------------------------------------------------------<br>><br>> The program write in
terminal:<br>><br>> I am node 0<br>> I am node 0<br>> Num threads (Get_size) -> 1<br>> I am node 0<br>> I am node 0<br>> Num threads (Get_size) -> 1<br>><br>> instead of:<br>><br>> I am node 0<br>> I am node 0<br>> Num threads (Get_size) -> 2<br>> I am node 1<br>> I am node 1<br>><br>><br>> Lola<br><br></td></tr></table>