Skip to content

Commit

Permalink
Setting correct path on each worker in parfor
Browse files Browse the repository at this point in the history
  • Loading branch information
tpfau committed Apr 5, 2018
1 parent f7117c2 commit 325bbec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/analysis/FVA/fluxVariability.m
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,13 @@
lpsolver = CBT_LP_SOLVER;
qpsolver = CBT_QP_SOLVER;
milpsolver = CBT_MILP_SOLVER;
cpath = path;
if minNorm
parfor i = 1:length(rxnNameList)
changeCobraSolver(qpsolver,'QP',0,-1);
changeCobraSolver(lpsolver,'LP',0,-1);
changeCobraSolver(milpsolver,'MILP',0,-1);
path(cpath);
parLPproblem = LPproblem;
parLPproblem.osense = 1;
[minFlux(i),Vmin(:,i)] = calcSolForEntry(model,rxnNameList,i,parLPproblem,1, method, allowLoops,printLevel,minNorm,cpxControl,preCompMinSols{i});
Expand All @@ -340,6 +342,7 @@
changeCobraSolver(qpsolver,'QP',0,-1);
changeCobraSolver(lpsolver,'LP',0,-1);
changeCobraSolver(milpsolver,'MILP',0,-1);
path(cpath);
parLPproblem = LPproblem;
[mins(i)] = calcSolForEntry(model,rxnListMin,i,parLPproblem,1, method, allowLoops,printLevel,minNorm,cpxControl,[]);
end
Expand All @@ -352,6 +355,7 @@
changeCobraSolver(qpsolver,'QP',0,-1);
changeCobraSolver(lpsolver,'LP',0,-1);
changeCobraSolver(milpsolver,'MILP',0,-1);
path(cpath);
parLPproblem = LPproblem;
[maxs(i)] = calcSolForEntry(model,rxnListMax,i,parLPproblem,1, method, allowLoops,printLevel,minNorm,cpxControl,[]);
end
Expand Down

0 comments on commit 325bbec

Please sign in to comment.