<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body dir="auto">
<div>I think this may have to do with the matrix reodering scheme. I think CHOLMOD, used by MATLAB backslash operator, uses AMD (approximate min. degree) ordering scheme by default. PETSc's default reordering scheme is nested dissection. For PETSc + MATLAB,
 use the option -pc_factor_mat_ordering_type qmd </div>
<div><br>
</div>
<div>Shri</div>
<div><br>
On Nov 21, 2014, at 11:23 AM, "Victor Magri" <<a href="mailto:victor.antonio.magri@gmail.com">victor.antonio.magri@gmail.com</a>> wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>I'm solving a linear system which comes from the discretization of an elliptic equation. The mesh has 1 million control volumes and there are two more constraints for the system.</div>
<div><br>
</div>
<div>First, I've solved it in MATLAB using backslash command, which in turn calls CHOLMOD once the matrix is SPD. Using tic and toc funtions, I could see that it takes about 2s for the system to be solved (See attached for more details).</div>
<div><br>
</div>
<div>I wrote both matrix and rhs in PETSc binary format and solved the linear system using the example problem defined in ksp/examples/tutorials/ex10.c. The command line options were:</div>
<div><br>
</div>
<div>
<div>mpiexec -n -1 ./ex10 -f A1mi.dat -rhs rhs1mi.dat -log_summary -ksp_monitos -ksp_view -ksp_type preonly -pc_type cholesky -pc_factor_mat_solver_package cholmod</div>
</div>
<div><br>
</div>
<div>The configuration parameters for CHOLMOD in PETSc and MATLAB seems the same, so I was expecting a similar computation time, but it took about 13s to solve in PETSc. (See attached for more details).</div>
<div><br>
</div>
<div>Why does CHOLMOD solution time differs between them?</div>
<div><br>
</div>
<div>If someone wants to try for yourself, here are the binaries for the matrix and the rhs, respectively.</div>
<div><a href="https://www.dropbox.com/s/q9s6mlrmv1qdxon/A1mi.dat?dl=0">https://www.dropbox.com/s/q9s6mlrmv1qdxon/A1mi.dat?dl=0</a><br>
</div>
<div><a href="https://www.dropbox.com/s/2zadcbjg5d9bycy/rhs1mi.dat?dl=0">https://www.dropbox.com/s/2zadcbjg5d9bycy/rhs1mi.dat?dl=0</a><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div><PetscOutput.dat></div>
</blockquote>
<blockquote type="cite">
<div><MatlabOutput.dat></div>
</blockquote>
</body>
</html>