Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  no refcounter: calling on bad env

    Posted 06/23/12 09:30 AM

    Originally posted by: gianessipaolo


    Good morning to all of you,

    I got the following error messages while trying to solve a model using OPL scripting and model files:

    ################################################################################################
    • ERRORENGINE_001 at 132:40-42 ./opl/aff/aff_model_vineq.mod: Exception from IBM ILOG Concert: no refcounter: calling on bad env.
    • ERRORENGINE_001 at 132:40-42 ./opl/aff/aff_model_vineq.mod: Exception from IBM ILOG Concert: no refcounter: calling on bad env.
    • ERRORENGINE_001 at 136:34-45 ./opl/aff/aff_model_vineq.mod: Exception from IBM ILOG Concert: no refcounter: calling on bad env.
    • ERRORENGINE_001 at 286:32-58 ./opl/aff/aff_model_vineq.mod: Exception from IBM ILOG Concert: no refcounter: calling on bad env.
    • ERRORENGINE_001: Exception from IBM ILOG Concert: no refcounter: calling on bad env.
    • ERRORENGINE_001 at 36:0 ./opl/aff/aff_meta.mod: Exception from IBM ILOG Concert: no refcounter: calling on bad env.
      1. CONCERT exception: no refcounter: calling on bad env
    ################################################################################################

    The errors occurs in the following excerpts (I report line numbers for ease of reading):

    ################################################################################################
    (127) {raw_affect1} AC1 = ...;
    (128) raw_affect1 aAC1ac in AC1 = ac;
    (129) {affect1} A1 = {ac.a | ac in AC1};
    (130)
    (131) {raw_affect2} AC2 = ...;
    (132) raw_affect2 aAC2ac in AC2 = ac;
    (133) {affect2} A2 = {ac.a | ac in AC2};
    (134)
    (135) float c1a in A1 = aAC1.c;
    (136) float c2a in A2 = aAC2.c;

    http://...

    (286) dexpr float z11 = sum(a in A1) c1[a] * x1[a];
    ################################################################################################

    I find somehow curious that first error occurs twice in the same line (132), without touching line (131) which is pretty identical.
    By the way, used types are defined elsewhere like this:

    ################################################################################################
    tuple affect1 {string ul; string tl; string wl;};
    tuple affect2 {string wl; string tl; string ul;};

    tuple raw_affect1 {key affect1 a; float c;};
    tuple raw_affect2 {key affect2 a; float c;};
    ################################################################################################

    I found someone who has experimented something similar (http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14688330) but he was using OPL Interfaces and has been proposed to solve it by using OplFactory, which to my knowledge does not appear to be usable in OPL scripting.

    I remark also that this problem occurs only on my Ubuntu Precise Pangolin (12.04) personal notebook, and not while running on my office machine, which mounts a Debian distro.

    Does anyone know how to deal with this problem? Is it due to some errors in my code or to some change in arrays handling in OPL, so that I need to declare variables in a different way?

    Thank you in advance for your help and in any case,

    Paolo Gianessi
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: no refcounter: calling on bad env

    Posted 07/30/12 07:17 AM

    Originally posted by: SystemAdmin


    It seems to me that you are using main script to create and handle sub OPL model.
    If yes, then can you try with setting the following setting to off?
    execute{
    settings.mainNewEngineEnv = false;
    }
    

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: no refcounter: calling on bad env

    Posted 07/30/12 07:54 AM

    Originally posted by: gianessipaolo


    Hi,

    and thank you for your answer.

    Yes, I do use a main script to handle a model file and corresponding instance data.
    The way I use files is quite standard I think: this is the main script excerpt:

    ==========================
    var src, def, plx, opl, dat, dte;
    src = new IloOplModelSource(srcnm);

    def = new IloOplModelDefinition(src);
    plx = new IloCplex();
    opl = new IloOplModel(def, plx);
    dat = new IloOplDataSource(datnm);

    opl.addDataSource(dat);
    opl.generate();

    plx.solnpoolcapacity = opl.SOLPOOLDIM; // these are constants which value is fixed elsewhere
    plx.solnpoolreplace = opl.SOLPOOLPOPSTGY;

    plx.epgap = 0.005;
    plx.tilim = 10800;

    var hasSolution = plx.populate(); // populates solution pool

    if(!hasSolution) {...}
    else {...}
    ==========================

    Where should I put the option switch off that you suggested?

    Thank you in advance,

    Paolo Gianessi
    #DecisionOptimization
    #OPLusingCPLEXOptimizer