precice / tutorials

Various tutorial cases for the coupling library preCICE with real solvers. These files are meant to be rendered on precice.org, so don't look at the README files here.
https://www.precice.org/
GNU Lesser General Public License v3.0
101 stars 105 forks source link

Nutils cases are extremely slower than the rest #506

Open MakisH opened 3 months ago

MakisH commented 3 months ago

As stated in the Nutils Book, Nutils is not (yet) the fastest tool in its class. I experience that in our perpendicular-flap tutorial, where especially our fluid-nutils case is taking orders of magnitude longer than the rest of the solvers (half a day instead of a couple of minutes).

Following the official suggestions, I tried something like

OMP_NUM_THREADS=1 NUTILS_NPROCS=4 python myscript.py

without a directly visible impact (did not measure). I also commented-out the VTK output at the end of each coupling time window.

However, I think that we should first have a closer look and check if we are doing any extremely unnecessary work (e.g., too tight convergence measures, too much output, etc). The mesh already seems to be very coarse.

@gertjanvanzwieten @uekerman do you maybe have any quick ideas?

If we could drop the simulation time to a couple of minutes (or anything less than an hour), we could also integrate this in our system tests.

uekerman commented 3 months ago

IIRC installing mkl should held to some extend. Then, Nutils picks a different solver backend.

Note that the fluid-nutils case uses different numerics than the other fluid cases. We solve for velocities and pressure simultaneously and we use H2-H1 elements. Cheaper would be to use H1-H1 + stabilization, but I also like that we keep the code + formulation here as simple as possible. And we use second-order in time, which we need for testing the waveforms.

If we find anything quick and simple, OK, but I would not want to change the numerics here.

For the systemtests, I would simply compute a few timesteps.

uekerman commented 3 months ago

There is already https://github.com/precice/tutorials/pull/429 which touches the case quite a bit.

MakisH commented 3 months ago

Update: @uekerman wanted to have a closer look into the numerics, but after the currently semi-done release cycle.

IshaanDesai commented 3 months ago

The participant micro-nutils in the two-scale heat conduction tutorial is also extremely slow compared to other micro simulations of similar kind, and I have a feeling that the numerics there has a lot of potential for improvement.