Use MPI with Parallella Cluster

Use MPI with Parallella Cluster

Postby Cary » Thu Aug 28, 2014 4:06 pm

I am new to Parallella and working with clusters of boards. I am having some trouble with using MPI to communicate across multiple boards. When running the following program:

Code: Select all
int main(int argc, char** argv) {
  // Initialize the MPI environment
  MPI_Init(NULL, NULL);

  // Get the number of processes
  int world_size;
  MPI_Comm_size(MPI_COMM_WORLD, &world_size);

  // Get the rank of the process
  int world_rank;
  MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);

  // Get the name of the processor
  char processor_name[MPI_MAX_PROCESSOR_NAME];
  int name_len;
  MPI_Get_processor_name(processor_name, &name_len);

  // Print off a hello world message
  printf("Hello world from processor %s, rank %d"
         " out of %d processors\n",
         processor_name, world_rank, world_size);

  // Finalize the MPI environment.
  MPI_Finalize();
}


Without using sudo before mpiexec I get this:
Code: Select all
mpiexec -n 3 --hostfile hosts ./mpirun
Hello world from processor work1, rank 1 out of 3 processors
Hello world from processor work2, rank 2 out of 3 processors
Hello world from processor command, rank 0 out of 3 processors
This is what i expected to happen.


When I use sudo before this call I get this:
Code: Select all
sudo mpiexec -n 3 --hostfile hosts ./mpirun
Hello world from processor command, rank 0 out of 1 processors
Hello world from processor work2, rank 0 out of 1 processors
Hello world from processor work1, rank 0 out of 1 processors
This is not what I expected.

I am giving this example because when I created a program for my Parallella boards everything works fine for one board but when trying to use MPI to run on all the boards I get this error when trying to run the following statement:

Code: Select all
mpiexec -n 3 --hostfile /home/cluster/bin/corr/example/bin/hosts  /home/cluster/bin/Parallella/epiphany-examples/apps/testing/bin/test.elf
e_init(): Program must be invoked with superuser privilege (sudo)


So it seems that I need sudo to execute the Epiphany code but when using sudo MPI doesn't seem to work correctly.

Any help for this issue will be greatly appreciated

THANKS
Cary
 
Posts: 2
Joined: Thu Aug 28, 2014 3:10 pm

Re: Use MPI with Parallella Cluster

Postby aolofsson » Thu Aug 28, 2014 6:03 pm

Please see the following post from a while back...
http://www.adapteva.com/white-papers/bu ... f-cluster/

You might need to set the path explicitly in your run program rather than in your bashrc to get it to work.

The good news is that this sudo nonsense will finally be gone in a couple of weeks time with the new SDK release :D

Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Use MPI with Parallella Cluster

Postby Cary » Thu Aug 28, 2014 8:59 pm

Thanks for the reply.

I also tried setting the path explicitly but not sure of the correct syntax for setting paths with mpiexec. Everything I tried gave me errors except when I used sudo. Any idea of how the mpi call might look when add paths?

Thanks
Cary
 
Posts: 2
Joined: Thu Aug 28, 2014 3:10 pm


Return to MPI

Who is online

Users browsing this forum: No registered users and 1 guest

cron