diff --git a/_quarto.yml b/_quarto.yml index 2d41e3284735a88a9afd18799629335a84ad53c4..606e6d9da7c95e1620eaa86fee23020f8588b220 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -52,7 +52,7 @@ website: - "exercises/user-experience.qmd" # - "exercises/testing.qmd" # - "exercises/git2.qmd" - # - "exercises/parallelism.qmd" + - "exercises/parallelism.qmd" # - "exercises/hardware.qmd" # - "exercises/file_and_data_systems.qmd" # - "exercises/memory_hierarchies.qmd" diff --git a/lectures/parallelism/slides.qmd b/lectures/parallelism/slides.qmd index 59f9c6a2d1495d69407c0018f285f4cda411002b..eaf71395bf865febf9da44f9d27b8a222545df66 100644 --- a/lectures/parallelism/slides.qmd +++ b/lectures/parallelism/slides.qmd @@ -1,6 +1,6 @@ --- title: "Parallelism" -author: "CF, GM, JFE FIXME" +author: "Georgiana Mania, Claudia Frauen, Jan Frederik Engels" --- # Motivation @@ -11,18 +11,14 @@ author: "CF, GM, JFE FIXME" * Use independent compute resources for each piece * Outlook for next week: The individual computing element does no longer get much faster, but there are more of them -* FIXME: What else? ## This lecture * Is mostly about parallelism as a concept -* Next week: Hardware using this concept +* Next week: Complications due to existing hardware -[comment]: # (Thinking about it, I think we should not give a theoretical definition here, -but first give the example and explain parallelism there. Eventually, with the -task-parallelism we should probably give a real definition and different flavours.) # Our example problem @@ -41,8 +37,16 @@ FIXME show plot of a soliton :::: # Our example problem -FIXME -show some central loop +```c +while ( t < 50 ){ + //[...] + for(i=0; i<npoints; i++){ + //[...] + u[i]=u2[i]-(delta_t/delta_x)*lu(h1,u1,i); + h[i]=h2[i]-(delta_t/delta_x)*lh(h1,u1,i); + } +} +``` # Decomposing problem domains ## Our problem domain @@ -115,8 +119,11 @@ time ./serial.x # use `time` to check the runtime 3. Compile and run the example using OpenMP ```bash gcc -fopenmp main.c -o parallel.x -lm -OMP_NUM_THREADS=2 time ./parallel.x +time OMP_NUM_THREADS=2 ./parallel.x ``` +FIXME: time is often a shell builtin, so output varies and also the place +where the env-var needs to be set. + 4. See next slide! # Hands-on Session! {background-color=var(--dark-bg-color) .leftalign} @@ -442,15 +449,6 @@ S1 and S2 can NOT be executed in parallel! * Parallelisation should not change the results! Exceptions to be discussed next week! -# FIXME -* Homework: - * Revisit `schedule` and try `dynamic` and explain why that happens. - * Parallelize the loop in `maxval`. - * Do a strong-scaling experiment starting with 2 threads and up to 32 - threads and plot the result. - * If you were to increase the number of threads, do you expect the speedup - to continue indefinitely? If not, which limits can you imagine? Feel free - to use kitchen metaphors. # Additional reading