-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Hessian Kernels for PP and SS #688
Comments
Formulations for Hessian Kernels: H_pp, H_ss. We can do different parametrizations similarly. |
Hi @danielpeter, I think I will start with CPU first since I think it is much easier. I am thinking about what is the most best way to store the extra hessian kernels. The current rho hessian kernels are stored in variable The current dimension of
Should we expand the current hessian array to Also,considering the CPU and GPU code similarity. |
i would stay with single arrays using (NGLLX,NGLLY,NGLLZ,NSPEC) only but using some naming convention to differentiate, like hess_vp_kl.., hess_vs_kl.., and so on. that way, we have minimal impact on existing workflow and visualization tools like combine_vol_data**, etc. |
Hi @danielpeter, To calculate the hessian kernel for kappa and mu, I need some extra terms such as space derivatives of adjoint velocity field:
Those terms are needed for computing source and reciver hessian kernels. Current specfem3d globe seems only computed the spatial gradients of forward velocity, but not for adjoint velocity. Could you confirm my point? |
these derivatives depend on the mapping, i.e. are mesh dependent only, but do not depend on the wavefields. so you can use xix_crust_mantle, etc. for calculating the gradient of both forward and adjoint wavefields. |
Got you. So you mean they are just arrays got allocated and we are free to use them as we want during the calculation. |
yes, these arrays are read in the beginning by the solver and available during all calculations. if you prefer, for speed performance we use Deville products by default (USE_DEVILLE_PRODUCTS_VAL) and in those cases, have these shape function derivatives merged into the array deriv_mapping_crust_mantle(x,NGLLX,NGLLY,NGLLZ,NSPEC) (in prepare_optimized_arrays.F90 line 482). this makes reading these values a bit more efficient. that's fine tuning however. |
Hi @danielpeter, Could you help to take a look at this code change? Please let me know if there is any alarming issues you spot. I think I should get most of the calculation code done and the code compiles with no errors. The only thing bugs me a little bit is the conversion between Also, since I write a function to be called so I define a interface here. Not sure if it follows the coding style of specfem. |
Hi @danielpeter, may I ask for your help when porting the code to GPU? I have a few questions to you if you have time to answer them. Q1: When can I find the definiation to the Q2: I need to caluclate the gradient of the |
Hi @danielpeter, I think I get most of what I want. There is one thing confuse me a little bit. In the
I see it actually support reading CUDA code from reference directory and I suppose the reference directory is hand-written CUDA code. The default value of For computing kernels of hessian kernels of |
hi Wenjie, these reference CUDA routines were used when we ported the code from CUDA to BOAST routines. these original CUDA routines became the "reference" when we compared then the different versions for testing and validation. so there is still this option to either use the reference hand-written or the generated CUDA routines. however, most of the reference routines haven't been adapted to the newer code changes, so i would guess that this won't work anymore. thus, just focus on writing BOAST kernels to then generate CUDA and OpenCL kernels. you can ignore these references/**.cu kernels and won't need to write such an additional one. |
for the questions above, i don't have much to add other than try and look up how it was done for the |
Hi @danielpeter , thanks for the help. I am I am pretty much done with the BOAST part. You may take a look at the code change here, though there are lots of code changes... The only thing I am not sure is the |
hi Wenjie, the changes look good. regarding the openCL calls, we will just test it and correct if necessary. |
Hi all,
SPECFEM3D GLOBE currently calculate Hessian kernels based on density. We would like to add two more kernels, to proper precondition Vp and Vs kernels separately. This requires SPECFEM to calculate two extra Hessian kernels (in both fortran and CUDA) and write them out (in both binary and adios format).
Second, the current Hessian kernel is based on source-receiver wavefield. Congyue would like to use the source-source wavfield, to get Hessian.
I would like to use this thread to track our working progress.
Congyue's previous code change to calculate pp hessian kernels: icui@5329763
update 2020.06.17
I put some code update here so people can help to check the formula.
https://github.com/wjlei1990/specfem3d_globe/pull/2/files
The text was updated successfully, but these errors were encountered: