2022 SYLLABUS for course PHYD57, Advanced Computational Methods in Physics Lecturer: prof. Pawel Artymowicz (pawel@utsc.utoronto.ca; please put PHYD57 in the subject line and make sure the address is as shown, otherwise mail may be misplaced and not answered) _______________________________________________________________________________ Lectures (L1-L12, 2 hrs with 10 min break) on Tuesdays 14:00-16:00 Tutorials (T1-T10) on Tuesdays, 17:00-18:00, on days listed below. Meetings on zoom, login via Quercus. Deadlines for 4 sets of assignments/projects are denoted A1-A4 at 2pm. Expect to see them posted 7-14 days before the deadline. _______________________________________________________________________________ Jan Feb Mar Apr 11 L1 1 L4, T3, A1 1 midterm*, L7 5 L12, T10, A4 18 L2, T1 8 L5, T4, 8 L8, T6 29 Fri 2:00-5:00 25 L3, T2 15 L6, T5 15 L9, T7 Final Exam** 17 A2 20 A3 22 reading week 22 L10, T8 29 L11, T9 _______________________________________________________________________________ *) midterm in class, 1st hour of lecture 7 (14:05-15:00) on 1 March **) due time for writeups & 30 min exam presentations (zoom) on 29 Apr. Notify prof. of any time conflict. Syllabus is subject to small changes. Please download the updates every week. 1 Structure and scope of the course Syllabus of PHYD57 Numerical Comp. in Physical Sciences: History and Contemporary efforts 2 HPC: need for speed, why and how History and modernity: microprocessors, Unix, Linux, and Internet Intro to Linux (CentOS) Command line interface and shells (bash and tcsh) Text editors: vi, nano, gedit, micro, ... 3 Connectivity (ssh & sftp, traceroute & ping) Securing your system against break-ins via /etc/hosts.deny Basic Linux commands (cd, ls, ps, cd, &, bg, fg, alias, setenv, output redirection to file via > , rm) Getting more info: manual pages (man), -h, --help, or -help modifiers Recommended compilers: GNU: gcc, gfortran; Intel: icc, ifort; PGI: pgcc, pgf95 Simple program in C, Fortran95, Python, Matlab and IDL (Schoerghofer book p.30) More complex program, example of HPC: 2nd order Laplace operator stencil for diffusion equation Speed comparison of C/F95 with Python & Numpy: why we learn HPC 4 C and Fortran 95 - compilers, basic usage Numerical puzzle of 711 - learning C and Fortran Kruskal counts and their connection to linked lists Coding Kruskal counts trick in Python and Fortran C: Language overview, compilers Integration with Python: calling C from Python examples of programs 5 More Fortran Examples of programs: Init. value problems for ODEs More C Parallel execution of programs on CPU and MIC Parallel implementations: diffusion and wave equation Modern computing and the success of Integrated Circuits Barriers to single-thread comuting and Moore's law 6-7 Multi-dimensional arrays in C vs. Fortran Bottlenecks: Computation vs. RAM bandwidth (on CPU) An example program in C and Fortran. Parallelization via OpenMP in C and F Segmentation faults due to limited stack 8 Brief intro to a choice of Final Projects Intro to parallellism of supercomputing clusters CPU and MIC (many integrated cores, Xeon Phi) Calling C functions from Python Graphics in Fortran and C: DISLIN library 9 Parallel implementations: diffusion and wave equation Linked lists, nearest neighbor search Computations with CPU vs. MIC vs. CUDA Supercomputing Particle disks on MIC cluster Optically thick disk calculation (IRI) N-body integration methods and implementations 10 Interaction of protoplanets with 3D particle and gas disks Fluids by Eulerian vs. Lagrangian methods: CPU and GPU. Incompressible flow alorithm (fluidsGL) Fourier integral & discrete transform. FFT, N lnN scaling. Gravitational potential by FFT convolution Aliasing and zero-padding Examples of simple GPU programs written in CUDA Fortran 11 Discussion of chosen assignment problem solutions Examples of simple GPU programs in CUDA C/C++ CUDA computation of tetrahedrons puzzle & Laplacians Introduction to MPI Smoothed Particle Hydrodynamics implementation 12 Machine Learning, Artificial Intelligence, Neural Networks Gershenfeld "The Nature of Mathematical Modeling" (1999) Papers on NNs in spectra classifications, exoplanet research Optimum Search: Simplex (Nader-Mead). Overfitting problem. What are NNs and why do they work despite dimensionality curse Programming: Automatic vectorization and compiler reports Further details and hints on four final projects