Mohsin Rizvi
COMS 4995 - Parallel Functional Programming
Fall 2024
Final Project - README

This file details how to compile and run the maze-solver program, as well as how to run the
two other programs that I included (partest.hs, which I wrote for trying out parList with rseq,
and mazegen.py, which I used to generate large test mazes).

When running any of the commands included below, omit the preceding "$ ".



maze-solver

This is my completed program for this project.

To compile the maze solver program with Stack, run the following commands:
$ stack install vector
$ stack install PSQueue
$ stack install monad-par
$ stack --resolver lts-22.33 ghc -- --make -Wall -O mazeSolver.hs -threaded -rtsopts

The usage for the resulting program is:
$ ./mazeSolver <mazefile> <depth> [-show] +RTS -N<depth>

To run the program, supply a valid maze file and a parallelism depth to use, in addition to the
+RTS and -N<depth (for example, -N8) arguments. If you want to see the resulting path rendered
on the maze instead of just printed as a list of coordinates, include the -show option. Note
that printing out the maze with -show may slow down the program due to IO costs.

Note that various test maze files I used to test my program are included in my submission under
the test/ directory.



partest

This is a short program that I wrote to test using parList to evaluate list elements in parallel.
It doesn't compute anything interesting, but I am including it for the sake of completion.

To compile the partest program with Stack, run the following commands:
$ stack install monad-par
$ stack --resolver lts-22.33 ghc -- --make -Wall -O partest.hs -threaded -rtsopts

To run the program in serial:
$ ./partest - <depth>
To run the program in parallel:
$ ./partest + <depth> +RTS -N<depth>

Note that you should still supply the same <depth> even if running in serial, since the total
amount of work done is based on the specified depth, even if only using one thread.



mazegen.py

This is a short Python3 program included in the test/ directory that I wrote to easily create
large mazes to do performance testing with (including most of the maze files under test/).
Note that to run this program, you must have Python3 on your compute.

To run the program and generate a maze with given x and y dimensions and write the maze to a file:
$ python3 mazegen.py <x-axis-length> <y-axis-length> > somefile.txt
