Decision Optimization

Decision Optimization

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

 View Only
  • 1.  CPLEX v123 x86-64 MS VS2010 performance issue

    Posted Fri October 21, 2011 02:17 PM

    Originally posted by: Iannis


    Dear all,

    So far I was using CPLEX v12.2 under Visual Studio 2010 on a 32-bit machine.

    I switched to CPLEX v12.3 with Visual Studio 2010 under Windows 7 Prof (64 bit).

    In both cases I am using Concert technology.

    I followed the regular project creation process described in the instructions. Linking fails under the Win32 Active Solution Platform and generates messages such as:

    1>CAPX01.obj : error LNK2001: unresolved external symbol "public: __thiscall IloNumArray::IloNumArray(class IloEnv,long)" (??0IloNumArray@@QAE@VIloEnv@@J@Z)
    1>CAPX01.obj : error LNK2001: unresolved external symbol "public: __thiscall IloEnvI::~IloEnvI(void)" (??1IloEnvI@@QAE@XZ)

    When I change the Active Solution Platform to x64, the project compiles and links OK, but with warnings as:

    1>C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\include\ilcplex/ilocplexi.h(3091): warning C4244: 'argument' : conversion from 'IloInt' to 'CPXINT', possible loss of data
    1>C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\include\ilcplex/ilocplexi.h(3831): warning C4244: 'return' : conversion from 'const IloBool' to 'int', possible loss of data
    1>..\CAPX01.cpp(117): warning C4267: '=' : conversion from 'size_t' to 'unsigned short', possible loss of data

    during compilation and warnings as:

    1>concert.lib(iloalg.obj) : warning LNK4099: PDB 'concert.pdb' was not found with 'concert.lib(iloalg.obj)' or at 'C:\Users\ifragkos\Documents\Visual Studio 2010\Projects\HorizonDec\x64\Release\concert.pdb'; linking object as if no debug info
    1>concert.lib(iloallocator.obj) : warning LNK4099: PDB 'concert.pdb' was not found with 'concert.lib(iloallocator.obj)' or at 'C:\Users\ifragkos\Documents\Visual Studio 2010\Projects\HorizonDec\x64\Release\concert.pdb'; linking object as if no debug info

    during linking.

    The algorithm then runs but it is very slow (twice or three times as slow). Any idea why this happens?

    Thank you in advance,

    Iannis
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CPLEX v123 x86-64 MS VS2010 performance issue

    Posted Mon October 24, 2011 03:16 AM

    Originally posted by: SystemAdmin


    > When I change the Active Solution Platform to x64, the project compiles and links OK, but with warnings as:
    >
    > 1>C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\include\ilcplex/ilocplexi.h(3091): warning C4244: 'argument' : conversion from 'IloInt' to 'CPXINT', possible loss of data
    > 1>C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\include\ilcplex/ilocplexi.h(3831): warning C4244: 'return' : conversion from 'const IloBool' to 'int', possible loss of data
    >
    These warnings are ugly but can be ignored. We will work to get rid of them.

    > 1>..\CAPX01.cpp(117): warning C4267: '=' : conversion from 'size_t' to 'unsigned short', possible loss of data
    >
    It looks like this is in your own code. Can you please show us the line that triggers this warning?

    > The algorithm then runs but it is very slow (twice or three times as slow). Any idea why this happens?
    >
    Can you tell what part of the algorithm runs slower as before? Is it the extraction of the model? Is it the time that IloCplex::solve() spends in the tree? Or is calling CPLEX just a subtroutine in your code and you do lots of additional stuff?

    Have you tried to create a 32bit binary by linking against the 32bit libraries instead of the 64bit libraries? Does this also show the performance degradation you report?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: CPLEX v123 x86-64 MS VS2010 performance issue

    Posted Mon October 24, 2011 11:06 AM

    Originally posted by: Iannis


    > dju358 wrote:

    Dear Daniel,

    Thank you for the reply. It turns out that it was a machine-specific problem, not CPLEX specific (there is a known "CPU throttling" issue with my netbook).

    A follow up on the above:

    > 1>..\CAPX01.cpp(117): warning C4267: '=' : conversion from 'size_t' to 'unsigned short', possible loss of data
    >
    It looks like this is in your own code. Can you please show us the line that triggers this warning?

    the line is just
    ns = mh[ 0][ js].size();
    
    where ns is unsigned short and mh 0 js is a vector of unsigned short numbers.

    Have you tried to create a 32bit binary by linking against the 32bit libraries instead of the 64bit libraries? Does this also show the performance degradation you report?

    This is how I found what was wrong actually. I tried with CPLEX123 32bit and CPLEX122 32bit and had the same issues.

    Thanks again,

    Iannis
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: CPLEX v123 x86-64 MS VS2010 performance issue

    Posted Tue October 25, 2011 08:52 AM

    Originally posted by: SystemAdmin


    > > 1>..\CAPX01.cpp(117): warning C4267: '=' : conversion from 'size_t' to 'unsigned short', possible loss of data
    > >
    > It looks like this is in your own code. Can you please show us the line that triggers this warning?
    >
    > the line is just
    ns = mh[ 0][ js].size();
    
    where ns is unsigned short and mh 0 js is a vector of unsigned short numbers.
    >
    With "vector" you mean std::vector? The return type of std::vector::size() is size_t, which is a 32 or 64 bit unsigned integer, depending on your platform. An unsigned short is usually only 16 bits wide. So the compiler warns you that you are assigning a 32 or 64bit value to a 16bit value. This assignment may discard data if the vector happens to be longer than 2^16-1 elements.
    If you want to get your code correct then 'ns' should be of type std::vector<...>::size_type (not that you have to add appropriate template arguments instead of '...').
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: CPLEX v123 x86-64 MS VS2010 performance issue

    Posted Tue October 25, 2011 03:26 PM

    Originally posted by: Iannis


    Yes, it was std::vector .

    Yes, I did not define it properly. Its size is at most 20 elements so I neglected using the size type.

    Thank you for the support,

    Iannis
    #CPLEXOptimizers
    #DecisionOptimization