Skip to content

Commit

Permalink
Merge branch 'hotfix-1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
gBringout committed Apr 26, 2015
2 parents 4595d5a + 1df9a8c commit 519e5d1
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 60 deletions.
30 changes: 20 additions & 10 deletions otherFunctions/Field2.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,26 @@

disp('Calculation of the Field');

%activate the paralle function if license is available
[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
numWorkers = 0;
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end
if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
matlabpool open
%activate the parallel function
matlabVersion = version;
matlabVersion = str2num(matlabVersion(1:3));
if matlabVersion < 8.2
[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end

if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
% and at least 2 cores
matlabpool open
end
elseif matlabVersion >= 8.2
poolobj = gcp('nocreate'); % If no pool, do not create new one.
if isempty(poolobj)
parpool;
end
end

parfor xIndex = 1:nbrPointX;
Expand Down
30 changes: 20 additions & 10 deletions otherFunctions/Field3.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,26 @@

disp('Calculation of the Field');

%activate the paralle function if license is available
[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
numWorkers = 0;
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end
if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
matlabpool open
%activate the parallel function
matlabVersion = version;
matlabVersion = str2num(matlabVersion(1:3));
if matlabVersion < 8.2
[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end

if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
% and at least 2 cores
matlabpool open
end
elseif matlabVersion >= 8.2
poolobj = gcp('nocreate'); % If no pool, do not create new one.
if isempty(poolobj)
parpool;
end
end

for xIndex = 1:nbrPointX;
Expand Down
24 changes: 20 additions & 4 deletions streamBEM/coreFunctions/Amn2.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,26 @@
AY = zeros(size(node_1,2),size(node_2,2));
AZ = zeros(size(node_1,2),size(node_2,2));

[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
if matlabpool('size') == 0 && TF
% checking to see if the pool is already open and of we have the licence
matlabpool open
%activate the parallel function
matlabVersion = version;
matlabVersion = str2num(matlabVersion(1:3));
if matlabVersion < 8.2
[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end

if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
% and at least 2 cores
matlabpool open
end
elseif matlabVersion >= 8.2
poolobj = gcp('nocreate'); % If no pool, do not create new one.
if isempty(poolobj)
parpool;
end
end

tic
Expand Down
29 changes: 20 additions & 9 deletions streamBEM/coreFunctions/Cn7.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,26 @@
Cy = zeros(size(r,1),size(node,2));
Cz = zeros(size(r,1),size(node,2));

[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
numWorkers = 0;
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end
if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
matlabpool open
%activate the parallel function
matlabVersion = version;
matlabVersion = str2num(matlabVersion(1:3));
if matlabVersion < 8.2
[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end

if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
% and at least 2 cores
matlabpool open
end
elseif matlabVersion >= 8.2
poolobj = gcp('nocreate'); % If no pool, do not create new one.
if isempty(poolobj)
parpool;
end
end

fprintf('Loop n=%5.0i',0);
Expand Down
29 changes: 20 additions & 9 deletions streamBEM/coreFunctions/Laplacian3.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,26 @@
end
constante = 1/(4*pi*h^2);

[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
numWorkers = 0;
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end
if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
matlabpool open
%activate the parallel function
matlabVersion = version;
matlabVersion = str2num(matlabVersion(1:3));
if matlabVersion < 8.2
[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end

if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
% and at least 2 cores
matlabpool open
end
elseif matlabVersion >= 8.2
poolobj = gcp('nocreate'); % If no pool, do not create new one.
if isempty(poolobj)
parpool;
end
end

%%
Expand Down
29 changes: 20 additions & 9 deletions streamBEM/coreFunctions/Lmn10.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,26 @@

L = zeros(size(node_1,2),size(node_2,2)); % 1 = m, 2 = n

[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
numWorkers = 0;
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end
if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
matlabpool open
%activate the parallel function
matlabVersion = version;
matlabVersion = str2num(matlabVersion(1:3));
if matlabVersion < 8.2
[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end

if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
% and at least 2 cores
matlabpool open
end
elseif matlabVersion >= 8.2
poolobj = gcp('nocreate'); % If no pool, do not create new one.
if isempty(poolobj)
parpool;
end
end

tic
Expand Down
29 changes: 20 additions & 9 deletions streamBEM/coreFunctions/Rmn9.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,26 @@

conductorSurfaceResistance = rho/t;

[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
numWorkers = 0;
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end
if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
matlabpool open
%activate the parallel function
matlabVersion = version;
matlabVersion = str2num(matlabVersion(1:3));
if matlabVersion < 8.2
[TF,~] = license('checkout', 'Distrib_Computing_Toolbox');
if TF
schd = findResource('scheduler', 'configuration', 'local');
numWorkers = schd.ClusterSize;
end

if matlabpool('size') == 0 && TF && numWorkers >1
% checking to see if the pool is already open and of we have the licence
% and at least 2 cores
matlabpool open
end
elseif matlabVersion >= 8.2
poolobj = gcp('nocreate'); % If no pool, do not create new one.
if isempty(poolobj)
parpool;
end
end

%fprintf('Loop n=%5.0i',0);
Expand Down

0 comments on commit 519e5d1

Please sign in to comment.