logsdail / carmm

Scripts for creation, manipulation and analysis of geometric and electronic structure of molecular models
GNU General Public License v3.0
5 stars 17 forks source link

MACE Preoptimisation for FHI-aims #148

Open GabrielBram opened 6 months ago

GabrielBram commented 6 months ago

A workflow intended for pre-optimising structures and NEB transition state paths with the MACE family of forcefields.

Functionality invoked through the standard aims.optimise and aims.ts_search commands, with a user supplied MACE pre-optimiser to the ReactAims object, eg.,

mace_params = {'model': 'large',
               'dispersion': False,
               'default_dtype': 'float64',
               'device': 'cpu'}

reactor = ReactAims(params, basis_set, hpc)
reactor.MaceReact_Preoptimiser = ReactMACE(mace_params, force_field="mace_mp")

atoms = reactor.aims_optimise(atoms, 0.02, relax_unit_cell=False, restart=True, mace_preopt=True)[0]
ikowalec commented 6 months ago

This currently breaks the restarts on task-farming

GabrielBram commented 6 months ago

Dw, was just seeing how it behaved in the test infrastructure. By the looks of it, it's not recognising the restart as converged and attempts to run an FHI-aims simulation even though it can't. Why it's doing that is another matter.

...It also breaks itself.

Hmm. Will request the review when everything is in working order.

GabrielBram commented 6 months ago

Magical - it works on my machine but not on the remote CI tests. Something stupid must have happened.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 98.91304% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 89.15%. Comparing base (4ed96da) to head (15a6303).

Files Patch % Lines
carmm/run/workflows/react.py 98.24% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #148 +/- ## ========================================== + Coverage 88.23% 89.15% +0.91% ========================================== Files 80 81 +1 Lines 3265 3355 +90 ========================================== + Hits 2881 2991 +110 + Misses 384 364 -20 ``` | [Flag](https://app.codecov.io/gh/logsdail/carmm/pull/148/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Logsdail) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/logsdail/carmm/pull/148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Logsdail) | `89.15% <98.91%> (+0.91%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Logsdail#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

GabrielBram commented 5 months ago

Hello! This is somewhat ready - I do not like some of the solutions herein (e.g., the approach of re-attaching calculators after the MACE run), and some of the restart logic needs re-working. However, just to get the branch out there and to field suggestions, I've submitted a request for review.