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

Wrong parsing of command line arguments with mpirun #6372

Closed
angainor opened this issue Feb 8, 2019 · 12 comments
Closed

Wrong parsing of command line arguments with mpirun #6372

angainor opened this issue Feb 8, 2019 · 12 comments

Comments

@angainor
Copy link

angainor commented Feb 8, 2019

In 3.1.1 and 3.1.3 I get the following warning starting MPI applications that take the --am argument:

$ mpirun -H c11-3 ls --am aa bb
--------------------------------------------------------------------------
Process 130051 Unable to locate the variable file "aa" in the following search path:
   /cluster/software/OpenMPI/3.1.1-GCC-7.3.0-2.30/share/openmpi/amca-param-sets:/cluster/projects/nn9999k/
--------------------------------------------------------------------------
--------------------------------------------------------------------------
You're using the --am option. Please be advised that this option is deprecated;
you should use --tune instead. The --tune option allows one to specify mca
parameters as well as environment variables from within a file using the same
command line syntax (e.g. -mca var val -mca var "val" -x var=val -x var).
The --am option will be removed in a future release.
--------------------------------------------------------------------------

Of course ls doesn't take this argument, but that is only to illustrate the problem. It seems that mpirun is trying to analyze the application's arguments, and beyond the application name. Note that the above message is only displayed when the -H switch is present, and when there are at least 2 arguments after --am. Pretty funny, and only annoying: I do not see any other side effects except for the noise.

@jsquyres jsquyres added the bug label Feb 8, 2019
@jsquyres
Copy link
Member

jsquyres commented Feb 8, 2019

Hah, that's a fun bug!

Yes, it looks like something in the command line parsing is reading --am before it discards everything to the right (from OMPI's processing, anyway) of the command to be executed. I simplified your example down to:

$ mpirun echo --am a b

A similar error happens on master HEAD, so this is likely behavior that has escaped attention for quite a while.

@SimonR1
Copy link

SimonR1 commented Jan 13, 2020

Dear everyone,
I have the same problem and would be very grateful for any help or advice.

@awlauria
Copy link
Contributor

I can take a look and see what's going on.

@awlauria awlauria self-assigned this Jan 13, 2020
@rhc54
Copy link
Contributor

rhc54 commented Jan 13, 2020

FWIW: this is fixed in the RTE for OMPI v5. Problem is in not processing the cmd line before searching for mca params (including --am), thereby not knowing where the executable starts.

@awlauria
Copy link
Contributor

awlauria commented Jan 13, 2020

Thanks @rhc54 .

@SimonR1 this will be fixed in the next major release - OMPI v5.0 via prrte.

@awlauria awlauria removed their assignment Jan 13, 2020
@jsquyres
Copy link
Member

I confirm: this is fixed on Open MPI master / what will eventually become v5.0.

I'm kinda guessing that this is not going to be fixed in prior releases, mainly due to lack of resources (i.e., no one has submitted a fix in 20+ months).

franzpoeschel added a commit to franzpoeschel/openPMD-api that referenced this issue Dec 7, 2023
The bug sounds similar to this one
open-mpi/ompi#6372, though that is supposedly
fixed in Open MPI 5..

This creates a tmp script to call the launched application instead of
calling it directly on the command line. This way, mpirun does not see
the command line arguments and cannot try to wrongly parse them.
franzpoeschel added a commit to openPMD/openPMD-api that referenced this issue Dec 7, 2023
* Use mpirun wrapper to circumvent parser bug in mpirun

The bug sounds similar to this one
open-mpi/ompi#6372, though that is supposedly
fixed in Open MPI 5..

This creates a tmp script to call the launched application instead of
calling it directly on the command line. This way, mpirun does not see
the command line arguments and cannot try to wrongly parse them.

* Add mechanism to get rid of the workaround again in future
@loganharbour
Copy link

For those that have also scrambled across this like myself, it appears this is still not fully resolved:

[harblh@br006: ~ ]
$ mpiexec hostname
br006
br006
br010
br010
[harblh@br006: ~ ]
$ mpiexec hostname --help
mpiexec (Open MPI) 5.0.5

Usage: mpiexec [OPTION]...

See the mpirun(1) man page or HTML help for a detailed list of command
line options that are available.

Report bugs to https://www.open-mpi.org/community/help/

In the second case, --help is being passed as an argument to mpiexec

@rhc54
Copy link
Contributor

rhc54 commented Sep 11, 2024

It is (and has been for some time) fixed on the main branch, but there is a missing cherry-pick into the release branch. Have that in-process now.

@loganharbour
Copy link

It is (and has been for some time) fixed on the main branch, but there is a missing cherry-pick into the release branch. Have that in-process now.

Great. Thanks for addressing this quickly!

@everythingfunctional
Copy link

I also just encountered this.

@rhc54
Copy link
Contributor

rhc54 commented Oct 9, 2024

Ok....but as stated, it has been fixed and just awaits another release.

@loganharbour
Copy link

To be clear - the fix that @rhc54 was referencing did work for me. Just hasn't made it into a release.

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

No branches or pull requests

7 participants