-
Notifications
You must be signed in to change notification settings - Fork 465
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
Save registry structures to file without using a buffer #1986
Save registry structures to file without using a buffer #1986
Conversation
The CMakeLists.txt now automatically generates modules based on the Registry_NWTC_Library_mesh.txt and Registry_NWTC_Library_base.txt files. It also concatenates these files to create the full Registry_NWTC_Library.txt which is included by other modules. The changes to Generate_NWTC_Library_types.bat replicate this behavior.
I noticed that the file Of course, if we do start auto-generating the params for each module through the registry (or similar) from csv files instead of the OutListParameters.xlsx, we'll have another set of auto-generated files using a file name other than I don't have a solution here, just an observation. |
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.
the help menu for the registry might have a typo
@@ -13,6 +13,7 @@ Usage: openfast_registry registryfile [options] -or- | |||
-h this summary | |||
-I <dir> look for usefrom files in directory "dir" | |||
-O <dir> generate types files in directory "dir" | |||
-inc generate types file to be included in another file |
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.
Should this be subs
for the new flag?
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.
changed to incsubs and updated documentation in new commit
I'd be fine with changing the name since this solution is a bit of a hack. The existing process requires two steps: 1) generate |
I definitely like the new solution! For the name, could we do something like |
…ry_mesh.txt and change custom target name
This pull request is ready to be merged.
Feature or improvement description
This pull request changes the Registry and types files to pack/unpack data directly to/from a file without using temporary buffers; thereby reducing the memory used when generating a checkpoint file. This PR also updates the NWTC_Library so that the registry subroutines used by ModMeshMapping are automatically updated.
This PR also adds the ModVar module upon which the tight coupling changes are based.
Impacted areas of the software
NWTC_Library
*_Types.f90
Additional supporting information
The existing code generated by the OpenFAST registry to pack/unpack data structures to/from files used buffer arrays to temporarily store the data in memory before it was written. For models which require a large amount of data (InflowWind/SeaState); or which have a long runtime and use binary output; this could cause a significant amount of memory to be used. As these buffers grow, there is also the potential to overflow the indexing variable (typically an IntKi) which is only capable of representing a number up to 2,147,483,647. So if an array has more than 2 billion elements (which could happen when packing all the data into an array), the program will crash with a strange error.
Test results, if applicable
No test results changed. 5MW_OC3Mnpl_DLL_WTurb_WavesIrr_Restart, which checks the restart functionality, passed successfully.