Dr. Guy Tel-Zur (*)=and clones + various tools

Slides:



Advertisements
Similar presentations
NGS computation services: API's,
Advertisements

MATLAB Parallel Computing Toolbox A.Hosseini Course : Professional Architecture.
Parallel Matlab Vikas Argod Research Computing and Cyberinfrastructure
Prepared by Abdullah Mueen and Eamonn Keogh
Parallel Computing in Matlab
Setting up of condor scheduler on computing cluster Raman Sehgal NPD-BARC.
MPI Program Structure Self Test with solution. Self Test 1.How would you modify "Hello World" so that only even-numbered processors print the greeting.
Computational Physics Lecture 10 Dr. Guy Tel-Zur.
A Grid Parallel Application Framework Jeremy Villalobos PhD student Department of Computer Science University of North Carolina Charlotte.
1 Parallel Computing—Introduction to Message Passing Interface (MPI)
Guide To UNIX Using Linux Third Edition
Operating System Program 5 I/O System DMA Device Driver.
Task Farming on HPCx David Henty HPCx Applications Support
© 2004 The MathWorks, Inc. 1 MATLAB for C/C++ Programmers Support your C/C++ development using MATLAB’s prebuilt graphics functions and trusted numerics.
Copyright 2007, Information Builders. Slide 1 Maintain & JavaScript: Two Great Tools that Work Great Together Mark Derwin and Mark Rawls Information Builders.
Exercise problems for students taking the Programming Parallel Computers course. Janusz Kowalik Piotr Arlukowicz Tadeusz Puzniakowski Informatics Institute.
2012/06/22 Contents  GPU (Graphic Processing Unit)  CUDA Programming  Target: Clustering with Kmeans  How to use.
1 Lab Session-III CSIT-120 Fall 2000 Revising Previous session Data input and output While loop Exercise Limits and Bounds Session III-B (starts on slide.
PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates.
Parallel Programming Models Jihad El-Sana These slides are based on the book: Introduction to Parallel Computing, Blaise Barney, Lawrence Livermore National.
Condor Tugba Taskaya-Temizel 6 March What is Condor Technology? Condor is a high-throughput distributed batch computing system that provides facilities.
DOS  In the 1980s or early 1990s, the operating system that shipped with most PCs was a version of the Disk Operating System (DOS) created by Microsoft:
A Metadata Based Approach For Supporting Subsetting Queries Over Parallel HDF5 Datasets Vignesh Santhanagopalan Graduate Student Department Of CSE.
Scientific Computing Lecture 5 Dr. Guy Tel-Zur Autumn Colors, by Bobby Mikul, Mikul Autumn Colors, by Bobby Mikul,
FYP Final Presentation: Distributed Audio Mixing Daire O'Neill, Final Year Electronic Engineering Project Supervisor: Dr Peter Corcoran Co-Supervisor:
Slide 1 MIT Lincoln Laboratory Toward Mega-Scale Computing with pMatlab Chansup Byun and Jeremy Kepner MIT Lincoln Laboratory Vipin Sachdeva and Kirk E.
Grid Computing I CONDOR.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Parallel Computing with Matlab CBI Lab Parallel Computing Toolbox TM An Introduction Oct. 27, 2011 By: CBI Development Team.
1 © 2012 The MathWorks, Inc. Parallel computing with MATLAB.
Condor Project Computer Sciences Department University of Wisconsin-Madison A Scientist’s Introduction.
Practice and Evaluation. Practice Develop a java class called: SumCalculator.java which computes a sum of all integer from 1 to 100 and displays the result.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
Flow Control and Functions ● Script files ● If's and For's ● Basics of writing functions ● Checking input arguments ● Variable input arguments ● Output.
Today’s lecture 2-Dimensional indexing Color Format Thread Synchronization within for- loops Shared Memory Tiling Review example programs Using Printf.
Message Passing Programming Model AMANO, Hideharu Textbook pp. 140-147.
Slide-1 Parallel Matlab MIT Lincoln Laboratory Parallel Matlab: The Next Generation Dr. Jeremy Kepner /MIT Lincoln Laboratory Ms. Nadya Travinin / MIT.
XYZ 11/13/2015 MIT Lincoln Laboratory 300x Matlab Dr. Jeremy Kepner MIT Lincoln Laboratory September 25, 2002 HPEC Workshop Lexington, MA This.
Simulating the Nonlinear Schrodinger Equation using MATLAB with CUDA
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd Edition, by B. Wilkinson & M. Allen, ©
Lab 2 Parallel processing using NIOS II processors
Chapter 4 Message-Passing Programming. The Message-Passing Model.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
Slide-1 Parallel Matlab MIT Lincoln Laboratory Parallel Programming in Matlab -Tutorial- Jeremy Kepner, Albert Reuther and Hahn Kim MIT Lincoln Laboratory.
Shangkar Mayanglambam, Allen D. Malony, Matthew J. Sottile Computer and Information Science Department Performance.
Project18 Communication Design + Parallelization Camilo A Silva BIOinformatics Summer 2008.
3/12/2013Computer Engg, IIT(BHU)1 MPI-1. MESSAGE PASSING INTERFACE A message passing library specification Extended message-passing model Not a language.
EPICS and LabVIEW Tony Vento, National Instruments
April 24, 2002 Parallel Port Example. April 24, 2002 Introduction The objective of this lecture is to go over a simple problem that illustrates the use.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
MPI-Message Passing Interface. What is MPI?  MPI is a specification for the developers and users of message passing libraries. By itself, it is NOT a.
Parallel Computing with MATLAB Modified for 240A UCSB Based on Jemmy Hu University of Waterloo
Active-HDL Server Farm Course 11. All materials updated on: September 30, 2004 Outline 1.Introduction 2.Advantages 3.Requirements 4.Installation 5.Architecture.
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
Linux Administration Working with the BASH Shell.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
MPI: Message Passing Interface An Introduction S. Lakshmivarahan School of Computer Science.
Advanced Computing Facility Introduction
Development Environment
Key Ideas from day 1 slides
In-situ Visualization using VisIt
MPI Message Passing Interface
NGS computation services: APIs and Parallel Jobs
Operation System Program 4
Learn about MATLAB Engineers – not sales!
Oct. 27, By: CBI Development Team
Dr. Guy Tel-Zur (*)=and clones + various tools
Multithreaded Programming
A Virtual Machine Monitor for Utilizing Non-dedicated Clusters
Parallel Processing - MPI
Presentation transcript:

Dr. Guy Tel-Zur (*)=and clones + various tools Parallel Matlab(*) Dr. Guy Tel-Zur (*)=and clones + various tools

Agenda Mathworks – Parallel Computing toolbox Parallel Matlab (Octave) using MatlabMPI Parallel Matlab (Octave) using pMatlab Parallel Computing with Matlab on Amazon Cloud Matlab (Octave) + Condor Matlab over GPGPU using gp-you Parallel Scilab (in the future)

Mathworks – Parallel Computing toolbox Parallel Computing without CUDA or MPI The toolbox provides eight workers (MATLAB computational engines) to execute applications locally on a multicore desktop Parallel for-loops (parfor) for running task-parallel algorithms on multiple processors Computer cluster and grid support (with MATLAB Distributed Computing Server)

Parallel Computing toolbox 2011

2012

parfor - Parallel for loop parfor - Parallel for loop Syntax parfor loopvar = initval:endval; statements; end parfor (loopvar = initval:endval, M); statements; end Description parfor loopvar = initval:endval; statements; end executes a series of MATLAB commands denoted here as statements for values of loopvar between initval and endval, inclusive, which specify a vector of increasing integer values. Unlike a traditional for-loop, there is no guarantee of the order in which the loop iterations are executed. The general format of a parfor statement is: parfor loopvar = initval:endval <statements> end

validation

parfor – an example Perform three large eigenvalue computations using three computers or cores: ntasks = 4 matlabpool(ntasks) parfor i=1:ntasks, c(:,i) = eig(rand(500)); end

>> ntasks = 4; >> tic;for i=1:ntasks, c(:,i)=eig(rand(1000)); end; toc Elapsed time is 18.545340 seconds. >> tic;parfor i=1:ntasks, Elapsed time is 10.980618 seconds. >>

spmd

PP2012b, we reached here

Parallel Computing Toolbox and MATLAB Distributed Computing

Parallel Matlab (Octave) using MatlabMPI Files location: vdwarf - /usr/local/PP/MatlabMPI Read the README there! cd to the examples directory eval( MPI_Run('basic', 3,machines) ); where: machines = {‘vdwarf1' ‘vdwarf2‘ ‘vdwrf3’}

MatlabMPI http://www.ll.mit.edu/mission/isr/matlabmpi/matlabmpi.html#introduction

Available examples: xbasic.m Extremely simple MatlabMPI program that prints out the rank of each processor. basic.m Simple MatlabMPI program that sends data from processor 1 to processor 0. multi_basic.m Simple MatlabMPI program that sends data from processor 1 to processor 0 a few times. probe.m Simple MatlabMPI program that demonstrates the using MPI_Probe to check for incoming messages. broadcast.m Tests MatlabMPI broadcast command. basic_app.m Examples of the most common usages of MatlabMPI. basic_app2.m Examples of the most common usages of MatlabMPI. basic_app3.m Examples of the most common usages of MatlabMPI. basic_app4.m Examples of the most common usages of MatlabMPI. blurimage.m MatlabMPI test parallel image processing application. speedtest.m Times MatlabMPI for a variety of messages. synch_start.m Function for synchronizing starts. machines.m Example script for creating a machine description. unit_test.m Wrapper for using an example as a unit test. unit_test_all.m Calls all of the examples as way of testing the entire library. unit_test_mcc.m Wrapper for using an example as a mcc unit test. unit_test_all_mcc.m Calls all of the examples using MPI_cc as way of testing the entire library.

MatlabMPI Demo Installed on the vdwarf machines

MatlabMPI implements the fundamental communication operations in MPI using MATLAB’s file I/O functions.

matlab -nojvm -nosplash -display null < RUN.m MatlabMPI Look at the RUN.m to see how to run MatlabMPI code Let’s look at a basic example MatlabMPI code – Next slide matlab -nojvm -nosplash -display null < RUN.m

Add to Matlab path: vdwarf2.ee.bgu.ac.il> cat startup.m addpath /usr/local/PP/MatlabMPI/src addpath /usr/local/PP/MatlabMPI/examples Addpath ./MatMPI

xbasic %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Basic Matlab MPI script that % prints out a rank. % % To run, start Matlab and type: % eval( MPI_Run('xbasic',2,{}) ); % Or, to run a different machine type: % eval( MPI_Run('xbasic',2,{'machine1' 'machine2'}) ); % Output will be piped into two files: % MatMPI/xbasic.0.out % MatMPI/xbasic.1.out % MatlabMPI % Dr. Jeremy Kepner % MIT Lincoln Laboratory % kepner@ll.mit.edu

% Initialize MPI. MPI_Init; % Create communicator. comm = MPI_COMM_WORLD; % Modify common directory from default for better performance. % comm = MatMPI_Comm_dir(comm,'/tmp'); % Get size and rank. comm_size = MPI_Comm_size(comm); my_rank = MPI_Comm_rank(comm); % Print rank. disp(['my_rank: ',num2str(my_rank)]); % Wait momentarily. pause(2.0); % Finalize Matlab MPI. MPI_Finalize; disp('SUCCESS'); if (my_rank ~= MatMPI_Host_rank(comm)) exit; end

Demo folder ~/matlab/, watch top at the other machine

Parallel Matlab (Octave) using pMatlab Global arrays – “…Communication is hidden from the programmer; arrays are automatically redistributed when necessary, without the knowledge of the programmer…” “…The ultimate goal of pMatlab is to move beyond basic messaging (and its inherent programming complexity) towards higher level parallel data structures and functions, allowing any MATLAB user to parallelize their existing program by simply changing and adding a few lines, Source: http://www.ll.mit.edu/mission/isr/pmatlab/pMatlab_intro.pdf

Instead of:

Write using pMatlab:

Parallel Computing with Matlab on Amazon Cloud

Matlab (Octave) + Condor Sample 1: submit file (cp.sub) ------------------------ universe        = vanilla executable      = cp1.bat initialdir      = C:\user\CondorMatlab log             = matlabtest.log error           = matlabtest.err input         = CondorMatlabTest.m getenv          = true requirements = (NAME == "slot1@remotePC") queue --------------------------- cp1.bat ---------------- cd "C:\PROGRA~1\MATLAB\R2007b\bin\win32" matlab.exe  -r  "CondorMatlabTest"

Condor Demos On my PC: C:\Users\telzur\Documents\BGU\Teaching\ParallelProcessing\PP2011A\Lectures\06\condor_demo_2010 *** has a bug *** On the Linux vdwarf – Condor + Octave /users/agnon/misc/tel-zur/condor/octave On the Linux vdwarf – Condor + Matlab /users/agnon/misc/tel-zur/condor/matlab/example_legendre

0utput of the Matlab+Condor demo

Matlab over GPGPU using gp-you

GPGPU and Matlab http://www.accelereyes.com

GP-you.org

>> GPUstart Copyright gp-you.org. GPUmat is distribuited as Freeware. By using GPUmat, you accept all the terms and conditions specified in the license.txt file. Please send any suggestion or bug report to gp-you@gp-you.org. Starting GPU - GPUmat version: 0.270 - Required CUDA version: 3.2 There is 1 device supporting CUDA CUDA Driver Version: 3.20 CUDA Runtime Version: 3.20 Device 0: "GeForce 310M" CUDA Capability Major revision number: 1 CUDA Capability Minor revision number: 2 Total amount of global memory: 455475200 bytes - CUDA compute capability 1.2 ...done - Loading module EXAMPLES_CODEOPT - Loading module EXAMPLES_NUMERICS -> numerics12.cubin - Loading module NUMERICS - Loading module RAND

Let’s try this A = rand(100, GPUsingle); % A is on GPU memory B = rand(100, GPUsingle); % B is on GPU memory C = A+B; % executed on GPU. D = fft(C); % executed on GPU Executed on GPU A = single(rand(100)); % A is on CPU memory B = single(rand(100)); % B is on CPU memory C = A+B; % executed on CPU. D = fft(C); % executed on CPU Executed on CPU

% SAXPY demo % this file: C:\Users\telzur\Downloads\GPUmat\guy_saxpy.m % 14.5.2011 clear all; close all; N = 500 A = GPUsingle(rand(1,N)); B = GPUsingle(rand(1,N)); alpha = 2.0; % CPU computation disp('CPU computation time:') tic;Saxpy_mat = alpha * single(A) + single(B);toc % GPU computation disp('GPGPU computation time:') tic;cublasSaxpy(N, alpha, getPtr(A), 1, getPtr(B), 1);toc CPU computation time: Elapsed time is 0.022271 seconds. GPGPU computation time: Elapsed time is 0.001854 seconds.

Parallel Scilab (in the future) Scilab + PVM, http://ats.cs.ut.ee/u/kt/hw/scilabpvm/ Scilab + ProActive, http://proactive.inria.fr/index.php?page=scilab