mpirun -np 3 nn6 RRS feed

  • Question

  • 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) failed
    MPI_Send(99).: Invalid rank has value 1 but must be nonnegative and less than 1

    what 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");



    return 0;

    Tuesday, June 5, 2012 5:41 PM

All replies

  • 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.



    Monday, June 18, 2012 4:35 PM