Hi Dmitry,

thanks for reporting this. I also noticed the same issue recently. The problem 
is that the dune-uggrid gridview is not thread-safe (yet).
It works fine in many situation but in combination with MPI there seems to be 
an unfixed issue. dune-uggrid doesn’t actually claim to be thread-safe at the 
moment.
This means, we should turn off multithreading for this case. I will file an 
issue report so we fix this for the upcoming release.

Unfortunately this means that you currently can’t profit from multithreading 
with your setup.
If you can switch to dune-alugrid you should be safe, because alugrid 
guarantees thread-safe grid views and this is also better tested.

Best wishes
Timo


> On 4 Sep 2022, at 21:06, Dmitry Pavlov <dmitry.pav...@outlook.com> wrote:
> 
> Hello,
> 
> Since the introduction of multithreading in DuMux, some of my programs became 
> broken unless I turn off the multithreading (Assembly.Multithreading = No).
> 
> Here is what happens:
> 
> $ mpirun -n 3 ../build-cmake/app/myprogram params.input 
> -Assembly.Multithreading Yes
> Rank 2: Reading parameters from file params.input.
> Rank 0: Reading parameters from file params.input.
> Rank 1: Reading parameters from file params.input.
> increased coupling table, now 131072 entries
> increased object table, now 131072 entries
> increased coupling table, now 131072 entries
> increased object table, now 131072 entries
> Computed bounding box tree with 45885 nodes for 22943 grid entites in 
> 0.0108701 seconds.
> Computed bounding box tree with 45885 nodes for 22943 grid entites in 
> 0.0119696 seconds.
> Computed bounding box tree with 45843 nodes for 22922 grid entites in 
> 0.0134437 seconds.
> Computed bounding box tree with 45885 nodes for 22943 grid entites in 
> 0.0110555 seconds.
> Computed bounding box tree with 45885 nodes for 22943 grid entites in 
> 0.0119418 seconds.
> Computed bounding box tree with 45843 nodes for 22922 grid entites in 
> 0.0132196 seconds.
> Colored 22943 elements with 10 colors in 0.027214792 seconds.
> Colored 22943 elements with 10 colors in 0.031937611 seconds.
> Colored 22922 elements with 11 colors in 0.039886839 seconds.
> 
> Newton solver configured with the following options and parameters:
>  -- Newton.EnableAbsoluteResidualCriterion = true
>  -- Newton.EnableResidualCriterion = true
>  -- Newton.MaxAbsoluteResidual = 1e-05
>  -- Newton.ResidualReduction = 1e-05
>  -- Newton.MinSteps = 1
>  -- Newton.MaxSteps = 18
>  -- Newton.TargetSteps = 10
>  -- Newton.RetryTimeStepReductionFactor = 0.5
>  -- Newton.MaxTimeStepDivisions = 10
> 
> Newton iteration  1 done, residual = 1.2153e+00
> Newton iteration  2 done, residual = 1.6401e-01
> Newton iteration  3 done, residual = 3.3126e-03
> Newton iteration  4 done, residual = 1.8403e-06
> Assemble/solve/update time: 0.98(19.48%)/3.7(74.34%)/0.31(6.18%)
> [  0%] Time step 1 done in 5 seconds. Wall clock time: 5.0086, time: 600, 
> time step size: 600
> Newton iteration  1 done, residual = 3.0417e-06
> Assemble/solve/update time: 0.28(15.72%)/1.5(81.67%)/0.047(2.61%)
> [  0%] Time step 2 done in 1.8 seconds. Wall clock time: 6.8551, time: 1200, 
> time step size: 600
> Newton iteration  1 done, residual = 5.9808e-07
> Assemble/solve/update time: 0.24(12.95%)/1.5(81.64%)/0.1(5.41%)
> [  0%] Time step 3 done in 1.9 seconds. Wall clock time: 8.7735, time: 1800, 
> time step size: 600
> Assemble: r(x^k) = dS/dt + div F - q;   M = grad rDune reported error: 
> GridError 
> [partitionType:/home/dpavlov/DUMUX/dune-grid/dune/grid/uggrid/uggridentity.hh:128]:
>  Unknown priority 4
> 
> 
> I use stock DuMux 3.5 and DUNE modules are at version 2.8. My grid is 2D and 
> is loaded from an msh file version 2. The simulation is two-phase porous flow 
> (2pnc model).
> 
> I do not have a short example now. I wonder if anybody did run into this 
> issue before.
> 
> 
> Best regards,
> 
> Dmitry
> 
> 
> 
> _______________________________________________
> DuMux mailing list
> DuMux@listserv.uni-stuttgart.de
> https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

_______________________________________________
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to