aiidateam / aiida-testing

A pytest plugin to simplify testing of AiiDA plugins.
MIT License
5 stars 6 forks source link

fix: add option to disable MPI #68

Closed ltalirz closed 1 year ago

ltalirz commented 1 year ago

CalcJob plugins can specify default values for whether codes should use MPI or not: using the metadata.options.withmpi variable.

aiida-testing can run calculations with a single MPI process if an MPI library is installed. However, the MPI library is then also required in order to fetch the results from the test database (because the mock executable will be run with mpirun -np 1 ...).

Here we add an option --mock-disable-mpi that allows users to disable the use of MPI (e.g. in order to run tests on CI in conjunction with --mock-fail-on-missing).

ltalirz commented 1 year ago

Cheers; thanks for the super-quick review, it actually doesn't work yet ;-)

Tests pass locally because I have an mpi library installed. I'll need to monkeypatch slightly differently

greschd commented 1 year ago

I'm guessing the Python 3.7 failure is because the latest AiiDA doesn't support that, so an older version is installed. We should probably also drop support for 3.7 in a separate PR, and rebase on that.

ltalirz commented 1 year ago

Cheers, I believe some of the archive cache fixtures cater to older AiiDA versions, so for the moment I will simply add some conditionals based on the version.

ltalirz commented 1 year ago

Thanks for the quick input @greschd , much appreciated!