knbarton / ners570-finalproject

Ners 570 Final Project
1 stars 1 forks source link

Parallelism #8

Open knbarton opened 4 years ago

knbarton commented 4 years ago

This issue is complete when the code runs with OpenMP parallelism.

knbarton commented 3 years ago

I started a branch for this, parallelism_8. I added omp do loops to mod_centered_diff.f90 and mod_initialize.f90. I'm not sure if there's much we could do to add parallelism to mod_comp_next_step.f90 since diffx/diffy/diffh all return full arrays, meaning we can't rewrite the operation an explicit loop.

I wasn't sure how to add the -fopenmp flag to the CMake file, but it can be compiled directly using these commands:

gfortran -c -fopenmp mod_centered_diff.f90 mod_initialize.f90 mod_comp_next_step.mod tsunami.f90
gfortran -fopenmp tsunami.o mod_initialize.o mod_centered_diff.o mod_comp_next_step.o -o tsunami