Submit job to specified workers in an MJS cluster
7 次查看(过去 30 天)
显示 更早的评论
My tasks consume a large amount of memory so that I should not submit more than 5 tasks to each node in our group cluster (each node has 8 workers). Can I tell MJS to use only 5 workers in each node? If not possible, can we do it manually?
1 个评论
Peter Schwander
2020-1-7
I have a somewhat related question. In MATLAB R2019a, I want that have successive tasks to go on different worker nodes. This was possible e.g. in MATLAB2015b by chosing appropriate names for the workers, i.e.
./startworker -name worker000 -jobmanagerhost boltzmann.phys.uwm.edu -remotehost compute-0-0 -v -clean
./startworker -name worker001 -jobmanagerhost boltzmann.phys.uwm.edu -remotehost compute-0-1 -v -clean
./startworker -name worker002 -jobmanagerhost boltzmann.phys.uwm.edu -remotehost compute-0-2 -v -clean
./startworker -name worker003 -jobmanagerhost boltzmann.phys.uwm.edu -remotehost compute-0-3 -v -clean
However, with MATLAB R2019a, this scheme does not work anymore.
采纳的回答
Thomas Ibbotson
2016-1-4
Unfortunately, this is not possible. You could temporarily reduce the number of workers on each node to 5. The MJS startworker and stopworker scripts can be run remotely from the client machine. Of course you would not want to stop a worker that was running someone else's job, so you would need to pause the queue and wait for all other jobs to finish running first.
Something a bit like this (untested) code should work (replace 'MyMJSProfile' with your MJS profile):
c = parcluster('MyMJSProfile');
% Pause the queue so no more jobs will run
pause(c);
% Create and submit our job to the queue
j = batch('myJobScript');
% Promote the job to the top of the queue so it will
% run next
while true
[~, q, ~, ~] = findJob(c);
if q(1) == j
break;
else
promote(c, j);
end
end
% Wait for all other jobs to finish running
[~, ~, runningJobs, ~] = c.findJob;
if ~isempty(runningJobs)
wait(runningJobs);
end
% Now run stopworker on each node until there are only 5 workers on each node.
% Note I've missed out the code that loops through the nodes and stops the
% right number of workers.
system([matlabroot '/toolbox/distcomp/bin/stopworker -remotehost myNode1 -name myWorker1']);
% Resume the queue so the job runs
resume(c);
wait(j);
% The job has finished now so we can start the workers again
system([matlabroot '/toolbox/distcomp/bin/startworker -remotehost myNode1 -name myWorker1']);
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!