Programmable Distributed Processing Environment

Project Inspiration:

I recently graduated from a small liberal arts college with degrees in Math and Computer Science. During my time there, I took a class in computer architecture, focusing mainly on CPU design, and one of our assignments was to create a simulation of a simple processor of our own design. We worked in groups so I worked with one of my friends and one thing we decided to do was to write a little assembler that would convert our assembly code into our machine code. But since this was a group project my friend ended up working on this aspect of the project while I worked on the main CPU simulation code.

However, I had a strong desire to work on the assembler part of the program, and after the project was finished and the class was over I still had the idea of designing my own assembly language and execution engine floating around in my head. So I went home for Christmas vacation and had some ideas tumbling around in my head, because I also was interested in doing some network programming, and eventually I decided that I wanted to write a distributed processing system that would execute my own bytecode language.

My school works using a 4-1-4 semester schedule, where we have two standard semesters and in between, during the month of January, we have a one month session of intensive study. Being a senior and not needing credits during that time, I decided to not take a course and instead use the time to work on this project. So over a three week period I worked for about 4-5 hours a day during the week and this is what I hammered out.

It may not look like much, but before I started this project I had no idea how to use sockets in C++ and very little experience multithreading or the Windows console APIs. And I also wrote the client so that it would run on Windows and Linux on Intel hardware and Solaris on the Sparc. That required a fair amount of time too because there are some rather subtle differences between all of those platforms. (Especially the Sparc chips because they handle doubles differently than Intel.)

What the project consists of:

The project consists of two parts:
  1. The Processing Node: This is a very simple program that is simply the main execution engine combined with communications code. This code runs on Windows, Linux, and Solaris simply by commenting or uncommenting one or two #define's.
  2. The Management Node: This program is rather complex, consisting of a fairly sophisticated console-based user interface, everything necessary to manage and communicate with the processing nodes, and the assembler engine. The user interface works in two different modes, either Menu mode or CommandLine mode, and can be switched between the two at will. However, the CommandLine mode is much more powerful and sophisticated so that is the best one to use. This code runs only on Windows because I am using some Win32 API calls to handle a little threading and some console functions.

How to compile:

I work on this project on Windows using Visual C++ 6.0, so it is probably easiest to compile if you are doing the same. However, I have compiled the code for the processing node on both Linux and Solaris and it is a simple matter of deleting the extra Visual C++ specific files and then just compiling all of the .cpp files. Make sure you also link the necessary libraries (I think Linux is fine without anything special, but Solaris needs you to add the -lsockets option when compiling). You also will have to set a couple of #define's in the EasySocket.h file before compiling. If you are running Linux or Solaris you will need to uncomment the #define UNIX line, and if you are running on Sparc hardware then you will also need to uncomment the line directly below that (#define SPARC). When compiling the management server I have only used the VC++ compiler, since it has to run on Windows anyway. If you are running Windows but don't have access to VC++ then you're on your own...sorry. Let me know if you try anything else!

How to run:

The processing node is very simple to use. Once it is compiled, execute "processingnode server" and the program will run and wait for connections until the management server connects and sends it the kill command.

The management server is run simply by compiling it and running the executable, there are no special commandline arguments or anything that need to be used.

Sourceforge Project

In case you are looking for my actual project page: http://sourceforge.net/project/projects/pdpe

 

SourceForge Logo