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:
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.
Separate into separate procedures:
Obtaining input data
Retrieving and storing 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 ;
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 ;
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.
Use multiSolve with 1 parallel session.
Use multiSolve with multiple parallel sessions.
Use multiSolve with provide mode