Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

System.ArgumentOutOfRangeException when calling Cplex.solve()

  • 1.  System.ArgumentOutOfRangeException when calling Cplex.solve()

    Posted 06/04/09 03:05 PM

    Originally posted by: SystemAdmin


    [Multani said:]

    Hello,

    I am using CPLEX 11.2 with Concert for C#. I have several independent LPs to solve. I do this in parallel (using the MS Parallel Extensions to the .NET Framework). Sometimes, when I call Cplex.Solve(), I get the following exception:


    System.ArgumentOutOfRangeException occurred
      Message="Count cannot be less than zero.\r\nParameter name: count"
      Source="mscorlib"
      ParamName="count"
      StackTrace:
          at System.String.CopyTo(Int32 sourceIndex, Char[] destination, Int32 destinationIndex, Int32 count)
          at System.IO.StreamWriter.Write(String value)
          at ILOG.CPLEX.CplexI.OutChannelFunction.CallIt(Object handle, String message)
          at ILOG.CPLEX.CplexStubs.CPXPmsgfunction0(IntPtr handle, IntPtr message)
          at ILOG.CPLEX.CplexStubs.CPXlpopt(IntPtr env_, IntPtr lp_)
          at ILOG.CPLEX.CplexI.Solve()
          at ILOG.CPLEX.Cplex.Solve()
          at PowerMarket.FundamentalPowerMarketModel.DetermineEmissionAllowancesPrice() in D:\InvestmentModel\PowerMarket\FundamentalPowerMarketModel.cs:line 643
      InnerException:

    I am not sure whether this exception has something to do with the parallel extensions I am using or not. So far, the problem occurred only when I was running the code in parallel, however, I just started to test it with sequential code.

    Any ideas what could be the problem?
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: System.ArgumentOutOfRangeException when calling Cplex.solve()

    Posted 06/05/09 06:09 PM

    Originally posted by: SystemAdmin


    [Multani said:]

    What I forgot to mention: I turned all output off, so I do have no idea why CPLEX calls the IO.StreamWriter.
    #CPLEXOptimizers
    #DecisionOptimization