Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpi-cmd-template: It is necessary to escape nr_ranks and cmd inside configuration file #717

Open
robert-mijakovic opened this issue Jun 16, 2021 · 3 comments

Comments

@robert-mijakovic
Copy link

I tried to use mpi-cmd-template inside a configuration file but it fails because nr_ranks and cmd need to be escaped.
--mpi-cmd-template="srun -n %(nr_ranks)s %(cmd)s" results in:
ERROR: Failed to parse configuration options: Bad value substitution: option 'mpi-cmd-template' in section 'override' contains an interpolation key 'nr_ranks' which is not a valid option name. Raw value: '"srun -n %(cmd)s %(nr_ranks)s"'
However, specifying it with: --mpi-cmd-template="srun -n %%(nr_ranks)s %%(cmd)s" works fine.

@ocaisa
Copy link
Member

ocaisa commented Jun 16, 2021

This is a little bit misleading because --mpi-cmd-template="srun -n %(nr_ranks)s %(cmd)s" as a command line option is indeed correct. The issue arises if you try to put this in a configuration file, in that case you will need to escape the % with another %

@robert-mijakovic
Copy link
Author

Correct, that is what I did and it worked.

@robert-mijakovic
Copy link
Author

It is necessary to make it more clear in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants