http://www.gurobi.com/doc/30/refman/node201.html
Additionally, if you are solving all these models within the same process, it is recommended to use the same GRBEnv object, instead of creating a separate GRBEnv object for each model.
The additional advice about the GRBEnv object brought the relieve.
Phil
I have replicated the exact same experiment on a different machine.
- Academic license is still valid
- the solver starts 2800 - 3000 times per hour with different problem
(*.mps) files.
- Unused GRBModel are set to null and System.gc() is properly used.
- A separate GRBEnv object is used for each problem instance and set
to null simultaneously with GRBModel objects
- Java VM Option: -Xmx1024m
And still, after 2 - 3 hours, operation stops and I see these error
messages in the output window of Netbeans:
Optimal solution found (tolerance 1.00e-04)
Best objective 4.8359136968e+02, best bound 4.8354795606e+02, gap 0.0090%
gurobi.GRBException: Unable to write to file 'C://*.sol'
Then java creates another problem instance and tries to call Gurobi
solver another time. Gurobi solver's answer is:
ERROR: No Gurobi license found (user *, host *, *)
What can be the reason that writing a solution file fails suddenly?
Thank you so much and best regards,
Phillip
On Sat, Aug 21, 2010 at 2:16 AM, Greg Glockner <gloc...@gurobi.com> wrote:
Thanks for the quick response.
I double checked:
There is >500 Gig diskspace available.
Less than 3 Gig out of 4 Gig Memory in use at the time of the crash
(64 bit system)
All BufferedReaders are closed.
All BufferedWriters are flushed and closed.
I also call the GLPK package periodically to write MPS files. The
error comes from Gurobi though when Gurobi shall write the *.sol file.
Why does Gurobi come with a "No License" error as a subsequent error
of the "gurobi.GRBException: Unable to write to file" ?
Do I have to synchronize Gurobi with some Java thread?
What other limited resource could I check?
Many thanks!!!
Phillip
This is the code of the method that solves a problem and writes the
solution. After writing the solution, I check whether the solution
file has been created. If no, the very same method is called one more
time with the exact same parameter setting.
This is what happens, when the error occurs:
1. guMo.write() throws exception Error Code:10013
2. solveAndWriteSolutionWithGurobi returns FALSE
3. solveAndWriteSolutionWithGurobi is called one more time
4. guMo.optimize() throws exception Error Code:10009
Why does guMo.optimize() fail to obtain a valid license?
Thank you very much for you help!
Phillip
boolean solveAndWriteSolutionWithGurobi(String
gurobiLogFileOutputPath, String mpsFileInputPath, String
solutionFileOutputPath) {
try {
GRBEnv grbEnv = new GRBEnv(gurobiLogFileOutputPath);
GRBModel guMo = new GRBModel(grbEnv, mpsFileInputPath);
guMo.optimize();
guMo.write(solutionFileOutputPath);
grbEnv = null;
guMo = null;
} catch (GRBException e) {
System.out.println(e.toString());
}
if (checkIfFileExists(solutionFileOutputPath)) {
return true;
} else {
return false;