Skip to content

Commit

Permalink
took out global variable and used argument instead
Browse files Browse the repository at this point in the history
  • Loading branch information
marouenbg committed May 22, 2017
1 parent d67d7a6 commit d94f797
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions fastFVA.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@

%set a random log filename to avoid overwriting ongoing runs
rng('shuffle');
global filenameParfor;
filenameParfor = ['parfor_progress_', datestr(now, 30), '_', num2str(randi(9)), '.txt'];

% Turn on the load balancing for large problems
Expand Down Expand Up @@ -386,10 +385,10 @@
fprintf('\n -- Starting to loop through the %d workers. -- \n', nworkers);
fprintf('\n -- The splitting strategy is %d. -- \n', strategy);

out = parfor_progress(nworkers);
out = parfor_progress(nworkers,filenameParfor);

parfor i = 1:nworkers

rxnsKey = 0; %silence warning

%preparation of reactionKey
Expand Down Expand Up @@ -455,7 +454,7 @@
fprintf('\n----------------------------------------------------------------------------------\n');

% print out the percentage of the progress
percout = parfor_progress;
percout = parfor_progress(-1,filenameParfor);

if(percout < 100)
fprintf(' ==> %1.1f%% done. Please wait ...\n', percout);
Expand All @@ -468,7 +467,7 @@
% Aggregate results
optsol = iopt(1);
ret = max(iret);
out = parfor_progress(0);
out = parfor_progress(0,filenameParfor);

end

Expand Down

0 comments on commit d94f797

Please sign in to comment.