This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
blog:spring2016:ahoover3:journal [2016/02/22 16:44] – [February 8th, 2016] ahoover3 | blog:spring2016:ahoover3:journal [2016/05/03 16:00] (current) – [April 28th, 2016] ahoover3 | ||
---|---|---|---|
Line 164: | Line 164: | ||
Looking to take on another project to keep the work flow going. I'd love to get a hold of a raspberry pi zero and a controller board in order to make use of the the old Acer Aspire S7 screen for an external display. The display would show the lab 46 data page and could be mounted on a wall for quick access. I'd like to be able to use the touch screen also, but I'm not sure if I will be able to find a controller board that will allow me to utilize the touch screen. | Looking to take on another project to keep the work flow going. I'd love to get a hold of a raspberry pi zero and a controller board in order to make use of the the old Acer Aspire S7 screen for an external display. The display would show the lab 46 data page and could be mounted on a wall for quick access. I'd like to be able to use the touch screen also, but I'm not sure if I will be able to find a controller board that will allow me to utilize the touch screen. | ||
+ | ====February 23rd, 2016==== | ||
+ | |||
+ | ====February 29th, 2016==== | ||
+ | |||
+ | Happy leap day! | ||
+ | |||
+ | Today I began researching different aspects of a raspberry pi in order to create a wifi enabled video feed that will be attached to a rc car in order to control it remotely. It will be controlled using standard WASD configuration. | ||
+ | |||
+ | Components Needed: | ||
+ | * Raspberry pi | ||
+ | * wifi dongle | ||
+ | * camera module | ||
+ | * rc car | ||
+ | |||
+ | Resources to be Used: | ||
+ | * http:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | Possible Issues to Ponder: | ||
+ | * what os to use with the pi | ||
+ | * what the control interface will be | ||
+ | * video stream lag with wifi connectivity | ||
+ | * camera compatibility & setup | ||
+ | * voltage supply for pi board | ||
+ | |||
+ | |||
+ | ====March 4th, 2016==== | ||
+ | |||
+ | Today began the creation of the cluster for generating prime numbers. Four computers are going to be linked together over the network, sharing computing power in order to speed up the processing and intelligently assign tasks for efficiency. | ||
+ | |||
+ | In use are 4 Dell Optiplex 745's with Intel core duos. Each computer is equipped with 160GB hard drives and 4GB of DDR2 RAM each. Each machine will be running Debian' | ||
+ | |||
+ | Today I selected the machines, installed the ram and hard drives, and am currently netbooting all 4 machines with the above OS. This is going to be a very time consuming part of the operation. | ||
+ | |||
+ | To begin with, Each computer is set up with the exact same configurations except for the host name, in order to differentiate. | ||
+ | |||
+ | The hostnames are Master (where the commands will be executed), Minion0, Minion1 and Minion2. Using the title of ' | ||
+ | |||
+ | The root password, username, user password and the like were kept the same, in order to make it easier to transfer information between the machines and make authentication easier. | ||
+ | |||
+ | ====March 7th, 2016==== | ||
+ | |||
+ | All the computers had installed Debian properly except for minion0, which failed in its installation. When reinstalling the system, instead of installing the desktop environment like before on the other machines, a purely bare bones installation was used. | ||
+ | |||
+ | This was done in order to make the most optimized system possible. Once the system was installed, even the recommended files and installations were removed. Things like the dictionary library aren't needed for what we are doing, so they were taken out. | ||
+ | |||
+ | When all is said and done, the entire OS was reduced down to only 830MB, roughly. This small size enables us to fit the entire system on only a gigabyte of memory. And since speed is the goal, the intent is to put that entire system on a 1GB ram stick, or otherwise known as a ramdisk. This makes any performance blazingly fast. Memory in ram though is volatile though, which means that it would have to be netbooted every time the computer boots. | ||
+ | |||
+ | ====March 11th, 2016==== | ||
+ | |||
+ | Today we tackled the issue of not having the IP addresses assigned properly for the cluster nodes. Every time they were booted, they took the addresses of 10.80.2.142, | ||
+ | |||
+ | The static IP addresses that were supposed to be assigned are as follows: | ||
+ | - Minion0 - 10.80.2.100 | ||
+ | - Minion1 - 10.80.2.101 | ||
+ | - Minion2 - 10.80.2.102 | ||
+ | - Minion3 - 10.80.2.103 | ||
+ | |||
+ | This is what the DHCP was set for, but it never worked. | ||
+ | It was confusing because there wasn't any clear reason for it to be holding on to the previous address. Eventually after a lot of trial and error, it was determined that in the DHCP log there was an old entry for the mac address of the machines that was listed before the new IP addresses we had created. This was because these machines were originally part of the old video wall project. After deleting these entries, the IP's were assigned properly. | ||
+ | |||
+ | ====March 14th, 2016==== | ||
+ | |||
+ | Working on cosmetic details and trying to make each host display their name at the prompt, instead of just the ambiguous minion. This would make it easier to discern which machine you were hooked into and working on, making things easier. | ||
+ | |||
+ | Other than that, the machines are ready to go in order to start implementing the programs that will utilize the power of multiprocessing as opposed to multithreading. | ||
+ | |||
+ | ====March 21st, 2016==== | ||
+ | |||
+ | Did some research on creating a cluster setup using the timeserver program in Systems Programming earlier. There is a cluster library, however it would probably be better to use the existing libraries in order to get a better understanding of the way sockets work. | ||
+ | |||
+ | ====March 23rd, 2016==== | ||
+ | |||
+ | Working on creating a program that will take advantage of the cluster. I was originally thinking about trying to send the program to the individual nodes, but I feel that it will be easier to give the server program the existing function to use, and simply use the client program to read the data that is outputted to the socket. This way, there is only reading that is going on. | ||
+ | |||
+ | ====April 13th, 2016==== | ||
+ | |||
+ | Today I researched and learned about Beowulf clusters. Beowulf clusters are an open source community that is implementing a similar system comparable to what we have created in the lab. | ||
+ | |||
+ | There are multiple open source systems and programs that take advantage of cluster computing in c, with one of the top ones being MOSIX. These systems take multiple network connected machines and turns them into a " | ||
+ | |||
+ | |||
+ | ====April 15th, 2016==== | ||
+ | |||
+ | More information regarding Dragonfly BSD : | ||
+ | |||
+ | More information regarding MOSIX: [[https:// | ||
+ | |||
+ | Perks of using Dragonfly versus MOSIX is that MOSIX treats every single node on a cluster as part of a whole single machine. This means that performance decreases might be seen if there are differences in the physical hardware of the nodes. Dragonfly is different in the respect that you have more control over where specific parts of the program go if you so desire. | ||
======Systems Programming Journal====== | ======Systems Programming Journal====== | ||
Line 319: | Line 409: | ||
The month was also off by one because there are 12 months, but it goes from 0-11 when numbering them. | The month was also off by one because there are 12 months, but it goes from 0-11 when numbering them. | ||
- | + | ||
+ | ====February 23rd, 2016==== | ||
+ | |||
+ | ====February 25th, 2016==== | ||
+ | |||
+ | Concurency | ||
+ | |||
+ | man fork | ||
+ | |||
+ | A fork creates a child process. It requires unistd.h and duplicates a calling process. The parent is the one that created the process, and the child process is what was created. | ||
+ | |||
+ | pid = process ID | ||
+ | |||
+ | you can view processes using the top command, and under the ' | ||
+ | |||
+ | using forks, processes and process ids, we create a program that makes zombies. blarg. | ||
+ | |||
+ | ====March 1st, 2016==== | ||
+ | |||
+ | PNC1 project will be looking at optimizing programs by utilizing the full potential of the cpu through multi-core processing. | ||
+ | |||
+ | adding a -O1 at the end of a gcc line allows for compiler optimization. | ||
+ | |||
+ | ====March 3rd, 2016==== | ||
+ | |||
+ | Beginning the immersion into threading. This is the third step after using forks. | ||
+ | |||
+ | We always have to deal with time vs space when writing a program, such as a prime number generator. You can have either one or the other, but not both. Either take up more time and save space, or allocate more space in favor of better time. | ||
+ | |||
+ | man page pthreads (7) | ||
+ | man page readdir_r (3) line 19 | ||
+ | |||
+ | vocab: | ||
+ | * locking | ||
+ | * mutex | ||
+ | * semaphore | ||
+ | * data hazard | ||
+ | * read | ||
+ | * write | ||
+ | * cancellation point | ||
+ | |||
+ | **Voids** | ||
+ | These are basically devoid of type, allowing us to store things in memory, but avoid assigning it a type such as char, int, etc. | ||
+ | |||
+ | ====March 8th, 2016==== | ||
+ | |||
+ | Still working on forks. Sort of a work on stuff day. | ||
+ | |||
+ | Different types of sort algorithms can drastically improve performance. | ||
+ | |||
+ | Bubble, insert and select are the easiest and simplest to implement. | ||
+ | |||
+ | Quicksort, | ||
+ | |||
+ | ====March 10th, 2016==== | ||
+ | |||
+ | PNC2 is open for business. | ||
+ | |||
+ | Talking about sockets today, and using them to create a time server. | ||
+ | |||
+ | Useful website: beej's guide to networking. | ||
+ | |||
+ | **Protocols** | ||
+ | * ipx/spx | ||
+ | * smb | ||
+ | * tcp/ip | ||
+ | |||
+ | sockaddr_in: | ||
+ | |||
+ | |||
+ | ====March 15th, 2016==== | ||
+ | |||
+ | Finished the timeserver.c program and demonstrated it working. Depending on what port it uses, that port cannot be accessed by anyone else after the server is running. This allows only one program to work at a time. | ||
+ | |||
+ | ====March 17th, 2016==== | ||
+ | |||
+ | Happy St. Patrick' | ||
+ | |||
+ | Today' | ||
+ | |||
+ | **Resources** | ||
+ | * man 3 getifaddrs - ifaddrs creates a linked list. woot. | ||
+ | |||
+ | ====March 22nd, 2016==== | ||
+ | |||
+ | Writing the client side of the socket implementation. | ||
+ | |||
+ | We will use the write and read system calls. They are very low level. | ||
+ | |||
+ | dup2: duplicating. We made a modification using this at the end of our timeserver program. | ||
+ | |||
+ | getenv | ||
+ | |||
+ | ====March 24th, 2016==== | ||
+ | |||
+ | Talking about terminal management (stty)and ioctl() | ||
+ | |||
+ | **Resources** | ||
+ | * man stty | ||
+ | * man ioctl | ||
+ | * man tty_ioctl | ||
+ | * man ioctl_list | ||
+ | |||
+ | stty -echo: hides your typing within the terminal. Passwords use this. | ||
+ | |||
+ | ====April 5th, 2016==== | ||
+ | |||
+ | Talking about pipes today. | ||
+ | |||
+ | Pipes: unidirectional data channel that can be used for interprocess communication. | ||
+ | |||
+ | man pipe | ||
+ | |||
+ | FIFO: fist in, first out. - queue | ||
+ | |||
+ | |||
+ | stty echo: resets the previous operation. | ||
+ | |||
+ | ====April 7th, 2016==== | ||
+ | |||
+ | Time to explore signals! | ||
+ | |||
+ | newer way: sigaction - this is much more portable and is used for more broad instances. This still uses signal.h. | ||
+ | |||
+ | **Resources needed:** | ||
+ | |||
+ | * man signal | ||
+ | * signal.h | ||
+ | * kill -l for signal #'s | ||
+ | * CTRL+Z to kill programs | ||
+ | * man signal 7 | ||
+ | * man sigaction | ||
+ | |||
+ | **Interacting with the program: | ||
+ | * ps -find the running | ||
+ | * ps | grep sigfun2 | ||
+ | * kill -# (process id) | ||
+ | |||
+ | |||
+ | |||
+ | ====April 12th, 2016==== | ||
+ | |||
+ | **Shared Memory** | ||
+ | |||
+ | The goal is to use this as a shared communication channel. | ||
+ | |||
+ | * man page: man shmat | ||
+ | * must be compiled with -lrt (real time library) | ||
+ | * ls -l /run/shm/ | ||
+ | * cat / | ||
+ | * | ||
+ | |||
+ | ====April 14th, 2016==== | ||
+ | |||
+ | Continuation of shared memory exploration. | ||
+ | |||
+ | We are attempting to create a ghetto messaging (chat) program that utilizes shared memory. | ||
+ | |||
+ | ====April 21st, 2016==== | ||
+ | |||
+ | Today' | ||
+ | |||
+ | Ncurses is a terminal management library. This means that it takes over the stdout, stdin, and such. Things like fprintf will not work properly while ncurses is engaged. | ||
+ | |||
+ | **Resources: | ||
+ | * man ncurses (on the pod, not lab46) | ||
+ | * man initscr (init screen) | ||
+ | * -lncurses (to compile against) | ||
+ | * man refresh | ||
+ | * man getxyx | ||
+ | |||
+ | |||
+ | |||
+ | ====April 26th, 2016==== | ||
+ | |||
+ | Working with ncurses again today, with an immersion in the windows aspect of it. | ||
+ | |||
+ | ====April 28th, 2016==== | ||
+ | |||
+ | da real Pac-Man implementation. | ||
+ | |||
+ | Over the years, there have been many different implementations that are similar to the original, and those with different styles. | ||
+ | |||
+ | In order to layout the board, we will use a variation of the bit-field called a bit-board. | ||
+ | |||
+ | In order to make things more manageable, separate files should be written and compiled in one. | ||
+ | |||
+ | ====May 3rd, 2016==== | ||
+ | |||
+ | Continuing the pac-man journey by implementing a cursor function. | ||
+ | |||
+ | user include ncurses.h | ||
+ |