I am relatively new to MPI.This is the mpi program i want to execute.
A very simple program to get processor name and print it out along
with processor id.
#include <iomanip>
#include <sstream>
#include "mpicxx.h"
using namespace std;
int main(int argc,char *argv[])
{
char processor_name[80];
int nprocs,pid,namelen;
MPI::Init();
nprocs=MPI::COMM_WORLD.Get_size();
pid=MPI::COMM_WORLD.Get_rank();
MPI_Get_processor_name(processor_name,&namelen);
cout<<"Pid: "<<pid<<" Node: "
<<processor_name<<endl;
MPI::Finalize();
cout<<"Complete: "<<endl;
return 0;
}
When I run the code without specifing working directory like this
mpirun -np 11 ./mpi_combi.out
I get the neat output.
But when i do the same mpi run with
mpirun -np 11 -wd /home/chellapp/vdock_test ./mpi_combi.out
gives me error message like this.
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 anyone please let me know the fault in the code.
Thanks in advance
|