From a04b2b5c787971e6d78c1cfa33e97b2c7cd2604b Mon Sep 17 00:00:00 2001 From: Thomas Pfau Date: Wed, 7 Feb 2018 11:20:52 +0100 Subject: [PATCH] Update tests --- .../analysis/testSubspaces/testMinSpan.m | 18 ++++++++++++++++++ .../testFitC13Data/testFitC13Data.m | 11 +++++------ .../testPaint4Net/testPaint4Net.m | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/test/verifiedTests/analysis/testSubspaces/testMinSpan.m b/test/verifiedTests/analysis/testSubspaces/testMinSpan.m index 93093c9be6..01b5cef57b 100644 --- a/test/verifiedTests/analysis/testSubspaces/testMinSpan.m +++ b/test/verifiedTests/analysis/testSubspaces/testMinSpan.m @@ -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); diff --git a/test/verifiedTests/dataIntegration/testFitC13Data/testFitC13Data.m b/test/verifiedTests/dataIntegration/testFitC13Data/testFitC13Data.m index 7600e13be9..f7c7471bbd 100644 --- a/test/verifiedTests/dataIntegration/testFitC13Data/testFitC13Data.m +++ b/test/verifiedTests/dataIntegration/testFitC13Data/testFitC13Data.m @@ -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; @@ -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 diff --git a/test/verifiedTests/visualization/testPaint4Net/testPaint4Net.m b/test/verifiedTests/visualization/testPaint4Net/testPaint4Net.m index 9185c9b537..8285abc431 100644 --- a/test/verifiedTests/visualization/testPaint4Net/testPaint4Net.m +++ b/test/verifiedTests/visualization/testPaint4Net/testPaint4Net.m @@ -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});