Julia 0.6 pmap function

I want to paralelize a decomposition algorithm for optimization named Progressive Hedging. This optimization is stored on a function named PH which recieve arguments for the model, some arguments are matrix but PH needs just a vector from that matrix in this way.

for s = 1:nS
    res = PH(k,s,data,Lines,Ag,Gx,Pmax[:,s],Prmax[:,s],COpe[:,s])
    push!(data,res)
end

So PH needs just a vector from Pmax, Prmax and COpe.

To paralelize I try to do this.

 pmap(s -> PH(k,s,data,Lines,Ag,Gx,Pmax[:,s],Prmax[:,s],COpe[:,]),1:nS)

But I get this:

The applicable method may be too new: running in world age 21846, while current world is 21965.

I'm using Julia 0.6 maybe the way i'm programming is from a older version.

Any idea?

Upvotes: 1

Views: 233

Answers (1)

PRobbe
PRobbe

Reputation: 1

I recently had a similar issue with pmap() in 0.6. Try to assign the argument f in pmap(f,c...) to a concrete function, i.e.,

createPH(s) = PH(k,s,data,Lines,Ag,Gx,Pmax[:,s],Prmax[:,s],COpe[:,])
pmap(createPH,1:nS)

This fixed the issue for me. (Also note that in 0.6.0 a warning is generated, and not a world age error)

Upvotes: 0

Related Questions