On 2014-11-14 15:33, Jørgen Kvalsvik wrote:
I have an update and a few questions regarding my project. For
introduction and details, please see
http://www.opm-project.org/pipermail/opm/2014-October/000664.html

Thanks a lot for the update. I haven't digested the message yet and I don't feel qualified to answer just yet so I'll comment on just one point.

Using my SparseMatrixBuilder, now modified to rely on std::map instead
of std::vector

As a general rule I usually distrust std::map<> when it comes to handling anything that has to do with computational performance and inner loops. Std::map<> is to a very great extent a "pointer focused" container (tree-like structure internally). What's more discouraging still is that std::unordered_map<> isn't all that much better though there is some improvement. You can look up

    Chandler Carruth CppCon 2014

on YouTube for some stories. Mr. Carruth is a Clang and LLVM developer at Google.

Also, the conversion from coordinate format to CSR (or CSC for that matter) is a solved problem that is O(nnz) complexity--including optionally generating sorted rows (columns) without repeated indices. You don't actually need the std::map<> at all, just the triplets (in whatever form). This just means that there is further potential for performance improvements. That's good.

Still

I am able to remove all allocation code in the
IncompFlowSolverHybrid. I consider this a win, because it
significantly simplifies setting up sparse matrices and leaks fewer
implementation details

That's good too! As the person who perpetrated that code in the first place I can attest that it was rather painful to write and difficult to extend.

I am able to reduce the running time of
upscale-benchmark-relperm. I attribute this to a more efficient
allocation and instantiation of the matrices, as the BCRSMatrix now can
be build row-wise and not in the more inefficient random mode.

Do keep in mind, however, that per-row construction leads to a data structure in which the matrix values are stored in separate containers per row whereas the original scheme uses a single contiguous array for the values. That may or may not matter in any particular application.


Bård

_______________________________________________
Opm mailing list
[email protected]
http://www.opm-project.org/mailman/listinfo/opm

Reply via email to