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

[CL] New Phreeqc Interface #2640

merged 41 commits into from Sep 18, 2019

Conversation

@renchao-lu
Copy link
Member

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member Author

renchao-lu commented Sep 2, 2019

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

@renchao-lu renchao-lu force-pushed the renchao-lu:PhreeqcIORefactorNew branch from 6bb7bb3 to 3711fe4 Sep 3, 2019
@montoyav

This comment has been minimized.

Copy link
Member

montoyav commented Sep 3, 2019

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

@renchao-lu

This comment has been minimized.

Copy link
Member Author

renchao-lu commented Sep 3, 2019

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 renchao-lu:PhreeqcIORefactorNew branch 3 times, most recently from 7633f87 to 36fb54b Sep 4, 2019
@renchao-lu renchao-lu force-pushed the renchao-lu:PhreeqcIORefactorNew branch 9 times, most recently from 9ab8d28 to 8667d33 Sep 6, 2019
@renchao-lu renchao-lu force-pushed the renchao-lu:PhreeqcIORefactorNew branch from 553c22f to 2d9d4c0 Sep 17, 2019
@endJunction endJunction merged commit 5cc658e into ufz:master Sep 18, 2019
3 checks passed
3 checks passed
continuous-integration/jenkins/pr-merge This commit looks good
Details
deploy/netlify Deploy preview ready!
Details
ufz.ogs #20190917.14 succeeded
Details
@renchao-lu renchao-lu deleted the renchao-lu:PhreeqcIORefactorNew branch Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.