precice / matlab-bindings

MATLAB language bindings for preCICE
https://www.precice.org
GNU Lesser General Public License v3.0
5 stars 3 forks source link

Support parallel runs (intra-solver parallelism) #3

Open BenjaminRodenberg opened 4 years ago

BenjaminRodenberg commented 4 years ago

Currently, the bindings do not support parallel runs. We should add this feature.

uekerman commented 4 years ago

What exactly do you mean by "parallel runs"? Shared memory parallelization of Matlab? Or does Matlab also offer distributed parallelization? If shared memory: do we want to treat the Matlab solver as a serial or as a parallel solver from preCICE perspective? If we treat it as a serial solver this should always be possible or am I overlooking sth?

BenjaminRodenberg commented 4 years ago

What exactly do you mean by "parallel runs"? Shared memory parallelization of Matlab? Or does Matlab also offer distributed parallelization? If shared memory: do we want to treat the Matlab solver as a serial or as a parallel solver from preCICE perspective? If we treat it as a serial solver this should always be possible or am I overlooking sth?

To be more clear: I mean intra-solver parallelism. I.e. the MATLAB solver running on several processes. Currently, we require the user to provide solverProcessIndex = 0 and solverProcessSize = 1, otherwise an error is thrown:

https://github.com/precice/matlab-bindings/blob/199fddccbd27215911fa1232d9f52b6040a10d73/%2Bprecice/%40SolverInterface/SolverInterface.m#L23-L27

From preCICE perspective nothing speaks against supporting intra-solver parallelism, but since the feature is untested with the MATLAB bindings, we currently do not support it and rather throw an error on unexpected user input.

uekerman commented 4 years ago

But which type of parallelization would you want to support? Shared memory parallelization? Using then more threads in preCICE has never been tested afaik. I am not sure if preCICE has enough thread-safety for this. Only letting one thread interact with preCICE might be just the right approach.