Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

callbacks work with 2 threads but not with more

  • 1.  callbacks work with 2 threads but not with more

    Posted Sat April 20, 2013 03:51 PM

    Originally posted by: Falcon_G


    Dear all

    I have got a problem for which I generate the cuts in lazy constraint callback and a userCut callback.

    The code works fine with a single thread.

     

    with more threads:

    Initially, I had an instance of IloFastMutext which was shared between them to lock and unlock.  I expected to work properly as I have done it in the earlier versions of cplex but this time did not and causes an exception which is not catched.

    Therefore, i gave one separate instance of IloFastMutex to each callback  and after that it works fine with two threads.

     

    As soon as I increase the number of threads to three 3 I get the same issue and execution ends with:

    First-chance exception at 0x774745ce in bc-multi-thread.exe: 0xC0000005: Access violation reading location 0xfeeefeee.
    Unhandled exception at 0x774615de in bc-multi-thread.exe: 0xC0000005: Access violation reading location 0xfeeefeee.
    First-chance exception at 0x7745016e in bc-multi-thread.exe: 0x00000000: The operation completed successfully.
    Unhandled exception at 0x774615de in bc-multi-thread.exe: 0x00000000: The operation completed successfully.
    The program '[22708] bc-multi-thread.exe: Native' has exited with code 0 (0x0).
     

    Again the exception is not catched in any of the following:

         catch(IloMutexProblem& e)
         {
             cout << "IloMutexProblem::" << e << endl;
         }
        catch (IloException& e) {
            cout << "exception::" << e << endl;
        }
        catch (...) {
            cout << "exception::" << endl;
        }  

     

    I appreciate any constructive comment.

     

    regards,

    Shahin

     

     

     

     

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: callbacks work with 2 threads but not with more

    Posted Mon April 29, 2013 08:08 AM

    Do the callback classes only access callback-local data or do they access global data? In the latter case having a different mutex for different callbacks will not prevent race conditions.


    #CPLEXOptimizers
    #DecisionOptimization