Jump to content
GMS, SMS, and WMS User Forum
Bruce Campbell

MODFLOW Run Time Increase

Recommended Posts

Hi -- My run times for a MODFLOW model have increased from 20 minutes to 2.5 hours over the past few months. I haven't added any MODFLOW packages over this time period but the size of the H5 file has doubled from about 700MB to 1.5GB which I'm sure results in the longer run times. Not sure why the H5 file has doubled in size. Does it only contain MODFLOW inputs?

Share this post


Link to post
Share on other sites

I assume that you haven't added any additional stress periods either?

Can you upload to the ftp and we will take a look? If you happen to have the older version and can upload that also that would be great.

Share this post


Link to post
Share on other sites

Forgot to mention, I run the model outside of GMS in a DOS window. Tried running it within GMS earlier this week and got the same slow run time. I run the mf2pest program outside of GMS. I modify the *.pst files and they are slightly different from the one that is produced by GMS from the mf2pest program, I have to add another regularization line. If any of this is confusing, please let me know.

Share this post


Link to post
Share on other sites

Inside the directory where GMS is installed there is a folder called hdf5_tools. Inside this folder you will find a command line program called h5repack. Copy this program to the directory with the large h5 file. On the command line type

h5repack "largefile".h5 outfile.h5. This is will take several minutes to complete. When it is done replace "largefile" with outfile. The file should be much smaller. The h5repack program will remove all items from the h5 file that are no longer being referenced by the internal h5 file structure. GMS doesn't automatically run this program on each file save because it can often take several minutes to run.

Share this post


Link to post
Share on other sites

Hi Alan -- Ran the repack program as directed and it reduced the *.h5 file size to about 0.5 GB (from about 1.5 GB) - big reduction. Deleted the larger one and replaced it with the smaller one and got a run started, however, the model doesn't appear to running much faster. In 45 minutes, it's still on the 8th stress period (out of 39). I'm using the GMG solver and when it's iterating, it runs as fast as it always did -- but there are long pauses between stress periods that take the extra time. It used to just go straight to the next stress period with little or no pause. I'm writing the following files *.out, *.hed, and *.ccf. All of which are large files. Tried it on my brand new laptop and it runs a little faster.

I used to get something like this when I had a path to the model executable but started putting a copy of the MODFLOW executable (along with the *.dll's) in the directory with the input/output files and it ran much faster. Not sure why that would make a difference...

Share this post


Link to post
Share on other sites

Hi Alan -- Made a couple of runs after the repack program was run on the *.h5 file. The run times are only slightly improved. The run is producing a very large (2.7 GB) *.ParameterArray.h5 file. This file in the "fast run" I sent to last week was 270 MB. Can't help but think the long run time is related to writing this large file. Is it something that GMS or PEST needs? Can I turn it off so that it isn't written during the model run?

Share this post


Link to post
Share on other sites

Hi Alan -- The questions just keep on coming. The last runs with the H5 file produced by the repack program produced CCF and HED files named "fort.740" and "fort.742" (or something like that). GMS won't read them into the solution. I tried changing the names to *.ccf and *.hed but GMS doesn't like these names, either. Must be something in the binary file - a header line maybe?

Share this post


Link to post
Share on other sites

Hi Bruce- Thanks for your patience. I also noticed the large *.ParameterArray.h5 file and I believe this is the culprit for you long run times. I am working on a solution and hope to have it to you soon.

Share this post


Link to post
Share on other sites

Bruce

I found and fixed the issue. In GMS 9, we implemented Null Space Monte Carlo (NSMC) with PEST. As part of that implementation, we modified some MODFLOW code so that MODFLOW would write out data sets of Parameter arrays while MODFLOW ran. This was necessary to be able to visualize the results from NSMC. The code to write the data sets was not very efficient, especially for a really large model like yours. At any rate, it is now fixed and it adds no extra time to the model run time. Here is a link to an updated version of mf2k:

ftp://pubftp.aquaveo.com/download/gms/user/Bruce/mf2k.zip

This will be in the next update to GMS and will be available in all the flavors of MODFLOW that we ship.

Share this post


Link to post
Share on other sites

Hi Alan -- Sorry to keep the parade of bad news going but... Got your mf2k executable but couldn't get it to work either outside or inside GMS. Outside in a DOS window, I get a Fortran error access violation error with both attempts. I have been using the "mf2k_h5_64" executable so I don't know if that makes a difference. What does the "parallel" version of MODFLOW mean in this case? Read the explanation in the GMS help documentation but still confused.

I appreciate your help,

Share this post


Link to post
Share on other sites

Hi Alan -- Got a solution - used the mf2k_h5_64.exe version that is in GMS 8.3 that I still have on my machine. Worked great, run time back to about 37 minutes vs 3+ hours. The parameter array file is 16KB instead of 2.7GB. Much more manageable.

Thanks again for your help..

Share this post


Link to post
Share on other sites

Bruce

Sorry. I actually knew you were using mf2k_h5_64.exe and I sent the parallel version by mistake. (The parallel version allows the SAMG and the PCGN solvers to use multiple cores on computers that have them.) Sounds like you got it working. The next update of GMS 9 will have the fix in all versions of MODFLOW that we ship.

Share this post


Link to post
Share on other sites

Hi Alan -- Question about the parallel versions of MODFLOW and the two solvers. Have you found them to be effective with large models like the one I'm working on? What I've been doing is running BeoPest across our network with 3 - 8 core machines. Haven't ventured into the cloud, yet. Do these GMS parallel versions allow for this (multiple machines across a network) or is it limited to one machine? If I remember right, the Parallel Pest version that GMS uses is limited to one machine. Was having trouble with Parallel PEST and John Doherty suggested switching to BeoPest and it has worked very well. With this model, Parallel PEST was not always taking the lowest phi calculated during the lambdas and John said there might be a bug. I've found that BeoPest always takes the lowest phi.

Share this post


Link to post
Share on other sites

They only work on 1 machine with multiple cores. In terms of the parallel versions saving time I have seen mixed results. If you have a license to the SAMG solver then it is worth trying. Often it is the fastest solver for models that I have worked with. In the little bit of testing that we have done with the PCGN solver the MODFLOW grid had to be well above 1 million cells before we saw much improvement in the run time compared to the serial version.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...