This happens, for example, when calling MPI simulator's get_probabilities() which does self._comm.allgather(result.copy_to_host()). If the vector is too large (e.g. 32 qubits), the following is raised:
File "mpi4py/MPI/Comm.pyx", line 1595, in mpi4py.MPI.Comm.allgather
File "mpi4py/MPI/msgpickle.pxi", line 862, in mpi4py.MPI.PyMPI_allgather
File "mpi4py/MPI/msgpickle.pxi", line 147, in mpi4py.MPI.pickle_dump
File "mpi4py/MPI/msgbuffer.pxi", line 50, in mpi4py.MPI.downcast
OverflowError: integer 34359738509 does not fit in 'int'
which is due to a legacy issue of mpi4py/pickle (see https://github.com/mpi4py/mpi4py/issues/119) that is solved by mpi4py.util.pkl5. It seems the switch to pkl5 can be realized by simply changing the current self._comm = MPI.COMM_WORLD to pkl5.Intracomm(MPI.COMM_WORLD).
This happens, for example, when calling MPI simulator's
get_probabilities()
which doesself._comm.allgather(result.copy_to_host())
. If the vector is too large (e.g. 32 qubits), the following is raised:which is due to a legacy issue of mpi4py/pickle (see https://github.com/mpi4py/mpi4py/issues/119) that is solved by
mpi4py.util.pkl5
. It seems the switch topkl5
can be realized by simply changing the currentself._comm = MPI.COMM_WORLD
topkl5.Intracomm(MPI.COMM_WORLD)
.