parpool use existing slurm job
Show older comments
If I've already started an interactive Slurm job with 5 nodes, how can I start a parpool using the resources allocated to that existing job?
Accepted Answer
More Answers (2)
Venkat Siddarth Reddy
on 15 Jan 2024
Edited: Venkat Siddarth Reddy
on 15 Jan 2024
0 votes
I understand that you are trying to create a parallel pool using the resources of a running Slurm job.
To achieve this,you will need to set up a Slurm profile in MATLAB, as this will enable "parpool" function to access the Slurm cluster.
Additionally, you will need to use the "MATLAB Parallel Server" since you're aiming to utilize multiple nodes of the cluster.
For more information on Slurm profiles and using the MATLAB Parallel Server with Slurm jobs, please refer to the following documentation:
- https://www.mathworks.com/help/matlab-parallel-server/install-and-configure-matlab-parallel-server-for-slurm-1.html
- https://it.stonybrook.edu/help/kb/using-matlabs-parallel-server-for-multi-core-and-multi-node-jobs
- https://www.mathworks.com/matlabcentral/answers/1749950-running-parfor-on-multiple-nodes-using-slurm
I hope this helps!
Edric Ellis
on 16 Jan 2024
clus = parcluster('mySlurmProfile') % set up as per Venkat's post
job = batch(clus, 'myScriptThatUsesParfor', Pool=20);
- Launch a job on your SLURM cluster with 21 workers
- When the job starts, the first worker becomes a non-interactive "client", and the remaining 20 are connected up as a parpool for use by that client
- That first worker executes your program myScriptThatUsesParfor
- Any parfor loops etc. inside that script use the 20 workers
Is that the sort of thing you want to achieve?
Categories
Find more on Third-Party Cluster Configuration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!