MOPL - Matrix Operation Parallelism Language

17
MOPL MOPL Matrix Operation Parallelism Language Designed and implemented by: Fengwei Zhang, Maoliang Huang, Thomas Ricatte, Jorge Portal, Seoho Lee April 29th

Transcript of MOPL - Matrix Operation Parallelism Language

Page 1: MOPL - Matrix Operation Parallelism Language

MOPL

MOPLMatrix Operation Parallelism Language

Designed and implemented by:Fengwei Zhang,Maoliang Huang,Thomas Ricatte,Jorge Portal,Seoho Lee

April 29th

Page 2: MOPL - Matrix Operation Parallelism Language

MOPLIntroduction

Motivation

Explosion of multiprocessor technology in modern timesSoftware designers should (and will be required to soon, if notalready) take advantage of this technology

Stay competitiveBetter quality of softwareHigher user satisfaction

Researchers can definitely benefit from exploiting thistechnology as well

Less time-consuming modeling and experimentation comparedto uniprocessorAccess to a relative abundance of computational resources

Generally clunky, confusing, and difficult to engineer softwarethat

Page 3: MOPL - Matrix Operation Parallelism Language

MOPLIntroduction

Motivation

What about a programming language that resolves aroundexploiting this technology, while making the job of dividing softwareinto multiple processors almost invisible to the programmers ?

Enter MOPL

Page 4: MOPL - Matrix Operation Parallelism Language

MOPLIntroduction

MOPL at a glance

MOPL is the Matrix Operation Parallelism Language.MOPL is designed to perform lightning-fast, safe, andmultithreaded operations, focusing its power primarily in thedomain of matrices.

Matrix addition, matrix multiplication, etc.

Multiprocessor programming is invisible to the programmer inMOPL. MOPL uses an internal system to decide how to dividesegments of operations into threads and how many.MOPL utilizes a "divide-and-conquer" approach to matrixoperations, delegating responsibility for submatrices of theoperations to the threads it creates, so they execute in parallel.Result : highly scalable and rapid matrix operations to suit theend-users’ needs, whether it is a corporation, researcher, orconsumer.

Page 5: MOPL - Matrix Operation Parallelism Language

MOPLArchitecture

Architecture

Page 6: MOPL - Matrix Operation Parallelism Language

MOPLArchitecture

Architecture

Page 7: MOPL - Matrix Operation Parallelism Language

MOPLArchitecture

Architecture

Page 8: MOPL - Matrix Operation Parallelism Language

MOPLArchitecture

Architecture

Page 9: MOPL - Matrix Operation Parallelism Language

MOPLExamples

A simple program

main ( ){

s c a l a r i ;// d e c l a r e a 3x3 squa r e mat r i xcon s t mat r i x b (3 , 3 ) = {2 , 3 , 7 : 9 , 2 , 3 : 3 , 4 , 2 } ;

// d e c l a r e an a r r a y o f mat r i x .// The s i z e o f the a r r a y i s 3// and each mat r i x i s a 3x3 squa r e mat r i x .ma t r i x [ 3 ] c ( 3 , 3 ) ;

f o r ( i =0; i <3; i++) {c [ i ] = {1 , 0 , 0 : 0 , 1 , 0 : 0 , 0 , 1 } ;

}

c [ 0 ] = c [ 0 ] ∗ b ;i = 10 ;c [ 1 ] = i ∗ b ;c [ 2 ] = c [ 0 ] − c [ 1 ] ;

}

Page 10: MOPL - Matrix Operation Parallelism Language

MOPLTools and environment

Tools

SVN repository, Wiki, . . .

Awesome IDE for PLT projects

JVM, javacc, jjtree

Used for the internal mailing-list

Page 11: MOPL - Matrix Operation Parallelism Language

MOPLParallelism

Parallelism features

Parallelism is user-invisibleExternal Matrix Operation LibraryParallel matrix addition, subtraction, multiplication functionsin the library

ImplementationUsing multi-threads running simultaneously do matrixoperations

Page 12: MOPL - Matrix Operation Parallelism Language

MOPLParallelism

Threads Testing Experiment

Page 13: MOPL - Matrix Operation Parallelism Language

MOPLParallelism

Experiment analysis

Beyond certain threads, there is no gain at all because the processoris saturated with work.

Adding another thread will only give it another task to do that itstill has to be scheduled.

On our Core 2 laptop, there is a big difference between liner runningand two threads running

Slight changes if we add more threads

Page 14: MOPL - Matrix Operation Parallelism Language

MOPLParallelism

Matrix multiplication algorithm

Divide and Conquer algorithm

Divide the matrix into 4 sub matrices

Do recursion

Until : sub-matrices size < block size

Page 15: MOPL - Matrix Operation Parallelism Language

MOPLTests

Test plan

Correctness, completeness, and efficiency.MOPL should run every input correctly.MOPL should check on every grammarMOPL should effectively implement parallelism, and take theadvantage of multi-threading for faster computation

Page 16: MOPL - Matrix Operation Parallelism Language

MOPLTests

Test plan

Test 1 : Phase to assess our algorithm before final version.White box testing each on our Java ClassEffectiveness of our threadingRegression testing to find software regressions.

Test 2 :Testing after our final program to assess our languageBlack box testingTest Suites to cover simple test model which test our efficiencyand advanced model to test our correctness

Page 17: MOPL - Matrix Operation Parallelism Language

MOPLConclusion

Conclusion

ParallelismMultithreading is difficult to implementFinding Effective Matrix computation.JavaCCMOPL is a simple and fast program that computes Matrixfaster than any other language