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

How to show the version of OpenMPI from "mpifort" etc. #13169

Closed
cponder opened this issue Mar 28, 2025 · 10 comments
Closed

How to show the version of OpenMPI from "mpifort" etc. #13169

cponder opened this issue Mar 28, 2025 · 10 comments

Comments

@cponder
Copy link

cponder commented Mar 28, 2025

I built OpenMPI 5.0.7 using the NVHPC 25;1 compilers.
When I run these commands

--> mpifort -V
nvfortran 25.1-0 64-bit target on x86-64 Linux -tp sapphirerapids 
NVIDIA Compilers and Tools
Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES.  All rights reserved.
cponder@viking-prod-297: /usr/local/bin/mpifort -version
nvfortran-Warning-Unknown switch: -version
nvfortran-Warning-No files to process

--> mpifort --version
nvfortran 25.1-0 64-bit target on x86-64 Linux -tp sapphirerapids 
NVIDIA Compilers and Tools
Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES.  All rights reserved.

--> mpifort -dumpfullversion
25.1

they just show me the version of the underlying NVHPC compiler. though

mpirun --version
mpirun (Open MPI) 5.0.7

does give the right answer.

@cponder
Copy link
Author

cponder commented Mar 28, 2025

I hadn't considers this a problem back when I was building Modules, since my path to the executables would include the "5.0.1" as one of the directory-levels, so there was no question.
This comes up when I build containers, though, since I load everything into /usr/local/*. I want to make sure that somehow there wasn't a (for example) MPICH build thrown on top of it.

@ggouaillardet
Copy link
Contributor

ggouaillardet commented Mar 28, 2025

[EDIT]]
mpifort --showme:version does the trick.

(mpirun does not support the --showme:version as pointed by @rhc54)

@rhc54
Copy link
Contributor

rhc54 commented Mar 28, 2025

mpirun --showme:version does the trick.

Errr...no, that option isn't recognized. Just mpirun --version is what we support.

@ggouaillardet
Copy link
Contributor

ggouaillardet commented Mar 28, 2025

I beg to differ, this is done in the opal wrapper at

} else if (0 == strncmp(user_argv[i], "-showme:version", strlen("-showme:version"))
|| 0
== strncmp(user_argv[i], "--showme:version",
strlen("--showme:version"))) {
char *str;
str = opal_show_help_string("help-opal-wrapper.txt", "version", false, base_argv0,
options_data[user_data_idx].project,
options_data[user_data_idx].version,
options_data[user_data_idx].language, NULL);

~/local/ompi-master/bin/mpifort --showme:version
mpifort: Open MPI 5.1.0a1 (Language: Fortran)

@rhc54
Copy link
Contributor

rhc54 commented Mar 28, 2025

You said mpirun, not mpifort 😄 . I agree that the wrapper compilers would behave that way.

@ggouaillardet
Copy link
Contributor

Oh i see, my bad!

Thanks for pointing out.

@cponder
Copy link
Author

cponder commented Mar 28, 2025

Ok this gives me what I need:

--> mpifort --showme:version
mpifort: Open MPI 5.0.7 (Language: Fortran)

--> mpirun -V
mpirun (Open MPI) 5.0.7

One thing I gotta say, though: the --showme doesn't show up when I use either of these:

mpifort --help
mpicxx --help

@cponder cponder closed this as completed Mar 28, 2025
@ggouaillardet
Copy link
Contributor

@cponder well, the right syntax is

$ mpifort --showme:help
mpifort [-showme[:<command,compile,link,incdirs,
              libdirs,libs,version,help>]] args

  -showme:command    Show command used to invoke real compiler
  -showme:compile    Show flags added when compiling
  -showme:link       Show flags added when linking
  -showme:incdirs    Show list of include dirs added when compiling
  -showme:libdirs    Show list of library dirs added when linking
  -showme:libs       Show list of libraries added when linking
  -showme:version    Show version of Open MPI
  -showme:help       This help message

@cponder
Copy link
Author

cponder commented Mar 28, 2025

I'd kinda expect

mpifort --help

to at least mention that there's a --showme option, which it doesn't. This goes against all Linux/GNU/etc. conventions, which is what brought me to post this in the first place....

@ggouaillardet
Copy link
Contributor

mpifort serves as a wrapper, meaning that just as the --version flag is forwarded to the Fortran compiler, the --help flag is similarly passed along to it. If you believe this is an issue worth addressing and can gather enough support, feel free to open another issue.

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

3 participants