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

Fix parallel dispatch with target argument in transpile() #8952

Merged
merged 6 commits into from
Oct 20, 2022

Commits on Oct 19, 2022

  1. Fix parallel dispatch with target argument in transpile()

    If a custom target was specified when calling the transpile() function
    with more than one circuit the parallel dispatch of the shared custom
    target would fail because the basis_gates created from the target was a
    dict keys type. Pickle is unable to serialize a dict keys object
    apparently and this would cause an exception to be raised. This commit
    fixes this by casting the basis_gates from the target as a list so that
    it can be serialized.
    mtreinish committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    22b255a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    949703c View commit details
    Browse the repository at this point in the history
  3. Fix parallel flag for test

    mtreinish committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    319d31e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cb6ea8d View commit details
    Browse the repository at this point in the history
  5. Fix parallel test setup

    In the previous patches we were attempting to use
    unittest.mock.patch.dict to override the env variable used to control
    parallel execution in qiskit. However, the issue with doing this is that
    the env variable is read at import time and stored in a global variable
    as we don't expect the env variable to change dynamically during the
    execution of a script. To workaround this the mocks are removed and
    instead a setUp() method is added to the test class to override the
    whatever the environment default is and instead hardcode parallel_map to
    run in parallel for the test and then switch it back to the earlier
    value after the test finishes. This lets us dynamically adjust the
    default behavior for parallel execution for this test class.
    mtreinish committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    9d2cfd2 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2022

  1. Configuration menu
    Copy the full SHA
    2d39e77 View commit details
    Browse the repository at this point in the history