What size of a piece will give the maximum productivity, using the master worker with MPI?

I am using MPI for a parrlel program that is trying to solve a Metric TSP problem. I have processors P and N cities.

Each thread asks for work from the master, receives a piece - which is a range of permutations that it must check and calculate the minimum among them. I optimize this by pre-trimming the wrong routes.

There is a total quantity (N-1)! routes for calculation. each worker receives a piece with a number that represents the first route that he must check, as well as the last. In addition, the master sends him the latest best result known, so he can easily expose bad routes in advance with some lower bound on their residues.

Each time an employee collects a result that is better than global, he asynchronously sends it to all other employees and the owner.

I am not looking for a better solution. I'm just trying to determine which piece size is better.

The best piece size I have found so far is (n!) / (N / 2) !, but it does not give such a good result.

please help me figure out which piece size is best here. I'm trying to balance the amount of computing and communication thanks

+3
source share
1 answer

It depends a lot on factors beyond your control: MPI implementation, overall load on the machine, etc. However, I would venture to suggest that it also depends heavily on the number of work processes. In this note, understand that MPI starts processes, not threads.

, , " , ". , - (, ).

+1

Source: https://habr.com/ru/post/1787014/


All Articles