#include <mpi.h>
#include <stdio.h>

int main(int argc, char ** argv)
{
    int myrank, size;
    int numsend, numrecv;
    MPI_Status  status;

    MPI_Init(&argc, &argv);

    MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
    MPI_Comm_size(MPI_COMM_WORLD, &size);

    numsend=33;
    numrecv=50;

    if (myrank==0)
    MPI_Send(&numsend,1,MPI_INT,1,10,MPI_COMM_WORLD);
    else if (myrank==1)
    MPI_Recv(&numrecv,1,MPI_INT,0,10,MPI_COMM_WORLD,&status);
    else
      printf("No MPI call assigned to me");

    if(myrank==1){
    printf(" I am rank %d of %d\n", myrank, size);
    printf("Received value numrecv= %d\n", numrecv);}

    MPI_Finalize();
    return 0;
}
