Computer Science 320 Introduction to Hybrid SMP/Clusters.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

1 Applets Programming Enabling Application Delivery Via the Web.
Computer Science 320 Clumping in Parallel Java. Sequential vs Parallel Program Initial setup Execute the computation Clean up Initial setup Create a parallel.
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Recursive Factorial Demo pubic class Factorial {
Chapter 10 Ch 1 – Introduction to Computers and Java Streams and File IO 1.
13/04/2015Client-server Programming1 Block 6: Threads 1 Jin Sa.
The Singleton Pattern II Recursive Linked Structures.
Problem Solving 5 Using Java API for Searching and Sorting Applications ICS-201 Introduction to Computing II Semester 071.
Mutual Exclusion The Art of Multiprocessor Programming Spring 2007.
Exception Handling – illustrated by Java mMIC-SFT November 2003 Anders P. Ravn Aalborg University.
Ade Azurat, Advanced Programming 2004 (Based on LYS Stefanus’s slides) Advanced Programming 2004, Based on LYS Stefanus’s slides Slide 2.1 Multithreading.
Computer Science 101 Data Encryption And Computer Networks.
SE-1020 Dr. Mark L. Hornick 1 Exceptions and Exception Handling.
Chapter 10 Introduction to Arrays
Computer Science 320 Reduction Variables and Operators.
CS 206 Introduction to Computer Science II 09 / 14 / 2009 Instructor: Michael Eckmann.
Arrays. Memory organization Table at right shows 16 bytes, each consisting of 8 bits Each byte has an address, shown in the column to the left
CS 206 Introduction to Computer Science II 01 / 21 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 09 / 04 / 2008 Instructor: Michael Eckmann.
Java ThreadsGraphics Programming Graphics Programming: Java Threads.
Java Review 2 – Errors, Exceptions, Debugging Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Lab 2 Data Streams. Lab 2: Data Streams Introduction Reading from an Input Stream Writing to an Output Stream Filter Streams.
Csci5233 Computer Security1 GS: Chapter 5 Asymmetric Encryption in Java.
Hybrid Cipher encryption Plain Text Key Cipher Text Key Plain Text IV Hybrid Cipher decryption Hybrid Cipher Note: IV used in encryption is not used in.
Algorithms: Selected Exercises Goals Introduce the concept & basic properties of an algorithm.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Xiaoying Gao, Peter Andreae, VUW Indexing Large Data COMP
Introduction to Computer Programming Error Handling.
1 Web Based Programming Section 6 James King 12 August 2003.
Abstract Data Types (ADTs) and data structures: terminology and definitions A type is a collection of values. For example, the boolean type consists of.
Computer Science 320 Load Balancing for Hybrid SMP/Clusters.
Computer Science 320 Broadcasting. Floyd’s Algorithm on SMP for i = 0 to n – 1 parallel for r = 0 to n – 1 for c = 0 to n – 1 d rc = min(d rc, d ri +
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Quick overview of threads in Java Babak Esfandiari (extracted from Qusay Mahmoud’s slides)
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
Lecture 2 Object Oriented Programming Basics of Java Language MBY.
Monitor's Secret Key Crypto - KARN, encrypt 512 bit Secret.
Chapter 9 1 Chapter 9 – Part 1 l Overview of Streams and File I/O l Text File I/O l Binary File I/O l File Objects and File Names Streams and File I/O.
Arrays An array is a data structure that consists of an ordered collection of similar items (where “similar items” means items of the same type.) An array.
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 10.
CS 206 Introduction to Computer Science II 09 / 10 / 2009 Instructor: Michael Eckmann.
1 Week 12 l Overview of Streams and File I/O l Text File I/O Streams and File I/O.
Strings in MIPS. Chapter 2 — Instructions: Language of the Computer — 2 Character Data Byte-encoded character sets – ASCII: 128 characters 95 graphic,
Computer Science 320 Massive Parallelism. Example Problem: Breaking a Cipher Somehow obtain a sample plaintext and its ciphertext Then search for the.
5-Dec-15 Sequential Files and Streams. 2 File Handling. File Concept.
Threads Eivind J. Nordby University of Karlstad Inst. for Information Technology Dept. of Computer Science.
Computer Science 320 Reduction. Estimating π Throw N darts, and let C be the number of darts that land within the circle quadrant of a unit circle Then,
Exceptions Chapter 16 This chapter explains: What as exception is Why they are useful Java exception facilities.
Computer Science 320 Load Balancing with Clusters.
Mark Fontenot CSE Honors Principles of Computer Science I Note Set 15.
Week 5 - Wednesday.  What did we talk about last time?  Recursion  Definitions: base case, recursive case  Recursive methods in Java.
ICS3U_FileIO.ppt File Input/Output (I/O)‏ ICS3U_FileIO.ppt File I/O Declare a file object File myFile = new File("billy.txt"); a file object whose name.
Data Types and Conversions, Input from the Keyboard CS303E: Elements of Computers and Programming.
Computer Science 320 Load Balancing. Behavior of Parallel Program Why do 3 threads take longer than two?
Software Development Introduction
Computer Science 320 Parallel Image Generation. The Mandelbrot Set.
Computer Science 320 Random Numbers for Parallel Programs.
Computer Science 320 A First Program in Parallel Java.
Network Security. Three tools Hash Function Block Cipher Public Key / Private Key.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
Computer Science 320 Barrier Actions. 1-D Continuous Cellular Automata 1-D array of cells, each having a value between 0.0 and 1.0 Each cell has a neighborhood.
Computer Science 320 Reduction. Estimating π Throw N darts, and let C be the number of darts that land within the circle quadrant of a unit circle Then,
Computer Science 320 Cache Interference. Unexpected Performance The testing of the partial key search SMP program produced anomalous results In particular,
CSI 3125, Preliminaries, page 1 Files. CSI 3125, Preliminaries, page 2 Reading and Writing Files Java provides a number of classes and methods that allow.
Throw, Throws & Try-Catch Statements Explanations and Pictures from: Reference:
Computer Science 320 Introduction to Cluster Computing.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Exceptions, Interfaces & Generics
Introduction to Exceptions in Java
Accessing Files in Java
Java for Beginners University Greenwich Computing At School DASCO
Presentation transcript:

Computer Science 320 Introduction to Hybrid SMP/Clusters

Massively Parallel AES Key Search Inputs: –128-bit plain text block –128-bit cipher text block – 256-bit key with N lower-order bits missing –N, the number of missing lower-order key bits Output: The correct key to encode the text Method: try all 2 N possible missing bit strings to find the key that does encrypt the plain text correctly

Sequential Version for (int cntr = 0; cntr < maxcount; ++cntr){ // Try key } Tries up to 2 N possible keys

SMP Version new ParallelTeam().execute(new ParallelRegion(){ public void run() throws Exception{ execute(0, maxcounter, new IntegerForLoop(){ public void run(){ for (int cntr = first; cntr <= last; ++cntr){ // Try key } }); } }); Splits 2 N possible keys evenly among K threads

Cluster Version Range chunk = new Range(0, maxcounter – 1).subrange(size, rank); int lb = chunk.lb(); int ub = chunk.ub(); for (int cntr = lb; cntr <= ub; ++cntr){ // Try key } Splits 2 N possible keys evenly among K nodes

Hybrid Version Range chunk = new Range(0, maxcounter – 1).subrange(size, rank); int lb = chunk.lb(); int ub = chunk.ub(); new ParallelTeam().execute(new ParallelRegion(){ public void run() throws Exception{ execute(lb, ub, new IntegerForLoop(){ public void run(){ for (int cntr = first; cntr <= last; ++cntr){ // Try key } }); } }); Splits 2 N possible keys evenly among Kp nodes * Kt threads per node

Specify # Nodes and # Threads Range chunk = new Range(0, maxcounter – 1).subrange(size, rank); int lb = chunk.lb(); int ub = chunk.ub(); new ParallelTeam().execute(new ParallelRegion(){ public void run() throws Exception{ execute(lb, ub, new IntegerForLoop(){ public void run(){ for (int cntr = first; cntr <= last; ++cntr){ // Try key } }); } }); $ java –Dpj.port=28000 –Dpj.np=8 -Dpj.nt=8...

Improvement: Early Return for (int cntr = first; cntr <= last; ++cntr){ int lsbs = keylsbs | cntr; trialKey[28] = (byte) (lsbs >>> 24); trialKey[29] = (byte) (lsbs >>> 16); trialKey[30] = (byte) (lsbs >>> 8); trialKey[31] = (byte) (lsbs ); cipher.setKey(trialKey); cipher.encrypt(plainText, trialciphertext); if (match(ciphertext, trialciphertext)){ foundKey = new byte[32] System.arraycopy(trialkey, 0, foundkey, 0, 32); }... if (foundKey != null) System.out.println(Hex.toString(foundkey)); Would like to quit this thread, other threads in the same node, and other nodes early, when the correct key is found

Improvement: Sizeup for (int cntr = first; cntr <= last; ++cntr){ int lsbs = keylsbs | cntr; trialKey[28] = (byte) (lsbs >>> 24); trialKey[29] = (byte) (lsbs >>> 16); trialKey[30] = (byte) (lsbs >>> 8); trialKey[31] = (byte) (lsbs ); cipher.setKey(trialKey); cipher.encrypt(plainText, trialciphertext); if (match(ciphertext, trialciphertext)){ foundKey = new byte[32] System.arraycopy(trialkey, 0, foundkey, 0, 32); } if (foundKey != null) System.out.println(Hex.toString(foundkey)); Would also like to extend the size of N beyond 30 bits