This sounds good, and it'll likely be the fastest way.
--
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
This would work, but in this case (and using cython) python's
multiprocessing module might be a bit more effort / featureful than
you want. I might suggest just writing a quick C function putting in
an open MP directive, and calling that. If you mark it as static
inline, put it in a C separate header file and include that from
cython, it would be pretty painless.
The advantage is that openmp is trivial to use if you parallelize
loops in C/C++. Just add in "#pragma omp parallel for" in front of
your loop and most of the time you're done.
The disadvantage is that it's possible that your process is memory
bound -- simply summing stuff often is -- in which case parallelizing
it might not help. Also, not every compiler supports openmp (gcc 4.3
and up do, but it's not standard before that), so you might have extra
issues there.
--Hoyt
++++++++++++++++++++++++++++++++++++++++++++++++
+ Hoyt Koepke
+ University of Washington Department of Statistics
+ http://www.stat.washington.edu/~hoytak/
+ hoy...@gmail.com
++++++++++++++++++++++++++++++++++++++++++