compdyn/partmc

Adapt GPU to all relevant reactions

cguzman95 opened this issue · 4 comments

After the merge of my GPU branch and chem_mod branch, GPU part needs to be adapted to the new variable names and structures.

This issue is to fix GPU part until it works for the most common reactions (arrhenius, photolysis, troe,etc). Complex reactions like phase-transfer will be tried to execute in GPU and at least take into account if GPU flag is activated

Hi @mattldawson - I'm looking at reactions HL_phase_transfer and SIMPOL_phase_transfer, and they need a lot of work to adapt on GPU (and it doesn't guarentee it will works fine).

For the moment, it prints a warning if the user tries to compute one of this reaction on GPU. It's okay for you if I left this adaptation for the 2.0 version?

Hi @cguzman95 - yeah, I figured those would be difficult. I'm fine with leaving the GPU calculations for them until 2.0, but we should talk about how we set up the work-around. The MONARCH mechanism will include these reactions, so if we want to run MONARCH chemistry on GPUs we'll need a way to still calculate these somehow. This could be just calculating them on the CPUs, or we could set up the aerosol functions (which I'm assuming are the difficult part to port to GPUs) to be calculated more like the sub-model parameters, where they're pre-calculated in a separate function before calling rxn_calc_deriv(). What would be your preference?

I prefer calculating them in CPU, since coding this is just a moment (add a function on rxn_solver that only calculates them, and call it alongside sub_models). The other option needs more changes, and maybe we can treat it as a issue apart and discuss what reactions should be calculated on sub_model or not

UPDATE: Jacobian feels working on unit_tests, however, it was false (I missed to adapt jac_map). I just reason in #99 that I want to reduce jacobian data and then adapt the jacobian since the jacobian has a low impact and probably won't achieve any speedup at the moment.