The issue with the new line is that it instantiates the Gurobi model on the master process and copies that model to the other processes. You need to create different Gurobi models on different processes.
One option is
addprocs(2)
@everywhere using JuMP, Gurobi
@everywhere const env = Gurobi.Env()
@everywhere function upperbound_mip2(i)
m = Model(solver=GurobiSolver(env, OutputFlag=0))
@variable(m, 0 <= x[i=1:100] <= i)
@objective(m, Max, x[i])
solve(m)
getobjectivevalue(m)
end
pmap(upperbound_mip2, 1:100)
another option is
addprocs(2)
@everywhere using JuMP, Gurobi
@everywhere const env = Gurobi.Env()
@everywhere const m = Model(solver=GurobiSolver(env, OutputFlag=0))
@everywhere @variable(m, 0 <= x[i=1:100] <= i)
@everywhere function upperbound_mip2(i)
@objective(m, Max, x[i])
solve(m)
getobjectivevalue(m)
end
pmap(upperbound_mip2, 1:100)