Top Banner
First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio
48

First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

Dec 28, 2015

Download

Documents

Austin Parrish
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

First principles modeling with Octopus: massive parallelization towards petaflop computing and more

A. Castro, J. Alberdi and A. Rubio

Page 2: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

2

Outline

Theoretical SpectroscopyThe octopus codeParallelization

Page 3: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

3

Outline

Theoretical SpectroscopyThe octopus codeParallelization

Page 4: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

4

Theoretical Spectroscopy

Page 5: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

5

Theoretical Spectroscopy

Electronic excitations:~Optical absorption~Electron energy

loss~Inelastic X-ray

scattering

~Photoemission~Inverse

photoemission~…

Page 6: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

6

Theoretical Spectroscopy

Goal: First principles (from electronic structure) theoretical description of the various spectroscopies (“theoretical beamlines”):

Page 7: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

7

Theoretical Spectroscopy

Role: interpretation of (complex) experimental findings

Page 8: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

8

Theoretical Spectroscopy

Role: interpretation of (complex) experimental findings

Theoretical atomistic structures, and corresponding TEM images.

Page 9: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

9

Theoretical Spectroscopy

Page 10: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

10

Theoretical Spectroscopy

Page 11: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

11

Theoretical Spectroscopy

The European Theoretical Spectroscopy Facility (ETSF)

Page 12: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

12

Theoretical SpectroscopyThe European Theoretical Spectroscopy

Facility (ETSF)

~ Networking~ Integration of tools (formalism,

software)~ Maintenance of tools~ Support, service, formation

Page 13: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

13

Theoretical Spectroscopy

The octopus code is a member of a family of free software codes developed, to a large extent, within the ETSF:~abinit~octopus~dp

Page 14: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

14

Outline

Theoretical SpectroscopyThe octopus codeParallelization

Page 15: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

15

The octopus code

Targets:~Optical absorption spectra of molecules,

clusters, nanostructures, solids.~Response to lasers (non-perturbative response

to high-intensity fields)~Dichroic spectra, and other mixed (electric-

magnetic responses)~Adiabatic and non-adiabatic Molecular

Dynamics (for, e.g. infrared and vibrational spectra, or photochemical reactions).

~Quantum Optimal Control Theory for molecular processes.

Page 16: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

16

The octopus code

Physical approximations and techniques:~Density-Functional Theory, Time-

Dependent Density-Functional Theory to describe the electron structure.• Comprehensive set of functionals through the

libxc library.

~Mixed quantum-classical systems.~Both real-time and frequency domain

response (“Casida” and “Sternheimer” formulations).

Page 17: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

17

The octopus code

Numerics:~Basic representation:

real space grid.~Usually regular and

rectangular, occasionally curvilinear.

~Plane waves for some procedures (especially for periodic systems)

~Atomic orbitals for some procedures

Page 18: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

18

The octopus code

Derivative in a point: sum over neighbor points.Cij depend on the points used: the stencil.More points -> more precision.Semi-local operation.

Page 19: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

19

The octopus code

The key equations~Ground-state DFT: Kohn-Sham

equations.

~Time-dependent DFT: time-dependent KS eqs:

Page 20: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

20

The octopus code

Key numerical operations:~Linear systems with sparse matrices.~Eigenvalue systems with sparse matrices.~Non-linear eigenvalue systems.~Propagation of “Schrödinger-like”

equations.

~The dimension can go up to 10 million points.

~The storage needs can go up to 10 Gb.

Page 21: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

21

The octopus code

Use of libraries:~BLAS, LAPACK~GNU GSL mathematical library.~FFTW~NetCDF~ETSF input/output library~Libxc exchange and correlation library~Other optional libraries.

Page 22: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

22

www.tddft.org/programs/octopus/

Page 23: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

23

Outline

Theoretical SpectroscopyThe octopus codeParallelization

Page 24: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

24

Objective

Reach petaflops computing, with a scientific codeSimulate photosynthesis of the light in chlorophyll

Page 25: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

29

Multi levelparallelization

MPIKohn­Sham­states

Real­space­domains

In NodeOpenMP­threads OpenCL­

tasksVectorization

CPU GPU

Page 26: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

30

Target systems:Massive number of execution units ~Multi core

processors with vectorial FPUs

~IBM Blue Gene architecture

~Graphical processing units

Page 27: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

31

High Level Parallelization

MPI parallelization

Page 28: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

32

Parallelization by states/orbitals

Assign each processor a group of statesTime propagation is independent for each stateLittle communication requiredLimited by the number of states in the system

Page 29: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

33

Domain parallelization

Assign each processor a set of grid pointsPartition libraries: Zoltan or Metis

Page 30: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

34

Main operations in domain parallelization

Page 31: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

Low level paralelization and vectorization

OpenMP andGPU

Page 32: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

36

Two approaches

OpenMPThread programming based on compiler directivesIn node parallelizationLittle memory overhead compared to MPIScaling limited by memory bandwidthMultithreaded Blas and Lapack

OpenCLHundreds of execution unitsHigh memory bandwidth but with long latencyBehaves like a vector processor (length > 16)Separated memory: copy from/to main memory

Page 33: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

37

Supercomputers

Corvo cluster~X86_64

VARGAS (in IDRIS)~Power6~67 teraflops

MareNostrum~PowerPC 970~94 teraflops

Jugene (image)~1 petaflops

Page 34: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

38

Test Results

Page 35: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

39

Laplacian operator

Comparison in performance of the finitedifference Laplacian operator

CPU uses 4 threadsGPU is 4 times fasterCache effects are visible

Page 36: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

40

Timepropagation

Comparison in performance for a timepropagation

Fullerene moleculeThe GPU is 3 times fasterLimited by copying and non GPU code

Page 37: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

41

Multi level parallelization

Clorophyll molecule: 650 atomsJugene Blue Gene/PSustained throughput: > 6.5 teraflopsPeak throughput: 55 teraflops

Page 38: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

Scaling

Page 39: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

43

Scaling (II)

Comparison of two atomic system in Jugene

Page 40: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

44

Target system

Jugene all nodes~294 912 processor cores = 73 728

nodes~Maximum theoretical performance of

1002 MFlops

5879 atoms chlorophyll system~Complete molecule of spinach

Page 41: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

45

Tests systems

Smaller molecules~180 atoms~441 atoms~650 atoms~1365 atoms

Partition of machines~Jugene and Corvo

Page 42: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

46

Profiling

Profiled within the codeProfiled with Paraver tool~www.bsc.es/paraver

Page 43: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

1 TD iteration

Page 44: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

Some “inner” iterations

Page 45: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

One “inner” iterationIreceive Isend Iwait

Page 46: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

Poisson solver

2­xAlltoallAllgather Allgather Scatter

Page 47: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

51

ImprovementsMemory improvements in GS~Split the memory among the nodes~Use of ScaLAPACK

Improvements in the Poisson solver for TD~Pipeline execution • Execute Poisson while continues with an

approximation

~Use new algorithms like FFM~Use of parallel FFTs

Page 48: First principles modeling with Octopus: massive parallelization towards petaflop computing and more A. Castro, J. Alberdi and A. Rubio.

52

Conclusions

Kohn Sham scheme is inherently parallelIt can be exploited for parallelization and vectorizationSuited to current and future computer architecturesTheoretical improvements for large system modeling