Hello Guys …
I am tryng to use parallel computing in julia
I have to ideas …one is try to set more processors in julia starting ( i do not know how to do that using ATOM ) .
or set a task to each processor …
for example: i have 3 things to calculate … Qa
, Qb
and Qc
Qa, Qb and Qc is independent … one processor can run Qa , another processor run Qb , and another processor run Qc … is it possible ?? should i use @parallel (+) , or another command, in where ?
function interpQa()
ag = 0.01:0.1:1.51
aσ = 0.07 : 0.05 : 0.4
if PrimeiraVez
mQ = [Q(g,sigma) for g in ag, sigma in aσ]
writedlm("Qa_cobre.dat",mQ)
else
mQ=readdlm("Qa_cobre.dat")
end
# Matriz com os valores de Q na grade
iQ = interpolate(mQ, BSpline(Cubic(Line())), OnGrid()) # Interpola na grade
sQ = scale(iQ, ag, aσ)
(x,y)->sQ[x,y]
end
# Modo de usar:
#Qb = interpQb()
# Depois usamos Qb(g,sigma,α)
function interpQb()
ag = 0.01:0.1:1.51
aσ = 0.07 : 0.05 : 0.4
aα = 0:0.2:3
if PrimeiraVez
mQ = [Qd(g,sigma,α) for g in ag, sigma in aσ, α in aα]
writedlm("Qb_cobre.dat",mQ)
else
mQ=readdlm("Qb_cobre.dat")
end
# Matriz com os valores de Q na grade
iQ = interpolate(mQ, BSpline(Cubic(Line())), OnGrid()) # Interpola na grade
sQ = scale(iQ, ag, aσ, aα)
(x,y,z) -> sQ[x,y,z]
end
# Modo de usar:
#Qc = interpQc()
# Depois usamos Qc(g,sigma)
function interpQc()
ag = 0.01:0.1:1.51
aσ = 0.07 : 0.05 : 0.4
if PrimeiraVez
mQ = [Qi(g,sigma) for g in ag, sigma in aσ]
writedlm("Qc_cobre.dat",mQ)
else
mQ=readdlm("Qc_cobre.dat")
end
# Matriz com os valores de Q na grade
iQ = interpolate(mQ, BSpline(Cubic(Line())), OnGrid()) # Interpola na grade
sQ = scale(iQ, ag, aσ)
(x,y)->sQ[x,y]
end
time0 = time()
println("Gerando a função Qa(g,sigma)")
Qa = interpQa() ## here we calculate Qa
tempod = (time() - time0)/60
println("Tempo decorrido: $tempod min")
time0 = time()
println("Gerando a função Qb(g,α,sigma) ")
Qb = interpQb() ## here we calculate Qb
tempod = (time() - time0)/60
println("Tempo decorrido: $tempod min")
time0 = time()
println("Gerando a função Qc(g,sigma)")
Qc = interpQc() ## here we calculate Qc
tempod = (time() - time0)/60
println("Tempo decorrido: $tempod min")