Solver-specific callback for custom termination rule for LP Barrier using Gurobi and JuMP

There’s a hack:

# Hack variable values out
for p in P
    for m in M
        col = unsafe_backend(model).variable_info[x[p, m].index].column
        colc = Cint(col - 1)
        ret = GRBgetdblattrelement(unsafe_backend(model), "X", colc, valuePdouble)
        println("x = $(x[p,m]) has value $(valuePdouble[])")
    end
end

But perhaps someone more knowledgeable can suggest a nicer way.