|
Hi, I posted the following message to stackoverflow some time ago but got no answers. I thought I would ask here, if that's ok. I am trying to re-write in cython a fortran subroutine that uses openmp. I have found no difficulty in re-writing the fortran subroutine itself in cython. The non openmp version works fine. However, I am not sure what to do about the following openmp directive.... !$omp parallel do private(x, y, z) In cython, I understand that you get the openmp parallel do using cython.parallel.prange. However, I don't see how to declare private variables for the loop. In more detail, the fortran/openmp subroutine is subroutine sigmasample(symbol_id, symbol_count, m, stirling, a, N, V, J, K, sigmarows, sigmasum) My cython code for doing the same thing (without parallelism) is def sigmasample(np.ndarray[np.int_t, ndim=1] S, I'd would be very grateful if anyone could provide any information what I can do to parallelize the first loop like I do with the fortran. thank you! -m |
--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
It seems then that c + cython + python makes a better team than fortran + f2py + python in that it seems like you can do more with the former than the latter.
All Fortran compilers have various non-standard ways of interacting with C. A common example is the Cray pointer.
A C long could e.g. be 32 bits on one compiler and 64 bits on another. The C standard just specifies that a long is at least 32 bits. So if we tell Fortran that the kind of an integer is a C long, what does that actually mean?
Thus, the Fortran compiler must know the ABI of the C compiler for the Fortran 2003 ISO C bindings to work. This generally happens when the two compilers come from the same vendor (e.g. gcc and gfortran, icc and ifort).
On Sat, Dec 14, 2013 at 9:50 AM, Sturla Molden <stu...@molden.no> wrote:All Fortran compilers have various non-standard ways of interacting with C. A common example is the Cray pointer.I was referring to iso_c_binding, which I learned about here:the "iso" in the name led me to believe it was a standard.