Cython: prange is repeating not parallelizing
问题 I have the following simple Cython function for a parallel reduction: # cython: boundscheck = False # cython: initializedcheck = False # cython: wraparound = False # cython: cdivision = True # cython: language_level = 3 from cython.parallel import parallel, prange cpdef double simple_reduction(int n, int num_threads): cdef int i cdef int sum = 0 for i in prange(n, nogil=True, num_threads=num_threads): sum += 1 return sum Which horrifyingly returns the following: In [3]: simple_reduction(n=10,