Skip to content

OpenMP parallelized assembly

Christoph Lehmann requested to merge chleh/ogs:openmp-parallel-assembly into master
  1. Feature description was added to the changelog
  2. Tests covering your feature were added?
  3. Any new feature or behavior change was documented?
  • implemented for
    • TH2M, TRM (via AssemblyMixin)
    • TRF (directly)
    • further processes will follow in the future
  • controlled by environment variable OGS_ASM_THREADS, not by OMP_NUM_THREADS!

Roll out to other processes

Option 1 – Use AssemblyMixin (preferred)

  • also enables submesh residuum output

Option 2

In the ...Process.h

+#include "ProcessLib/Assembly/ParallelVectorMatrixAssembler.h"

...

+    Assembly::ParallelVectorMatrixAssembler _pvma{*_jacobian_assembler};
  • could also be pulled up to the generic Process.h/base class Process

In the ...Process.cpp

-    GlobalExecutor::executeSelectedMemberDereferenced(
-        _global_assembler, &VectorMatrixAssembler::assembleWithJacobian,
-        _local_assemblers, pv.getActiveElementIDs(), dof_tables, t, dt, x, xdot,
-        process_id, M, K, b, Jac);
+    _pvma.assembleWithJacobian(_local_assemblers, pv.getActiveElementIDs(),
+                               dof_tables, t, dt, x, xdot, process_id, M, K, b,
+                               Jac);
Edited by Dmitry Yu. Naumov

Merge request reports