-
Notifications
You must be signed in to change notification settings - Fork 166
Description
Spun out from discussion on #699. When running on more than one process the rightapplyCompMatr validation tests fail as no exception is thrown in the "target amps fit in node" test, as below. (I've slightly expanded the CAPTURE in the below output!)
mpirun -n 2 ./tests/tests rightapplyCompMatr
QuEST execution environment:
precision: 2
multithreaded: 1
distributed: 1
GPU-accelerated: 0
GPU-sharing ok: 0
cuQuantum: 0
num nodes: 2
Testing configuration:
test all deployments: 0
num qubits in qureg: 6
max num qubit perms: 10
max num superop targs: 4
num mixed-deploy reps: 10
Tested Qureg deployments:
CPU + OMP + MPI
Filters: "rightapplyCompMatr"
Randomness seeded to: 4228350052
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests is a Catch2 v3.8.0 host application.
Run with -? for options
-------------------------------------------------------------------------------
rightapplyCompMatr
validation
targeted amps fit in node
-------------------------------------------------------------------------------
/home/otbrown/quantum/QuEST/tests/unit/operations.cpp:1043
...............................................................................
/home/otbrown/quantum/QuEST/tests/unit/operations.cpp:1085: FAILED:
REQUIRE_THROWS_WITH( apiFunc(), ContainsSubstring("cannot simultaneously store") && ContainsSubstring("remote amplitudes") )
because no exception was thrown where one was expected:
minNumCtrls := 0
numNewTargs := 6
numQubits - minNumCtrls := 6
ctrls := { }
targs := { 0, 1, 2, 3, 4, 5 }
matr.numQubits := 6
qureg.numQubits := 6
qureg.logNumAmpsPerNode := 11
===============================================================================
test cases: 1 | 0 passed | 1 failed
assertions: 61 | 60 passed | 1 failed
--------------------------------------------------------------------------
Primary job terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:
Process name: [[50347,1],0]
Exit code: 42
--------------------------------------------------------------------------I assume this test is attempting to trigger an exception from validate_mixedAmpsFitInNode. The problem is that asserts that qureg.numAmpsPerNode >= numTargAmps, and it always will be here, as qureg.numAmpsPerNode accounts for the fact that the qureg is a density matrix, while numTargAmps is calculated as 2^numTargets.
I would have said then that this just needed a slight change in the logic to account for density matrices, except there's a comment directly above it which says that isn't necessary so I'm throwing it back to you @TysonRayJones 😅