-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d0a267
commit df8b5e5
Showing
6 changed files
with
134 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
--- | ||
date created: Monday, 4. November 2024, 19:10 | ||
date modified: Monday, 4. November 2024, 19:20 | ||
--- | ||
|
||
Here is the content in Markdown format with the full task statements included in the headers: | ||
|
||
# 1. Note | ||
|
||
Please join us here: https://matrix.lmu.de/#/room/#wa2425:matrix.lmu.de for questions and discussions. | ||
|
||
There is no bonus for the final exams from the lab exercises. | ||
|
||
# 2. The Top500 List | ||
|
||
## (a) Explain the terms Rmax and Rpeak in the ranking | ||
|
||
## (b) Name 3 trends you can observe since the first release of the Top500 list in June 1996 | ||
|
||
## (c) Choose any high ranked system from the Top500 list and discuss its specification compared to SuperMUC-NG | ||
|
||
## (d) Today, mobile devices, such as smartphones and tablets, are equipped with relatively powerful CPUs. Could a mobile device achieving a Linpack performance of 2 GFLOP/sec have been ranked in past Top500 lists? What is the best ranking it could have reached? | ||
|
||
## (e) Assume a CPU with the following specification: 20 cores @ 2 GHz base frequency, 2x floating-point units per core with support for fused multiply-add (FMA) instructions, and a 256-bit vector length. Calculate the theoretical (double precision floating-point) peak performance of this CPU | ||
|
||
# 3. Moore’s Law | ||
|
||
Moore’s Law states that the number of transistors per area unit in an integrated circuit roughly doubles every 18 months. These additional resources can be used to improve performance. How did the performance of the systems ranked in the Top500 list change? Discuss the total performance of all systems, the #1 rank, and the #500 rank with respect to Moore’s Law. | ||
|
||
# 4. C Programming | ||
|
||
## (a) If you are not familiar with C, you can follow, for example, Beej’s Guide to C. First run a hello world example, then read up on the topics arrays, pointers and dynamic memory allocation | ||
|
||
## (b) Implement the following program in C: Allocate an array array_a of 100 int values dynamically using malloc. Allocate an array array_s of 100 int values statically (i.e., without using malloc). Fill array_a with values from 0 to 99. Copy values from array_a to array_s in reverse order. Print out the values from both arrays. Deallocate (free) the memory of array_a | ||
|
||
## (c) Why is it a mistake to try to deallocate the memory of array_s with free? | ||
|
||
# 5. Passing a 2D Array in C | ||
|
||
Passing an N x M 2D int array as argument to a function can be implemented with several possible parameter types for the 2D array in the function signature: | ||
|
||
```c | ||
int matrix[][] | ||
int matrix[0][0] | ||
int (*matrix)[] //array pointer to first row */ | ||
int *matrix //init pointer to first matrix element */ | ||
``` | ||
|
||
The following two functions shall accept an N x M 2D int array (int matrix[2] [3]) and print its values in a human-readable format. | ||
|
||
## (a) Implement the function void print_matrix_arr(int rows, int cols, int matrix[]). Pass matrix to print_matrix_arr in the provided test program to test your implementation | ||
|
||
## (b) Implement the function void print_matrix_ptr(int rows, int cols, int \*matrix). Pass matrix to print_matrix_ptr in the provided test program to test your implementation | ||
|
||
### Notes: | ||
|
||
- Depending on the implementation, the number of array elements per sub-array must appear before the array in the parameter list. | ||
- The 2D array must be passed either as 2D array type, array pointer type, or as a pointer to its first element. In the latter, the number of elements in each sub-array is not part of the passed type. | ||
|
||
# 6. Linked List in C | ||
|
||
## Implement the function struct element *push_back(struct element *head, int val) which appends a new list element with value val to the tail of a linked list, and returns a pointer to the new list tail on success, or NULL on error | ||
|
||
### Provided test program shall: | ||
|
||
1. print: head --> { 42 } --> { 99 } --> { 37 } --> { 13 } --> NULL | ||
after push_back(head, 13) | ||
|
||
2. not crash! | ||
|
||
### Note: | ||
|
||
The linked list head is passed to push_back as the parameter head and you need to iterate to the tail of the list before you can append the new list element. | ||
|
||
<!-- DISQUS SCRIPT COMMENT START --> | ||
|
||
<!-- DISQUS RECOMMENDATION START --> | ||
|
||
<div id="disqus_recommendations"></div> | ||
|
||
<script> | ||
(function() { // REQUIRED CONFIGURATION VARIABLE: EDIT THE SHORTNAME BELOW | ||
var d = document, s = d.createElement('script'); // IMPORTANT: Replace EXAMPLE with your forum shortname! | ||
s.src = 'https://myuninotes.disqus.com/recommendations.js'; s.setAttribute('data-timestamp', +new Date()); | ||
(d.head || d.body).appendChild(s); | ||
})(); | ||
</script> | ||
<noscript> | ||
Please enable JavaScript to view the | ||
<a href="https://disqus.com/?ref_noscript" rel="nofollow"> | ||
comments powered by Disqus. | ||
</a> | ||
</noscript> | ||
|
||
<!-- DISQUS RECOMMENDATION END --> | ||
|
||
<hr style="border: none; height: 2px; background: linear-gradient(to right, #f0f0f0, #ccc, #f0f0f0); margin-top: 4rem; margin-bottom: 5rem;"> | ||
<div id="disqus_thread"></div> | ||
<script> | ||
/** | ||
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS. | ||
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */ | ||
/* | ||
var disqus_config = function () { | ||
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable | ||
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable | ||
}; | ||
*/ | ||
(function() { // DON'T EDIT BELOW THIS LINE | ||
var d = document, s = d.createElement('script'); | ||
s.src = 'https://myuninotes.disqus.com/embed.js'; | ||
s.setAttribute('data-timestamp', +new Date()); | ||
(d.head || d.body).appendChild(s); | ||
})(); | ||
</script> | ||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> | ||
|
||
<!-- DISQUS SCRIPT COMMENT END --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.