[mpich-discuss] help
    Rajeev Thakur 
    thakur at mcs.anl.gov
       
    Sun Apr  4 10:12:02 CDT 2010
    
    
  
Make sure you are running it with the mpiexec from the same MPI
implementation that you used to compile the program. Give the full paths
to mpicc and mpiexec and try.
 
Rajeev
  _____  
From: mpich-discuss-bounces at mcs.anl.gov
[mailto:mpich-discuss-bounces at mcs.anl.gov] On Behalf Of guchonglin-6
Sent: Saturday, April 03, 2010 10:20 PM
To: mpich-discuss at mcs.anl.gov
Subject: [mpich-discuss] help
Hello:
       Now my problem changes to the following:
       I use the function MPI_Comm_rank anf MPI_Comm_size。but the
reslut is
      node1:/usr/cluster # mpiexec -n 2 ./d
      HELLOWORLD!process0 of 1 on node1
      HELLOWORLD!process0 of 1 on node2
      The problem is it should show process0 of 2 on node1 and process 1
of 2 on node2
     So,please help me.
The code is the following, so I want to know why like this:
#include <stdio.h>
#include "mpi.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);
   printf("HELLOWORLD!process%d of %d on
%s\n",myid,numprocs,processor_name);
   MPI_Finalize();
return 0;
}
         Thank you!
 
Gugu
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20100404/047d5aac/attachment.htm>
    
    
More information about the mpich-discuss
mailing list