Ogs for multicore machines

I am trying to execute an ogs project file on a multicore machine with the OpenMP standard. I have set the env variable OMP_NUM_THREADS but only one core is used. How can I use more cores ?

1 Like

Hi, in the serial (non-MPI) version some of the linear solvers are run in parallel. Otherwise we have MPI parallelization with PETSc: pass or set cmake option -DOGS_USE_PETSC=On. Then you will have to partition the mesh (and possibly the boundary meshes) for X parts and run ogs with mpirun -np X ogs your.prj.
There is no openMP support in the assembly.

As @dmitri.naumov already pointed out, the non-MPI parallelization depends on the solver.
If you are using the Eigen library see https://eigen.tuxfamily.org/dox/TopicMultiThreading.html for details.
E.g., if you want to you use a direct solver you can compile OGS with MKL support and use the PardisoLU solver. If you prefer an iterative solver you can use Eigen’s BiCGSTAB solver. Keeping in mind that only the DIAGONAL/Jacobi preconditioner but not ILUT uses OpenMP threads.
It is also important to note that the size of the problem can affect the number of OpenMP threads.