-
Notifications
You must be signed in to change notification settings - Fork 87
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
Pytest and MPI import leading to large numbers of error messages #1680
Comments
Okay, after talking to Alex, the situation is that this Lines 111 to 129 in 827d223
but at some point, recently, on Windows, it has started spraying the STDERR messages hundreds of times into STDOUT. The code doesn't halt, so it's not technically a "bug". But that's certainly hideous and unwanted. For now, Alex, I would say "install MPI" is a solution. But, long term, we will need to find a Python way to catch that STDERR message if it exists, and suppress it. |
ARMI has an import statement for
mpi4py
inside of a try statement in thecontext.py
file. See code snippet below. Ifpytest
is run with something that imports ARMI (directly or indirectly) and the user doesn't have ms-mpi installed then pytest outputs a huge wall of windows exception error text. See example below. The try statement functions correctly in that pytest test collection continues fine despite the dump of errors. Anipython
call to the same import statement results in theImportError
that the try statement is handling and doesn't result in the same wall of error messages. Is it possible to suppress the pytest wall of errors by either adding something to the pytest call or by adding something to this line in ARMI? Or is the solution to just shut up and install ms-mpi?Lines of code affected:
armi/armi/context.py
Lines 111 to 129 in 827d223
Example wall of text:
![image](https://private-user-images.githubusercontent.com/103008519/319347817-76fccf1a-8f20-4f7e-9c3a-8df22017c301.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4MTk5NzYsIm5iZiI6MTcyNTgxOTY3NiwicGF0aCI6Ii8xMDMwMDg1MTkvMzE5MzQ3ODE3LTc2ZmNjZjFhLThmMjAtNGY3ZS05YzNhLThkZjIyMDE3YzMwMS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyR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D0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.MAKNMB8Gk3kLNx_gYLFJ8uUsF_11v4KTEdMhqZoApic)
Example ipython import:
![image](https://private-user-images.githubusercontent.com/103008519/319348057-312c3334-3390-4cd0-9e18-44ff138d59e6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4MTk5NzYsIm5iZiI6MTcyNTgxOTY3NiwicGF0aCI6Ii8xMDMwMDg1MTkvMzE5MzQ4MDU3LTMxMmMzMzM0LTMzOTAtNGNkMC05ZTE4LTQ0ZmYxMzhkNTllNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwOFQxODIxMTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01NTcwMGUxZjRlMTY4NGE1ZDkwMDNmN2I2MmE3ODkyYzM3ZjlhOTUxZWE4MTk5NDRkYmI2OWQ0OGEwZDk5NTAzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.3ym8URX-v2ZvxLc-7GRSgRG0jSU9HqhfMWA-qf25Mn4)
The text was updated successfully, but these errors were encountered: