1 Numerical Simulations in the SILC Matrix Computation Framework
Tamito KAJIYAMA (JST / University of Tokyo, Japan) Akira NUKADA (JST / University of Tokyo, Japan) Reiji SUDA (University of Tokyo / JST, Japan) Hidehiko HASEGAWA (University of Tsukuba, Japan) Akira NISHIDA (Chuo University / JST, Japan)
International Conference on Computational Methods (ICCM 2007) April 4-6, 2007, Hiroshima, Japan
Outline
- The SILC matrix computation framework
– Easy-to-use interface for matrix computation libraries
- Proposal of two application modes for SILC
- Two applications in numerical simulations
– Cloth simulation in C – MPS-based simulation in Java
- Experimental results
- Concluding remarks
Overview of the SILC framework
- Simple Interface for Library Collections
– Independent of libraries, environments & languages – Easy to use
- Three steps to use libraries
– Depositing data (matrices, vectors, etc.) to a server – Making requests for computation by means of mathematical expressions – Fetching the results of computation if necessary
User program (client) SILC server
Matrix computation libraries
Depositing data Fetching results "x = A\b"
5.0 4.0 3.0 2.0 1.0 0.2 0.4 0.6 0.8 1 x Time (in seconds)
Example: Using SILC in C
) , ( ) , ( ) , ( ) , ( π x t x t π x t x x t x t = > = = > = ≤ ≤ = = ≤ ≤ ≥ ∂ ∂ = ∂ ∂ sin
2 2
ϕ ϕ ϕ π ϕ ϕ
si l c_envel ope_t A, C, x; / * create matrices A, C and vector x0 * / SI LC_PUT SI LC_PUT( " A" , &A) ; SI LC_PUT SI LC_PUT( " C" , &C) ; SI LC_PUT SI LC_PUT( " x" , &x) ; / * x0 * / f or ( k = 1; k <= n_st eps; k++) { SI LC_E SI LC_EXEC XEC( " b = C * x" ) ; SI LC_E SI LC_EXEC XEC( “ x = A ∖ ∖ b" ) ; SI LC_G SI LC_G ET ET( &x, " x" ) ; / * xk * / / * output solution xk at time tk * / } si l c_envel ope_t A, C, x; / * create matrices A, C and vector x0 * / SI LC_PUT SI LC_PUT( " A" , &A) ; SI LC_PUT SI LC_PUT( " C" , &C) ; SI LC_PUT SI LC_PUT( " x" , &x) ; / * x0 * / f or ( k = 1; k <= n_st eps; k++) { SI LC_E SI LC_EXEC XEC( " b = C * x" ) ; SI LC_E SI LC_EXEC XEC( “ x = A ∖ ∖ b" ) ; SI LC_G SI LC_G ET ET( &x, " x" ) ; / * xk * / / * output solution xk at time tk * / }
Solve the initial value problem of 1D diffusion equation below using the Crank-Nicolson method:
Functionalities of SILC
- Data structures for matrix computations
– Matrices (dense, band, sparse), vectors, etc.
- Math operators, functions, and subscript
– 2-norm of vector x: sqr t ( x' * x) – 5×5 submatrix of A: A[ 1: 5, 1: 5]
- No loops and conditional branching
– These are realized with the languages you use to write user programs for SILC
Main characteristics of SILC
- Independence from programming languages
– User programs for SILC in your favorite languages
- Independence from libraries and environments
– Using alternative libraries and environments requires no modification in user programs – Flexible combinations of client & server environments
Distributed parallel (MPI) Distributed parallel (MPI) Distributed parallel (MPI) Sequential Shared-memory parallel (OpenMP) Sequential Sequential Sequential SILC server User program (client)