eth-vaw-glaciology / course-101-0250-00 Goto Github PK
View Code? Open in Web Editor NEWETH course - Solving PDEs in parallel on GPUs
Home Page: https://pde-on-gpu.vaw.ethz.ch
License: Other
ETH course - Solving PDEs in parallel on GPUs
Home Page: https://pde-on-gpu.vaw.ethz.ch
License: Other
In L6 (https://pde-on-gpu.vaw.ethz.ch/lecture6/) this shows:
Why mention the license here? All is covered by MIT/CC BY-SA
this one https://cheatsheet.juliadocs.org/
It would be helpful to add comment lines to each script's top to state:
Bonus points for actually stating the equation.
I realize that some of that is encoded in the file name, but I cannot decode that.
For instance for https://github.com/eth-vaw-glaciology/course-101-0250-00/blob/main/scripts/l2_diffusion_1D.jl:
# Lecture 2.2a Parabolic PDEs - solve diffusion equation with explicit forward Euler step
#
# ∂C/∂t = D ∂²C/∂x²
problem resolved, I misunderstood the formula.
Why not
@inbounds @views function diffusion2D_step!(T, Ci, qTx, qTy, dTdt, lam, dt, _dx, _dy)
qTx .= .-lam.*(T[2:end ,2:end-1] .- T[1:end-1,2:end-1]).*_dx # Fourier's law of heat conduction: qT_x = -λ ∂T/∂x
qTy .= .-lam.*(T[2:end-1,2:end ] .- T[2:end-1,1:end-1]).*_dy # ... qT_y = -λ ∂T/∂y
dTdt .= Ci[2:end-1,2:end-1].*( # Conservation of energy: ∂T/∂t = 1/cp (-∂qT_x/∂x - ∂qT_y/∂y)
.-(qTx[2:end, : ] .- qTx[1:end-1, : ]).*_dx
.-(qTy[ : ,2:end ] .- qTy[ : ,1:end-1]).*_dy)
T[2:end-1,2:end-1] .= T[2:end-1,2:end-1] .+ dt.*dTdt # Update of temperature T_new = T_old + ∂t ∂T/∂t
return nothing
end
instead of
@inbounds @views macro d_xa(A) esc(:( ($A[2:end , : ] .- $A[1:end-1, : ]) )) end
@inbounds @views macro d_xi(A) esc(:( ($A[2:end ,2:end-1] .- $A[1:end-1,2:end-1]) )) end
@inbounds @views macro d_ya(A) esc(:( ($A[ : ,2:end ] .- $A[ : ,1:end-1]) )) end
@inbounds @views macro d_yi(A) esc(:( ($A[2:end-1,2:end ] .- $A[2:end-1,1:end-1]) )) end
@inbounds @views macro inn(A) esc(:( $A[2:end-1,2:end-1] )) end
@inbounds @views function diffusion2D_step!(T, Ci, qTx, qTy, dTdt, lam, dt, _dx, _dy)
qTx .= .-lam.*@d_xi(T).*_dx # Fourier's law of heat conduction: qT_x = -λ ∂T/∂x
qTy .= .-lam.*@d_yi(T).*_dy # ... qT_y = -λ ∂T/∂y
dTdt .= @inn(Ci).*(.-@d_xa(qTx).*_dx .- @d_ya(qTy).*_dy) # Conservation of energy: ∂T/∂t = 1/cp (-∂qT_x/∂x - ∂qT_y/∂y)
@inn(T) .= @inn(T) .+ dt.*dTdt # Update of temperature T_new = T_old + ∂t ∂T/∂t
return nothing
end
?
Also, if keeping the macros: do they need the @inbounds
and @views
as the function is already decorated like so?
The website https://pde-on-gpu.vaw.ethz.ch/software_install/#cuda-aware_mpi_on_piz_daint states
export MPICH_RDMA_ENABLED_CUDA=1
export IGG_CUDAAWARE_MPI=1
but the linked scripts in https://github.com/eth-vaw-glaciology/course-101-0250-00/tree/main/scripts/l8_scripts set them =0
.
Also, whilst at it, should the last line be julia --project -O3 <my_script.jl>
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.