parallel-display at the slave side
-
2010年2月4日 8:47I wanna do parallel rendering via mpich2. First I worked on a simple program, however I could not observe the message "Hello 1" for instance on a slave. what I did on the master side is to run wmpiexec.exe by specifying all the host names, and do nothing at slave sides.
Could anybody give me a hand? Thank you.
#include "mpi.h" #include <cstdio> #include <math.h> int main(int argc, char* argv[]) { int myid,numprocs; int namelen; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD,&myid);
MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
MPI_Get_processor_name(processor_name,&namelen); if(myid != 0){ printf("Hello %d", myid); //this is what I what to see at the screen of slaves!!! } printf(" Process %d of %d SAY HELLO TO MPI on %s\n",myid, numprocs, processor_name); MPI_Finalize(); return 0; }
全部回复
-
2010年2月6日 4:37
with MPICH2 and with MSMPI the stdout/error from the individual programs are redirected to mpiexec. You should see the output from all your ranks at mpiexec console.
Note that mpiexec has a -l (lowercase L) which prefix each line with the rank id.
thanks,
.Erez- 已标记为答案 Don PatteeModerator 2011年1月12日 2:50
-
2010年2月8日 1:37
yes, I do see the output from all ranks at mpiexec console of the master node.
I thought with the following line, I should see "Hello 1" at slave 1 for instance.
if (myid != 0) {printf("Hello, %d",myid):}
What should I do in order to realize this functionality? Thank you.