X10 Code Examples




Overview
Sample Codes
Benchmarks
Other Applications

Overview

The examples listed here are either small applications extracted from computational kernels or scientific computing benchmarks. Most of them are covered by our presentations:
  • HPC Challenge Submission for X10 (SC 2007) pdf (won Class 2 award: Most Productive Research Implementation)
  • Programming Scientific Computations in X10 (PGAS 2006, X10 Demo SC 2006) pdf
  • X10: a High-Productivity Approach to High Performance Programming (HPC Challenge Class 2 Award Submission SC 2006) pdf
More examples (not limited to the domain of scientific computing) will be added.

Sample Codes

The following examples demonstrate in X10 how to build and iterate over distributed arrays, and how to coordinate activities. Each of them either has a dependent-type version or itself uses dependent types. Note that our implementation of dependent types is still an ongoing effort. More support and improvements are on the way.
 
BlockDistedArray1D.x10 BlockDistedArray1D_Dep.x10
BlockDistedArray2D.x10 BlockDistedArray2D_Dep.x10
EncapsulatedArray1D.x10 EncapsulatedArray1D_Dep.x10
EncapsulatedArray2D.x10 EncapsulatedArray2D_Dep.x10
StencilFor2D.x10 StencilFor2D_Dep.x10
StencilForeach2D.x10 StencilForeach2D_Dep.x10
AllRedunctionBarrier.x10 AllReductionBarrier_Dep.x10
AllRedunctionP2P.x10 AllReductionP2P_Dep.x10
LU.x10 LU_Dep.x10
LU_Overlap.x10 Another version of LU_Overlap
x10Test.x10 (class used by the above examples)
Back to top

Benchmarks

We have been implementing benchmarks in X10 (literal translation to X10 or implementation from scratch). With the new x10c++ compiler which translates X10 programs into C++ SPMD programs communicating using an active messaging infrastructure and the runtime system based on IBM's LAPI (Low-level API), performance comparable to hand-written MPI implementations is realized for well-known benchmarks such as FT in NPB, and Random Access, Stream, and FFT in HPCC. Some of the X10 programs posted below also have a "static" version which is the one to be compiled with x10c++. Note that the current x10c++ compiler and runtime system (to be released soon) only implements a subset of X10 functionalities.

NAS Parallel Benchmarks (NPB)

 
HPC Challenge Benchmarks (HPCC)

Back to top

Other Applications

Graph algorithms

 
Back to top