Dear all,

I've been trying to find out if it is possible to run some
computations in parallel.  I've seen the documentation of @paralell,
but I *think* it is not what I need.

Here is what I have in mind: I have a function, say, defined
recursively based on the size of the input vector.  Something like:

def f(v):
    l=len(v)
    if l <= 1:
        return 0
    if l == 2:
        # do something...
        # e.g., here is something silly
        return v[0]-v[1]
    if len(v) > 2:
        v1=v[0:(l//2)]
        v2=v[(l//2):l]
        # I'd like to compute the t's below in parallel
        # as they are independent
        t1=f(v1)
        t2=f(v2)
        t3=f([sum(v1),sum(v2)])
        return t1 + t2 + t3

Of course, that computation is non-sense, but I have something just
like (with something else defined for length 2).  I'd like to compute
the t1, t2, and t3 in parallel.  (Note that since this is recursive,
it will call itself many times (depending on the size of the input),
likely more than the number of cores available.)

Any suggestions?

Thanks,

Luis

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

To unsubscribe from this group, send email to 
sage-support+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to