|
MASA-Core
|
MASA (Malleable Architecture for Sequence Aligners) is a software architecture that simplifies the implementation of the Smith-Waterman algorithm with Affine Gap penalties in any software/hardware architecture. MASA is divided in two parts: the "MASA Core", containing all the portable code; and the "MASA Extension", that contains the non-portable code. In order to create a new MASA extension, the non-portable part of the code must be re-implemented while the portable code must be kept untouched. The MASA architecture uses an oriented object paradigm to make the non-portable code low dependent of the portable code. This loosely coupled architecture produces an easier integration between the non-portable code and the portable code.
Each ported version of MASA to other architecture is called a "MASA Extension" and it will be mentioned like MASA-<ARCH>, where <ARCH> is the ported architecture. For instance, a MASA extension that uses the SSE2 instruction set can be called MASA-SSE2, while a MASA extension for MPI can be called MASA-MPI.
CUDAlign is the MASA extension for NVidia CUDA architecture. Historically, CUDAlign was firstly developed and then MASA was derived from it. MASA was developed as an effort to allow CUDAlign to be ported to any hardware/software architecture. Despite the fact that MASA was derived from CUDAlign, we will treat CUDAlign as the MASA-CUDA extension.
MASA inherited many algorithmic optimizations from CUDAlign, like linear memory usage, orthogonal execution, block pruning, incremental stages and checkpoint saving. The architectural optimizations of CUDAlign was kept in the MASA-CUDA extension code, for example loop unrollings, cached textures, k-neighborhood and phase division.
CUDAlign and its optimizations are well explained in [1] [2] [3] [4] [5].
To port MASA to any architecture, you must create an IAligner implementation (or a subclass of AbstractAligner) and a Parameter handler (a subclass of AbstractAlignerParameters). Then, create a main.cpp with the main() entry point and call the libmasa_entry_point(). Finally, compile the extension source code and link the object to the libmasa static library.
To understand how to implement these subclasses, read the documentation of IAligner, AbstractAligner and AbstractAlignerParameters. Then, you may want to copy some of the already existing extension to start a new extension for another platform. Proper changes to the Makefile.am may be necessary.
The MASA core is not thread-safe, so the extension must guarantee that the libmasa are not called concurrently. So, if the Aligner handles simultaneous thread with unsafe calls, consider extending from AbstractAlignerSafe instead of AbstractAligner.
Execute the following commands to compile MASA-Core.
autoreconf --force --install
./configure
make
This will create the libmasa.a static library.
Further compilation parameters are available using ./configure --help
All MASA extensions has the set of basic parameters, though they can extent this set to include extension-specific parameters. Considering that the extension binary is masa-extension, the most simple execution is
./masa-extension [fasta 1] [fasta 2]
but there are many parameters that may be necessary to use in order to obtain the desired features.
See ./masa-extension --help to an explanation of all the execution parameters.
1.7.6.1