Distributed Mandelbrot Rendering System
 - Client/Server - Contributed to the Public Domain June, 1999.

A learning project by:
 Jay W. Summet
 ja y@-remove-to-reply-summet.com
 http://www.summet.com

Environment:
 Borland C++ Builder 3
 Win95/WinNT

Description:

*NOTE*: Run in 256 Color mode only! See below for why.

This project is made up of two programs, a client and a server.
A) The Server
	The server is a small program that listens on a TCP/IP port
	for connections from clients. As it receives requests from clients
	it creates a new thread to handle them. Each server thread renders 
	part of a Mandelbrot fractal image, and returns it to the client
	via the TCP/IP connection.  The priority of the threads can be set
	by the slider control on the server. In addition, if the server is 
	ran in the foreground (so the user can interact with it) you can monitor
	the number of connections currently open, and the amount of work
	remaining on the status tab.

B) The Client
	This is a larger program, which can connect to one or more servers, running
	either on the local machine, or anywhere on a TCP/IP network.
	NOTE: It is suggested you only connect to servers that can be reached
	by a FAST network link, such as an Ethernet Network, or a FAST WAN. It
	doesn't work over modems.
	
	The Client can use one of two methods to distribute the work, 
	either equal allocation (DEFAULT - slower) or slice racing ( faster).
	Uncheck the "Equal Allocation" checkbox to use the slice Racing method.

	The client can render Mandelbrot images of any size (limited by the
	amount of Virtual Memory on the workstation), and connect to up to 1024
	different servers. Network testing has shown that after connecting to around
	20 servers on a 10BaseT Ethernet network, your gains begin to diminish 
	significantly. (But, even with only 20 servers, you can render some nice
	images FAST!)

	NOTE: Due to a bug in Borland’s TImage class, the Mandelbrot images display
	best when you have your workstation set to 256 color mode. It WORKS in other
	display modes, but the displays don't look good.

History:
	At the end of CS 440 - Computer Graphics (Fall Quarter 98-99) The instructor
	gave us a "fun project", which was to generate a Mandelbrot Fractal.
	I liked it, and after playing around with palate rotation animations (which
 	looks really cool ;>) my only complaint was that the sucker was SLOW.
	(even on a P200 rendering only 320x200)
	
	So, I thought, "It would sure be cool to generate these images on a 	
	distributed network of computers", went out and bought Borland C++ Builder 3
	Pro (which has TCP/IP support) and started playing over winter vacation.

	By the time I got back to school for Winter quarter, I had the Server done, 	
	and a basic client working that would connect to a single server and render a
	single specific image (500 x 300 pixels) over the network.

	I got Dr. Eastman, the instructor of my CS Senior Colloquium class to let me
	just work on this instead of doing a 5 page research paper on a CS topic, and
	by the end of Winter Quarter I had a Client that could connect to multiple
	servers.
	
	Then, in Spring Quarter, Dr. Schwing, who was teaching CS 473-Parallel, said
	that I should do some performance tests and do a write up about it for
	the SOURCE (Symposium On Undergraduate Research and Creative Expression)
	1999 Conference. The project won the Edmond Fischer award for Best Poster
	Session.

	Then of course, when Dr. Schwing announced that our final project in Parallel
	would be a research project of our choice....well...what could I do.....
	
	So, the moral of the story is that if you find something interesting you want
	to work on, go for it, even if it's not a class assignment.  You'll learn 
	neat stuff, and have fun. If you're lucky (and/or a fast talker) you may be
	able to use the project to cover for some of your classwork. Of course, you'll be
	doing MUCH more work that if you just did generic class assignments, but hey,
	we do this because we like it.....

The EXE's: 	
	Are in the main directory. Be sure that a MandelbrotServer is running on
	the local machine (or some other machine on the network) so that when
	you start the dMandelbrotClient (the d is for Distributed) you can connect
	to someplace.  If you just want to test it, start a server on the local
	machine, and then start the client. Just accept the default IP (127.0.0.1
	which loops back to the local machine) and hit the "Establish Connection"
	button.  Then press the "Redisplay" button to render. You can zoom in
	by using the mouse and doing a CLICK-DRAG-RELEASE to draw a box around
	the area you want to zoom into.

The Code:
	You will find the source code in, (drum roll....) the "Source" directory.	
	There is a features (the Auto-Search for servers) that I have
	not completed, so I disabled the GUI access to it, but the source 
	is all there, just enable the checkbox and play with it if you want.
	
	I have also included a small "ServerTest" project, that tests the sending
	of data through a TCP/IP loopback connection. (The same process
	would work over a Network connection as well...)

Other Files:
	I have included some MS Excel and MS Word files with various things
	in them that I used for the SOURCE 1999 conference. This includes the raw
	data and graphs for the tests I ran in the CS Dept. Labs with 19 servers.
	(Thanks Fred and Erik! [SysAdmin guys] )

BTW:
	If you have read all this, why don't you go take a break and read
	a cool Comic, Sluggy Freelance. (http://www.sluggy.com)  Be sure to
	read the viewing guide, and start at the begining and read from there.