Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  IloEnv and multithreading

    Posted 01/24/12 10:15 AM

    Originally posted by: PeterLenhard


    Hi, I hope I'm posting in the right forum.

    I'm using constraint programming to solve scheduling problems with IloSolver/IloScheduler.
    For certain reasons we calculate two solutions in different IloModels, but within the same IloEnv, and make a decision by comparing the two solutions. At the moment I'm trying to do this (independent, as I think) solving parallel.
    This does not mean using parallel solver, but starting two threads which solve their own goal with their own IloSolver each.

    But when I activate the parallel solving in two threads, I get memory access violations within IloSolutionI::store or IloFixedSizeAllocatorI::allocate. Simply suppressing the start of the second (parallel) thread results in a working program. So my first guess is the used IloEnv is not threadsafe and my approach can't be working at all.

    But I hope I'm wrong and making another fault.
    Can someone tell me if IloEnv is designed to be threadsafe?

    Thank you very much for your answer!
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: IloEnv and multithreading

    Posted 01/24/12 10:25 AM

    Originally posted by: PeterLenhard


    Additional information:
    My programming environment is Microsoft VisualStudio C++.
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: IloEnv and multithreading

    Posted 01/24/12 11:38 AM

    Originally posted by: SystemAdmin


    Dear Peter,

    The IloEnv class is not designed to be shared on several threads. Thus the errors you have when both threads tries to allocate memory for an IloSolution. You need to handle the IloEnv lock yourself or to create an IloEnv instance for each thread.

    Regards

    Philippe
    #CPOptimizer
    #DecisionOptimization


  • 4.  Thank you!

    Posted 01/24/12 01:33 PM

    Originally posted by: PeterLenhard


    Thank you for your answer, now I know what's happening.
    #CPOptimizer
    #DecisionOptimization