SOLVERSTUDIO- AMPL-CPLEX ran out of memory.

638 views
Skip to first unread message

Fabio M

unread,
Aug 12, 2014, 10:27:59 AM8/12/14
to am...@googlegroups.com
Hi everyone, 
I'm solving a large data MIP written in AMPL but using SolverStudio to set data from Excel. If I try to solve istances of the same problem increasing the set of a variable, after about 30 min of processing the model output write this message:
_________________________________________
There may be further error information in the clone logs.
IBM ILOG CPLEX Optimization Studio Commercial Edition                        ÿ
ran out of memory.
0 MIP simplex iterations
0 branch-and-bound nodes
No basis.
_________________________________________

I think that I need to set nodefile to 3 to overcome this problem but I do not understand how to use the command. Could someone help me to find a solution?

victor.z...@gmail.com

unread,
Aug 12, 2014, 12:12:09 PM8/12/14
to am...@googlegroups.com
You can set nodefile by adding an option command to your AMPL code:

  option cplex_options 'nodefile=3';

HTH,
Victor


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.

Fabio M

unread,
Aug 12, 2014, 12:26:02 PM8/12/14
to am...@googlegroups.com
Thank you Victor,
after a big week of work, I've wrongly used:  option cplex options 'nodefile=3' without underscore.

Unfortunately after another test with the correct option seems that nothing changes: 'run out of memory' message with big istances appears.
I've add the log file as txt file for more info about the problem

Thanks a lot
log error test1.txt

victor.z...@gmail.com

unread,
Aug 12, 2014, 12:34:52 PM8/12/14
to am...@googlegroups.com
The log doesn't contain the line

  CPLEX 12.6.0.0: nodefile=3

which means that the option was not applied. Make sure that you specify the option command before the solve command. Unfortunately I don't have access to Solver Studio, but looking at http://solverstudio.org/languages/ampl/, I think you can do this as follows:

  data SheetData.dat;
  option solver cplex;
  option cplex_options 'nodefile=3';
  solve;

HTH,
Victor

Fabio M

unread,
Aug 12, 2014, 1:44:17 PM8/12/14
to am...@googlegroups.com
Thank Victor for helping.

I think that the correct command is:
option solver cplex;
option cplex_options 'nodefile=3 logfile laz mipdisplay 2 mipinterval 1000';
solve;

In the previous test I've used "option cplex_options" for each one of those options.
Seems that now the log file correctly write all the options, but still does not work.

log error test2.txt

Robert Fourer

unread,
Aug 14, 2014, 3:17:05 PM8/14/14
to am...@googlegroups.com
You are right, it is necessary to specify one cplex_options string with all of the options in it. If now you see

CPLEX 12.6.0.0: nodefile 3

and you are still running out of memory, then please post the complete CPLEX output again.

Bob Fourer
am...@googlegroups.com

=======

Fabio M

unread,
Aug 19, 2014, 1:21:17 AM8/19/14
to am...@googlegroups.com
Now it's completely fixed, thank you Victor and Bob. 

miguel.r...@pucp.pe

unread,
Nov 12, 2019, 7:49:25 AM11/12/19
to AMPL Modeling Language
Hi Guys

I have a similar problem i code the following in my file . run:


reset;
model Bike.mod;
data Bike.dat;
option solver cPlex;
option cplex_options 'nodefile=3 mipdisplay=2 mipinterval=100 lpdisplay=1 bardisplay=1 treememlim=4000';
solve;
display x > variable.out;
display y > variable2.out;

My computer have more than 4 gb, aprox 8 gb . but i have the attached file with the wrong for running out of memory.
log error

AMPL Google Group

unread,
Nov 12, 2019, 8:31:39 PM11/12/19
to AMPL Modeling Language
You do have a large problem (about 5 million variables and constraints) and there is no doubt that CPLEX ran out of memory after presolving but before the main tree-search could begin. Here are some recommended troubleshooting steps:
  • To be sure that CPLEX was able to use all memory on your computer, give the AMPL command

    shell "cplex -v";

    and look for "64-bit" in the resulting message. (If you see "32-bit" then you need to download the 64-bit version instead.)
  • Add threads=1 to your cplex_options string. Currently CPLEX is trying to run with 12 threads, which uses extra memory. (If CPLEX can solve successfully with 1 thread, then possibly it will solve faster and still fit in memory with a few more threads.)
  • Make some trial versions of your problem that are smaller but still non-trivial. Usually this can be done by reducing the data in some reasonable way. By looking at the logs from the trial versions, you can get an idea of CPLEX's memory needs for your application, and then you can extrapolate to the larger version that you really want to solve.


--
Robert Fourer
am...@googlegroups.com
{#HS:1004520277-60184#}

Miguel Angel Rodríguez Anticona

unread,
Nov 17, 2019, 10:23:59 PM11/17/19
to am...@googlegroups.com
Hello Bob

Would you explain me please what is the logic about the command threads please?

Best and regrats
Miguel Rodríguez

--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/ppf2tp2VDDs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-1004520277-2834589014-1573608693-1594298177%40helpscout.net.

AMPL Google Group

unread,
Nov 18, 2019, 12:23:26 PM11/18/19
to AMPL Modeling Language
Some solvers, such as CPLEX, can try to speed their computations by running certain operations in parallel. They do this by running one or two parallel threads on each of the computer's processor cores. CPLEX's threads option tells it the maximum number of parallel threads to use.

Typically, you want CPLEX to use as many parallel threads as it can, which is what it does by default. However, each thread requires additional memory, so sometimes you want to try threads=1 to run in less memory, just to see if the problem will fit. If it does fit, you can then try threads=2, threads=3, etc. to see how many threads you can use without running out of memory. (For some problems, there isn't much speedup from adding more than a few threads anyway, though the only way to tell this is to experiment with the threads setting.)


--
Robert Fourer
am...@googlegroups.com
{#HS:1004520277-60184#}
On Mon, Nov 18, 2019 at 3:24 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Hello Bob

Would you explain me please what is the logic about the command threads please?

Best and regrats
Miguel Rodríguez

El mar., 12 nov. 2019 a las 20:31, AMPL Google Group (<am...@googlegroups.com>) escribió:

On Wed, Nov 13, 2019 at 1:31 AM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
You do have a large problem (about 5 million variables and constraints) and there is no doubt that CPLEX ran out of memory after presolving but before the main tree-search could begin. Here are some recommended troubleshooting steps:
  • To be sure that CPLEX was able to use all memory on your computer, give the AMPL command

    shell "cplex -v";

    and look for "64-bit" in the resulting message. (If you see "32-bit" then you need to download the 64-bit version instead.)
  • Add threads=1 to your cplex_options string. Currently CPLEX is trying to run with 12 threads, which uses extra memory. (If CPLEX can solve successfully with 1 thread, then possibly it will solve faster and still fit in memory with a few more threads.)
  • Make some trial versions of your problem that are smaller but still non-trivial. Usually this can be done by reducing the data in some reasonable way. By looking at the logs from the trial versions, you can get an idea of CPLEX's memory needs for your application, and then you can extrapolate to the larger version that you really want to solve.


--
Robert Fourer
am...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages