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

Parallel SIMUS Bug #2

Closed
apodkowa opened this issue May 10, 2022 · 2 comments
Closed

Parallel SIMUS Bug #2

apodkowa opened this issue May 10, 2022 · 2 comments

Comments

@apodkowa
Copy link
Contributor

It appears that parallel SIMUS doesn't work out of the box. I just downloaded the MUST toolbox and ran into the following error:

Error using simus (line 293)
DATENUM failed.

Error in UltrasoundSystem/simus (line 682)
            parfor (m = 1:M, kwargs.parcluster)

Caused by:
    Error using datenummx
    Use of function datenummx is not supported on a thread-based pool.

I suspect that MUST doesn't support this type of parfor syntax natively. It might require working with the maintainer to figure out a workable solution.

@thorstone25
Copy link
Owner

Hmmm, this may be specific to the type of parcluster.

Does it work if you setup your parpool manually with parpool('local', 'SpmdEnabled', false); and then call UltrasoundSystem/simus?

Does it work if you shutdown the parallel pool with delete(gcp('nocreate'))?

@thorstone25
Copy link
Owner

thorstone25 commented May 14, 2022

I just tested this on my system. It seems that parfor syntax is fine as it will run on a local parpool and on no parpool, just not a thread-based parpool.

The reason is the adMessage subroutine in the pfield.m function in MUST calls uiwait and msgbox. Even though it's not run, the interpreter errors when it detects a potential call to uiwait and/or msgbox.

There are 2 ways to get around this:

  • Use a local parpool with parpool('local', 'SpmdEnabled', false). You may have to shutdown the current one with delete(gcp('nocreate')). This is less memory efficient, but probably still better than single-threaded.
  • Comment out line 399 of pfield.m (the call to adMessage). Then use munlock pfield.m to unlock the file so that MATLAB loads it in again. This gives you the best performance.

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

2 participants