[Coin-discuss] OpenMP using OsiCbc
Yang Yuan
yyuan at email.arizona.edu
Wed Jan 24 01:43:49 EST 2007
Hi everyone,
I hope it is the right mailing list to post to. I am using OpenMP to build up a
shared-memory parallization. The necessary COIN library is built up using g++
successfully (not sure whether it needs certain specific setting for
shared-memory use), and my own parallel code is compiled using icc. I've tested
the serial version of the code, and it works fine. However, the parallel version
comes up this seg fault, when I am calling the COINopt function to solve a MIP
(not in the parallel region yet).
...
Allocating memory to TIME struct...
inside COIN optimization function call.
inside COIN optimization function call.
Segmentation fault
The following is part of the COINopt function. I believe it gets stuck at
si->writeMps, which seems impossible.
int COINopt(CoinModel model, bool MIP, bool dualOpt, double *obj_val, double
*cputime, double *primalSolution, double *reducedCost, double *dualSolution,
int beginCol, int endCol, int beginRow, int endRow)
{
int i;
printf ("inside COIN optimization function call.\n");
// Defines a solver interface to call the solver
OsiSolverInterface *si;
si = new OsiCbcSolverInterface();
//si = new OsiFmpSolverInterface();
si->setIntParam(OsiMaxNumIteration, 200000);
si->loadFromCoinModel(model, true); // reads in the model
// Simple consistency check on parameters
if(beginCol<0)
beginCol=0;
if(endCol>si->getNumCols())
endCol=si->getNumCols();
if(beginCol>endCol)
return -1;
if(beginRow<0)
beginRow=0;
if(endRow>si->getNumRows())
endRow=si->getNumRows();
if(beginRow>endRow)
return -1;
if(dualOpt)
si->setHintParam(OsiDoDualInInitial, true);
printf ("inside COIN optimization function call.\n");
si->writeMps("FromOSI");
// Call the solver
if(MIP)
si->branchAndBound();
else
si->initialSolve(); // TODO: DUAL simplex?!?
...
Would you please have a look at this, and give me some suggestions? Really
Appreciated!
Thanks!
yang
More information about the Coin-discuss
mailing list