function [out] = par_matlab_fun()
% Dummy matlab function that demonstrates parfor loop usage on the SCC

% Get the number of cores requested by the job
num_cores = str2num( getenv('NSLOTS') )

% Create a pool using only as many cores as requested by the job
parpool('local', num_cores)

parfor i = 1:20

   % Perform some computation
	for j = 1:10000
			  A = normrnd( 1:100, 1./(1:100) )
			  x = mean(A);
	end
end

display('Done')
out = 0
