I recently installed OpenMPI on my computer, and when I try to run a simple Hello World program, it exits with the following error:
This is the source code of the program:
#include <mpi.h> #include <stdio.h> int main(int argc, char *argv[]) { int size, rank; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); printf("Hello\n"); MPI_Finalize(); return 0; }
This is how I compile the program:
mpicc -o hello hello.c
and I execute it with
mpirun -np 2 hello
It does not generate compilation errors, and if I run ./hello , it works fine.
Sorry my english, any correction would be welcome.
source share