Added vectorized Riemann solvers for the single-layer shallow water equations#133
Added vectorized Riemann solvers for the single-layer shallow water equations#133mandli merged 2 commits intoclawpack:masterfrom
Conversation
| hvL=qr(i-1,nv) | ||
| hvR=ql(i,nv) | ||
|
|
||
| sw1 = 0.0d0 |
There was a problem hiding this comment.
You may want to add a comment as to why you needed to decompose this into scalars for future reference.
src/geoclaw_riemann_utils_vec.f90
Outdated
| integer meqn,mwaves,maxiter | ||
| !double precision fw(meqn,mwaves) | ||
| !double precision sw(mwaves) | ||
| double precision sw1,sw2,sw3,fw11,fw12,fw13,fw21,fw22,fw23,fw31,fw32,fw33 |
There was a problem hiding this comment.
We have been using real(kind=8) instead of double precision with the intent to perhaps support multiple precisions depending on the case. I know the former is less portable but I think it's probably best to be consistent unless there is another reason to use double precision.
There was a problem hiding this comment.
I've now replaced double precision with real(kind=8) in my code. Note however that the original geoclaw_riemann_utils.f still uses double precision, you may want to check whether this should also be modified.
src/rpn2_geoclaw_vec.f90
Outdated
| use amr_module, only: mcapa | ||
|
|
||
| use storm_module, only: pressure_forcing, pressure_index | ||
| use statistics |
There was a problem hiding this comment.
It was a module I created to measure the execution time of each solver, but I removed it before this pull request. Apparently, I forgot to delete it from a couple of files, and my compilation tests did not complain because the .mod file was still present in my computer. I have already removed these "use statistics" lines from the code.
|
When I test this, I seem to be missing the module needed by |
…equations: * double precision -> real(kind=8) ; * !DIR$ SIMD -> !$OMP SIMD ; * Added a few comments explaining that I had to decompose some arrays into several scalars because of what seems to be a bug with the Intel Compiler; * Removed subroutines riemann_ssqfwave and riemann_fwave from geoclaw_riemann_utils_vec.f90 because they were not being used and also were not compatible with the vectorized code (different order in the array indices); * Removed "use statistics", which is a module I was using to measure the execution time taken by each solver.
|
I have pushed a new commit that addresses the issues you have pointed out. Main changes:
|
|
This looks good to me now. Randy can you test this quick and make sure it also works for you? |
|
It compiles and runs, but seems to be slower. See the comment I posted on clawpack/geoclaw#291. |
These changes introduce new vectorized implementations for the single-layer shallow water equations (chile2010 example). The user can easily switch between the serial and the vectorized code: to use vectorization, one needs to define GEOCLAW_VEC=1 before compiling. More info in the chile2010 Makefile.