Skip to content

Commit

Permalink
Merge pull request #3 from AdamSimpson/master
Browse files Browse the repository at this point in the history
Updating fork
  • Loading branch information
Adam Simpson committed Aug 26, 2014
2 parents 0291e13 + 9db3ab2 commit 0801d83
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 4 deletions.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# PiBrot
PiBrot is a parallel Mandelbrot set race. The screen is divided in half vertically with one MPI task drawing the left side image and an identical image being drawn on the right side with N-2 MPI tasks, where N is the total number of MPI tasks.

## Screenshot
Initially a single button appears along with an oak leaf cursor. When ready to start the race place the cursor over the start button and press `a`.
![alt text](https://raw.githubusercontent.com/AdamSimpson/PiBrot/master/images/start_screenshot.png "Start Screenshot")

It is easy to see that the right side image will be generated considerably faster than the left. The speedup should approximately be N-2 times.
![alt text](https://raw.githubusercontent.com/AdamSimpson/PiBrot/master/images/mid_screenshot.png "Mid Screenshot")

The completed image on the right as the left attempts to catch up
![alt text](https://raw.githubusercontent.com/AdamSimpson/PiBrot/master/images/final_screenshot.png "Final Screenshot")

## Install

Several prerequisites are required before compiling the code. In a Linux environment, such as Raspian, these may be obtained using your distros package management system. On Macintosh it is recomended that [Homebrew](http://brew.sh) be used.

### Macintosh

It is assumed that the XCode toolchain has been installed, this is freely available from [Apple](https://developer.apple.com/xcode/downloads/) . Once Homebrew has been installed The following commands may be run in Terminal.app to setup the prerequisties.

$ brew install mpich
$ brew install homebrew/versions/glfw3
$ brew install glew

### Raspberry Pi

On the RaspberryPi the following packages must be installed, all of which are availble through apt-get. If you used the TinySetup scripts these should already be installed

$ sudo apt-get install mpich
$ sudo apt-get install libglew-dev

## Compile and run
Once the prerequisites have been installed PiBrot can be compiled and run.

### Macintosh

To compile

$ make -f makefile_macos

To run on a 4 core single socket computer:

$ mpirun -n 4 ./bin/pibrot

### Raspbery Pi
To Compile

$ make

To run on TinyTitan

$ make run

9 changes: 5 additions & 4 deletions exit_menu_gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ THE SOFTWARE.
void init_exit_menu(exit_menu_t *state, gl_t *gl_state)
{
// Initialize program launcher images OpenGL state
int image_width = 500;
int image_height = 312;
int image_width = gl_state->screen_width/3.84;
int image_height = gl_state->screen_height/3.846;

float half_height = (image_height/(float)gl_state->screen_height);
float half_width = (image_width/(float)gl_state->screen_width);
Expand Down Expand Up @@ -100,8 +100,9 @@ void init_exit_menu(exit_menu_t *state, gl_t *gl_state)

// Initialize cursor
state->cursor_state = malloc(sizeof(cursor_t));
int cursor_width = 120;
int cursor_height = 160;
int cursor_width = gl_state->screen_width/16.0;
int cursor_height = gl_state->screen_height/7.5;

#ifdef RASPI
init_cursor(state->cursor_state, gl_state, "SPH/images/cursor.png", cursor_width, cursor_height);
#else
Expand Down
Binary file added images/final_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mid_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/start_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0801d83

Please sign in to comment.