当我跑的时候
mpirun -np 4 mpi_script.sh
Open MPI tried to fork a new process via the "execve" system call but failed. ... Error: Exec format error
尽管我可以用 ./mpi_script.sh
./mpi_script.sh
就我而言,问题是我没有 shebang .
添加 #!/usr/bin/env bash
#!/usr/bin/env bash
#!/usr/bin/env bash # rest of script # ...
注意:确保文件具有执行权限:
chmod +x mpi_script.sh