Making a collection of JuMP models using pmap

This appears to be a bug in OrderedCollections.

@everywhere begin
    using OrderedCollections
    struct Foo
        x::Vector{Int}
    end
    function foo(i)    
        x = Foo(Int[])
        return x, OrderedDict(x => 2)
    end
end

function bar()
    x, y = pmap(foo, 1:1)[1]
    z = copy(y)
    OrderedCollections.rehash!(z)
    return haskey(y, x), haskey(z, x)
end
a, b = bar()  # false, true ?!?

Issue: https://github.com/JuliaCollections/OrderedCollections.jl/issues/9

As a work-around for your issue, you need to call rehash! on models[1].ext[:expr].terms