Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Matlab Parallel Computing Toolbox Support? #19

Open
arwelHughes opened this issue Jan 19, 2023 · 2 comments
Open

Enhancement: Matlab Parallel Computing Toolbox Support? #19

arwelHughes opened this issue Jan 19, 2023 · 2 comments
Assignees

Comments

@arwelHughes
Copy link

I Have Paramonte running well via the Matlab interface, and also am seeing significant speedup when running Paramonte from a terminal using 'mpiexec'.

However, I also have a Matlab Parallel Computing Toolbox (PCT) licence, and this 'under the hood' does execute code on multiple Matlab sessions, using an implementation of MPI (e.g. https://uk.mathworks.com/help/matlab-parallel-server/use-different-mpi-builds-on-unix-systems.html).

It seems then that it should be possible to run Paramonte using the PCT on multiple Matlab sessions, rather than resorting to 'mpiexec' from a separate terminal maybe? Is this planned?

(I've also emailed Mathworks with a question about this, and will report back what they say...)

Regards,
Arwel

@fagheri
Copy link
Member

fagheri commented Jan 19, 2023

@arwelHughes , thanks for the inquiry.
The question is about avoiding the direct launch of mpiexec and using the library in parallel from within MATLAB (Please correct my understanding of your question if it is not).
Possible Resolution
Currently, parallel simulations require a direct MPI launch. PCT might offer a solution, but I am not aware of it (if it does, please let us know). We are currently working on a new version of the library. As part of the new version, we are also exploring the possibility of thread parallelism (as opposed to MPI parallelism) in MATLAB.
I will try to prioritize this issue. But it may take a while (likely until mid-spring) to develop an efficient, elegant production-ready solution.

@JoshuaOsborneDATA
Copy link
Member

JoshuaOsborneDATA commented Feb 12, 2023

@arwelHughes, I'm currently in the process of implementing the parallelism you've requested into the package. There are multiple approaches to parallelism:

  1. The sampler automatically parallelizes the function calls and generates as many function values as there are processes.
  2. The sampler lets you return 'njob' number of function evaluations that are computed by the end-user (you) and returned to the sampler. Here' njob' refers to the number of processes
  3. The sampler has no idea of parallelism at all, however, the end-user (you) parallelizes the computations within the function and returns a single function evaluation to the sampler. I don't believe this is what you want.
    Which approach would best suit your requests here? In my opinion the first approach is best as it does not require any extra work from the end-user (you).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants