plasmo-dev / Plasmo.jl

A Platform for Scalable Modeling and Optimization
Other
150 stars 21 forks source link

paralllelizable linkconstraint #19

Closed sshin23 closed 4 years ago

sshin23 commented 4 years ago

This change should allow parallel link constraint creation. To enable parallel linkconstraint creation, I deleted global linkconstraint counter and made it local to each optiedge. Also, this allows doing @linkconstraint(optiedge,n1[:x]==n2[:x]). The effect is the same as @linkconstraint(graph,n1[:x]==n2[:x]), but we can make sure that the parent graph is not referenced, thus parallel model building is not colliding with each other. Tests in Plasmo.jl are all passed but not sure if the solver interfaces are OK with this change. Let me know what you think :)

jalving commented 4 years ago

All of the changes look good to me. I think localizing link constraint indices to their edges moves the framework in the right direction. The graph can query this information through its edges. There might be some issues now with getting PipsSolver.jl working correctly since each rank expects to know the overall linkconstraint structure, but I should be able to get that working before we tag the next release.