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

use mpiexec to run import test in PythonPackage easyblock if usempi is enabled #2001

Closed
wants to merge 2 commits into from

Conversation

lexming
Copy link
Contributor

@lexming lexming commented Mar 24, 2020

Python packages using MPI should run the sanity check command python -c "import module_name" with mpirun to avoid failed initializations of MPI.

Fixes: easybuilders/easybuild-easyconfigs#10213

@lexming lexming requested a review from boegel March 24, 2020 11:38
@lexming
Copy link
Contributor Author

lexming commented Mar 24, 2020

Successfully tested with:

  • h5py-2.10.0-foss-2020a-Python-3.8.2.eb (usempi: True)
  • h5py-2.10.0-intel-2020a-Python-3.8.2.eb (usempi: True)
  • networkx-2.4-foss-2020a-Python-3.8.2.eb (usempi: False)

@akesandgren
Copy link
Contributor

Don't we already have a variable for this that should be used? @boegel ??

@boegel boegel changed the title pythonpackage: prepend mpirun to sanity check use mpiexec to run import test in PythonPackage easyblock if usempi is enabled Mar 24, 2020
@boegel
Copy link
Member

boegel commented Mar 24, 2020

@akesandgren There's self.toolchain.mpi_cmd_for which we use in a couple of easyblocks, but that uses mpirun rather than mpiexec too...

@ocaisa
Copy link
Member

ocaisa commented Mar 24, 2020

At least that is configurable though with mpi_cmd_template (after investigating)

exts_filter = (orig_exts_filter[0].replace('python', self.python_cmd), orig_exts_filter[1])
exts_filter = (exts_filter[0].replace('python', self.python_cmd), exts_filter[1])

if 'exts_filter' not in kwargs:
kwargs.update({'exts_filter': exts_filter})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent is off by one level here

@@ -687,16 +687,18 @@ def sanity_check_step(self, *args, **kwargs):
}

# make sure 'exts_filter' is defined, which is used for sanity check
if self.multi_python:
# when installing for multiple Python versions, we must use 'python', not a full-path 'python' command!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please retain this comment below, so we're not left wondering why replacing 'python' with the full path is not done when using multi-Python

exts_filter = EXTS_FILTER_PYTHON_PACKAGES

if self.toolchain.options.get('usempi', None):
# packages using MPI have to execute the sanity checks with mpirun
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not mpirun, mpiexec

@boegel
Copy link
Member

boegel commented Mar 24, 2020

At least that is configurable though with mpi_cmd_template (after investigating)

Please open an issue in framework with some motivation, maybe we need to replace mpirun with mpiexec in mpi_cmd_for

@akesandgren
Copy link
Contributor

@boegel I though self.toolchain.mpi_cmd_for was configurable from the outside too?

@ocaisa
Copy link
Member

ocaisa commented Mar 24, 2020

Please open an issue in framework with some motivation, maybe we need to replace mpirun with mpiexec in mpi_cmd_for

Sure I can do that but what I meant was that if we used mpi_cmd_for then it is possible to handle funky site specifics with a configuration variable, see https://github.com/easybuilders/easybuild-framework/blob/develop/easybuild/tools/toolchain/mpi.py#L178

True that it is not a very obvious though, name is a a bit off.

@lexming
Copy link
Contributor Author

lexming commented Mar 30, 2020

I got feedback from Intel on the original issue that triggered this change (easybuilders/easybuild-easyconfigs#10213). They acknowledge the issue and it should be fixed at some point.

Therefore, this PR is not the way to go. It should not be necessary to use mpiexec/mpirun to perform simple executions of binaries linked to Intel MPI (or any other MPI implementation). So, the sanity checks in Python packages are correct as they are done now. In the case of the bug at hand with Intel MPI 2019.6, the best solution is to fix affected easyconfigs as in easybuilders/easybuild-easyconfigs#10246 given that it won't be necessary in the future.

In conclusion, I'm closing this PR.

@lexming lexming closed this Mar 30, 2020
@lexming lexming deleted the python-mpi branch April 21, 2020 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IMPI v2019.6: MLX provider in libfabric not working
4 participants