I'm working on a code that work with Epiphany processor (http://www.parallella.org/) and to run Epiphany codes i need sudo privileges on host side program. There is no escape from sudo!
Now i need to run this code across several nodes, in order to do that i'm using mpi but mpi wont function properly with sudo
#sudo mpirun -n 12 --hostfile hosts -x LD_LIBRARY_PATH=${ELIBS} -x EPIPHANY_HDF=${EHDF} ./hello-mpi.elf
Even a simple code that does node communication does not work. The ranks comes 0 if i use sudo. Communication between threads works but not across nodes. This is important because i wanted to divide the work load properly across the cards.
here is the simple code
#include <stdio.h>
#include <mpi.h>
int main(int argc, char *argv[]) {
int numprocs, rank, namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Get_processor_name(processor_name, &namelen);
printf("Hello World from MPI Process %d on machine %s\n", rank, processor_name);
MPI_Finalize();
}
This code should spit out the rank number differently across the nodes but it does not work with sudo
Any help on this would be great
Here is the output from running the above code without sudo.
mpirun -n 3 --hostfile $MPI_HOSTS ./mpitest
output:
Hello world from processor work1, rank 1 out of 3 processors
Hello world from processor command, rank 0 out of 3 processors
Hello world from processor work2, rank 2 out of 3 processors
This is as expected.
Here is the output from running the above code with sudo.
sudo mpirun -n 3 --hostfile $MPI_HOSTS ./mpitest
output:
Hello world from processor command, rank 0 out of 1 processors
Hello world from processor work1, rank 0 out of 1 processors
Hello world from processor work2, rank 0 out of 1 processors
This is not.
Edit:-
I think @Hristo Iliev got the right answer but I'm not going to be able to test this out