Sorry, but I don't see how the script shown can produce that error message; perhaps you modified it, in that case you need to post the full code, or, the error message is actually coming from one of the two executed commands, in which case that needs to be debugged...
I'm not sure how many monks here might already have experience with SLURM, gromacs, et al, but if it's only a few, the rest of us will need all the information you can provide so that we can help you best. To that effect, it would be good if you could read I know what I mean. Why don't you? and How do I post a question effectively?