Hello,

I have written this short program

#include <mpi.h>
#include <stdio.h>
#include <sys/utsname.h>

int main(int argc, char **argv){
int i, myid, numprocs;
struct utsname name;
MPI_Status status;

MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &myid);

uname(&name);
printf("Je suis %d/%d on %s\n", myid, numprocs, name.nodename);

if (myid == 0){
    buf[0]='i';
    MPI_Send(buf,1,MPI_INT,1,0,MPI_COMM_WORLD);
    fprintf(stderr,"Tour %d : Envoye '%c' vers 1\n", i, buf[0]);
    }
else{
    MPI_Recv(buf,1,MPI_INT,0,0,MPI_COMM_WORLD,&status);
    fprintf(stderr,"Tour %d : Recu '%c' de 0\n", i, buf[0]);
    }
MPI_Finalize();
return 0;
}

I compile with : mpicc pingpong.c -o pingpong
And when i try to launch it with : mpiexec -n 2 pingpong
I have this :
Je suis 0/2 on xpscp117892.tasfr.thales
Je suis 1/2 on xpscp117892.tasfr.thales
[xpscp117892.tasfr.thales:08216] mca_btl_sm_send: write fifo failed: errno=9
Tour 4130968 : Envoye 'i' vers 1
Tour 4716696 : Recu 'i' de 0

And I don't understant why I have an error "mca_btl........"
PS: I'm working with only one PC

Thanks

Reply via email to