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

Support aliases in gbasf2 batch #40

Merged

Conversation

meliache
Copy link
Collaborator

Sam Cunliffe was so nice to tell me how to extract alias values, not just their names, from the variable manager (b2question link. With that it was pretty easy to store them also in the pickle and reapply them on the grid. I tested it and it seems to work nicely.

I now you suggested to look at pickable_basf2.py to store the basf2 calls, but the variables wouldn't be pickled as far as I know except if you wrap them in make_code_pickable. And to be honest I couldn't figure out yet how to use the code from pickable_basf2 for my use-case yet.

@meliache
Copy link
Collaborator Author

The only thing that I see might be fishy with this solutions, is, that the aliases are taken from VariableManager singleton and thus are specific to the basf2 state. That is, variables added to one task will probably also be added to all tasks afterwards that are processed by the same worker, as far as I understand. But I don't see much danger with that, except when people use different alias values for the same alias names (keys) in different tasks. I just checked that there's no bugs when people add the same alias multiple times, but then it's still only once in the variable manager, so there is no danger in that.

@nils-braun
Copy link
Owner

Sorry the review took so long, looks very good to me.
I think you are very right: it should not be a problem. After all, I think (might need some checking) that basf2 tries to clean up most of its singletons after processing, including the variable manager (if not, that would be worth a PR against basf2).

Thanks, @meliache!

@nils-braun nils-braun merged commit 8f7160e into nils-braun:main Jun 26, 2020
@meliache meliache added the enhancement New feature or request label Mar 17, 2021
@meliache meliache linked an issue Mar 17, 2021 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maybe support non-path basf2 configuration in gbasf2/grid batch
2 participants