write vertext file instead of matrix, and rework parallel processing