AlderAutomation

Uni Blog Week 05

Last updated: 29 minutes ago

Intro

This week has been hugely into programming of personal projects and avoiding proper school work. :| And we have midterms starting soon so I have to get buckled down and study properly. The School week was decent though.

Project Management (Monday Morning)

Lecture

Started the lecture by telling us that he caught 20 students using AI to plagiarize their most recent assignment with him. Those students got a zero. Next time they get reported. He then lectured on the importance of Time, Scope, and Cost of project management.

He also went over timelines for the project and upcoming midterm. I need to start studying a bit harder than I have been.

Assignments

We are to submit our project plan. We still don't have our 4th groupy. I took the initiative and emailed our proff about it. He has since responded that he would try to communicate with our last groupy, but so far we still have not heard anything.

Operating Systems (Monday Afternoon)

Lecture

Not going to lie, I wasn't paying too much attention in this class. I was working on the assignment instead. He lectured about system threads and parallelism and concurrency.

Assignments

This assignment is all about threading and how that works. He has us evaluating some threading code and then has us create an array of 600000000 random ints and sum it using 4 threads. The threading question was an absolute wild ride. Threading is so weird with the forced header signature for the support function. And working with such a large number, I had to think about data types and their sizes. I had to use long long instead of just int!

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h> 

#define SIZE 600000000

int arr[SIZE]; 

// calc and var quarter of the array 
int quarterSize = SIZE / 4; // should be 150000000

// function to sum a quarter of the array 
void *sumQuartArray(void* arg) {
	long long sum = 0; 
	int min = *(int *)arg; 

	for (int i = min ; i < min+quarterSize ; i++) {
		sum = sum + arr[i]; 
	}

	long long *result = malloc(sizeof(int)); 
	*result = sum; 
	
	return result; 
}

int main () {
	// randomize the array elements
	for (int i = 0 ; i < SIZE ; i ++) {
		arr[i] = (rand() % 50 ) + 1; 
	}

	// create a starting point array and populate it 
	int starts[4] = {0, 150000000, 300000000, 450000000}; 
	
	// Create four threads in a thread array 
	pthread_t threads[4]; 

	long long arraySum = 0; 

	// Split array over the four threads and setup compute funct for each 
	for (int i = 0 ; i < 4 ; i++ ) {
		pthread_create(&threads[i], NULL, sumQuartArray, &starts[i]); 
	}

	// join all arrays 
	for (int i = 0; i < 4; i++ ) {
		void *returnValue; 

		pthread_join(threads[i], &returnValue); 

		arraySum += *(long long *)returnValue; 

		printf("Thread %d returned: %lld\n", i, *(long long *)returnValue); 

		free(returnValue); 
	}

	printf("The total of the array is: %lld\n", arraySum); 

	return 0; 
}

Data Communications (Tuesday Afternoon)

Lecture

A Quiz!

Lecture on the upcoming project which is solo, even though we have a group for this course. This man baffles me. I find it so odd that the Project, which should be group work, is solo and the weekly assignment, which should be solo, is group work.

The actual lecture is on chapter 3 content which is all about the data layer.

Assignments

Assignment 4 is just questions out of the text book again.

Project

This looks massive. I'll need to do a solo report (2500-4000 words) and a 12-15 minute presentation on a topic of his choosing, which for our group is "emerging ethernet technologies". It sounds like we are free to choose any subtopic of that, and I will likely try to frame it as systems programming, since that's why I am here. I did some research and I am going to try and do my report on eBPF. It is not directly an ethernet technology or new but it has exploded because of the new ethernet technologies. I sent him an email to see if that is reasonable. If it is, I'm going to try to do some programming for that as well, it might out to be a good time.

Extreme Programming (Thursday Afternoon)

Lecture

This lecture was more about MapReduce and Hadoop. The proff really seems to have no idea what she is talking about and has to constantly pause to try and figure out her slides and what she is going to say. And it really feels like we are moving at a snail's pace. We are 5 weeks in and we are still talking about MapReduce in the same introductory level. Next week we are going to discuss the midterm coming up, but we haven't really learned anything.

Assignments

We had another inclass assignment where we built a mapreduce that was the exact same as previous in and out of class assignments.

She said that she would release another assignment by last night, but she hasn't yet. Which is another grip that I have with this proff, she promises things and then doesn't deliver. >.<

Conclusion

Another week is done. Another week closer to being done and back to employment.

References

eBPF

If you want me to elaborate on anything, please message me on Discord, Mastodon, X, or email me. I’ll be happy to go into more detail one-on-one or to create more posts.

noaibadge

#blog #university