CSE305 Project: Parallel sequence alignment
Authors: Andreea Patarlageanu, Marta Teodora Trales, Joanne Jegou
During this project, we worked on local parallel sequence alignement with affine gap penalty, with the set of characters {A, C, G, T}. We focused on the computation of the score and not the alignement it-self. We implemented the Smith-Waterman algorithm, which is a dynamic programming algorithm. Because of that, parallelization of this algorithm requires some thinking. We first implemented a simple sequential version on CPU, then we introduced the lazy computation of the matrices. We worked on parallelizing those algorithms, and executing them on GPU.
We worked together on implementation of several algorithms, starting first with CPU and then working on the GPU code. We decided on the work to be done as we advanced in the project, and met in person at least once a week.
Please note that the commits on Github are not completely representative of the work done by each of the group members, as Andreea and Joanne wrote together some of the files but committed from a single computer.
main.cppis the first sequential implementation of the parallel sequence alignement on CPUlazySmith.cppis the sequential implementation of the Lazy Smith AlgorithmlazySmith_parallel_threads.cppis the parallel version of the Lazy Smith algorithm using threadslazySmith_parallel_future.cppis the parallel version of the Lazy Smith algorithm usingfuturebut it is NOT WORKING
simpleGPU.cuthe simple sequential implementation on GPU with wavefront approach on anti-diagonalscudaSmithM.cua second version of the simple sequential implementation on GPU (we had a miscommunication and both of us took that approach on GPU)cudaLazy.cppthe parallelised lazy implementation of the algorithm on GPUsmithDiagonalGPU.cuthe working version of the wavefront approach on anti-diagonals on GPU, with high performance (and speedup)
Makefile1the makefile for testing on CPU only (runmake -f Makefile1)Makefile2the makefile for testing on CPU and GPU (runmake -f Makefile2)TestFile.cppthe testing file for CPU (run./test_runner1after compiling)TestFileWithGPU.cppthe testing file for CPU and GPU (run./test_runner2after compiling)algoCPU.hthe header file for .cpp filesalgoGPU.hthe header file for .cu files
We have two main testing files, which indicates the SUCCESS of the computations (success corresponds to the equality of all computed scores, we get an ERROR otherwise), the time for computations, and the speed-up for each method compared to the simple sequential version).
To test the different files, we commented out all the void main() functions in the different files. To run the files indepently, you have to uncomment the main() functions.
Computations and testing on GPU are executed through SSH on the school's computers. The testing is as follows:
TestFile.cppis the testing file for CPU computations only. It is compiled through the commandmake -f Makefile1and ran with./test_runner1TestFileWithGPU.cppis the testing file that includes comparison with GPU computations as well. It is compiled through the commandmake -f Makefile2and ran with./test_runner2
The parameters for testing can be changed directly in the main() function of the test files: we test the score computation for different values of the length N of the sequences to compare, which are defined in the sequence_lengths vector. num_tests is the number of tests performed for each N. We fixed by default the score's parameters MATCH, MISMATCH, GAP_INIT and GAP_EXT to respectively 1, -1, 1, 1, and they have to be changed directly in the function files.
When running the test files, the user will be prompted to enter 1 or 2:
1outputs the time and speed-up per test for eachN(it gives the result of all tests)2outputs the average speed-up for each method for eachN(to compare the improvement in performance for each method depending on the sequence lengthN).