1

When I run

mpirun -np 4 mpi_script.sh

I get the error

Open MPI tried to fork a new process via the "execve" system call but failed.
...
Error:             Exec format error

despite the fact that I can run the script with ./mpi_script.sh

1 Answer 1

2

In my case the problem was I didn't have a shebang.

Adding #!/usr/bin/env bash to the top of my script fixed it:

#!/usr/bin/env bash

# rest of script
# ... 

N.b. be sure that the file has execute permissions:

chmod +x mpi_script.sh
Sign up to request clarification or add additional context in comments.

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.