0

I am trying to run a mpi program but i have some problem with the installation. I get the packet from a repository and i can compile my program, but when i try to run the program i can t do it. Well, my program is a little bit biggest than an "Hello World", but my problem is with mpi library (i think so), not with the code. Here is my "Hello World" parallel (in spanish of course):

#include <stdio.h>
#include <mpi.h>

 int main(int argc, char *argv[])
 {
 int rank, size;

 MPI_Init(&argc, &argv);

 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 MPI_Comm_size(MPI_COMM_WORLD, &size);

printf("Hola Mundo! Soy el %d de %d\n", rank, size);

MPI_Finalize();

return 0;
}

When i use mpicc appears the hola file.

mpicc hola.c -o hola

Then i run my program:

mpirun -np 5 ./hola

The output of (for @Gilles)

ls -1 hola

is just

hola

The output show from the comand line is this:

  [proxy:0:0@miMachine-LMint] HYDU_create_process 
   (./utils/launch/launch.c:75): execvp error on file hola (No such file 
  or directory)
   [proxy:0:0@miMachine-LMint] HYDU_create_process 
   (./utils/launch/launch.c:75): execvp error on file hola (No such file 
or directory)
[proxy:0:0@miMachine-LMint] HYDU_create_process 
(./utils/launch/launch.c:75): [proxy:0:0@patricio-LMint] 
HYDU_create_process (./utils/launch/launch.c:75): execvp error on file 
hola (No such file or directory)
execvp error on file hola (No such file or directory)
[proxy:0:0@miMachine-LMint] HYDU_create_process 
(./utils/launch/launch.c:75): execvp error on file hola (No such file 
or directory)




Well the thing is that i dont know what is the problem. 

2 Answers 2

3

When you report an issue, you should always include the command line that leads to the error message.

Anyway, it seems you ran

mpirun hola

instead of

mpirun ./hola
Sign up to request clarification or add additional context in comments.

4 Comments

I used mpirun ./hola and mpirun hola (may be it works). Sorry , and the line that reports the error is that. "mpirun ./hola" or "mpirun -np 3 ./hola" when i want to use more than one process.
please edit your question with both your mpicc and mpirun commands and outputs. are you running on only one machine ? what does ls -l hola says ?
ls -l this is ls minus lower-case L. which distro and MPI library are you using ? what if you mpirun -np 5 pwd/hola ? if it still does not work, can you try strace -f -e execve mpirun -np 5 pwd/hola ? can you confirm you are running on only one node and mpirun is invoked on miMachine-LMint ? what if you ls -l hola; mpirun -np 1 ls -l hola ?
Hi @Gilles Gouaillardet. I forgotten this question. I installed another operative system and i was using mpi normally and guess what... i had the same problem. Ok i wanted to kill my self when... i saw that i was using mprun myfile instead ./myfile. Then i remembered that question and came here to aswered this. Big sorpraise when i saw the question answered. Ok it seems that all the time i ran (when i make the mistake) myFile instead of ./myfile . Thanks for your answer and sorry for the delay XD.
1

ok. i could make it work. I am not an expert in linux and install packages. Seems that there is a package to mpi file compile and there is another package to run mpi files. I installed the compile package and the run packege later. Then i "turned on" the run package and i could ran my program. First i got the compiler package.

apt-get install lam4-dev

Second i got the run package.

apt-get install lam-runtime

Third i turned on the run time package

lamboot

And here is my command line output. First ran the program

mpirun -np 5 ./algo

Hola! Soy el 0 de 5
Hola! Soy el 2 de 5
Hola! Soy el 1 de 5
Hola! Soy el 3 de 5
Hola! Soy el 4 de 5

Thanks @Gilles for your answer and sorry if i it was a rookie question and my english.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.