mpirun -np 3 nn6
-
5 iunie 2012 17:41
when I am going to run the code it is showing
1Fatal error in MPI_Send: Invalid rank, error stack:MPI_Send(174): MPI_Send(buf=0x7ffff63272c0, count=12, MPI_CHAR, dest=1, tag=100, MPI_COMM_WORLD) failedMPI_Send(99).: Invalid rank has value 1 but must be nonnegative and less than 1what type of problem is it? How can I solve it. I am doing a project on it. i am egarly waiting for the reply.My code is:#include <stdio.h>#include "mpi.h"
int main (int argc, char ** argv){
int my_PE_num, ntag= 100 ;char message[12]= "Hello, world";
MPI_Status status;
MPI_Init (&argc, &argv);MPI_Comm_rank (MPI_COMM_WORLD, &my_PE_num);
if (my_PE_num ==0)MPI_Send (&message, 12, MPI_CHAR, 1, ntag, MPI_COMM_WORLD);
printf("\n my name************\n");/*
else if (my_PE_num == 1)
MPI_Recv(&message, 12, MPI_CHAR, 0, ntag, MPI_COMM_WORLD, &status);
printf("\n that is*************\n");
*/
MPI_Finalize();
return 0;}
Toate mesajele
-
18 iunie 2012 16:35
Hi Nasrin,
With Windows HPC, you would launch your program using MPIExec.exe as follows: MPIExec -n 2 nn6, where nn6 is the name of your application. The -n 2 argument to MPIExec tells MPIExec to launch two ranks, with rank values 0 and 1.
Best,
Robert