1 / 14

X10: Performance and Productivity at Scale

X10: Performance and Productivity at Scale. 李强. X10 Project status. X10 is developed by the IBM PERCS project as part of the DARPA program on High Productivity Computing Systems (HPCS) Target markets: Scientific computing, business analytics X10 2.4.2 release in Feb 2014 Java-backend

nyla
Télécharger la présentation

X10: Performance and Productivity at Scale

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. X10:Performance and Productivity at Scale 李强

  2. X10 Project status • X10 is developed by the IBM PERCS project as part of the DARPA program on High Productivity Computing Systems (HPCS) • Target markets: Scientific computing, business analytics • X10 2.4.2 release in Feb 2014 • Java-backend • C++-backend

  3. X10 overview • X10 is an instance of the Asynchronous PGAS model in the Java family • Threads can be dynamically created under programmer control (as opposed to SPMD execution of MPI, UPC, FORTRAN) • n distinct threads, p distinct memories (n <> p) • APGAS model, the Asynchronous, Partitioned Global Address Space model.

  4. X10 Hello world! class Generic datatype method • 1 // file HelloWorld.x10 • 2 public class HelloWorld { • 3 public static def main(args: Array[String](1)):Void { • 4 x10.io.Console.OUT.println("Hello, World"); • 5 } • 6 } package

  5. X10 Basics • X10 is an object-oriented language based on Java • Base data types • Non-numeric: Boolean, Byte, Char and String • Fixed point: Short, Int and Long • Floating point: Float, Double and Complex • Top level containers: classes and interfaces, grouped into packages • Objects are instantiated from classes

  6. Difference with java • var n:Long = 0; • public static val solution = [1,2,3,4,5] ; • val N:long; • Fields may be mutable (var) or immutable (val). • The type of a mutable field must always be specified. • A mutable field may or may not be initialized. • The type of an immutable field may be omitted if the field declaration specifies an initializer. • Function as argument, x10 supports both OO and functional programming.

  7. X10 Parallelism • Parallelism = Activities + Places • Basic parallel constructs (async, at, finish, atomic) • Activities • All X10 programs begin with a single activity executing main in place 0 • Places hold activities and objects

  8. public class TutAtomic2 { constint a = new boxedInt(100); constint b = new boxedInt(100); public static atomic void incr_a() { a.val++ ; b.val-- ; } public static atomic void decr_a() { a.val-- ; b.val++ ; } public static void main(String args[]) { int sum; finish { async for (inti=1 ; i<=10 ; i++ ) incr_a(); for (inti=1 ; i<=10 ; i++ ) decr_a(); } atomic sum = a.val + b.val; System.out.println("a+b = " + sum); } // main() } // TutAtomic2

  9. Limitations of using a Single Place • Largest deployment granularity for a single place is a single SMP • Smallest granularity can be a single CPU or even a single hardware thread • Single SMP is inadequate for solving problems with large memory and compute requirements • X10 solution: incorporate multiple places as a core foundation of the X10 programming model  Enable deployment on large-scale clustered machines, with integrated support for intra-place parallelism

  10. Scalable X10: using multiple places • class HelloWholeWorld { • public static def main(args:Array[String](1)):void { • for (var i:Int=0; i<Place.MAX_PLACES; i++) { • valiVal = i; • async at (Place.places(iVal)) { • Console.OUT.println("Hello World from place "+here.id); • } • } • } • } Hello World from place 0 Hello World from place 2 Hello World from place 3 Hello World from place 1

  11. at – place shift • Shift current activity to a place to evaluate an expression, then return • Copy necessary values from calling place to callee place, discard when done

  12. A more complicated example

  13. A more complicated example

  14. Thanks for your attention!

More Related