Skip to content

Assertion failure when running the examples with MPI #38

Open
@wh5a

Description

@wh5a

Describe the bug
With 2-qubit gates, the buffer passed to the Loop_DN function may not be aligned and causes assertion failure.

To Reproduce
Steps to reproduce the behavior:

  1. Build the project with MPI
  2. Run the example with 2 processes:
    mpirun -np 2 /opt/intel-qs/examples/bin/grover_4qubit.exe
  3. We get assetion failures:

grover_4qubit.exe: /root/intel-qs/src/highperfkernels.cpp:299: void Loop_DN(unsigned long, unsigned long, unsigned long, Type *, Type *, unsigned long, unsigned long, const qhipster::TinyMatrix<Type, 2U, 2U, 32U> &, bool, Timer *) [with Type = std::complex]: Assertion (UL(state1) % 256) == 0' failed. grover_4qubit.exe: /root/intel-qs/src/highperfkernels.cpp:298: void Loop_DN(unsigned long, unsigned long, unsigned long, Type *, Type *, unsigned long, unsigned long, const qhipster::TinyMatrix<Type, 2U, 2U, 32U> &, bool, Timer *) [with Type = std::complex<double>]: Assertion (UL(state0) % 256) == 0' failed.

Additional context
Another example also has this behavior:
mpirun -np 2 /opt/intel-qs/examples/bin/test_of_custom_gates.exe 4

It seems single-qubit gates are fine and only two-qubit gates have this problem. In particular, the problem appeared in psig.ApplyCPhaseRotation() in the grover_4qubit example. I did some debugging and found the pointer was pointed to offset 0x80. I'm not sure if this is a real bug, or just the way I'm running it is wrong.

When I run with 4 processes, the pointer points to offset 0x40. When I run with 8 processes, the problem disappears again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions