- Arjun Anil
- Aditi Chintawar
A study of how Otsu's method for Image Binarization can be sped up using CUDA and OpenMP multi-threading techniques.
Important
All SLURM scripts in this repository target the euler04 node on the instruction partition.
You must have access to the instruction partition to submit jobs as-is.
If you are running on a different cluster or partition, see Running on a different node or partition.
From the repo root:
cd dataset
make generate-dataset
cd ..This compiles and runs the dataset generator, placing binary image files under dataset/out/.
Each implementation has its own SLURM script. cd into the respective directories and queue using
sbatch
# p1 -- single-threaded baseline
cd p1-baseline && sbatch slurm-p1.sh && cd ..
# p3 -- OpenMP parallel (scales 1, 2, 4, 8 threads)
cd p3-openmp && sbatch slurm-p3.sh && cd ..
# p4 -- cuBLAS
cd p4-cublas && sbatch slurm-p4.sh && cd ..
# p5 -- CUDA Thrust
cd p5-thrust && sbatch slurm-p5.sh && cd ..
# p6 -- CUDA CUB
cd p6-cub && sbatch slurm-p6.sh && cd ..The slurm scripts will compile the required binary internally so no need to run an extra
compilation/make command.
Output and error logs are written to <pN>.out / <pN>.err inside the respective implementation directory.
Each SLURM script contains two directives that tie it to a specific node and partition:
#SBATCH --partition=instruction
#SBATCH --nodelist=euler04To run on a different setup, open the relevant script and:
- Change the partition -- replace
instructionwith your target partition name, or remove the--partitionline entirely to use your cluster's default. - Change or remove the node constraint -- replace
euler04with your target node name, or remove the--nodelistline entirely to let the scheduler choose any available node.
Alternatively, SLURM allows command-line flags to override script directives:
sbatch --partition=<your-partition> --nodelist=<your-node> p1-baseline/slurm-p1.sh