For example, I want the process "myexe.exe" to run on any host computer. So i want hostname to be evaluated on each computer and inserted into the command. Ideally i want this all done in one line. I tried the following code.
mpiexec -n 8 -hosts 1 %hostname% myexe.exe myinputfile.txt
But i got this error
... unable to get host address for %hostname% (11001)
So it doesn't appear to have evaluated hostname properly. How do i get hostname to be evaluated properly in the command?
You could use
localhostinstead.But, on Windows (implied by the
cmdtag) you probably should use:The magic for setting a variable from the output of
hostnameis:In a .bat file script, double the PERCENT SIGN character.