SlideShare a Scribd company logo
PARALLEL COMPUTING (SAMPLE ASSIGNMENT)
Our online Tutors are available 24*7 to provide Help with Help with Parallel Computing
Homework/Assignment or a long term Graduate/Undergraduate Help with Parallel
Computing Project. Our Tutors being experienced and proficient in Help with Parallel
Computing ensure to provide high quality Help with Parallel Computing Homework Help.
Upload your Help with Parallel Computing Assignment at ‘Submit Your Assignment’
button or email it to . You can use our ‘Live
Chat’ option to schedule an Online Tutoring session with our Help with Parallel
Computing Tutors.
Finite difference equation
This sample assignment Compares the speed of the parallel computing toolbox functions vs
CPU for finite difference
test_gpu_array3.m
% script to test the speed of finite difference calculations on gpu vs cpu
% Mark Ward, University of Birmingham, r.m.ward@bham.ac.uk
LoopVals=500*(1:2); % how many times we want to loop the calculations for timing
NVals=1000*(1:4); % what array edge sizes we want to try
myPerf=zeros(length(LoopVals)+1,length(NVals)+1); % somewhere to store a table of
performance numbers
myPerf(2:end,1)=LoopVals; % record the loop sizes
myPerf(1,2:end)=NVals; % and array sizes
%======================
iGPU=true % true to run on GPU, false for CPU
%======================
for iLoopVals=1:length(LoopVals)
for iNVals=1:length(NVals)
N=NVals(iNVals);
% set up arrays for the finite difference calculation
if iGPU,
clear g1 iicentre
pause(0.5)
g=gpuDevice(1);
reset(g);
pause(0.5)
g1=gpuArray.zeros(N,N); %,'single');
iicentre=2:N-1;
iicentre=gpuArray(iicentre); %(int32(iicentre)) isn't noticeably
info@assignmentpedia.com
faster on average
iiup=iicentre+1;
iidown=iicentre-1;
else
g1=zeros(N,N);
iicentre=2:N-1; % indices to point to the array away from the
edges
iiup=iicentre+1; % and the edges
iidown=iicentre-1;
end
ii=round(0.4*N):round(0.6*N);g1(ii,ii)=1; % make the array hotter in the
centre
iLoop=LoopVals(iLoopVals);
fprintf('About to run %g loops of %g^2 2D finite difference
calculationn',iLoop,N)
tic % start timing
for ii=1:iLoop, % simplified finite difference. Should also have
temperature-dependent material properties.
if iGPU % run gpu code using arrayfun as it's faster than
overloading the normal syntax
g1(iicentre,iicentre)=arrayfun(@heat_eqn_fdiff,g1(iicentre,iicentre), ...
g1(iiup,iicentre),g1(iidown,iicentre), ...
g1(iicentre,iiup),g1(iicentre,iidown));
else % cpu is quicker using matrix operations, not arrayfun
g1(iicentre,iicentre)= 0.2*g1(iicentre,iicentre)+0.2* ...
(g1(iiup,iicentre)+g1(iidown,iicentre)+g1(iicentre,iiup)+g1(iicentre,iidown));
end
end
if iGPU,
g_res=gather(g1); % bring the results back from the gpu
else
g_res=g1;
end
t=toc; % stop timing after gathering the results back to main memory
myPerf(iLoopVals+1,iNVals+1)=N^2*iLoop/t/1e6 % speed in millions of fd
operations per second
imagesc(g_res,[0 1]);axis image;drawnow;pause(0.1) % show the
"temperature" plot
end
end
clear g1
g=gpuDevice(1);
reset(g);
% GTX580, arrayfun, indices as gpu arrays, single precision
% myPerf =
% 0 1000 2000 3000 4000
% 500 606.6 1332.2 1331.2 1222.8
% 1000 1000.6 1358.1 1342.7 1228.7
% all double precision below here:
% GTX580, arrayfun, indices as gpu arrays
% myPerf =
% 0 1000 2000 3000 4000
% 500 775.89 829.07 783.14 685.37
% 1000 813.41 831.59 803.56 688.19
% GTX580, arrayfun, indices on the cpu
% myPerf =
% 0 1000 2000 3000 4000
% 500 707.77 731.84 716.49 623.03
% 1000 733.92 741.25 720.24 596.46
% GTX 580, normal matlab syntax operating on gpu arrays
% myPerf =
% 0 1000 2000 3000 4000
% 500 551.02 568.05 537.08 500.59
% 1000 564.13 571.14 538.36 502.32
%cpu i5-2500K @ 4.2 GHz
% myPerf =
% 0 1000 2000 3000 4000
% 500 37.401 38.362 0 0
% 1000 0 0 0 0
visit us at www.assignmentpedia.com or email us at info@assignmentpedia.com or call us at +1 520 8371215

More Related Content

PPT
Parallel computing chapter 3
PPTX
Backprop
PPTX
PPT - Discovering Reinforcement Learning Algorithms
PDF
Algorithm basics
PDF
Efficient equity portfolios using mean variance optimisation in R
PDF
ALGORITHMS FOR PACKET ROUTING IN SWITCHING NETWORKS WITH RECONFIGURATION OVER...
PDF
Current Trends in Networking (Assignment)
PPTX
Tom Peters, Software Engineer, Ufora at MLconf ATL 2016
Parallel computing chapter 3
Backprop
PPT - Discovering Reinforcement Learning Algorithms
Algorithm basics
Efficient equity portfolios using mean variance optimisation in R
ALGORITHMS FOR PACKET ROUTING IN SWITCHING NETWORKS WITH RECONFIGURATION OVER...
Current Trends in Networking (Assignment)
Tom Peters, Software Engineer, Ufora at MLconf ATL 2016

Similar to Parallel computing homework help (20)

PPT
Code Tuning
PDF
PDF
Faster computation with matlab
PDF
Aosd2009 adams
PDF
ICML2013読み会 Large-Scale Learning with Less RAM via Randomization
PPTX
NYAI - Scaling Machine Learning Applications by Braxton McKee
PPTX
Braxton McKee, CEO & Founder, Ufora at MLconf NYC - 4/15/16
PDF
Distributed Radar Tracking Simulation Project
PDF
Distributed Radar Tracking Simulation Project
PPTX
PPT
Process synchronization(deepa)
ODP
Introduction to MPI
PDF
Data Analytics and Simulation in Parallel with MATLAB*
PPTX
Ch07-3-sourceCode.pptxhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
PPSX
matrixmultiplicationparallel.ppsx
PPSX
MAtrix Multiplication Parallel.ppsx
PPT
Operating System
PPT
ch3 Process Operation System lecture.ppt
PPTX
Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...
PDF
GPU Parallel Computing of Support Vector Machines as applied to Intrusion Det...
Code Tuning
Faster computation with matlab
Aosd2009 adams
ICML2013読み会 Large-Scale Learning with Less RAM via Randomization
NYAI - Scaling Machine Learning Applications by Braxton McKee
Braxton McKee, CEO & Founder, Ufora at MLconf NYC - 4/15/16
Distributed Radar Tracking Simulation Project
Distributed Radar Tracking Simulation Project
Process synchronization(deepa)
Introduction to MPI
Data Analytics and Simulation in Parallel with MATLAB*
Ch07-3-sourceCode.pptxhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
matrixmultiplicationparallel.ppsx
MAtrix Multiplication Parallel.ppsx
Operating System
ch3 Process Operation System lecture.ppt
Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...
GPU Parallel Computing of Support Vector Machines as applied to Intrusion Det...
Ad

More from Assignmentpedia (20)

PDF
Transmitter side components
PDF
Single object range detection
PDF
Sequential radar tracking
PDF
Resolution project
PDF
Radar cross section project
PDF
Radar application project help
PDF
Network costing analysis
PDF
Matlab simulation project
PDF
Matlab programming project
PDF
Links design
PDF
Image processing project using matlab
PDF
Help with root locus homework1
PDF
Transmitter subsystem
PDF
Computer Networks Homework Help
PDF
Theory of computation homework help
PDF
Econometrics Homework Help
PDF
Video Codec
PDF
Radar Spectral Analysis
PDF
Pi Controller
PDF
Help With Digital Communication Project
Transmitter side components
Single object range detection
Sequential radar tracking
Resolution project
Radar cross section project
Radar application project help
Network costing analysis
Matlab simulation project
Matlab programming project
Links design
Image processing project using matlab
Help with root locus homework1
Transmitter subsystem
Computer Networks Homework Help
Theory of computation homework help
Econometrics Homework Help
Video Codec
Radar Spectral Analysis
Pi Controller
Help With Digital Communication Project
Ad

Recently uploaded (20)

PPTX
Cell Types and Its function , kingdom of life
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Lesson notes of climatology university.
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PDF
RMMM.pdf make it easy to upload and study
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Pre independence Education in Inndia.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
Cell Types and Its function , kingdom of life
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Anesthesia in Laparoscopic Surgery in India
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Lesson notes of climatology university.
VCE English Exam - Section C Student Revision Booklet
TR - Agricultural Crops Production NC III.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Pharma ospi slides which help in ospi learning
Renaissance Architecture: A Journey from Faith to Humanism
STATICS OF THE RIGID BODIES Hibbelers.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
GDM (1) (1).pptx small presentation for students
RMMM.pdf make it easy to upload and study
Pharmacology of Heart Failure /Pharmacotherapy of CHF
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
human mycosis Human fungal infections are called human mycosis..pptx
Pre independence Education in Inndia.pdf
Microbial disease of the cardiovascular and lymphatic systems

Parallel computing homework help

  • 1. PARALLEL COMPUTING (SAMPLE ASSIGNMENT) Our online Tutors are available 24*7 to provide Help with Help with Parallel Computing Homework/Assignment or a long term Graduate/Undergraduate Help with Parallel Computing Project. Our Tutors being experienced and proficient in Help with Parallel Computing ensure to provide high quality Help with Parallel Computing Homework Help. Upload your Help with Parallel Computing Assignment at ‘Submit Your Assignment’ button or email it to . You can use our ‘Live Chat’ option to schedule an Online Tutoring session with our Help with Parallel Computing Tutors. Finite difference equation This sample assignment Compares the speed of the parallel computing toolbox functions vs CPU for finite difference test_gpu_array3.m % script to test the speed of finite difference calculations on gpu vs cpu % Mark Ward, University of Birmingham, r.m.ward@bham.ac.uk LoopVals=500*(1:2); % how many times we want to loop the calculations for timing NVals=1000*(1:4); % what array edge sizes we want to try myPerf=zeros(length(LoopVals)+1,length(NVals)+1); % somewhere to store a table of performance numbers myPerf(2:end,1)=LoopVals; % record the loop sizes myPerf(1,2:end)=NVals; % and array sizes %====================== iGPU=true % true to run on GPU, false for CPU %====================== for iLoopVals=1:length(LoopVals) for iNVals=1:length(NVals) N=NVals(iNVals); % set up arrays for the finite difference calculation if iGPU, clear g1 iicentre pause(0.5) g=gpuDevice(1); reset(g); pause(0.5) g1=gpuArray.zeros(N,N); %,'single'); iicentre=2:N-1; iicentre=gpuArray(iicentre); %(int32(iicentre)) isn't noticeably info@assignmentpedia.com
  • 2. faster on average iiup=iicentre+1; iidown=iicentre-1; else g1=zeros(N,N); iicentre=2:N-1; % indices to point to the array away from the edges iiup=iicentre+1; % and the edges iidown=iicentre-1; end ii=round(0.4*N):round(0.6*N);g1(ii,ii)=1; % make the array hotter in the centre iLoop=LoopVals(iLoopVals); fprintf('About to run %g loops of %g^2 2D finite difference calculationn',iLoop,N) tic % start timing for ii=1:iLoop, % simplified finite difference. Should also have temperature-dependent material properties. if iGPU % run gpu code using arrayfun as it's faster than overloading the normal syntax g1(iicentre,iicentre)=arrayfun(@heat_eqn_fdiff,g1(iicentre,iicentre), ... g1(iiup,iicentre),g1(iidown,iicentre), ... g1(iicentre,iiup),g1(iicentre,iidown)); else % cpu is quicker using matrix operations, not arrayfun g1(iicentre,iicentre)= 0.2*g1(iicentre,iicentre)+0.2* ... (g1(iiup,iicentre)+g1(iidown,iicentre)+g1(iicentre,iiup)+g1(iicentre,iidown)); end end if iGPU, g_res=gather(g1); % bring the results back from the gpu else g_res=g1; end t=toc; % stop timing after gathering the results back to main memory myPerf(iLoopVals+1,iNVals+1)=N^2*iLoop/t/1e6 % speed in millions of fd operations per second imagesc(g_res,[0 1]);axis image;drawnow;pause(0.1) % show the "temperature" plot end end
  • 3. clear g1 g=gpuDevice(1); reset(g); % GTX580, arrayfun, indices as gpu arrays, single precision % myPerf = % 0 1000 2000 3000 4000 % 500 606.6 1332.2 1331.2 1222.8 % 1000 1000.6 1358.1 1342.7 1228.7 % all double precision below here: % GTX580, arrayfun, indices as gpu arrays % myPerf = % 0 1000 2000 3000 4000 % 500 775.89 829.07 783.14 685.37 % 1000 813.41 831.59 803.56 688.19 % GTX580, arrayfun, indices on the cpu % myPerf = % 0 1000 2000 3000 4000 % 500 707.77 731.84 716.49 623.03 % 1000 733.92 741.25 720.24 596.46 % GTX 580, normal matlab syntax operating on gpu arrays % myPerf = % 0 1000 2000 3000 4000 % 500 551.02 568.05 537.08 500.59 % 1000 564.13 571.14 538.36 502.32 %cpu i5-2500K @ 4.2 GHz % myPerf = % 0 1000 2000 3000 4000 % 500 37.401 38.362 0 0 % 1000 0 0 0 0 visit us at www.assignmentpedia.com or email us at info@assignmentpedia.com or call us at +1 520 8371215