I am using LAM/MPI 7.1.2 on two linux machines. I am able to lamboot and
compile MPI examples successfully but when trying to the run programs like
this
#include <stdio.h>
#include <mpi.h>
int main(int argc,char* argv[]) {
MPI_Init(&argc,&argv);
printf("Hello 1\n");
int rank, size;
printf("Hello 2\n");
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
printf("Hello, world! I am %d of %d\n", rank, size);
MPI_Finalize();
return 0;
}
compiled as -> "mpicc -o hello1 hello.c"
with this -> "mpirun -v -np 1 hello1"
it just prints "9515 hello1 running on n0 (o)"
and when i manually quit with a Ctrl-C it says
^C-----------------------------------------------------------------------------
It seems that [at least] one of the processes that was started with
mpirun did not invoke MPI_INIT before quitting (it is possible that
more than one process did not invoke MPI_INIT -- mpirun was only
notified of the first one, which was on node n0).
mpirun can *only* be used with MPI programs (i.e., programs that
invoke MPI_INIT and MPI_FINALIZE). You can use the "lamexec" program
to run non-MPI programs over the lambooted nodes.
-----------------------------------------------------------------------------
Can someone help to figure out the error?
|