Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplex C++ project in High Performance Computer(HPC)

    Posted 04/06/16 07:55 PM

    Originally posted by: Roni.Mohammad


    Dear all,

    I am trying to figure out how to run a C++ project with cplex in a cluster size of 800 compute blades with:Two 12-core 2.5 GHz Intel Xeon (Haswell) processors per blade (24 cores/node and 19,200 cores total) . I will be using few of the nodes . I am trying to solve a large scale mixed integer problem.  

     Is there any example which shows step by step  procedure that demonstrates how to configure and  run a C++ project with cplex in a cluster?  

    Any advice or direction would be helpful

    Thanks in advance.

    Roni

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplex C++ project in High Performance Computer(HPC)

    Posted 04/07/16 03:21 AM

    Originally posted by: T_O


    From our experience, distributed MIP does not really help when you already have 24 cores per node. Of course, this might be very dependent on the actual problem instance, but do not expect too much. It might as well be faster when you use fewer cores. I would just use one node of the cluster, not more.

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cplex C++ project in High Performance Computer(HPC)

    Posted 04/07/16 02:19 PM

    Originally posted by: Roni.Mohammad


    Thanks for your reply. I am new to experimenting cplex in cluster . I am trying to configure my problem to the cluster  

    • Did you follow this process  http://www.ibm.com/support/knowledgecenter/SSSA5P_12.6.1/ilog.odms.cplex.help/CPLEX/UsrMan/topics/parallel_optim/distribMIP/11_cpp_eg.html?  
    • I am was wallking through this tutorial 

      #include <ilcplex/ilocplex.h>
      #include <cstring>

      ILOSTLBEGIN

      static void
      usage (char const *program)
      {
         cerr << "Usage: " << program << " <vmc> <model>" << endl
              << "   Solves a model specified by a model file using " << endl
              << "   distributed parallel MIP." << endl
              << "   Arguments:" << endl
              << "    <vmc>    The virtual machine configuration file" << endl
              << "             that describes the machine that can be" << endl
              << "             used for parallel distributed MIP." << endl
              << "    <model>  Model file with the model to be solved." << endl
              << "   Example:" << endl
              << "     " << program << " process.vmc model.lp" << endl;
      }

      int
      main (int argc, char **argv)
      {
         char const *vmconfig = NULL;

         // Check command line length (exactly two arguments are required).
         if ( argc != 3 ) {
             usage(argv[0]);
            return -1;
         }

         // Pick up VMC from command line.
         vmconfig = argv[1];

         // Solve the model.
         int exitcode = 0;
         IloEnv env;
         try {
            // Create and read the model.
            IloModel model(env);
            IloCplex cplex(model);
            cplex.importModel(model, argv[2]);

            // Load the virtual machine configuration.
            // This will force solve() to use parallel distributed MIP.
            cplex.readVMConfig(vmconfig);

            // Solve the problem and display some results.
            if ( cplex.solve() )
               env.out() << "Solution value  = " << cplex.getObjValue() << endl;
            else
               env.out() << "No solution" << endl;
            env.out() << "Solution status = " << cplex.getStatus() << endl;

            // Cleanup.
            cplex.end();
            model.end();
         }
         catch (IloException& e) {
            cerr << "Concert exception caught: " << e << endl;
            exitcode = -1;
         }
         catch (...) {
            cerr << "Unknown exception caught" << endl;
            exitcode = -1;
         }

         env.end();

         return exitcode;

      }  // END main

      What are the three arguments require to run this program?
    • Did you install cplex in cluster and submit the project/job to the cluster?

     

    Thanks again for your feedback


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Cplex C++ project in High Performance Computer(HPC)

    Posted 04/07/16 03:50 PM

    Originally posted by: T_O


    I assume, you have OpenMPI available on your cluster. Then please have a look at the attached script. Just call it as follows:

    mpirun --npernode 1 ./cplex_mpi /path/that/contains/the/cplex/binary /path/to/your/problem/file/e.g./air04.mps.gz

    This should do everything for you. Please obtain the nodes of the cluster completely and exclusively not to disturb other users.

     

    Of course, you can do all this from inside a job script or an interactive job.

     

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Cplex C++ project in High Performance Computer(HPC)

    Posted 04/08/16 01:09 AM

    If you never used MPI before then I suggest you first make yourself familiar with that software. It is completely unrelated to CPLEX but you will probably have a hard time to run CPLEX distributed parallel MIP through MPI if you don't know it.

    The program requires only two, not three arguments. What these arguments are is explained in the program's usage message (see the usage() function): the first argument is the VMC file, the second is the model to solve.

    You may want to read the distributed parallel MIP documentation to understand how things work and in particular what a VMC file is. Pay particular attention to the chapters that illustrate how to use either openMPI or MPICH and also to the chapter that explains how to use distributed parallel MIP in the interactive. Running your own code is very similar, you just have to run a different master program. If you only want to solve a problem then you don't even need custom code, you can just follow the instructions for running distributed parallel MIP in the interactive. Maybe it is best to start with that.


    #CPLEXOptimizers
    #DecisionOptimization