termination command `kill -9 {id}` no longer works (from 2022b to 2024b)

조회 수: 3 (최근 30일)
zhi
zhi 2025년 6월 7일
답변: Steven Lord 2025년 6월 7일
My HPC (unix/slurm) used to have matlab 2022b, on which the kill -9 command works well to terminate a job upon completion.
self.call_args = re.sub(r'\s+', ' ', '''"
diary('{0}');
addpath('{1}');
try,
{3},
rc = 0,
catch me,
fprintf('%s: %s\\n', me.identifier, me.message),
rc = 1,
end,
diary off;
fileID = fopen('{2}', 'w');
if rc,
fprintf(fileID, '{2} failed; see log file'),
else,
fprintf(fileID, '{2} run successfully'),
end,
fclose(fileID);
id = feature('getpid');
if ispc,
cmd = sprintf('taskkill /pid %d /f',id),
elseif (ismac || isunix),
cmd = sprintf('kill -9 %d',id),
else,
error('unknown operating system'),
end,
system(cmd);
exit(0);
"'''.format(norm_log, norm_base, self.exec_file, source_exec), flags = re.MULTILINE)
However, since the upgrade to 2024b, the command no longer works and matlab would hang upcome completion of a job.
I'm trying to understand what changed across the two versions.
One candidate is “MathWorks Service Host” which could have been introduced just now:
> Starting from R2024a, all MATLAB installations require MathWorks Service Host.
But matlab’s official release notes don’t mention whether the unix version turned on the feature from 2022b to 2024b. So I'm not sure, so coming here for ideas.

답변 (1개)

Steven Lord
Steven Lord 2025년 6월 7일
Rather than killing the process, why not just call quit to exit MATLAB?

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by