Pregunta

I have a web interface to controlate a cluster with OpenMPI, I use shell_exec() function to execute mpirun, when i try to execute with "-host local" it works perfectly but when i run with the command "-hostfile /home/hostfile" it does nothing.

If i put the command in the console it works perfectly but the same command in shell_exec() doesn't work.

Command that is not working from shell_exec:

cd /mpi; mpirun -np 64 -hostfile /home/hostfile17 paralelo 1 image.bmp out.bmp

But that command works perfectly from the console.

Any idea on what is going on?.

¿Fue útil?

Solución

PHP's shell_exec function will execute your command under a non-login user. This just means that $PATH & other environment variables that you would expect would not be provided. Just be explicit about where your mpirun is located, and use absolute paths to ensure MPI knows what your talking about.

Example:

/usr/local/bin/mpirun -np 64 -hostfile /home/hostfile17 /full/path/paralelo 1 /mpi/image.bmp /mpi/out.bmp
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top