Engineer

To transform your application to utilize the multiSolve library may be daunting, especially if your application has evolved over time and several developers have contributed to its success. That is why a best practice is presented in this chapter,

  • that permits you and your team to make small steps,

  • have each step verified before going to the next step, and

  • whereby the end result is effective use of the multiSolve library.

Summary of steps

First a summary of the steps:

  1. Separate data set(s) that contain the multiple instances, with their verified solutions. And ensure that the version of the project you are working with produces these verified solutions.

  2. Separate into separate procedures:

    1. Obtaining input data

    2. Generating matrix

    3. Solving

    4. Retrieving and storing solution

    5. Verify solution

    Your algorithm should now have the following structure:

    1for (i,j,k) | bp_combinationWorthAnalyzing(i,j,k) do
    2    pr_getInput(i,j,k);
    3    pr_genMatrix(i,j,k);
    4    pr_solve(i,j,k);
    5    pr_storeSolution(i,j,k);
    6    pr_verifySolution(i,j,k);
    7endfor ;
    
  3. Transform to single index, say i_instance, using techniques similar to composite objects.

    1for i_instance do
    2    pr_getInput(i_instance);
    3    pr_genMatrix(i_instance);
    4    pr_solve(i_instance);
    5    pr_storeSolution(i_instance);
    6    pr_verifySolution(i_instance);
    7endfor ;
    

    whereby, pr_getInput(i_instance) begins with:

    1ep_i := ep_comboI(i_instance);
    2ep_j := ep_comboJ(i_instance);
    3ep_k := ep_comboK(i_instance);
    4
    5! the original pr_getInput procedure.
    
  4. Use multiSolve with 1 parallel session.

  5. Use multiSolve with multiple parallel sessions.

  6. Use multiSolve with provide mode modify.