[CT420]: Assignment 2 progress

This commit is contained in:
2025-03-19 15:23:58 +00:00
parent 71875c8a1f
commit 927326d0a4
5 changed files with 48 additions and 2 deletions

View File

@ -8,7 +8,23 @@
\usepackage[final, colorlinks = true, urlcolor = black, linkcolor = black, citecolor = black]{hyperref} \usepackage[final, colorlinks = true, urlcolor = black, linkcolor = black, citecolor = black]{hyperref}
\usepackage{fontspec} \usepackage{fontspec}
\setmainfont{EB Garamond} % \setmainfont{EB Garamond}
% \setmonofont[Scale=MatchLowercase]{Deja Vu Sans Mono}
\setmainfont{EB Garamond}[
Ligatures=TeX,
Numbers=OldStyle
]
% Fallback font (for missing characters)
\setmainfont{EB Garamond}[
% Ligatures=TeX,
% Numbers=OldStyle
]
\newfontfamily{\emojifont}{Noto Color Emoji}[Renderer=Harfbuzz]
% Monospace font configuration
\setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono} \setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
\usepackage[backend=biber, style=numeric, date=iso, urldate=iso]{biblatex} \usepackage[backend=biber, style=numeric, date=iso, urldate=iso]{biblatex}
@ -123,8 +139,38 @@ int main(){
\caption{Getting the clock resolution of the virtual machine} \caption{Getting the clock resolution of the virtual machine}
\end{figure} \end{figure}
\section{CPU \& Data-Intensive Applications}
To develop my CPU \& data-intensive programs, I chose to use Python for ease of development (and because any Python program will stress your CPU \& memory no matter how simple {\emojifont 😉}).
I chose \mintinline{shell}{htop} as my resource-monitoring tool as I have often used it in the past, it has easy to read \& understand output, and shows you exactly what proportion of the CPU \& memory is in use at that time.
It also allows you to list processes by CPU consumption or memory consumption which is a useful option to have for this assignment.
\begin{code}
\inputminted[linenos, breaklines, frame=single]{python}{../code/stressers/stress_cpu.py}
\caption{\texttt{stress\_cpu.py}}
\end{code}
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{./images/medcpuload.png}
\caption{\mintinline{python}{htop} output when running \mintinline{shell}{python3 stress_cpu.py --load medium}}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{./images/highcpuload.png}
\caption{\mintinline{python}{htop} output when running \mintinline{shell}{python3 stress_cpu.py --load high}}
\end{figure}
\begin{code}
\inputminted[linenos, breaklines, frame=single]{python}{../code/stressers/stress_memory.py}
\caption{\texttt{stress\_memory.py}}
\end{code}
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{./images/memstress.png}
\caption{\mintinline{python}{htop} output when running \mintinline{shell}{python3 stress_memory.py --usage 0.85}}
\end{figure}
\printbibliography \printbibliography
\end{document} \end{document}

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB