In my code I put something like following. Most time they worked. The job did return at about the set time. But quite often they didn’t. They seem to hang in the server after 8 hours and got killed. And quite often resubmiting the same job would have the expected result. Is there any way we force it to stop?
Each solver has its own time-limit features, so let’s start with Gurobi. First, execute the following AMPL commands (which show the versions of AMPL and Gurobi you are using) and report the output that appears:
option version;
shell "gurobi -v";
Then, run Gurobi again with an extra option that displays a detailed log of the solver’s progress:
The next time that Gurobi hangs, kill it after 30 minutes and report all of the output that appeared.
(Note that these instructions assume you are running AMPL and Gurobi on your computer. If you are using the NEOS Server then the cause of difficulties may be harder to determine.)
On NEOS, you can use outlev=1 for BARON, and mipdisplay=2 for CPLEX.
If you are an instructor or student at an educational institution, and have a computer where you can install optimization software, then you can also consider the Academic Community Edition, which provides free access to AMPL, Gurobi, and CPLEX (and also COPT, MOSEK, and Xpress).
How to check the result after outlev=1 in Neos? I put option baron_options ‘prtime 60 maxtime 600 outlev=1’; when submitting. But still see the same result like:
*************************************************************
NEOS Server Version 6.0
Job# : 1557xxxx
Password : xxxxxxxx
User :
Solver : go:BARON:AMPL
Start : 2025-03-03 18:42:49
End :
Host : prod-sub-1.neos-server.org
Disclaimer:
This information is provided without any express or
implied warranty. In particular, there is no warranty
of any kind concerning the fitness of this
information for any particular purpose.
Announcements:
*************************************************************
Job 1557xxxxx is running.
Up-to-date Results:
Job 1557xxxxx dispatched
password: xxxxx
---------- Begin Solver Output -----------
Condor submit: 'neos.submit'
Condor submit: 'watchdog.submit'
Job submitted to NEOS HTCondor pool.
I also tried it locally and it returned after 10 minutes. When I increase the timeout with option baron_options 'prtime 60 maxtime 6000 outlev=1';
the output is
For information on limitations that apply to long NEOS Server jobs, see “How long can my problem run using NEOS?” in the NEOS Server FAQ.
For your local BARON run, are you saying that after this line,
46+ 1086.73 108MB -9.10950 -3.82916 10.11%
there is no more output from BARON, even though the process continues to run and to use CPU time? That suggests something is wrong in BARON. The first thing to do is to check the version that you are using. Execute this AMPL command (on the local computer),
shell "baron -v";
then copy all of the message that appears, and paste it into your reply.
Also you should try leaving out the prtime option, to see whether that is affecting the output in some unexpected way.
ampl: shell "baron -v";
BARON 24.5.8 (2024.05.08) (Windows AMD64), driver(20241227), liccheck(20211124), ASL(20241202)
Licensed to AMPL Community Edition License for <xxxx@xxxxxx>.
Temporary license expires 20260302.
Using license file "D:\Program Files\AMPL\ampl.lic".
and here is what was shown after I pressed ctrl-c:
46+ 1086.73 108MB -9.10950 -3.82916 10.11%
*** Search interrupted by user ***
Wall clock time: 49234.25
Total CPU time used: 48915.88
Total no. of BaR iterations: 58
Best solution found at node: 6
Max. no. of nodes in memory: 27
All done
===========================================================================
BARON: Cntrl-C Abort
: Interrupted by Control-C
Retaining scratch directory "F:\temp\jerron\baron_tmp4604".
Could not find "".
Could not find "".
Could not find "".
Could not find "".
Could not find "".
Could not find "".
Could not find "".
Could not find "".
Could not find "".
BARON 24.5.8 (2024.05.08): 58 iterations, interrupted (Control-C).
Objective -9.109499409
ampl:
Here is a job’s output after it was terminated after running 8 hours in Neos. As we can see, the job was supposed to terminate in around 10 minutes. But it seemed to stop progressing after about 8 minutes.
*************************************************************
NEOS Server Version 6.0
Job# : 1559xxxx
Password : xxxxxx
User :
Solver : go:BARON:AMPL
Start : 2025-03-06 13:35:52
End : 2025-03-06 21:38:06
Host : prod-sub-1.neos-server.org
Disclaimer:
This information is provided without any express or
implied warranty. In particular, there is no warranty
of any kind concerning the fitness of this
information for any particular purpose.
Announcements:
*************************************************************
You are using the solver baron.
Checking ampl.mod for baron_options...
Checking ampl.com for baron_options...
Executing AMPL.
processing data.
processing commands.
Executing on prod-exec-7.neos-server.org
Presolve eliminates 247 constraints and 2 variables.
Substitution eliminates 888 variables.
Adjusted problem:
681 variables:
679 nonlinear variables
2 linear variables
1285 constraints; 56614 nonzeros
570 nonlinear constraints
715 linear constraints
132 equality constraints
1153 inequality constraints
1 nonlinear objective; 550 nonzeros.
BARON 24.5.8 (2024.05.08): threads=4
outlev=1
prtime 60
maxtime 600
outlev=1
===========================================================================
BARON version 24.5.8. Built: LNX-64 Wed May 8 10:06:40 EDT 2024
Running on machine prod-exec-7.neos-server.org
BARON is a product of The Optimization Firm.
For information on BARON, see https://minlp.com/about-baron
If you publish work using this software, please cite publications from
https://minlp.com/baron-publications, such as:
Khajavirad, A. and N. V. Sahinidis,
A hybrid LP/NLP paradigm for global optimization relaxations,
Mathematical Programming Computation, 10, 383-421, 2018.
===========================================================================
This BARON run may utilize the following subsolver(s)
For LP/MIP/QP: CLP/CBC
For NLP: IPOPT, FILTERSQP
===========================================================================
Doing local search
Solving bounding LP
Starting multi-start local search
Done with local search
===========================================================================
Iteration Open nodes Time (s) Lower bound Upper bound
1 1 62.15 -0.100000E+52 -1.65965
3+ 2 122.16 -0.100000E+52 -1.65965
4+ 3 182.16 -0.100000E+52 -1.65965
5+ 3 242.17 -0.100000E+52 -1.65965
5+ 3 366.88 -0.100000E+52 -1.65965
6+ 4 426.88 -0.100000E+52 -1.65965
ERROR: Your job was terminated because it exceeded the maximum allotted time for a job.
Please refer to the NEOS Server FAQ (https://neos-guide.org/content/FAQ) for more information regarding job termination conditions and potential solutions.
The output after ctrl-C indicates that BARON continued running for a long time, but did not find any feasible solution better than the one it reported at iteration 6:
Wall clock time: 49234.25
Total CPU time used: 48915.88
Total no. of BaR iterations: 58
Best solution found at node: 6
Max. no. of nodes in memory: 27
Furthermore, only 58 iterations were accomplished in all that time. This suggests that somehow BARON is getting stuck, but there is no easy way to say why, particularly since the log output stops. We could pursue the possibility of submitting some files that would make it possible to reproduce the problem, but still it might be a while before the problem was fixed.
Do you get better results with Gurobi (using outlev=1)? If it doesn’t reject the problem, it would be helpful to show all of the output, as the Gurobi logs provides much useful information.