fixed bug in parallel generating input matrics.