As described with S301, when r=2 and alphabetical characters are of the two types of A and T, blocks ($ block, A$ block, T$ block, AA block, AT block, TA block, and TT block) of seven types are used. Specifically, the number of blocks can be calculated according to an equation “(the number of blocks)=((h(r+1)?1)/(h?1)” obtained by generalizing an equation “7=23?1”. Then, the multicore CPU 101 can calculate the number of blocks based on the number of CPU cores so that (the number of CPU cores)×K=(the number of blocks) (K is, for example, a constant number in a range of 10 to 90 indicating several tens of times). Then, the multicore CPU 101 can substitute the calculated number of blocks into the equation obtained by the generalization, thereby automatically calculating the parameter r.
When the positive integer parameter r is increased, the number of blocks is exponentially increased. Thus, the value of r can be determined so that the number of blocks is several tens of times larger than the number of CPU cores. In this case, even when dynamic load distribution is executed by multithreading, and calculation time in the processes P(w) and Q(w) varies, calculation loads of the cores can be equalized and the speed can be efficiently increased by effectively using all the cores.
For example, the number of processes Q(w) executable independently of each other in parallel is equal to the number of text strings w having a length of r?1. When the alphabet size is h, the number of processes Q(w) executable independently of each other in parallel is equal to h(r?1). Thus, even when h=4 like the case of DNA sequence data, r can be selected so that the number of processes Q(w) is several tens of times larger than the number of usable CPU cores.