0

我有以下代码:

    /* C Example */

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


    int main (int argc,char* argv[])
    {
       int rank, size;

       MPI_Init (&argc, &argv); /* starts MPI */
       MPI_Comm_rank (MPI_COMM_WORLD, &rank);   /* get current process id */
       MPI_Comm_size (MPI_COMM_WORLD, &size);   /* get number of processes */
       printf( "Hello world from process %d of %d\n", rank, size );
       MPI_Finalize();
       return 0;
    }

我用它编译

mpicc hello.c

但是当我启动它时

mpirun -np 2 ./a.out

什么也没发生,我必须用 Ctrlt+C 取消它。我究竟做错了什么?

提前致谢 :)

4

0 回答 0