# Affinity-Based Task Scheduling on Heterogeneous Multicore Systems Using CBS and QBICTM
## 3 Results
The first technique used for load balancing puts the tasks from all clusters into a queue where similar or dependent tasks are listed in continuous order. We applied the technique on a factorial program by allocating a larger bunch of tasks to the fastest core based on its processing power. Results show an improvement in the execution time for each individual task and the process as a whole. The throughput of the overall system also increased whereas the waiting time for each task decreased significantly. Table 4 shows the average execution time of the tasks for our chunk-based technique which is used to find the factorial for a given range of numbers by taking different input parameters from the Bayesian model. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Parameter**} & \multirow{2}{*}{**Range**} & \multicolumn{2}{c}{**Execution Time (Seconds)**} \\ \cline{3-4}  & & **CBS** & **OS Scheduler** \\ \hline \multirow{4}{*}{20} & 1–3000 & 2.17 & 3.18 \\  & 5000–7000 & 8.56 & 21.60 \\  & 12,000–15,000 & 66.86 & 172.80 \\  & 16,000–18,000 & 88.37 & 173.75 \\ \hline \multirow{4}{*}{40} & 1–3000 & 2.07 & 3.05 \\  & 5000–7000 & 8.40 & 21.54 \\  & 12,000–15,000 & 66.57 & 147.76 \\  & 16,000–18,000 & 86.68 & 173.40 \\ \hline \multirow{4}{*}{60} & 1–3000 & 1.98 & 2.77 \\  & 5000–7000 & 8.31 & 20.89 \\  & 12,000–15,000 & 65.04 & 144.76 \\  & 16,000–18,000 & 70.05 & 155.38 \\ \hline \multirow{4}{*}{80} & 1–3000 & 2.02 & 2.93 \\  & 5000–7000 & 8.31 & 21.20 \\ \cline{1-1}  & 12,000–15,000 & 65.13 & 146.13 \\ \cline{1-1}  & 16,000–18,000 & 70.21 & 171.30 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Average execution time for the factorial program based on different input parameters. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter (\%)** & **Dependency Ratio** \\ \hline
20 & 12–31 \\
40 & 26–54 \\
50 & 36–63 \\
60 & 47–74 \\
80 & 66–88 \\
90 & 79–96 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Task dependency ratios for a factorial program using the Bayesian model. We took each single output from the Bayesian model based on the input parameters and made clusters from identical tasks. We computed the execution time for the factorial of each individual number in the given range listed in the Table 4 and computed the overall execution time for the whole program. Figure 6 shows a comparison of the average execution time for the factorial program for the different range of numbers based on the input parameter value. Results show an improvement in the overall average execution time by applying our chunk-based technique compared to the default operating system scheduler. The average execution time for the whole factorial program was reduced by 32-50% compared to the default OS scheduler. The CBS load balancing technique decreases the total execution time of the factorial program compared to the schedulers used by the operating system. The results for the average execution time for the factorial program by scheduling the clusters on cores and applying the QBICTM scheduling mechanism by introducing a quantum at the fastest core are presented in Table 5.  
We took different values for the time quantum and found the factorial for a different range of numbers. The quantum based intra-core migration technique is applied on each task generated as output by the Bayesian generative model based on the input parameter values. A time quantum is introduced at the fastest core and each single task gets a fair and equal chance to be processed at the fastest core. When the quantum expires, the intra core migration of tasks takes place as discussed earlier in Section 2.3. Our load balancing technique outperformed the default OS scheduler in terms of the execution time for the factorial program as it processed the whole program in significantly less time. The reduction in overall execution time for different ranges of numbers is between 30-55%.