Skip to content

schnorr/fractal_pcad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

384 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fractal @ PCAD

We’ll keep here our efforts for the “UFRGS Portas Abertas”. Our idea is to run an enourmous fractal in an interactive manner for our visitors at the Informatics Institute data center.

People involved:

If you want to get yourself involved, get in touch. ;-)

Building

To build the project, ensure you have MPI and Raylib installed. You can adjust the Raylib installation path in the Makefile.

Then, simply run:

make

This will create three executables inside the bin/ directory:

  • grafica (GUI client, requires Raylib)
  • textual (command line client with no graphical output, useful for benchmarking)
  • coordinator (parallel server, requires MPI)

Log level

There is logging available for the textual client and the coordinator. By default, the build uses LOG_BASIC logging. You can override this at compile time by setting the LOG_LEVEL variable:

make LOG_LEVEL=LOG_NONE

Available options include:

  • LOG_NONE No logging output
  • LOG_BASIC Default option, includes coordinator timing logs and worker timing logs per client request
  • LOG_FULL Includes LOG_BASIC logs, as well as logs for individual discretized tasks executed by each worker.

Running

Coordinator (server)

The coordinator should be run using mpirun. You should specify at least 2 processes with option -n (one for the coordinator itself and at least one worker).

Example:

mpirun -n 4 ./bin/coordinator <port>

Runs the server, listening on a given port. Note that 4 processes means the server will be launched with 3 workers.

Graphical client

To connect to the coordinator and interact with the fractal using the GUI client:

./bin/grafica <host> <port>

Textual client

For benchmarking or running without graphical output, you can use the textual client:

./bin/textual <host> <port> <granularity> <fractal_depth> <screen_width> <screen_height> <ll_x> <ll_y> <ur_x> <ur_y>

The granularity is the size of the square blocks the server will discretize the fractal space into.

The fractal depth is the max number of iterations to run the mandelbrot algorithm for each pixel.

ll_x / ll_y are the lower left corner x and y fractal coordinates, and ur_x / ur_y are the upper right corner x and y fractal coordinates.

Interacting with the fractal (GUI client)

You can go further in the fractal by selecting a new zone to zoom in when in selection mode. You can enter selection mode by pressing ENTER.

KEYFUNCTION
ENTEREnters “Selection Mode”
BACKSPACEExits “Selection Mode”
ENTER (in selection mode)Sends current selected area as next payload
ARROWKEYS / WASD *Move selection box
S-UPARROW or S-w *Increase selection box size
S-DOWNARROW or S-s *Decrease selection box size
C-z **Go back to the previous payload
SPACEChange the actual color mode
cShow the workers colors within the actual color mode
G +Increase the granularity
G -Decrease the granularity
P +Increase the depth of the fractal
P -Decrease the depth of the fractal

When in selection mode, you can also move the box using the mouse by left clicking the selection box and draggin it. And also change it’s size with the mouse scroll.

*You can hold “CONTROL” to move the box or change it’s size with precision.

**C stands for “CONTROL” and S stands for “SHIFT”.

About

Interactive program to compute a fractal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •