문제

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?.

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top