Skip to content
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

[CL] New Phreeqc Interface #2640

Merged
merged 41 commits into from
Sep 18, 2019
Merged

Conversation

renchao-lu
Copy link
Contributor

@renchao-lu renchao-lu commented Sep 2, 2019

Current chemical solver interface between OGS-6 and Phreeqc works in a conventional way (via file-based approach). That is, in each time step, Phreeqc input file is prepared for speciation calculation and phreeqc output file is then parsed for result updates. This approach is not computationally efficient.

New Phreeqc Interface by direct memory access

Thanks to Dima's instruction and Wenqing's help, we hereby provide an alternative interface by direct memory access. This approach allows us not to process Phreeqc input and output files any more. This feature greatly cuts down computation costs. In the small-scale kinetic reactant benchmark added in this pull request (containing 201 nodes), computation time by Phreeqc reduces from ~0.05 seconds to ~0.03 seconds (in average) in each time step. We gain 60% speed-up. In another intermediate-scale test (not included in this pull request, download by IntermediateScaleKineticReactantBenchmark.zip containing 24461 nodes, with the same chemical configuration as in the small-scale test), Phreeqc runtime decreases from ~40 seconds to ~2 seconds. We acquire 20x speed-up. Speed-up effect becomes more and more significant with the increase of number of nodes (also referred as number of chemical system).

In addition, using this alternative interface prevents from precision lost in truncation.

Limitation
By far this new interface only supports for kinetic reaction process (equilibrium reaction process is not open yet).

  1. Feature description was added to the changelog
  2. Tests covering your feature were added?
  3. Any new feature or behavior change was documented?

@joboog
Copy link
Contributor

joboog commented Sep 2, 2019

Is this replacing the existing OGS-6--PhreeqcInterface, or will there be an option to choose the interface type?

@renchao-lu
Copy link
Contributor Author

The latter. Switching the tag <chemical_solver> from Phreeqc to PhreeqcKernel is meant to call the new phreeqc interface.

@montoyav
Copy link
Member

montoyav commented Sep 3, 2019

Maybe interesting to know/mention how many cores were used for the mentioned simulations.

@renchao-lu
Copy link
Contributor Author

Maybe interesting to know/mention how many cores were used for the mentioned simulations.

Parallelization not touched in this PR. Just single core. @montoyav

@renchao-lu renchao-lu force-pushed the PhreeqcIORefactorNew branch 3 times, most recently from 7633f87 to 36fb54b Compare September 4, 2019 17:01
@renchao-lu renchao-lu force-pushed the PhreeqcIORefactorNew branch 9 times, most recently from 9ab8d28 to 8667d33 Compare September 13, 2019 11:20
@endJunction endJunction merged commit 5cc658e into ufz:master Sep 18, 2019
@renchao-lu renchao-lu deleted the PhreeqcIORefactorNew branch September 18, 2019 15:53
@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants