Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tpfau committed Apr 5, 2018
1 parent 55ffd66 commit a04b2b5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
18 changes: 18 additions & 0 deletions test/verifiedTests/analysis/testSubspaces/testMinSpan.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@
% Setup parameters and run detMinSpan
params.saveIntV = 0; % Do not save intermediate output

%This test runs fluxVariability. So we have to start te parallel pool
%before the solver is set.
%The following can be done with any allowed solver, but e.g. pdco will fail, so we will run a few others.
% create a parallel pool
try
%Shut down any existing pool
minWorkers = 2;
myCluster = parcluster(parallel.defaultClusterProfile);

if myCluster.NumWorkers >= minWorkers
poolobj = gcp('nocreate'); % if no pool, do not create new one.
if isempty(poolobj)
parpool(minWorkers); % launch minWorkers workers
end
end
catch
disp('Trying Non Parallel')
end


changeCobraSolver('gurobi', 'all', 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

%For some odd reason, this fails on 2015b under certain conditions. so we
%will skip the test on 2015b.
matver = ver('MATLAB');
global CBT_MISSING_REQUIREMENTS
if isequal(matver.Version,'8.6')
error(CBT_MISSING_REQUIREMENTS,'ParPool is likely to fail on 2015b. Skipping this test');
end
% matver = ver('MATLAB');
% global CBT_MISSING_REQUIREMENTS
% if isequal(matver.Version,'8.6')
% error(CBT_MISSING_REQUIREMENTS,'ParPool is likely to fail on 2015b. Skipping this test');
% end

% save the current path
currentDir = pwd;
Expand All @@ -32,7 +32,6 @@
load('expdata.mat', 'expdata'); % load data
load('point.mat', 'v0'); % load initial point

%The following can be done with any allowed solver, but e.g. pdco will fail, so we will run a few others.
% create a parallel pool
try
%Shut down any existing pool
Expand Down
18 changes: 18 additions & 0 deletions test/verifiedTests/visualization/testPaint4Net/testPaint4Net.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@
load('testPaint4Net.mat');
model = readCbModel('testPaint4Net.mat','modelName','model');

%Paint4Net uses fluxVariability therefore start the parpool if available.
%The following can be done with any allowed solver, but e.g. pdco will fail, so we will run a few others.
% create a parallel pool
try
%Shut down any existing pool
minWorkers = 2;
myCluster = parcluster(parallel.defaultClusterProfile);

if myCluster.NumWorkers >= minWorkers
poolobj = gcp('nocreate'); % if no pool, do not create new one.
if isempty(poolobj)
parpool(minWorkers); % launch minWorkers workers
end
end
catch
disp('Trying Non Parallel')
end


for k = 1:length(solvers.LP)
fprintf(' -- Running testPaint4Net using the solver interface: %s ... ', solvers.LP{k});
Expand Down

0 comments on commit a04b2b5

Please sign in to comment.