Why does my Java code hang after the last statement when I try to deploy it using Parallel Computing Toolbox 4.2 (R2009b) and Builder JA 2.0.4 (R2009b)?

1 view (last 30 days)
I am trying to deploy a MATLAB code that uses a jobmanager to submit a job to 2 workers. I am using MATLAB distributed Computing Server to accomplish this. When I compile this code using Builder JA and run it using my driver program, the program hangs after executing the last statement. The main function in Java code does not exit and waits indefinitely.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Feb 2022
Edited: MathWorks Support Team on 22 Feb 2022
In order for deployed applications that use Parallel Computing Toolbox functions to terminate, the following function needs to be called after all the PCT functionality use is over or at the end of the MATLAB code.
pctRunDeployedCleanup
This function performs the necessary cleanup so that the client JVM can properly terminate when the deployed application exits.
For more information on this function, refer to the following link from the documentation:

More Answers (0)

Products


Release

R2009b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!