Code covered by the BSD License
-
Exercise1_SimBio_parfor
-
Exercise3_SimBio_jobs
-
Exercise5_batch_parfor
-
Exercise6_batch_spmd
-
Message Passing used in Calcu...
-
Portfolio Optimization Demo (...
-
Demo1_plot_optim(fig, risk, r...
PCTDEMO_PLOT_OPTIM Create the graphs for the Parallel Computing Toolbox
-
Demo1_plot_optim(fig, risk, r...
PCTDEMO_PLOT_OPTIM Create the graphs for the Parallel Computing Toolbox
-
Demo1_setup_optim(difficulty)
PCTDEMO_SETUP_OPTIM Perform the initialization for the Parallel Computing
-
Demo1_setup_optim(difficulty)
PCTDEMO_SETUP_OPTIM Perform the initialization for the Parallel Computing
-
Demo1_task_optim(covMat, expR...
PCTDEMO_TASK_OPTIM Find the frontier for a stock portfolio with the given
-
Demo1_task_optim_parfor(covMa...
PCTDEMO_TASK_OPTIM Find the frontier for a stock portfolio with the given
-
Demo1_task_optim_parfor(covMa...
PCTDEMO_TASK_OPTIM Find the frontier for a stock portfolio with the given
-
Demo4_plot_optim(fig, risk, r...
PCTDEMO_PLOT_OPTIM Create the graphs for the Parallel Computing Toolbox
-
Demo4_setup_optim(difficulty)
PCTDEMO_SETUP_OPTIM Perform the initialization for the Parallel Computing
-
Demo4_task_optim(covMat, expR...
PCTDEMO_TASK_OPTIM Find the frontier for a stock portfolio with the given
-
Demo4_task_optim_jobs(covMat,...
Demo4_task_optim_scheduled_job Find the frontier for a stock portfolio with the given
-
Demo6_plot_optim(fig, risk, r...
PCTDEMO_PLOT_OPTIM Create the graphs for the Parallel Computing Toolbox
-
Demo6_setup_optim(difficulty)
PCTDEMO_SETUP_OPTIM Perform the initialization for the Parallel Computing
-
Demo6_task_optim_parfor(covMa...
Demo6_task_optim_parfor Find the frontier for a stock portfolio with the given
-
Exercise2_loadReturns(nFiles,...
Loads in data from up mat files inside
-
Exercise2_plot_optim(fig, ris...
PCTDEMO_PLOT_OPTIM Create the graphs for the Parallel Computing Toolbox
-
Exercise2_task_optim(covMat, ...
PCTDEMO_TASK_OPTIM Find the frontier for a stock portfolio with the given
-
Exercise6_loadReturns(nFiles,...
Loads in data from up mat files inside
-
Exercise6_plot_optim(fig, ris...
PCTDEMO_PLOT_OPTIM Create the graphs for the Parallel Computing Toolbox
-
Exercise6_task_optim(covMat, ...
PCTDEMO_TASK_OPTIM Find the frontier for a stock portfolio with the given
-
calcRequiredDims(szA, multipl...
-
createSurface( n,distDim )
CREATESURFACE Creates a surface held in distributed arrays
-
haloNodes(A, noElem)
HALONODES returns a variant array containing localPart of the input
-
sampleFunctionAvg (a,sampleRa...
SAMPLEFUNCTION
-
sampleFunctionNoAvg( b, sampl...
SAMPLEFUNCTION2 Summary of this function goes here
-
sbiosimulate_wrapper(noRuns)
Load simbiology project
-
sbiosimulate_wrapper(noRuns)
Load simbiology project
-
sbiosimulate_wrapper(noRuns)
Load simbiology project
-
simulation
Load simbiology project
-
simulation
Load simbiology project
-
simulation
Load simbiology project
-
Demo1_PorfolioOptim.m
-
Demo2_spmd.m
-
Demo3_batchPortfolioOptim.m
-
Demo3_batchSPMD.m
-
Demo3_spmd_script.m
-
Demo3_task_optim_script.m
-
Demo4_PorfolioOptim.m
-
Demo5_MPI.m
-
Demo6_batchPortfolioOptim.m
-
Demo6_task_optim_script.m
-
Exercise5_interactive_parfor.m
-
Exercise5_jobs.m
-
Exercise5_simBioScriptParfor.m
-
Exercise6_OptimScriptSPMD.m
-
Exercise6_interactive_spmd.m
-
Parfor version of Portfolio O...
-
Parfor version of Portfolio O...
-
Parfor version of Portfolio O...
-
Parfor version of Portfolio O...
-
Portfolio Optimization Demo (...
-
View all files
|
|
| Demo5_MPI.m |
%% Simple MPI Example
% Sending Data from Lab1 to Lab2 and Lab4 using labSend
% Lab1 and Lab2 Receive Data from Lab1 using labReceive
%
% This is running in an spmd block but the code inside the block
% could run in a paralleljob or in pmode.
clear all
%% Open up a matlabpool
if matlabpool('size') == 0
matlabpool open 4
else
warning('MATLAB:poolOpen', 'matlabpool already open')
end
%% Running MPI commands
source = 1;
destination = [2, 4];
spmd
if labindex == source
% Send some data from source lab
testData = 1000;
labSend(testData, destination);
elseif any(labindex == destination)
% Receive on destination lab
recvdata = labReceive(source);
fprintf('I am lab %d out of %d \n', labindex, numlabs);
disp(recvdata)
end
end
%% Access data on the client
disp(recvdata)
%% Close the matlabpool
if matlabpool('size') ~= 0
matlabpool close
else
warning('MATLAB:poolClose', 'matlabpool already closed')
end
|
|
Contact us at files@mathworks.com