GATE CS 2024 Set 1 — Question 55

NAT+2 / -0MediumSpeedup & EfficiencyInstruction PipeliningComputer Organization & Architecture

Computer Organization & Architecture → Instruction Pipelining → Speedup & Efficiency

Last updated

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 ________

Correct answer

3 to 3

Solution

To find the number of cores that minimize the execution time, we define the total execution time T(n)T(n) as a function of the number of cores nn.
1.Identify Sequential and Parallel Components:
  • Total baseline time T1=100T_1 = 100 ns.
  • Parallelizable part P=90% of 100=90P = 90\% \text{ of } 100 = 90 ns.
  • Sequential part S=10% of 100=10S = 10\% \text{ of } 100 = 10 ns.
2. Formulate the Execution Time Function T(n)T(n):
  • When using nn cores, the parallel part is divided by nn.
  • The overhead for using an additional core is 10 ns. For nn cores, there are (n1)(n-1) additional cores, so the total overhead is 10(n1)10(n-1) ns.
  • T(n)=S+Pn+Overhead(n)T(n) = S + \frac{P}{n} + \text{Overhead}(n)
  • T(n)=10+90n+10(n1)T(n) = 10 + \frac{90}{n} + 10(n-1)
  • T(n)=10+90n+10n10=90n+10nT(n) = 10 + \frac{90}{n} + 10n - 10 = \frac{90}{n} + 10n
3. Minimize T(n)T(n):
  • To find the minimum, take the derivative with respect to nn and set it to zero:

dTdn=90n2+10=0\frac{dT}{dn} = -\frac{90}{n^2} + 10 = 0 10=90n210 = \frac{90}{n^2} n2=9n^2 = 9 n=3n = 3
4.Verification with Discrete Values:
  • T(1)=100T(1) = 100 ns (Baseline)
  • T(2)=902+10(2)=45+20=65T(2) = \frac{90}{2} + 10(2) = 45 + 20 = 65 ns
  • T(3)=903+10(3)=30+30=60T(3) = \frac{90}{3} + 10(3) = 30 + 30 = 60 ns
  • T(4)=904+10(4)=22.5+40=62.5T(4) = \frac{90}{4} + 10(4) = 22.5 + 40 = 62.5 ns
The execution time is minimized when the number of cores is 3.

More questions on Instruction Pipelining

Practice GATE CS PYQs with adaptive difficulty

Timed practice, skill tracking, and AI explanations — free to start.

Start practicing free