split the matrix to different threads