My parallel worker fall back to 3 workers when running at 4 workers

I was running a my code using parpool(4) which using 4 workers. However, I noticed after the execution of my code(having each worker writing to their own files), the workers falls back to 3. What could be the reason behind this?

9 Comments

What are you examining that leads you to suspect that it is falling back to 3 workers?
Is work being done on the 4th worker for part of the time?
Yes! The work actually done on the 4th worker for part of the time, and then it is falling back to 3 worker. I tried to shutdown the pool and recreate the pool again, and same thing happen again.
Okay, what are you observing that leads you to say that the 4th worker stops being used?
I first created 4 files, and parpool(4) and I used getCurrentTask().ID to get the worker ID in the parfor loop to store the file in their unique files. I then open the file that each of the workers saved, I realize one worker is not saving to its unique files, and the workers has turn into 3.
Possibly one of the workers encountered an error ?
How do you check if it encountered an error or not?
I created a parpool(4), that working fine until I run it, then fall back to 3, it happen occasionally.
Then I check, it doesnt show any error
@Raymond Norris have you observed this in the past, number of workers dropping even though no tasks have errors and no tasks are finished ?
It looks familar. It is possible for a pool to drop a worker and still stay open, but MATLAB would have notified you
An unexpected error occurred during PARFOR: Error in remote execution of parfor: Java is shutting down
Sounds like there's some frailty in the parpool if no user code is explicitly erroring out. I would suggest contacting Support (support@mathworks.com).

Sign in to comment.

Answers (1)

I've had this issue before. Its a memory problem! Are you processing large dataset?

Categories

Products

Release

R2022a

Asked:

on 19 Aug 2022

Answered:

on 19 Jan 2025

Community Treasure Hunt

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

Start Hunting!