-
Notifications
You must be signed in to change notification settings - Fork 388
Codes for a semi implicit barotropic mode solver #422
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
Codes for a semi implicit barotropic mode solver #422
Conversation
|
@hyungyukang Thank you for your effort on this. Please also link or attach any design documents or testing results you already have. For example, you could link to the talk you gave at the last E3SM meeting. |
I'll do that soon. Thanks, @mark-petersen! |
|
Uploading a slide file summarizing this work. A bit revised from my AGU talk last December. |
|
@hyungyukang I am able to work on this now. My apologies for the delay. It looks like commit e89de64ad removed all the files in the repo, and 687f11ac3 added them back again. At the command line, What were you trying to do with those two commits? We need to reset back to 3979482 and add just the changes you intended. One way to do that is to use a unix |
773867f to
3979482
Compare
3979482 to
bf1dc40
Compare
|
Rebased. For my own reference, I compiled lapack (https://github.com/Reference-LAPACK/lapack) on LANL IC as follows: Then to compile: Some test cases run using semi-implicit, but some result in a seg fault with an |
bf1dc40 to
0d0d715
Compare
|
Fixed |
|
@hyungyukang, did you test the semi-implicit solver with restarts? Most of my tests work when In this example, the full run goes 4 timesteps from time 0 to 8 hours (2hr/time step) and completes successfully. The restart run reads in the restart file at time step 2 (4 hours) and goes to 8 hours, and should be bfb identical to the full run. Is there a variable that you need added to the restart file? Or some other condition that could be missing for a restart? Perhaps on restart init we have to populate a variable used for the initial guess for the implicit solver? |
|
@mark-petersen, thanks for reviewing the codes. Actually I've never tested the solver using I'm currently running these cases - QU240, EC60to80, and RRS30to10. Are these test cases working with |
0d0d715 to
d92cf48
Compare
|
You need to run the code forward and write restart files, and then restart from there. I can send a test case. That SSH warning is because the model is reading in all zeros, because no restart file is available. |
@mark-petersen, got it. I'll run it today. I'll let you know when I find problems as soon as possible. |
|
@hyungyukang I just sent you a zip file of our nightly regression suite, with all the correct flags for your rebased PR. unzip it, then and point ocean_model to your executable in each subdirectory. You can use run.py or cd into full_run and then restart_run and run each of those separately. The run.py in the restart_test directory compares if you get bit-for-bit matching solutions at the end of the full run and restart run. |
@mark-petersen, just received it. Thanks! |
|
I'll let you test it. When the restart run is not identical to the original run, the most likely cause is that you have a variable or setting in memory that is not saved for the restart. In that case, you need to add that variable to list just below that. Another possibility is that you are missing something in your init routine, like initializing variables for your implicit method. The original run (no restart) initializes the |
ce30963 to
d92cf48
Compare
|
@mark-petersen , I just fixed the bugs for restart run. Can you please test it? |
|
@mark-petersen , I've made some changes for the SI code based on what I've tested in other branch. Since explicit-subcycling and semi-implicit schemes are sharing these options ( And now the SI code passes the restart run test: |
|
@hyungyukang this is great progress. I just ran our nightly regression suite with gnu debug and optimized, but with openmp off. I compile with and get First, thank you for fixing the restart, it now works! That is great.
I will make a QU240 that tests partitions as well and send it to you. I don't have time to debug it much this week, but you could try. The general method is, make sure you also get a non-bfb match between 4 vs 8 cores (say), but a bfb match with split explicit. Then in your semi-implicit code, set your nCells and nEdges variables are maxed out, i.e. If that does not produce a bfb match, then look through and guess where you might need a halo update, and add it. Again, you can put in lots extra and there is no harm done. Once you get a bfb match, we need to take out all the extra ones, because halo updates are communication and are very expensive. |
|
Thanks @mark-petersen for the results. I'll be waiting for the partition test and look into the baroclinic channel test as well! |
|
I just sent a tar file with a new global test case, comparing 4 vs 8 processors. To run it: and it shows a mismatch between the two. Run with split explicit and it should match. Give it a try, and you can explore the halo strategies I have above. |
Add a new preprocessor directive (USE_LAPACK) around the calls to LAPACK routines. Also add OpenMP parallel regions to reflect recent threading PRs. Finally, remove calls to `mpas_ocn_get_config` and replace with `use ocn_config` module.
Update the log output when too many SI iterations occur. Previously, not all messages would be written to the log since MPAS_LOG_CRIT was passed prior to all log messages being written.
Modify time step size setting for SI code. Update USE_LAPACK flag in Makefile to provide broader compatibility
In this mode, the Jacobi preconditioner is used. Also, a simple single-precision allreduce is implemented to achieve BFB match across partitions. Later version, this BFB allreduce would be changed using better algorithms.
6602b92 to
87a1c21
Compare
Codes for a semi implicit barotropic mode solver #422
|
rebased. Testing... |
|
Passes mpas-o nightly regression suite with gnu debug and both split explicit and semi-implicit. Note that for semi-implicit, compile on grizzly with |
Adds ocean semi-implicit barotropic mode solver This brings in a new mpas-source submodule with changes only to the ocean core. It adds a semi-implicit barotropic solver for ocean time-stepping. Current default is split explicit and this new option is off by default, so this PR should be BFB. But it does require changes to the mpas-ocean Registry, so this PR also includes corresponding updates to its e3sm bld scripts. See MPAS-Dev/MPAS-Model#422 [NML] [BFB]
Adds ocean semi-implicit barotropic mode solver This brings in a new mpas-source submodule with changes only to the ocean core. It adds a semi-implicit barotropic solver for ocean time-stepping. Current default is split explicit and this new option is off by default, so this PR should be BFB. But it does require changes to the mpas-ocean Registry, so this PR also includes corresponding updates to its e3sm bld scripts. See MPAS-Dev/MPAS-Model#422 [NML] [BFB]
Codes for a semi implicit barotropic mode solver MPAS-Dev#422
Adds semi-implicit barotropic mode solver.