Presentation is loading. Please wait.

Presentation is loading. Please wait.

QAP/MPI Adam Gaweda Anthony Habash Ray Brown. What is QAP Stands for Quadratic Assignment Problem The QAP is the problem of assigning a set of facilities.

Similar presentations


Presentation on theme: "QAP/MPI Adam Gaweda Anthony Habash Ray Brown. What is QAP Stands for Quadratic Assignment Problem The QAP is the problem of assigning a set of facilities."— Presentation transcript:

1 QAP/MPI Adam Gaweda Anthony Habash Ray Brown

2 What is QAP Stands for Quadratic Assignment Problem The QAP is the problem of assigning a set of facilities to a set of locations, with given distances between these locations and given flows between the facilities. The goal is to place the facilities on locations in such a way that the sum of the products between flows and distances is minimal.

3 What is QAP, cont. Example QAP Matrix 042389 1065106 4120347 7195044 31361506 2171411130

4 MPI This is a MPI run program thus you will have to use certain functions throughout it This is a MPI run program thus you will have to use certain functions throughout it MPI_Init() function – starts the mutliple threads, this is done in the beginning MPI_Init() function – starts the mutliple threads, this is done in the beginning MPI_Finalize() function – kills treads and cleans up, done at end of program MPI_Finalize() function – kills treads and cleans up, done at end of program And pretty much any others that we used in assignment 7 And pretty much any others that we used in assignment 7

5 Calculating QAP Given two sets, P ("facilities") and L ("locations"), of equal size, together with a weight function w : P × P → R and a distance function d : L × L → R. Find the bijection f : P → L ("assignment") such that the cost function is minimized. Given two sets, P ("facilities") and L ("locations"), of equal size, together with a weight function w : P × P → R and a distance function d : L × L → R. Find the bijection f : P → L ("assignment") such that the cost function is minimized. Usually weight and distance functions are viewed as square real-valued matrices, so that the cost function is written down as Usually weight and distance functions are viewed as square real-valued matrices, so that the cost function is written down as

6 Simulating QAP This will be done by implementing reduction with MPI This will be done by implementing reduction with MPI Each processor will send off its Optimal Cost Each processor will send off its Optimal Cost The master processor will then call MPI_Reduce with its operator sent to MPI_MIN to find the smallest of all the Optimal Costs The master processor will then call MPI_Reduce with its operator sent to MPI_MIN to find the smallest of all the Optimal Costs

7 Problems with MPI… Overhead – For smaller Quadratic Assignment Problems, the overhead of sending it through MPI may trump the actual computation cost. Overhead – For smaller Quadratic Assignment Problems, the overhead of sending it through MPI may trump the actual computation cost. Such is the case with Nugent 12x12 Such is the case with Nugent 12x12 Optimal Permutation – We were unable to acquire both the optimal cost and the array that held the permutation. Optimal Permutation – We were unable to acquire both the optimal cost and the array that held the permutation.

8 QAP using Brute Force completed in 1135.219 seconds (~19 mins) Count: 479001600 Optimal Cost is 289 using Permutation: 1 9 5 4 0 10 7 3 2 8 6 11 Max Cost is 526 Sequential Results Parallel Results QAP using MPI completed in 1440.272 seconds (~24 mins) Each Processor did 39916800 Computations. Optimal Cost is 289 Max Cost is 526

9 Conclusion So after implementing this algorithm over the grid we should hope to see a dramatic decrease in the time that it takes to run the QAP problem over a parallel program as opposed to a sequential program. So after implementing this algorithm over the grid we should hope to see a dramatic decrease in the time that it takes to run the QAP problem over a parallel program as opposed to a sequential program.

10 The End


Download ppt "QAP/MPI Adam Gaweda Anthony Habash Ray Brown. What is QAP Stands for Quadratic Assignment Problem The QAP is the problem of assigning a set of facilities."

Similar presentations


Ads by Google