I'm currently trying to get a result out of the process showed below. However, it is taking too long for the number of steps needed. I would like to speed up the result. How can I implement multiprocessing for this situation?
Within the class I am building, I have the following definition
def class_corr(self,Delta,xi_q,Q,counter):
to = self.t
npts = 512
x0 = 12
dx =2*x0/npts
norm=0
classic=0
for n in range(0,npts+1):
qi = -x0+n*dx
for m in range(0,npts+1):
pj = -x0+m*dx
for k in range(0,npts+1):
xi_pk = -x0+k*dx
f1 += dx**3*wt(qi,pj,qo,po,to)*F(qi,xi_pk,Delta, Q)
fn += dx**3*wt(qi,pj,qo,po,to)*G(qi,xi_pk,xi_q,Delta,Q)
if counter:
return [f1, fn/f1]
return fn/f1
Is it even reasonable to use multiprocessing?
So far, I have checked these:
but I haven't been able to implement those nor gotten a solution.