Parallel algorithm to compute similarity matrix works beautifully