[Coin-discuss] CoinMpsIO::readGMPL ?

Gardner Pomper gardner at networknow.org
Fri Mar 17 18:39:53 EST 2006


Hi,

I am an extreme newbie to COIN, but we have a number of ampl models that we
would like to run on a system where we don't have ampl, and we would like to
use CLP and CBC as solvers. I had found a message on this list about being
able to read in GMPL models, so I reformatted one to the point where this
command line works:

glpsol -m test.mod

The next step, I think, is to load it into a Coin model, so that I can use
COIN solvers. I wrote this tiny test program:

#include "CoinMpsIO.hpp"
int main(int argc, char* argv[])
{
  CoinMpsIO m;
  m.readGMPL("test.mod");
}

I compiled and ran this and it seemed to *almost* load the model correctly;
but then it seg faulted:

[gardner at master1 cma]$ test_gmpl
Reading model section from test.mod...
Reading data section from test.mod...
7706 lines were read
Generating total_cost_mip...
Generating demand_const_1...
Generating relational_const_1...
Generating mcg_const_1...
Model has been successfully generated
Segmentation fault

Here is the stack trace from gdb:

(gdb) where
#0  0xb7f7f007 in CoinMessageHandler::message (this=0x0, messageNumber=1,
    normalMessage=@0xbffff794) at CoinMessageHandler.cpp:440
#1  0xb7f8f328 in CoinMpsIO::readGMPL (this=0xbffff710,
    modelName=0x8060b98 "test.mod", dataName=0x0, keepNames=false)
    at CoinMpsIO.cpp:2711
#2  0x0804938f in main (argc=1, argv=0xbffff844) at test_gmpl.cpp:6

Is this an actual bug, or am I just doing something stupid?

Thanks for any help!

- Gardner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20060317/9d08a2a7/attachment.html>


More information about the Coin-discuss mailing list