Unifying and optimizing parallel linear algebra algorithms