Skip to content

Checking that MPI is installed before running QBC.#79

Open
mghibaudi wants to merge 3 commits into
mainfrom
mpi-check
Open

Checking that MPI is installed before running QBC.#79
mghibaudi wants to merge 3 commits into
mainfrom
mpi-check

Conversation

@mghibaudi

Copy link
Copy Markdown
Contributor

Closes #78.

Rationale:

  • The QBC application requires (and demonstrates) MPI usage. If users want to include it in the execution they need to install the MPI libraries for example via pip install QStone[mpi]

This PR raises an exception if users try to run QBC apps without MPI.

@mghibaudi mghibaudi self-assigned this Nov 3, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds MPI detection capability to the MPIHandler class and enforces MPI requirement for the QBC application. The changes introduce an isMPI() method that returns True for the real MPI implementation and False for the no-MPI mock implementation, and adds a check in QBC's initialization to ensure MPI support is available.

Key Changes

  • Added isMPI() method to both MPI handler implementations to distinguish between real and mock MPI support
  • Added MPI availability check in QBC application initialization that raises an ImportError when MPI is not available

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
qstone/multiprocessing/nompi.py Adds isMPI() method returning False to indicate no MPI support
qstone/multiprocessing/mpi.py Adds isMPI() method returning True to indicate real MPI support
qstone/apps/QBC.py Adds MPI availability check in __init__ that raises error when MPI is unavailable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread qstone/multiprocessing/nompi.py
Comment thread qstone/multiprocessing/mpi.py
mghibaudi and others added 2 commits November 3, 2025 21:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

issues with running QBC

2 participants