Skip to content
Snippets Groups Projects
Commit 6794750d authored by Nicola Vigano's avatar Nicola Vigano
Browse files

OAR-launching: tentative fix for the diversity of data structures

parent 22712a4b
No related branches found
No related tags found
No related merge requests found
......@@ -16,60 +16,59 @@ function script_location = make_oar_matlab(pathdir, tmpdir, tmpname, oarpars)
exportPreload = 'export LD_PRELOAD="${LD_PRELOAD}:';
disp('Loading configuration about external libraries from conf.xml')
xmlConf = xml_read(fullfile(GT_MATLAB_HOME, 'conf.xml'));
xml_conf = gtConfLoadXML();
% External execution time libraries, same as:
% ['source ' fullfile(GT_MATLAB_HOME, 'setup_gt_env')], ...
if (isfield(xmlConf, 'matlab') ...
&& isfield(xmlConf.matlab, 'libraries') ...
&& isfield(xmlConf.matlab.libraries, 'path'))
libs = xmlConf.matlab.libraries;
num_paths = numel(libs.path);
try
libraries_path = gtConfGetField(xml_conf, 'matlab.libraries.path');
num_paths = numel(libraries_path);
external_libs = cell(1, num_paths);
is_cell = iscell(libs.path);
is_cell = iscell(libraries_path);
for n = 1:num_paths
% We add them all, but only the ones that are really reached on
% the machine will be used. Unfortunately this could
% potentially create problems, even if it is unlikely
if (is_cell)
external_libs{n} = [exportLibary libs.path{n} '"'];
tmp_path = external_libs{n};
else
tmp_path = libs.path(n);
if isfield(tmp_path, 'CONTENT')
external_libs{n} = [exportLibary tmp_path.('CONTENT') '"'];
else
tmp_path
warning('OAR:params', 'Weird structure!')
end
tmp_path = external_libs(n);
end
tmp_path = gtConfFilterAttribute(tmp_path, 'hostname');
if (~isempty(tmp_path))
external_libs{n} = [exportLibary tmp_path '"'];
end
end
else
catch
external_libs = {};
end
if (isfield(xmlConf, 'matlab') ...
&& isfield(xmlConf.matlab, 'preload') ...
&& isfield(xmlConf.matlab.preload, 'path'))
libs = xmlConf.matlab.preload;
num_paths = numel(libs.path);
try
preloads_path = gtConfGetField(xml_conf, 'matlab.preload.path');
num_paths = numel(preloads_path);
preload_libs = cell(1, num_paths);
is_cell = iscell(libs.path);
is_cell = iscell(preloads_path);
for n = 1:num_paths
% We add them all, but only the ones that are really reached on
% the machine will be used. Unfortunately this could
% potentially create problems, even if it is unlikely
if (is_cell)
preload_libs{n} = [exportPreload libs.path{n} '"'];
tmp_path = preloads_path{n};
else
tmp_path = libs.path(n);
if isfield(tmp_path, 'CONTENT')
preload_libs{n} = [exportPreload tmp_path.('CONTENT') '"'];
else
tmp_path
warning('OAR:params', 'Weird structure!')
end
tmp_path = preloads_path(n);
end
tmp_path = gtConfFilterAttribute(tmp_path, 'hostname');
if (~isempty(tmp_path))
preload_libs{n} = [exportPreload tmp_path '"'];
end
end
else
catch
preload_libs = {};
end
......
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