easybuilders / easybuild

EasyBuild - building software with ease
http://easybuild.io
GNU General Public License v2.0
470 stars 144 forks source link

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

Open robert-mijakovic opened 3 years ago

robert-mijakovic commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Correct, that is what I did and it worked.

robert-mijakovic commented 3 years ago

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