-
Notifications
You must be signed in to change notification settings - Fork 13
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
SimAnnealing Workchain: Error caused by calcfunction defined as closure #94
Comments
I just removed my comment in the mentioned issue, as my problem is not directly related to the issue. Here just the quick summary of my issue: I have a very specific use case: I have a cation (11 atoms in total) with different types of H-atoms, I only have the molecule atoms labeled. I figured out that I can remove the atom number label from the ff by giving arbitrary names to similar atoms with different parameters. Still, when I try to run the SimAnnealing WC, I run into the issue that the specified settings ( aiida-lsmo/aiida_lsmo/workchains/sim_annealing.py Lines 153 to 178 in ba6360a
Background: I also want to set the ReinsertionProbability that is set to 1.0 in the params to 0 (for charged molecules Raspa might run into numerical problems using reinsertion moves, so I want to use random translation moves instead) |
After a debugging session with Miriam, this is what transpired: Upon submission of the job script added in PR #95 , the error message is
The problem is this calcfunction that is defined as a closure (inside aiida-lsmo/aiida_lsmo/workchains/sim_annealing.py Lines 201 to 204 in 0999cce
Replacing this calcfunction by just creating the validate parameters directly inside setup (dirty) got rid of the error message.
To be figured out:
Miriam was running a recent AiiDA version with python 3.8.5 |
following up on the specific use case described in aiidateam/aiida-core#3304, I was trying to modify the default inputs of the simulated annealing workflow. However, the MC moves are specified in the parameters as
param = { ... 'Component': { self.ctx.molecule['name']: { 'MoleculeDefinition': 'Local', 'TranslationProbability': 1.0, 'ReinsertionProbability': 1.0, 'CreateNumberOfMolecules': self.ctx.parameters['number_of_molecules'], }, }, }
My solution is to allow a modification of the ReinsertionProbability and RandomTranslationProbability to make the simulation of charged molecules possible. I left the default parameters as set. I.e. I added the required parameters and modified the component definition:
parameters_schema = FF_PARAMETERS_VALIDATOR.extend({ ... Required('reinsertion_probability', default=float(1.0), description='Relative probability to perform a reinsertion move.'): float, Required('randomtranslation_probability', default=float(0.0), description='Relative probability to perform a random translation move.'): float
and
param = { ... 'ReinsertionProbability': self.ctx.parameters['reinsertion_probability'], 'RandomTranslationProbability': self.ctx.parameters['randomtranslation_probability'], ...
This solution is working fine for my case and doesn't change the default settings. @ltalirz or @danieleongari do you see any problems with this solution? If not, I will create a PR :)
The text was updated successfully, but these errors were encountered: