gridap / GridapDistributed.jl

Parallel distributed-memory version of Gridap
MIT License
103 stars 15 forks source link

Issues found/lessons learned with MPI-parallel p-Laplacian solver using `NLsolve.jl` #21

Closed amartinhuertas closed 2 years ago

amartinhuertas commented 4 years ago

In this issue, I summarize the issues/lessons that I found/learned while developing MPIPETScDistributePLaplacianTests.jl, a parallel MPI program for the solution of the p-Laplacian non-linear PDE. As agreed, the efforts have been put in trying to leverage the NLsolve.jl Julia package. In the development process, I could explore, as a result of marathonian debugging sessions, quite deep into the call path within this package that is triggered when setting up the nonlinear solver in Gridap.jl as nls = NLSolver(show_trace=true, method=:newton). All observations refer to the current version of NLsolve.jl, which at the date of writing it is v4.4.0

Although I did not explore NLSolve.jl in full, and thus the observations in the sequel may not necessarily apply to other parts of the sw package, I am not sure if this package has been carefully developed with HPC/performance in mind, or it is rather though as a toy/academic software effort. In particular, I have the following concerns:

Apart from these concerns, NLsolve.jl uses extensively generic Julia interfaces, mainly AbstractArray and broadcasting interfaces. While some the methods in these interfaces are already efficiently supported by PETSc.jl, some other are not either supported at all or supported efficiently with the generic ÀbstractArray.jl fallbacks. In order to have MPIPETScDistributePLaplacianTests.jl working, I had to overload a number of different methods for PETSc.Vec{Float64}. In the sequel, I will enumerate what I had to overload and why. At present, these method definitions are written at the driver lever, but obviously we will have to move them to the appropriate packages. As I mentioned earlier, I did not go through the whole NLsolve.jl package, so that it is likely that there are other methods to be defined as well if we switch to other solvers in NLsolve.jl.

Finally, I also have the following concerns:

amartinhuertas commented 4 years ago

@fverdugo and @santiagobadia related