Skip to content
Snippets Groups Projects
Commit baa2a4b8 authored by Yoann Guilhem's avatar Yoann Guilhem
Browse files

Bugfix for gtOarGetStats.

parent 8e2fbaf3
No related branches found
No related tags found
No related merge requests found
......@@ -18,13 +18,13 @@ function statsTable = gtOarGetStats(IDs, vars)
% Version 001 04-04-2012 by Nvigano
% Creating the job query string
jobsStr = ['! oarstat' sprintf(' -j %d', IDs) ' -f'];
jobsStr = ['oarstat -f' sprintf(' -j %d', IDs)];
% Getting the output
[~, output] = unix(jobsStr);
[~, output] = system(jobsStr);
% Now we chop the input:
jobsBlocks = regexp(output, '\n\n', 'split');
statsTable = cell(1, length(jobsBlocks) - 1);
jobsBlocks = regexp(output(1:end-1), '\n\n', 'split');
statsTable = cell(1, length(jobsBlocks));
for ii = 1:length(IDs)
statsTable{ii}.('Job_Id') = IDs(ii);
end
......@@ -69,7 +69,7 @@ function statsTable = gtOarGetStats(IDs, vars)
[newVars, acceptedIDs] = intersect(vars, possible_vars);
if (length(newVars) ~= length(vars))
fprintf('Removing not existing variables for OAR:\n ')
fprintf('Removing not existing variables for OAR:\n ');
rejectedIDs = setdiff(1:length(vars), acceptedIDs);
fprintf(' %s', vars{rejectedIDs});
fprintf('\n');
......@@ -81,7 +81,6 @@ function statsTable = gtOarGetStats(IDs, vars)
incomplete_logs = false;
% Now extract info from the output of 'oarstat'
if (~isempty(statsTable))
jobsBlocks = jobsBlocks(1:end-1);
for ii = 1:length(vars)
stats = regexp(jobsBlocks, [vars{ii} ' = (?<' vars{ii} '>.*?)\n'], 'names', 'once');
if (isempty(stats))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment