diff --git a/qpms/qpms_c.pyx b/qpms/qpms_c.pyx index ea4d433..c2437ad 100644 --- a/qpms/qpms_c.pyx +++ b/qpms/qpms_c.pyx @@ -959,8 +959,8 @@ cdef class ScatteringSystem: cdef ccart3_t res cdef cart3_t pos cdef Py_ssize_t i - with nogil, parallel(), boundscheck(False), wraparound(False): - for i in prange(evalpos_a.shape[0]): + with nogil: + for i in range(evalpos_a.shape[0]): pos.x = evalpos_a[i,0] pos.y = evalpos_a[i,1] pos.z = evalpos_a[i,2] @@ -1000,6 +1000,7 @@ def empty_lattice_modes_xy(EpsMu epsmu, reciprocal_basis, wavevector, double max free(omegas_c) return omegas + cdef class _ScatteringSystemAtOmegaK: ''' Wrapper over the C qpms_scatsys_at_omega_k_t structure @@ -1045,8 +1046,8 @@ cdef class _ScatteringSystemAtOmegaK: cdef ccart3_t res cdef cart3_t pos cdef Py_ssize_t i - with nogil, wraparound(False), parallel(): - for i in prange(evalpos_a.shape[0]): + with nogil: + for i in range(evalpos_a.shape[0]): pos.x = evalpos_a[i,0] pos.y = evalpos_a[i,1] pos.z = evalpos_a[i,2] @@ -1089,9 +1090,9 @@ cdef class _ScatteringSystemAtOmegaK: cdef ccart3_t *res cdef cart3_t pos cdef Py_ssize_t i, j - with nogil, wraparound(False), parallel(): + with nogil: res = malloc(fecv_size*sizeof(ccart3_t)) - for i in prange(evalpos_a.shape[0]): + for i in range(evalpos_a.shape[0]): pos.x = evalpos_a[i,0] pos.y = evalpos_a[i,1] pos.z = evalpos_a[i,2] @@ -1259,18 +1260,17 @@ cdef class _ScatteringSystemAtOmega: cdef ccart3_t res cdef cart3_t pos cdef Py_ssize_t i - with wraparound(False), nogil, parallel(): - for i in prange(evalpos_a.shape[0]): - pos.x = evalpos_a[i,0] - pos.y = evalpos_a[i,1] - pos.z = evalpos_a[i,2] - if alt: - res = qpms_scatsysw_scattered_E__alt(self.ssw, btyp_c, &scv_view[0], pos) - else: - res = qpms_scatsysw_scattered_E(self.ssw, btyp_c, &scv_view[0], pos) - results[i,0] = res.x - results[i,1] = res.y - results[i,2] = res.z + for i in range(evalpos_a.shape[0]): + pos.x = evalpos_a[i,0] + pos.y = evalpos_a[i,1] + pos.z = evalpos_a[i,2] + if alt: + res = qpms_scatsysw_scattered_E__alt(self.ssw, btyp_c, &scv_view[0], pos) + else: + res = qpms_scatsysw_scattered_E(self.ssw, btyp_c, &scv_view[0], pos) + results[i,0] = res.x + results[i,1] = res.y + results[i,2] = res.z return results.reshape(evalpos.shape) @boundscheck(False) @@ -1316,9 +1316,9 @@ cdef class _ScatteringSystemAtOmega: cdef ccart3_t *res cdef cart3_t pos cdef Py_ssize_t i, j - with nogil, wraparound(False), parallel(): + with nogil: res = malloc(basissize*sizeof(ccart3_t)) # thread-local - for i in prange(evalpos_a.shape[0]): + for i in range(evalpos_a.shape[0]): pos.x = evalpos_a[i,0] pos.y = evalpos_a[i,1] pos.z = evalpos_a[i,2] diff --git a/setup.py b/setup.py index 3fb7b3b..5cc2fb3 100755 --- a/setup.py +++ b/setup.py @@ -150,7 +150,7 @@ qpms_c = Extension('qpms.qpms_c', sources = ['qpms/qpms_c.pyx',], libraries = common_libs, include_dirs=['amos', 'qpms', numpy_includes], - extra_link_args=['-fopenmp'], + extra_link_args=['-fopenmp'], # needed? extra_compile_args=['-fopenmp'], )