Parallelization on a cluster

29 views
Skip to first unread message

Alex Jacoby

unread,
Jul 5, 2019, 4:37:15 PM7/5/19
to sage-support
Hello,

I am working on a project with some significant computation of following form (let's assume two cpus for simplicity):

let x be a list of mathematical objects and let + be a commutative binary operation on x's elements

def f(x):

    result = x[0]

    for i in range(1,len(x))

        result = result + x[i]

    return(result)


We want to break x up so that this function acts on a subset of elements in x, and these subsets are tackled on different CPU's on a cluster. Then we need to take y= [result_{cpu1},result{cpu2}] and  f(y). I've browsed some documentation on this, and I'm having trouble making sense of the parallel decorator, getting it to acknowledge more than one CPU (there seems to be some ambiguity between setting using @parallel('ncpus' = #) or using SAGE_NUM_THREADS ?), and I can't tell whether we need to use MPI4PY here or whether SAGE already has everything we need. Any help would be very much appreciated.


Best,

Alex


Reply all
Reply to author
Forward
0 new messages