-
Notifications
You must be signed in to change notification settings - Fork 371
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
Adds NOOPT_FILES concept to mpas cmake system #6668
Conversation
And uses this system to deoptimize icepack_shortwave_data.F90, a file that takes a very long time to compile and is just setting up consts.
|
Wuyin provided a pointer to a v3. HR run: https://pace.ornl.gov/exp-details/191652 While discussing v3 HR performance, we noticed the build times for that experiment: https://pace.ornl.gov/buildtime/191652
(This is almost half the time taken for the entire build) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved based on visual inspection and testing -- it passed the e3sm_ice_developer suite on chrysalis
Icepack has a cpp flag to not compile the input tables. I don't think E3SM needs to compile those because it reads in the same data from files. See |
@eclare108213 If I understand your right, we can skip compilation of this file for E3SM build. Please confirm. @jgfouca Once confirmed, can you remove this file from the CMake build sources then? |
@sarats Now I'm not sure whether the cpp will work. In the E3SM Icepack slack channel where we are discussing this, @apcraig writes
It sounds like we (CICE Consortium) only use the cpp for testing when we do not need those data values at all. You could try turning on the cpp locally and see if the answers change (or more likely that the code fails because it doesn't have the data it needs). If that happens, then definitely forge ahead with what you're doing now. |
Do you recall why all this data is hardcoded in a Fortran file instead of read in from a text file? Was it just to avoid doing any I/O ? ("Icepack does not support any IO directly.") |
Yes, that's right. E3SM is currently the only model using the 5-band snicar data, and we didn't want to have to maintain those data files just to support Icepack testing in the Consortium. E3SM in particular has wanted Icepack to be "lean", without all the bells and whistles available in CICE, and so we've resisted doing I/O. We can, though, if need be. |
@sarats , if I remove this file, the build fails:
Should I remove the icepack_shortwave.f90 as well? |
No, you can't remove either icepack_shortwave.f90 or icepack_shortwave_data.f90. They are both needed for the radiation calculations, regardless of where the data is coming from. My suggestion was that you test whether MPAS-seaice is reading the data from data files and somehow sending that data to Icepack by activating the cpp So then the first question to ask is whether E3SM is reading in all that data from a file and then using the data from the hardcoded tables instead. If so, which do you prefer? Choose one or the other. They should be identical, at the moment. If you want to use the data files, then we'll need to generalize Icepack's |
We've had some discussion of this in the E3SM Icepack slack channel. @rljacob A big motivator for hardcoding the tables in Icepack, which I had forgotten, is that the current data files don't have all of the dimension and other information needed to use the data -- that was hard-coded in E3SM. This is a potentially dangerous situation that we weren't willing to accommodate in Icepack. Rather than creating new data files that would have to be maintained, distributed, documented, read in, etc., we chose to go with the hard-coded tables instead. I believe E3SM is using the hardcoded table data ( |
@eclare108213 , it appears like all that hardcoded data is required: |
Hah, we commented at almost the exact same time. So, I think we are good to merge this? |
Adds NOOPT_FILES concept to mpas cmake system And uses this system to deoptimize icepack_shortwave_data.F90, a file that takes a very long time to compile and is just setting up consts. [BFB]
Merged to next. |
Just curious, can someone share the compile time different from optimized and not optimized for this file. Is it like 10x, 100x, 1000x? |
Also, for future reference, you don't need the CPP "USE_SNICARHC". It has no effect. At some point "USE_SNICARHC" became the default and the updated CPP is "NO_SNICARHC". So the CPP now allows a user to hide the hardcoded tables if they aren't needed instead of turning them on if they are. Anyway, you should remove the "USE_SNICARHC" when you have a chance for clarity. |
@apcraig this comment has a "with optimization" time #6668 (comment). |
Is there also a time for the "without optimization". Just curious whether turning off the optimization has a large impact or whether some other aspects (like number of lines) is playing a large role too. |
@apcraig -- the switch to "NO_SNICARHC" may not have made it into E3SM yet. Looking at icepack_shortwave_data.F90 I still see:
|
@apcraig , did you see my comment #6668 (comment) ? USE_SNICARHC has an effect. At least in the version of mpassi we are using. |
It looks like that's in the older version of Icepack that E3SM still has. We plan to resync them soon.
|
Sorry about that, thought you had that change in your version. Yes, keep the USE_SNICARHC turned on for now. |
@jgfouca please start merging this. |
And uses this system to deoptimize icepack_shortwave_data.F90, a file that takes a very long time to compile and is just setting up consts.
[BFB]