.. (לתיקייה המכילה) | ||
may we use DSs from STL? | |
No, you must implement with c. |
may we use helper files, or should we put all our code in tsp_static.c and tsp.c? | |
You should put all the code in tsp_static.c and tsp.c , because we will use our make file ,and you won't be able to modify the it. |
may we assume that there are more cities than processors? | |
No. |
in part 1: if we have 10 cities and 8 threads, would the following division be considered 'equal chunks': decide which city will follow city 0, and RR the options between the threads (so one thread actually checks 2 subtrees, while all the others check 1)? | |
It doesn't depend on number of cities , with 10 cities you may get to 10! (or 9!) chunks.., think about the solution and you will answer this by your self. |
How can we build a data_type with an array with dynamic size inside , should we use pointers? or what can we do? | |
No. you can't do so , the data type size and structure must not change after building it. use of pointer won't work , this is not a shared memory model. Remember that you can send more than one value using send (you may send n) , that is how it should be done. |
should the static solution finish with 18 cities input? and in part 2 ? | |
No. the static solution will be checked with up to 14 cities input. the dynamic solution should finish up-to 18 cities. both must finish within not more than 5 minutes. |
There can be more than one minimal path , can we return any minimal path or a specific one? | |
Right there may be several minimal paths, you may return any one of them. |
Can I make any assumptions about the number of cities and processors? | |
If it makes data partitioning easier for you, you may assume there are at least 5 cities (like in our implementation). You may also assume that there won't be more processors than the number of 4-city long sub-routes (so you can limit the partitioning granularity on the static part). Note, however, that an ideal solution would not have to make these assumptions. Therefore, if you do make them, make sure you check the input at the beginning of the run, and document your limitations. |
On the static part, who should do the partitioning? | |
The partitioning of the input can either be done by the root process, which will the distribute the parts to the rest, or you can have each process calculate its part based on its rank. |
How balanced should the partitioning be on the static part? | |
As balanced as possible... You may have differences if the numbers can't be split nicely, but they should be minimal. If difference is large, you should probably use finer partitioning. |