Currently the ray tracer works serially. To compile and run, the following commands can be executed:
cd src
mkdir build
cd build
cmake ..
make
./tracer_marble_single_threaded > img.ppmThis will produce a ppm image that can be viewed using tools such as feh. The raytracer produces the image below.
The binaries are output to build/bin folder.
cd build/bin
./gen_random_sceneThe above command will output a json .data file, which can be fed into the algorithm.
cd build/bin
./sphere_bvh_single_threaded /path/to/scene_fileTo run on 6 processes with 4 threads per process.
mpiexec -np 7 --bind-to none ./bin/bvh_mpi random_spheres_scene.data 4 > img.ppmNote that 7 processes are created in the above example. This is because an extra process is created for the load balancing mechanism that dynamically dispatches work to the other MPI processes that are executing the render. The process that runs the load balancing mechanism runs in a single thread. So 6 processes are created, each executing the render using 4 threads for a total of 24 worker threads, while the 7th process distributes work to the other processes.
./build/bin/bm_ray_tracingNeed to set up singularity image, see procedure under Environment Setup
#has to be in the root directory of ParRay i.e. at level where you see ./src, ./README.md
#make sure you have the singularity container set up.
qsub ./scripts/batch_script_full.slurmThe unit test requires CMake version at least 3.11 to run, due to the FetchContent() module.
To install CMake newest version on Ubuntu follow https://askubuntu.com/a/865294
The above process may need to install openssl and pkg-config
Use the following commands to install them
sudo apt install pkg-config
sudo apt install libssl
To install google benchmark in ubuntu run the following command
sudo apt-get update
sudo apt-get install libbenchmark-dev
On campus cluster
module load singularity
cd ~/scratch #The current scripts assume the singularity container is in ~/scratch
singularity build cs484.sif docker://cjf12harry/cs484:0.0.2 #build a singularity container from docker image, we cannot reuse the course container due to old cmake versionTo test the set up, use the provided light script
cd ParRay
qsub ./scripts/batch_script_light.slurm