Error starting MPICH on a quad-core processor

I tried to run the following MPI code and encountered an error as shown below. I would be grateful if you could help me with this.

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

int main(){
    int rank, size;

    MPI_Init(NULL, NULL);

//  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
//  MPI_Comm_size(MPI_COMM_WORLD, &size);

//  printf("Hello from %d of %d\n", rank, size);

    MPI_Finalize();

    return 0;
}

Error:

$ mpirun -np 4 ./a.out
mpiexec_ubuntu: cannot connect to local mpd (/tmp/mpd2.console_joseph); possible causes:
  1. no mpd is running on this host
  2. an mpd is running but was started without a "console" (-n option)
In case 1, you can start an mpd on this host with:
    mpd &
and you will be able to run jobs just on this host.
+3
source share
1 answer

Just follow the error message: start mpd & at the command prompt.

I highly recommend you use OpenMPI instead of MPICH, if possible.

+2
source

All Articles