Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Matlab and CPLEX on a HPC cluster

    Posted 04/27/18 03:48 PM

    Originally posted by: yvrob


    Hello,

    I am using CPLEX to solve a MILP (mixed-integer linear programming)  type problem with Matlab. The structure is as follow :
    - Aeq, Aineq, beq, bineq,… initialization with constraints
    - cplexmilp

    The problem is that this calculation is really heavy and take several days to find a solution, and I have no idea on how to use my cluster resources in parallel with Matlab and CPLEX. If I understood well, I am currently using one node, and the 20 threads of this node are automatically used for the calculation thanks to the cplexmilp function. However, how could I do this calculation with 4 nodes of my cluster (each of them using their 20 threads) ?

    Thank you,

    Yves Robert


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Matlab and CPLEX on a HPC cluster

    Posted 04/30/18 01:23 AM

    In order to use multiple machines/cluster nodes to solve the same problem you will have to use distributed MIP which is explained here. The CPLEX distribution has a few examples that illustrate how to do that, see the cplex/examples/src/distmipmatlab directory in your installation.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Matlab and CPLEX on a HPC cluster

    Posted 04/30/18 03:16 PM

    Originally posted by: yvrob


    Thank you for your answer.

    So my structure is now :

    Initialization of matrices/parameters (Aeq,Aineq,beq,f ...)

    prob.Aeq=Aeq;

    prob.Aineq=Aineq; ...

    Then I initiate the model : 

    cpx=Cplex(prob);

    And solve it :
    cpx.solve;

     

    If I understood well, I have to add above cpx.solve a line introducing a vmc. The thing is that I am running it on my university cluster and the link that you gave me asks me to give the hosts names, but I cannot know them in advance. So I tried to add this :

    cpx.readVMConfig("mpi")

    Which should create a vmc file based on the cluster I am working.

     

    However I get this error :

    Error using cplexlink1280
    Unknown CPLEX function 'copyVMConfig'.

    Error in Cplex/copyVMConfig

    Error in Cplex/subsref

     

    Even if I add the CPLEX folder (and subfolders) path to Matlab and export the CPLEX library in my bashrc with :

    export LD_LIBRARY_PATH="/global/home/users/yvesrobert/CPLEX/cplex/lib

    I still get this error.

     

    Do you have an idea on how I can fix this?

     

    Thank you.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Matlab and CPLEX on a HPC cluster

    Posted 04/30/18 06:45 PM

    Originally posted by: yvrob


    So after a lot of tries, I don't have this error anymore but this one :

     

    Error using cplexlink1280

    CPLEX Error  1001: Out of memory.

     

     

    Error in Cplex/readVMConfig

     

    Error in Cplex/subsref

     

    Error in test (line 234)

    cpx.readVMConfig("mpi")

     

    The error is not here when I don't put the line with VMC, so that is not the model which leads to this problem, and I put 40Go for the parameter "Workmem".

     

    I didn't see anything looking like that on the internet. Would you have an idea ?

     

    EDIT : the error is still here when I write : cpx.readVMConfig("hello"), so it just seems that this command doesn't work. I used then directly ./cplex and tried :

    CPLEX> set distmip config mpi

     

    But I just got that : 

    CPLEX Error  1003: Bad argument to Callable Library routine.

    Could not read Virtual Machine Configuration -- please try again.

     

    Still a problem but now I have no idea on what to do since I followed the instructions ...


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Matlab and CPLEX on a HPC cluster

    Posted 05/07/18 04:21 PM

    In order to have a chance for any of this to work, you have to run your matlab instance under MPI. Are you doing this? Also, I think, you have to use copyVMConfig() instead of readVMConfig().


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Matlab and CPLEX on a HPC cluster

    Posted 05/08/18 01:24 PM

    Originally posted by: yvrob


    Thank you for your answer.

    I am running Matlab on MPI, and tried your command, when I am using it, I see that it exists but I get this :

     

    Error using cplexlink1280
    Unknown CPLEX function 'copyVMConfig'.

    Error in Cplex/copyVMConfig

    Error in Cplex/subsref
     


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Matlab and CPLEX on a HPC cluster

    Posted 05/14/18 07:00 PM

    Originally posted by: yvrob


    Are you sure about this command DanielJunglas?

    EDIT : I tried on 3 different computers,  readVMConfig("mpi") tells me that it is out of memory, copyVMConfig (" mpi ") tells me that the function does not exist.


    #CPLEXOptimizers
    #DecisionOptimization