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

Configure max number of model instances #61

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

mdpiper
Copy link
Member

@mdpiper mdpiper commented Sep 16, 2021

To allow multiple instances of a model to be instantiated (think @wk1984's implementation of GIPL as a use case), the babelizer Fortran interoperability layer has a parameter

integer, parameter :: N_MODELS = 2048

For models that use statically allocated variables, this presents a problem--2048 copies of a model with memory already allocated are created! This, I believe, is at the heart of the problem in csdms/help-desk#104.

In this PR, an undocumented max_instances parameter is added to the build section of the babelizer input file. It's set to a small default number (currently 8), which allows enough instances to be created to run the bmi-tester. Users can override this default value in the babelizer input file; e.g.:

[build]
undef_macros = []
define_macros = []
libraries = []
library_dirs = []
include_dirs = []
extra_compile_args = []
max_instances = 32

or

[build]
undef_macros = []
define_macros = []
libraries = []
library_dirs = []
include_dirs = []
extra_compile_args = []
max_instances = 1

I'm choosing to keep this new parameter undocumented, pending further study.

@mdpiper
Copy link
Member Author

mdpiper commented Sep 16, 2021

@lzhu5 This is the change I'm plotting for the babelizer.

@mdpiper
Copy link
Member Author

mdpiper commented Oct 19, 2021

I should parameterize the tests like @mcflugen did in #60.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant