JuliaSmoothOptimizers / MUMPS.jl

A Julia Interface to MUMPS
Other
43 stars 15 forks source link

Using custom MPI communicator #130

Closed guiburon closed 8 months ago

guiburon commented 8 months ago

Hi!

I need to use my own MPI communicator for MUMPS. I studied the constructors in src/mumps_struc.jl and found out it is not that straightforward to do if you want to keep the convenient constructor that set the real and integer parameters.

I added the optional argument comm::Integer = DEFAULT_FORTRAN_COMMUNICATOR to the constructor. When using a custom MPI.Comm, I pass its .val field to the constructor and everything works fine with MPICH_jll with Julia 1.10 on Linux. I link a PR to illustrate.

It appears more logs are printed by MUMPS though with the error INFO(1) = -3 INFO(2) = -2 output by the non-root MPI procs of my custom communicator when I finalize the solver. It does not seem to be an error though because the solver is actually called with job = -2 to finalize, the results are accurate and the CPU usage is as expected. With the default communicator, only the root proc seems to be logging so maybe the same "errors" happen in the background?

I am out of my depth here because I don't even know how MUMPS.jl works with this mysterious DEFAULT_FORTRAN_COMMUNICATOR. Am I doing things correctly?

Thanks.

Guillaume