I'm running a simple hello world program written in C on mpi and the problem I'm having is that i can't seem to execute 10 processes for this simple program.
#include <stdio.h>
#include "mpi.h"
int main(int argc, char *argv[])
{
int rank; //rank of the process
int size; //number of processes
MPI_Init(&argc,&argv); //inititate MPI environment
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
MPI_Comm_size(MPI_COMM_WORLD,&size);
printf("Hello world from process %d of %d\n",rank,size);
MPI_Finalize();
return 0;
}
i run it on terminal by:
mpicc -o hello helloworld.c
mpirun --oversubscribe -np 10 hello
Output:
Hello world from process 0 of 10
Hello world from process 2 of 10
Hello world from process 3 of 10
Hello world from process 9 of 10
Hello world from process 7 of 10
Hello world from process 1 of 10
Hello world from process 6 of 10
Hello world from process 5 of 10
Hello world from process 4 of 10
Hello world from process 8 of 10
-----------------------------------------------------------------------
---
A system call failed during shared memory initialization that should
not have. It is likely that your MPI job will now either abort or
experience performance degradation.
I realized the maximum i can go with oversubscribe on my dual core mac is 5 which doesn't generate the warning as above but anything more than that gives me the error and I'm not sure why.
Would appreciate some help on this. If so how do i reinstall open mpi?