# Programming Models @ BSC

#### Boosting parallel computing research since 1989

Saiph

Saiph is a Domain Specific Language developed at BSC for simulating physical phenomena modelled by Partial Differential Equations systems designed for users that are not experts in numerical methods neither programming for supercomputers.
Saiph expects to ease the development of scientist applications by allowing domain experts to transcribe their equations into Saiph code and then generating HPC-ready code that efficiently exploits the computational resources of modern heterogeneous supercomputers while dealing with all the specific aspects of solving partial differential equations systems.

To achieve that, Saiph provides a high-level syntax that directly maps with concepts of the domain, hiding from the user all the complexities related to the numerical methods. Users only have to translate their equations to our language and define the details of the simulation. Later, this equation’s system is solved in parallel by a supercomputer, distributing the work across several nodes (using MPI) and applying intra-node tecnniques (using OpenMP/OmpSs) to achieve high performance.

``````// Physical dimensions and discretizations factors
val mesh = CartesianMesh(1 * Meters, 1 * Meters)
mesh.discretize(1 * mm, 1 * mm)

//Initializations
val T = Variable(Temperature)("Temp", mesh, 300 * Kelvins)
val v = Variable(Speed)("Velo", mesh, Vector(1 * m/s, -1 * m/s), "Ux, Uy")
val d = Constant(Meters2/Seconds)("Diff coeff", 0.001 * Meters2/Seconds)

//Boundary conditions
T.setDirichlet(CFaceYMIN, 0 * Kelvins)
T.setNeumann(CfaceYMAX, 0 * Kelvins/Meters)

//Adv-diff equation
val AdvDiffEq = Equation(dt(T), -v * grad(T) + d * lapla(T))

//Problem Definition
val prob = Problem(mesh)(AdvDiffEq)

//Finally we call to the solver
Stepper(prob, DT, NSTEPS, IntegrationMethod.Euler)("ADVDIFF2D",
OutputFormat.VTI, SamplingMethod.Flush)
``````