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

Add update+get_value functions #11

Open
sverhoeven opened this issue Oct 7, 2024 · 0 comments
Open

Add update+get_value functions #11

sverhoeven opened this issue Oct 7, 2024 · 0 comments

Comments

@sverhoeven
Copy link
Member

A very common way to call the BMI methods is

while m.get_current_time() < m.get_end_time():
  m.update()
  for v in variables:
    output[m.get_current_time()][v] = m.get_value(v)

Lots of requests are needed to get a value after each update, this could be slow.

To speed up running a model it would be nice to have additional run functions like

  1. update_until_and_get_value_of_variables(time, variables): Mapping<str, list<float>>
  2. update_until_and_get_value(time, variables): list<float>>
  3. update_until_and_get_value_at_indices(time, variable, indices): list<float>
  4. update_until_and_get_value_of_variables_at_indices(time, variables, indices): Mapping<str, list<float>>

We should benchmark to see if this how slow it is, if slow we should implement those functions.
The responses can get quite big, the client and server should support this.
Could those functions be a BMI extension, see csdms/bmi#138 ?

Similar to eWaterCycle/grpc4bmi#152

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

No branches or pull requests

1 participant