Question
The baseline execution time of a program on a 2 GHz single core machine is 100 nanoseconds (ns). The code corresponding to 90% of the execution time can be fully parallelized. The overhead for using an additional core is 10 ns when running on a multicore system. Assume that all cores in the multicore system run their share of the parallelized code for an equal amount of time.
The number of cores that minimize the execution time of the program is ________
Official answer and solution
- Official answer
- 3
- From
- Official GATE 2024 answer key
Solution
Formulate the execution time on cores as the sum of serial time, parallel time , and multicore overhead, then minimize over integer .
Out of the baseline single-core execution time:
- Serial (non-parallelizable) portion
- Parallelizable portion
When running on cores (where each additional core adds of overhead), the total execution time is:
(Even if the overhead is modeled as for , the variable part is still .)
Setting the derivative with respect to to zero (or applying AM-GM):
Checking integer values: , , , . Thus cores minimize the execution time.
3
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2024 Computer Science and Information Technology - Set 1 (CS1)
- Question
- 55 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.